vanilla-breeze 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/custom-elements.json +13966 -11505
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +1 -1
  4. package/dist/cdn/components/ai-chat.js +9 -6
  5. package/dist/cdn/components/ai-summary.js +4 -2
  6. package/dist/cdn/components/analytics-panel.js +19 -21
  7. package/dist/cdn/components/audio-player.js +17 -7
  8. package/dist/cdn/components/audio-visualizer.js +3 -3
  9. package/dist/cdn/components/author-index.js +2 -2
  10. package/dist/cdn/components/brand-mark.js +1 -1
  11. package/dist/cdn/components/bread-crumb.js +1 -1
  12. package/dist/cdn/components/calendar-wc.js +2 -2
  13. package/dist/cdn/components/card-list.js +1 -1
  14. package/dist/cdn/components/carousel-wc.js +1 -1
  15. package/dist/cdn/components/change-set.js +1 -11
  16. package/dist/cdn/components/chart-wc.js +32 -32
  17. package/dist/cdn/components/chat-input.js +1 -1
  18. package/dist/cdn/components/chat-window.js +1 -1
  19. package/dist/cdn/components/color-picker.js +1 -1
  20. package/dist/cdn/components/combo-box.js +1 -1
  21. package/dist/cdn/components/command-palette.js +1 -1
  22. package/dist/cdn/components/comment-box.js +49 -49
  23. package/dist/cdn/components/comment-thread.js +32 -32
  24. package/dist/cdn/components/comment-wc.js +1 -1
  25. package/dist/cdn/components/compare-surface.js +1 -1
  26. package/dist/cdn/components/consent-banner.js +1 -1
  27. package/dist/cdn/components/content-lens.js +1 -1
  28. package/dist/cdn/components/content-swap.js +1 -1
  29. package/dist/cdn/components/context-menu.js +1 -1
  30. package/dist/cdn/components/data-table.js +1 -1
  31. package/dist/cdn/components/date-picker.js +1 -1
  32. package/dist/cdn/components/day-view.js +1 -1
  33. package/dist/cdn/components/diagram-wc.js +2 -2
  34. package/dist/cdn/components/drag-surface.js +1 -1
  35. package/dist/cdn/components/drop-down.js +1 -1
  36. package/dist/cdn/components/emoji-picker.js +1 -1
  37. package/dist/cdn/components/flow-diagram.js +1 -1
  38. package/dist/cdn/components/foot-notes.js +1 -1
  39. package/dist/cdn/components/form-field.js +1 -1
  40. package/dist/cdn/components/geo-map.js +4 -4
  41. package/dist/cdn/components/glossary-index.js +1 -1
  42. package/dist/cdn/components/glossary-wc.js +1 -1
  43. package/dist/cdn/components/heading-links.js +1 -1
  44. package/dist/cdn/components/highlight-wc.js +2 -2
  45. package/dist/cdn/components/image-gallery.js +1 -1
  46. package/dist/cdn/components/image-map.js +1 -1
  47. package/dist/cdn/components/include-file.js +1 -1
  48. package/dist/cdn/components/manifest.json +100 -100
  49. package/dist/cdn/components/markdown-editor.js +1 -1
  50. package/dist/cdn/components/markdown-viewer.js +11 -11
  51. package/dist/cdn/components/nav-bar.js +1 -1
  52. package/dist/cdn/components/note-wc.js +2 -2
  53. package/dist/cdn/components/notification-wc.js +4 -4
  54. package/dist/cdn/components/page-info.js +2 -2
  55. package/dist/cdn/components/page-stats.js +1 -1
  56. package/dist/cdn/components/page-toc.js +1 -1
  57. package/dist/cdn/components/page-tools.js +1 -1
  58. package/dist/cdn/components/page-tour.js +5 -5
  59. package/dist/cdn/components/pager-wc.js +1 -1
  60. package/dist/cdn/components/poll-wc.js +1 -1
  61. package/dist/cdn/components/pop-over.js +1 -1
  62. package/dist/cdn/components/popularity-index.js +4 -4
  63. package/dist/cdn/components/print-page.js +1 -1
  64. package/dist/cdn/components/progress-tracker.js +1 -1
  65. package/dist/cdn/components/qr-code.js +1 -1
  66. package/dist/cdn/components/reaction-bar.js +1 -1
  67. package/dist/cdn/components/reader-view.js +3 -3
  68. package/dist/cdn/components/reading-progress.js +1 -1
  69. package/dist/cdn/components/recently-visited.js +7 -7
  70. package/dist/cdn/components/score-card.js +2 -2
  71. package/dist/cdn/components/selection-menu.js +1 -1
  72. package/dist/cdn/components/settings-panel.js +4 -4
  73. package/dist/cdn/components/share-wc.js +2 -2
  74. package/dist/cdn/components/short-cuts.js +1 -1
  75. package/dist/cdn/components/site-index.js +6 -6
  76. package/dist/cdn/components/site-map.js +1 -1
  77. package/dist/cdn/components/site-search.js +3 -3
  78. package/dist/cdn/components/slide-accept.js +1 -1
  79. package/dist/cdn/components/social-embed.js +1 -1
  80. package/dist/cdn/components/split-surface.js +1 -1
  81. package/dist/cdn/components/star-rating.js +1 -1
  82. package/dist/cdn/components/status-wc.js +1 -1
  83. package/dist/cdn/components/stepper-wc.js +1 -1
  84. package/dist/cdn/components/tab-set.js +1 -1
  85. package/dist/cdn/components/text-reader.js +2 -2
  86. package/dist/cdn/components/theme-picker.js +44 -44
  87. package/dist/cdn/components/time-index.js +2 -2
  88. package/dist/cdn/components/time-picker.js +1 -1
  89. package/dist/cdn/components/toast-msg.js +1 -1
  90. package/dist/cdn/components/tool-tip.js +1 -1
  91. package/dist/cdn/components/topic-map.js +3 -3
  92. package/dist/cdn/components/trust-filter.js +3 -3
  93. package/dist/cdn/components/version-switcher.js +3 -13
  94. package/dist/cdn/components/video-player.js +1 -1
  95. package/dist/cdn/components/watch-wc.js +2 -2
  96. package/dist/cdn/components/week-view.js +1 -1
  97. package/dist/cdn/components/youtube-player.js +1 -1
  98. package/dist/cdn/packs/effects.full.js +1 -1
  99. package/dist/cdn/packs/kawaii.effects.css +1 -1
  100. package/dist/cdn/packs/kawaii.full.css +1 -1
  101. package/dist/cdn/packs/kawaii.full.js +4 -4
  102. package/dist/cdn/packs/manifest.json +7 -7
  103. package/dist/cdn/packs/memphis.full.css +1 -1
  104. package/dist/cdn/packs/memphis.theme.css +1 -1
  105. package/dist/cdn/packs/ui.full.js +46 -46
  106. package/dist/cdn/themes/8bit.css +1 -1
  107. package/dist/cdn/themes/8bit.tokens.json +1 -1
  108. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  109. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  110. package/dist/cdn/themes/art-deco-dark.tokens.json +33 -1
  111. package/dist/cdn/themes/art-deco.css +1 -1
  112. package/dist/cdn/themes/art-deco.tokens.json +23 -1
  113. package/dist/cdn/themes/bauhaus-dark.tokens.json +23 -1
  114. package/dist/cdn/themes/bauhaus.css +1 -1
  115. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  116. package/dist/cdn/themes/brutalist-dark.tokens.json +33 -1
  117. package/dist/cdn/themes/brutalist.css +1 -1
  118. package/dist/cdn/themes/brutalist.tokens.json +23 -1
  119. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  120. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  121. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  122. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  123. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  124. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  125. package/dist/cdn/themes/classic.tokens.json +1 -1
  126. package/dist/cdn/themes/claymorphism-dark.tokens.json +33 -1
  127. package/dist/cdn/themes/claymorphism.css +1 -1
  128. package/dist/cdn/themes/claymorphism.tokens.json +23 -1
  129. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  130. package/dist/cdn/themes/clinical.tokens.json +1 -1
  131. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  132. package/dist/cdn/themes/cottagecore.css +1 -1
  133. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  134. package/dist/cdn/themes/cyber.css +1 -1
  135. package/dist/cdn/themes/cyber.tokens.json +1 -1
  136. package/dist/cdn/themes/dawn-dark.tokens.json +33 -1
  137. package/dist/cdn/themes/dawn.css +1 -1
  138. package/dist/cdn/themes/dawn.tokens.json +23 -1
  139. package/dist/cdn/themes/dracula.tokens.json +1 -1
  140. package/dist/cdn/themes/dusk.css +1 -1
  141. package/dist/cdn/themes/dusk.tokens.json +1 -1
  142. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  143. package/dist/cdn/themes/editorial.css +1 -1
  144. package/dist/cdn/themes/editorial.tokens.json +1 -1
  145. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  146. package/dist/cdn/themes/financial.tokens.json +1 -1
  147. package/dist/cdn/themes/genai.css +1 -1
  148. package/dist/cdn/themes/genai.tokens.json +1 -1
  149. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  150. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  151. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  152. package/dist/cdn/themes/government.tokens.json +1 -1
  153. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  155. package/dist/cdn/themes/high-noon-dark.tokens.json +23 -1
  156. package/dist/cdn/themes/high-noon.css +1 -1
  157. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  158. package/dist/cdn/themes/journal-dark.tokens.json +33 -1
  159. package/dist/cdn/themes/journal.css +1 -1
  160. package/dist/cdn/themes/journal.tokens.json +23 -1
  161. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  162. package/dist/cdn/themes/kawaii.css +1 -1
  163. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  164. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  165. package/dist/cdn/themes/magna.tokens.json +1 -1
  166. package/dist/cdn/themes/manifest.json +26 -50
  167. package/dist/cdn/themes/midnight.tokens.json +1 -1
  168. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  169. package/dist/cdn/themes/minimal.tokens.json +1 -1
  170. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  171. package/dist/cdn/themes/modern.tokens.json +1 -1
  172. package/dist/cdn/themes/nes-dark.tokens.json +1 -1
  173. package/dist/cdn/themes/nes.css +1 -1
  174. package/dist/cdn/themes/nes.tokens.json +1 -1
  175. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  176. package/dist/cdn/themes/neumorphism.css +1 -1
  177. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  178. package/dist/cdn/themes/nord-dark.tokens.json +33 -1
  179. package/dist/cdn/themes/nord.css +1 -1
  180. package/dist/cdn/themes/nord.tokens.json +23 -1
  181. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  182. package/dist/cdn/themes/organic.css +1 -1
  183. package/dist/cdn/themes/organic.tokens.json +1 -1
  184. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  185. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  186. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  187. package/dist/cdn/themes/rough.css +1 -1
  188. package/dist/cdn/themes/rough.tokens.json +1 -1
  189. package/dist/cdn/themes/solarized-dark.tokens.json +23 -1
  190. package/dist/cdn/themes/solarized.css +1 -1
  191. package/dist/cdn/themes/solarized.tokens.json +23 -1
  192. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  193. package/dist/cdn/themes/startup.tokens.json +1 -1
  194. package/dist/cdn/themes/super2026-dark.tokens.json +33 -1
  195. package/dist/cdn/themes/super2026.css +1 -1
  196. package/dist/cdn/themes/super2026.tokens.json +23 -1
  197. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  198. package/dist/cdn/themes/swiss.css +1 -1
  199. package/dist/cdn/themes/swiss.tokens.json +1 -1
  200. package/dist/cdn/themes/terminal.css +1 -1
  201. package/dist/cdn/themes/terminal.tokens.json +1 -1
  202. package/dist/cdn/themes/tokyo-night-dark.tokens.json +33 -1
  203. package/dist/cdn/themes/tokyo-night.css +1 -1
  204. package/dist/cdn/themes/tokyo-night.tokens.json +23 -1
  205. package/dist/cdn/themes/vaporwave-dark.tokens.json +33 -1
  206. package/dist/cdn/themes/vaporwave.css +1 -1
  207. package/dist/cdn/themes/vaporwave.tokens.json +23 -1
  208. package/dist/cdn/themes/win9x-dark.tokens.json +15 -4
  209. package/dist/cdn/themes/win9x.css +1 -1
  210. package/dist/cdn/themes/win9x.tokens.json +1 -1
  211. package/dist/cdn/vanilla-breeze-autoload.js +663 -0
  212. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  213. package/dist/cdn/vanilla-breeze-charts.js +32 -32
  214. package/dist/cdn/vanilla-breeze-core.css +1 -1
  215. package/dist/cdn/vanilla-breeze-core.js +78 -80
  216. package/dist/cdn/vanilla-breeze-dev.css +1 -1
  217. package/dist/cdn/vanilla-breeze-extras.js +47 -37
  218. package/dist/cdn/vanilla-breeze.css +1 -1
  219. package/dist/cdn/vanilla-breeze.js +180 -177
  220. package/package.json +12 -7
  221. package/dist/cdn/themes/amber.css +0 -2
  222. package/dist/cdn/themes/anthropic.css +0 -2
  223. package/dist/cdn/themes/anthropic.tokens.json +0 -564
  224. package/dist/cdn/themes/coral.css +0 -2
  225. package/dist/cdn/themes/emerald.css +0 -2
  226. package/dist/cdn/themes/forest.css +0 -2
  227. package/dist/cdn/themes/ibm.css +0 -2
  228. package/dist/cdn/themes/ibm.tokens.json +0 -568
  229. package/dist/cdn/themes/indigo.css +0 -2
  230. package/dist/cdn/themes/lavender.css +0 -2
  231. package/dist/cdn/themes/mcdonalds.css +0 -2
  232. package/dist/cdn/themes/mcdonalds.tokens.json +0 -533
  233. package/dist/cdn/themes/ocean.css +0 -2
  234. package/dist/cdn/themes/rose.css +0 -2
  235. package/dist/cdn/themes/slate.css +0 -2
  236. package/dist/cdn/themes/starbucks.css +0 -2
  237. package/dist/cdn/themes/starbucks.tokens.json +0 -593
  238. package/dist/cdn/themes/sunset.css +0 -2
@@ -1,3 +1,3 @@
1
- var y=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function b(o,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},r=g.get(o);if(customElements.get(o)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}g.set(o,s),customElements.define(o,t)}var d=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,s){t.addEventListener(e,n,s),this.#t.push(()=>t.removeEventListener(e,n,s))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{e?n.add(t):n.delete(t)}catch{let s=`--${t}`;e?n.add(s):n.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var f=class extends d{setup(){let t=this.getAttribute("data-lens-src")||this.getAttribute("src");t?this.#t(t).catch(()=>{}):this.#r()}async#t(t){let e;try{let s=await fetch(t);if(!s.ok)throw new Error(`status ${s.status}`);e=await s.json()}catch(s){this.#n(`Could not load ${t}: ${s.message}`);return}let n=Array.isArray(e)?e:e.pages||[];this.#e(n),this.#r()}#e(t){let e=new Map;for(let c of t){let a=c.author?.trim()||"Unknown";e.has(a)||e.set(a,[]),e.get(a).push(c)}let n=this.getAttribute("sort")||"alpha",s=[...e.entries()].sort(([c,a],[u,p])=>n==="count"?p.length-a.length:c.localeCompare(u)),r=[`<h2 class="author-index-heading">Authors <small>(${s.length})</small></h2>`];for(let[c,a]of s){let u=a[0],p=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");r.push(`<details data-author-group id="author-${p}">`),r.push(`<summary><span class="author-name">${l(c)}</span><span class="author-count" aria-label="${a.length} ${a.length===1?"page":"pages"}">(${a.length})</span></summary>`),u.authorUrl&&r.push(`<p class="author-link"><a href="${h(u.authorUrl)}" rel="author">View ${l(c)}'s profile</a></p>`),r.push('<ul class="author-pages">');for(let i of a){let m=[i.modified?`<time datetime="${h(i.modified)}">${l(i.modified)}</time>`:"",i.provenance?`<span class="author-prov" data-provenance="${h(i.provenance)}">${l(i.provenance)}</span>`:"",i.signed?'<span class="author-signed" title="Cryptographically signed">signed</span>':""].filter(Boolean).join(" \xB7 ");r.push(`<li><a href="${h(i.url)}">${l(i.title||i.url)}</a>${m?`<small>${m}</small>`:""}</li>`)}r.push("</ul></details>")}this.innerHTML=r.join(`
2
- `)}#n(t){if(this.children.length>0)return;let e=document.createElement("p");e.setAttribute("data-author-index-error",""),e.textContent=t,this.append(e)}#r(){if(!this.querySelector("[data-author-index-search]")){let t=this.getAttribute("placeholder")||"Filter authors\u2026",e=document.createElement("input");e.type="search",e.placeholder=t,e.setAttribute("data-author-index-search",""),e.setAttribute("aria-label",t),e.addEventListener("input",()=>this.#s(e.value)),this.prepend(e)}}#s(t){let e=t.trim().toLowerCase();for(let n of this.querySelectorAll("[data-author-group]")){let s=n,r=(s.textContent||"").toLowerCase();s.hidden=!!e&&!r.includes(e)}}};function l(o){return String(o??"").replace(/[&<>]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[t])}function h(o){return String(o??"").replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}b("author-index",f);export{f as AuthorIndex};
1
+ var T=window.matchMedia("(prefers-reduced-motion: reduce)");var x=new Map;function A(o,t,e={}){let s=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:s},n=x.get(o);if(customElements.get(o)){if(!n||n.priority>=s){n&&n.priority===s&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=s){n.priority===s&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}x.set(o,r),customElements.define(o,t)}var m=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,r){t.addEventListener(e,s,r),this.#t.push(()=>t.removeEventListener(e,s,r))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let s=this.#e.states;try{e?s.add(t):s.delete(t)}catch{let r=`--${t}`;e?s.add(r):s.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}};function y(o){return String(o??"").normalize("NFKD").replace(/\p{M}+/gu,"").toLowerCase()}function k(o){return y(o).replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")||"author"}function N(o,t,e=()=>!1){let s=k(o),r=s;for(let n=2;t.has(r)||e(r);n++)r=`${s}-${n}`;return t.add(r),r}function S(o){let t=String(o??"").trim();if(!t)return null;try{let{protocol:e}=new URL(t,"https://author-index.invalid/");return e==="http:"||e==="https:"?t:null}catch{return null}}function q(o){let t=Number.parseInt(o??"",10);return Number.isInteger(t)?Math.min(6,Math.max(1,t)):2}function L(o){let t=o.cloneNode(!0);return t.querySelectorAll('.visually-hidden, [aria-hidden="true"]').forEach(e=>e.remove()),y(t.textContent||"")}var b=class extends m{#t=null;setup(){if(this.querySelector(":scope > [data-author-index-search]")){this.#r();return}let t=this.getAttribute("data-lens-src")||this.getAttribute("src");t?(this.#t=new AbortController,this.#e(t,this.#t.signal)):this.#r()}teardown(){this.#t?.abort(),this.#t=null}async#e(t,e){let s;try{let r=await fetch(t,{signal:e});if(!r.ok)throw new Error(`status ${r.status}`);let n=await r.json();if(s=Array.isArray(n)?n:n?.pages||[],!Array.isArray(s))throw new Error("no pages array")}catch(r){if(e.aborted)return;this.children.length>0?this.#r():this.#s(`Could not load ${t}: ${r instanceof Error?r.message:r}`);return}e.aborted||(this.#n(s),this.#r())}#n(t){let e=new Map;for(let l of t){if(!l||typeof l!="object")continue;let a=typeof l.author=="string"&&l.author.trim()||"Unknown";e.has(a)||e.set(a,[]),e.get(a).push(l)}let s=this.getAttribute("sort")==="count"?"count":"alpha",r=[...e.entries()].sort(([l,a],[g,f])=>s==="count"&&f.length!==a.length?f.length-a.length:l.localeCompare(g)),n=q(this.getAttribute("heading-level")),u=new Set,p=l=>{let a=document.getElementById(`author-${l}`);return!!a&&!this.contains(a)},i=[`<h${n} class="author-index-heading">Authors <small>(${r.length})</small></h${n}>`];for(let[l,a]of r){let g=a[0],f=N(l,u,p),M=`${a.length} ${a.length===1?"page":"pages"}`;i.push(`<details data-author-group id="author-${h(f)}">`),i.push(`<summary><span class="author-name">${d(l)}</span><span class="author-count"><span aria-hidden="true">(${a.length})</span><span class="visually-hidden">, ${M}</span></span></summary>`);let $=S(g.authorUrl);$&&i.push(`<p class="author-link"><a href="${h($)}" rel="author">View ${d(l)}'s profile</a></p>`),i.push('<ul class="author-pages">');for(let c of a){let E=[c.modified?`<time datetime="${h(c.modified)}">${d(c.modified)}</time>`:"",c.provenance?`<span class="author-prov" data-provenance="${h(c.provenance)}">${d(c.provenance)}</span>`:"",c.signed?'<span class="author-signed" title="Cryptographically signed">signed</span>':""].filter(Boolean).join(" \xB7 "),w=S(c.url),v=d(c.title||c.url||"Untitled"),C=w?`<a href="${h(w)}">${v}</a>`:`<span>${v}</span>`;i.push(`<li>${C}${E?`<small>${E}</small>`:""}</li>`)}i.push("</ul></details>")}this.innerHTML=i.join(`
2
+ `)}#s(t){let e=document.createElement("p");e.setAttribute("data-author-index-error",""),e.textContent=t,this.append(e)}#r(){let t=this.querySelector(":scope > [data-author-index-search]");if(!t){let r=this.getAttribute("placeholder")||"Filter authors\u2026";t=document.createElement("input"),t.type="search",t.placeholder=r,t.setAttribute("data-author-index-search",""),t.setAttribute("aria-label",r),this.prepend(t)}let e=this.querySelector(":scope > [data-author-index-status]");e||(e=document.createElement("p"),e.setAttribute("data-author-index-status",""),e.setAttribute("role","status"),e.className="visually-hidden",t.after(e));let s=t;this.listen(s,"input",()=>this.#o(s.value))}#o(t){let e=y(t.trim()),s=[...this.querySelectorAll("[data-author-group]")],r=0;for(let i of s)i.hidden=!!e&&!L(i).includes(e),i.hidden||r++;let n=this.querySelector(":scope > [data-author-index-status]");if(!n)return;let u=s.length,p=i=>i===1?"author":"authors";e?r===0?n.textContent=`No authors match \u201C${t.trim()}\u201D`:n.textContent=`${r} of ${u} ${p(u)} match \u201C${t.trim()}\u201D`:n.textContent=`Showing all ${u} ${p(u)}`,n.classList.toggle("visually-hidden",!(e&&r===0)),n.toggleAttribute("data-empty",!!e&&r===0)}};function d(o){return String(o??"").replace(/[&<>]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[t])}function h(o){return String(o??"").replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}A("author-index",b);export{b as AuthorIndex,S as safeHref,k as slugify,N as uniqueSlug};
3
3
  //# sourceMappingURL=author-index.js.map
@@ -1,2 +1,2 @@
1
- var c=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,s){t.addEventListener(e,r,s),this.#t.push(()=>t.removeEventListener(e,r,s))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{e?r.add(t):r.delete(t)}catch{let s=`--${t}`;e?r.add(s):r.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var p=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function f(n,t,e={}){let r=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:r},i=u.get(n);if(customElements.get(n)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}u.set(n,s),customElements.define(n,t)}var h=class extends c{static observedAttributes=["src","src-dark","src-compact","alt","wordmark","height"];#t="";#e=null;#i=null;#s=!1;setup(){this.#t=this.#c(),this.hasAttribute("src-dark")&&this.#o(),this.#n()}teardown(){this.#e?.removeEventListener("change",this.#r),this.#e=null,this.#i?.disconnect(),this.#i=null,this.#s&&(window.removeEventListener("vb:theme-change",this.#r),this.#s=!1)}attributeChangedCallback(t,e,r){e!==r&&(!this.isConnected||!this.hasAttribute("data-upgraded")||(t==="src-dark"&&(r?this.#o():(this.#e?.removeEventListener("change",this.#r),this.#i?.disconnect(),this.#s&&(window.removeEventListener("vb:theme-change",this.#r),this.#s=!1))),this.#n()))}#a(){let t=document.documentElement.getAttribute("data-mode");if(t==="dark")return!0;if(t==="light")return!1;let e=getComputedStyle(this).colorScheme||"";return/\bdark\b/.test(e)&&!/\blight\b/.test(e)?!0:/\blight\b/.test(e)&&!/\bdark\b/.test(e)?!1:this.#e?.matches??!1}#o(){this.#e||(this.#e=matchMedia("(prefers-color-scheme: dark)"),this.#e.addEventListener("change",this.#r)),this.#i||(this.#i=new MutationObserver(()=>this.#r(void 0)),this.#i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode","data-theme"]})),this.#s||(window.addEventListener("vb:theme-change",this.#r),this.#s=!0)}#r=()=>{this.isConnected&&this.#n()};#n(){let t=this.getAttribute("src"),e=this.getAttribute("src-dark"),r=e&&this.#a()?e:t;if(!r){this.#t&&this.querySelector("img")&&(this.replaceChildren(document.createTextNode(this.#t)),this.removeAttribute("aria-label"));return}let s=this.#t||this.getAttribute("alt")||"",i=this.hasAttribute("wordmark"),l=this.getAttribute("height");if(this.querySelector("img")?.getAttribute("src")===r){let o=this.querySelector(".brand-mark-wordmark");if(i&&!o){let d=document.createElement("span");d.className="brand-mark-wordmark",d.textContent=s,this.appendChild(d)}else!i&&o&&o.remove();return}let a=document.createElement("img");if(a.src=r,a.alt=i?"":s,a.decoding="async",l&&(a.height=parseInt(l,10)),i){let o=document.createElement("span");o.className="brand-mark-wordmark",o.textContent=s,this.replaceChildren(a,o)}else this.replaceChildren(a),this.getAttribute("alt")||this.setAttribute("aria-label",s)}#c(){let t="";for(let e of this.childNodes)(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE&&e.tagName!=="IMG")&&(t+=e.textContent);return t.trim()}};f("brand-mark",h);
1
+ var a=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,i){t.addEventListener(e,r,i),this.#t.push(()=>t.removeEventListener(e,r,i))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{e?r.add(t):r.delete(t)}catch{let i=`--${t}`;e?r.add(i):r.delete(i)}}_adoptInternals(t){this.#e||(this.#e=t)}};var p=window.matchMedia("(prefers-reduced-motion: reduce)");var h=new Map;function f(n,t,e={}){let r=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:r},s=h.get(n);if(customElements.get(n)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}h.set(n,i),customElements.define(n,t)}var u="data-brand-mark-img",m="(width < 48rem)",l=class extends a{static observedAttributes=["src","src-dark","src-compact","compact-media","alt","wordmark","height"];#t=null;#e=null;#r=null;#i=!1;setup(){this.#c(),this.hasAttribute("src-dark")&&this.#o(),this.#n(),this.#e=new MutationObserver(()=>this.#d()),this.#e.observe(this,{childList:!0,characterData:!0,subtree:!0})}teardown(){this.#t?.disconnect(),this.#t=null,this.#e?.disconnect(),this.#e=null,this.#r=null,this.#i=!1}attributeChangedCallback(t,e,r){if(e!==r&&!(!this.isConnected||!this.hasAttribute("data-upgraded"))){if(t==="height"){this.#c();return}t==="src-dark"&&r!==null&&this.#o(),this.#n()}}#u(){let t=document.documentElement.getAttribute("data-mode");if(t==="dark")return!0;if(t==="light")return!1;let e=getComputedStyle(this).colorScheme||"";return/\bdark\b/.test(e)&&!/\blight\b/.test(e)?!0:/\blight\b/.test(e)&&!/\bdark\b/.test(e)?!1:(this.#r??matchMedia("(prefers-color-scheme: dark)")).matches}#o(){this.#i||(this.#i=!0,this.#r=matchMedia("(prefers-color-scheme: dark)"),this.listen(this.#r,"change",this.#s),this.listen(window,"vb:theme-change",this.#s),this.#t=new MutationObserver(this.#s),this.#t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode","data-theme"]}))}#s=()=>{this.isConnected&&this.#n()};#c(){let t=this.getAttribute("height")?.trim();if(!t){this.style.removeProperty("--brand-mark-height"),this.getAttribute("style")||this.removeAttribute("style");return}this.style.setProperty("--brand-mark-height",/^\d+(\.\d+)?$/.test(t)?`${t}px`:t)}#a(){return this.querySelector(`:scope > [${u}]`)}#n(){let t=this.getAttribute("src"),e=this.#a();if(!t){e?.remove();return}let r=this.getAttribute("src-dark"),i=r&&this.#u()?r:t;if(!(e instanceof HTMLPictureElement)||!e.querySelector(":scope > img")){e?.remove(),e=document.createElement("picture"),e.setAttribute(u,"");let c=document.createElement("img");c.decoding="async",e.append(c),this.prepend(e)}let s=e.querySelector(":scope > img");s.getAttribute("src")!==i&&s.setAttribute("src",i);let d=this.getAttribute("src-compact"),o=e.querySelector(":scope > source");if(d){o||(o=document.createElement("source"),e.prepend(o));let c=this.getAttribute("compact-media")||m;o.getAttribute("media")!==c&&o.setAttribute("media",c),o.getAttribute("srcset")!==d&&o.setAttribute("srcset",d)}else o?.remove();this.#d()}#d(){let t=this.#a()?.querySelector(":scope > img");if(!t)return;let e=this.getAttribute("alt"),r=!this.hasAttribute("wordmark"),i;r&&e?i=e:this.#l()?i="":i=e??"",t.getAttribute("alt")!==i&&t.setAttribute("alt",i)}#l(){for(let t of this.childNodes)if(!(t instanceof Element&&t.hasAttribute(u))&&t.textContent?.trim())return!0;return!1}};f("brand-mark",l);
2
2
  //# sourceMappingURL=brand-mark.js.map
@@ -1,2 +1,2 @@
1
- var w=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function E(i,e,r={}){let t=r.priority??10,o={impl:e,bundle:r.bundle,contract:r.contract,priority:t},n=y.get(i);if(customElements.get(i)){if(!n||n.priority>=t){n&&n.priority===t&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=t){n.priority===t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}y.set(i,o),customElements.define(i,e)}var h=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,t,o){e.addEventListener(r,t,o),this.#e.push(()=>e.removeEventListener(r,t,o))}setup(){}teardown(){}setState(e,r){this.#t||(this.#t=this.attachInternals());let t=this.#t.states;try{r?t.add(e):t.delete(e)}catch{let o=`--${e}`;r?t.add(o):t.delete(o)}}_adoptInternals(e){this.#t||(this.#t=e)}};var g="Home",f=class extends h{#e={};setup(){this.hasAttribute("role")||this.setAttribute("role","navigation"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Breadcrumb"),this.hasAttribute("data-from-pathname")?this.#t():this.#i(),this.#n(),this.#r()}get labels(){return{...this.#e}}set labels(e){!e||typeof e!="object"||(this.#e={...e},this.hasAttribute("data-from-pathname")&&(this.#t(),this.#n(),this.#r()))}#t(){let r=window.location.pathname.split("/").filter(Boolean),t=document.createElement("ol"),o=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#e["/"]||this.#e.home||g,o.appendChild(n),t.appendChild(o);let c="";r.forEach((l,u)=>{c+=`/${l}`;let d=u===r.length-1,p=document.createElement("li"),m=`${c}/`,b=this.#e[m]||this.#e[c]||this.#e[l]||d&&this.dataset.currentLabel||this.#o(l);if(d){let s=document.createElement("span");s.setAttribute("aria-current","page"),s.textContent=b,p.appendChild(s)}else{let s=document.createElement("a");s.href=m,s.textContent=b,p.appendChild(s)}t.appendChild(p)});let a=this.querySelector(":scope > ol");a?a.replaceWith(t):this.prepend(t)}#o(e){return e.replace(/[-_]+/g," ").replace(/\w\S*/g,r=>r[0].toUpperCase()+r.slice(1))}#i(){if(this.querySelector(":scope > ol"))return;let r=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(r.length===0)return;let t=document.createElement("ol");r.forEach(o=>{let n=document.createElement("li");n.appendChild(o),t.appendChild(n)}),this.prepend(t)}#n(){let e=this.querySelectorAll(":scope > ol > li");e.length!==0&&e.forEach((r,t)=>{let o=t===e.length-1,n=r.querySelector("a, span");n&&(o?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#r(){if(this.dataset.jsonld==="off")return;let e=Array.from(this.querySelectorAll(":scope > ol > li"));if(e.length===0)return;let t={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((n,c)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",u=a?.getAttribute("href"),d=u?new URL(u,window.location.origin).href:void 0;return{"@type":"ListItem",position:c+1,name:l,...d?{item:d}:{}}})},o=this.querySelector(':scope > script[type="application/ld+json"]');o||(o=document.createElement("script"),o.type="application/ld+json",this.appendChild(o)),o.textContent=JSON.stringify(t)}};E("bread-crumb",f);
1
+ var x=window.matchMedia("(prefers-reduced-motion: reduce)");var E=new Map;function A(i,t,n={}){let e=n.priority??10,r={impl:t,bundle:n.bundle,contract:n.contract,priority:e},s=E.get(i);if(customElements.get(i)){if(!s||s.priority>=e){s&&s.priority===e&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=e){s.priority===e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}E.set(i,r),customElements.define(i,t)}var u=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,n,e,r){t.addEventListener(n,e,r),this.#t.push(()=>t.removeEventListener(n,e,r))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,n){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{n?e.add(t):e.delete(t)}catch{let r=`--${t}`;n?e.add(r):e.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}};var L="Home",w="Show full path",p=":scope > ol > li:not([data-crumb-toggle])",v=4;function C(i){try{return decodeURIComponent(i)}catch{return i}}var m=class extends u{#t={};#e=!1;#n=!1;static get observedAttributes(){return["data-collapsed"]}setup(){this.#a(),this.hasAttribute("data-from-pathname")?this.#r():this.#l(),this.#i(),this.#s(),this.#o(),this.listen(this,"click",t=>{let e=(t.target instanceof Element?t.target:null)?.closest("[data-crumb-toggle] > button");if(!e||!this.contains(e))return;let r=e.getAttribute("aria-expanded")!=="true";e.setAttribute("aria-expanded",String(r)),this.dispatchEvent(new CustomEvent("bread-crumb:toggle",{bubbles:!0,detail:{expanded:r}}))})}attributeChangedCallback(t,n,e){n===e||!this.hasAttribute("data-upgraded")||t==="data-collapsed"&&this.#s()}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.#i(),this.#s(),this.#o()))}#a(){if(!!this.parentElement?.closest('nav, [role="navigation"]')){this.#e&&this.removeAttribute("role"),this.#n&&this.removeAttribute("aria-label"),this.#e=!1,this.#n=!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.#n=!0)}#r(){let n=window.location.pathname.split("/").filter(Boolean),e=document.createElement("ol"),r=document.createElement("li"),s=document.createElement("a");s.href="/",s.textContent=this.#t["/"]||this.#t.home||L,r.appendChild(s),e.appendChild(r);let o=this.dataset.currentLabel,a="";n.forEach((l,S)=>{a+=`/${l}`;let b=S===n.length-1,h=document.createElement("li"),f=`${a}/`,y=C(l),g=b&&o||this.#t[f]||this.#t[a]||this.#t[C(f)]||this.#t[y]||this.#t[l]||this.#c(y);if(b){let c=document.createElement("span");c.setAttribute("aria-current","page"),c.textContent=g,h.appendChild(c)}else{let c=document.createElement("a");c.href=f,c.textContent=g,h.appendChild(c)}e.appendChild(h)});let d=this.querySelector(":scope > ol");d?d.replaceWith(e):this.prepend(e)}#c(t){return t.replace(/[-_]+/g," ").replace(/\S+/g,n=>n[0].toUpperCase()+n.slice(1))}#l(){if(this.querySelector(":scope > ol"))return;let n=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(n.length===0)return;let e=document.createElement("ol");n.forEach(r=>{let s=document.createElement("li");s.appendChild(r),e.appendChild(s)}),this.prepend(e)}#i(){let t=this.querySelectorAll(p);t.length!==0&&t.forEach((n,e)=>{let r=e===t.length-1,s=n.querySelector("a, span");s&&(r?s.setAttribute("aria-current","page"):s.removeAttribute("aria-current"))})}#s(){let t=this.querySelector(":scope > ol"),n=t?.querySelector(":scope > li[data-crumb-toggle]"),e=this.querySelectorAll(p);if(!(!!t&&this.hasAttribute("data-collapsed")&&e.length>=v)){n?.remove();return}let s=n||document.createElement("li");if(!n){s.setAttribute("data-crumb-toggle","");let o=document.createElement("button");o.type="button",o.setAttribute("aria-expanded","false"),o.setAttribute("aria-label",w),o.textContent="\u2026",s.appendChild(o)}e[0].nextElementSibling!==s&&e[0].after(s)}#o(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(p));if(t.length===0)return;let e={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((s,o)=>{let a=s.querySelector("a, span"),d=a?.textContent?.trim()||"",l=a instanceof HTMLAnchorElement&&a.hasAttribute("href")?a.href:void 0;return{"@type":"ListItem",position:o+1,name:d,...l?{item:l}:{}}})},r=this.querySelector(':scope > script[type="application/ld+json"]');r||(r=document.createElement("script"),r.type="application/ld+json",this.appendChild(r)),r.textContent=JSON.stringify(e)}};A("bread-crumb",m);
2
2
  //# sourceMappingURL=bread-crumb.js.map
@@ -1,3 +1,3 @@
1
- var tt=window.matchMedia("(prefers-reduced-motion: reduce)");var j=new Map;function z(a,t,e={}){let s=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:s},i=j.get(a);if(customElements.get(a)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}j.set(a,n),customElements.define(a,t)}var Y=class extends HTMLElement{#c=[];#a;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.#c)t();this.#c=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,n){t.addEventListener(e,s,n),this.#c.push(()=>t.removeEventListener(e,s,n))}setup(){}teardown(){}setState(t,e){this.#a||(this.#a=this.attachInternals());let s=this.#a.states;try{e?s.add(t):s.delete(t)}catch{let n=`--${t}`;e?s.add(n):s.delete(n)}}_adoptInternals(t){this.#a||(this.#a=t)}};function I(a){let t=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),s=String(a.getDate()).padStart(2,"0");return`${t}-${e}-${s}`}function $(a){if(!a)return null;let[t,e,s]=a.split("-").map(Number);return new Date(t,e-1,s)}function V(a,t){return new Date(a,t+1,0).getDate()}function M(a,t){return a&&t&&a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()}function G(a,t){let e=new Date(a);return e.setDate(e.getDate()+t),e}function Q(a,t){if(!t)return null;let e=$(t);if(!e)return null;let s=e;if(typeof a=="object"&&a)if(typeof a.end=="string"){let n=$(a.end);n&&n>=e&&(s=n)}else typeof a.days=="number"&&Number.isFinite(a.days)&&a.days>=1&&(s=G(e,Math.floor(a.days)-1));return{start:e,end:s,startISO:t,endISO:I(s),days:Math.round((s.getTime()-e.getTime())/864e5)+1}}function X(){try{let a=new Intl.Locale(navigator.language);if(a.weekInfo)return a.weekInfo.firstDay%7}catch{}return 0}function Z(a){return a?typeof a=="string"?[{label:a}]:Array.isArray(a)?a:typeof a=="object"?[a]:[]:[]}var P=new Map;function H(a,t="short"){let e=`${a}:${t}`;if(P.has(e))return P.get(e);let s=new Intl.DateTimeFormat(a,{weekday:t}),n=Array.from({length:7},(i,o)=>s.format(new Date(2026,0,4+o)));return P.set(e,n),n}var B=class extends Y{static formAssociated=!0;#c;#a="en-US";#e=new Date().getMonth();#t=new Date().getFullYear();#M=0;#g={};#o=null;#l=null;#k=new Set;#I=new Map;#y=null;#d=new Set;#n=null;#r=null;#w=null;#s="none";#T="default";#$=1;#L=null;get isDateDisallowed(){return this.#L}set isDateDisallowed(t){this.#L=t,this.#E&&this.#m()}#Y=null;get getDayParts(){return this.#Y}set getDayParts(t){this.#Y=t,this.#E&&this.#m()}get events(){return this.#g}set events(t){let e=this._normalizeEventsInput(t);this.#g!==e&&(this.#g=e,this.#E&&this.#m(),this.dispatchEvent(new CustomEvent("calendar-wc:events-changed",{detail:{events:e,source:"property"},bubbles:!0})))}_normalizeEventsInput(t){if(!t)return{};if(Array.isArray(t)){let e={};for(let s of t){let n=s?.date;n&&(e[n]||(e[n]=[]),e[n].push(s))}return e}return typeof t=="object"?t:{}}#E=!1;#N;#A;#f;#h;#u;#B;#i;#p;#b;#v=null;_detailCleanup=null;#D={dayToEvents:new Map,spans:[]};constructor(){super(),typeof this.attachInternals=="function"&&(this.#c=this.attachInternals(),this._adoptInternals(this.#c))}setup(){this.#a=this.closest("[lang]")?.lang||navigator.language;let t=new Date;this.#e=parseInt(this.getAttribute("data-month")??"",10)-1,isNaN(this.#e)&&(this.#e=t.getMonth()),this.#t=parseInt(this.getAttribute("data-year")??"",10),isNaN(this.#t)&&(this.#t=t.getFullYear()),this.#M=X(),this.#s=this.getAttribute("data-selection")||"none",this.#T=this.getAttribute("data-size")||"default",this.#$=Math.max(1,Math.min(12,parseInt(this.dataset.months??"",10)||1));let e=this.getAttribute("data-events");if(e)try{this.#g=JSON.parse(e)}catch{}this.#o=$(this.dataset.minDate),this.#l=$(this.dataset.maxDate);let s=this.getAttribute("data-disabled-dates");s&&s.split(",").forEach(i=>this.#k.add(i.trim()));let n=this.getAttribute("data-highlight-dates");n&&n.split(",").forEach(i=>{let[o,l]=i.trim().split(":");this.#I.set(o,l||"")}),this.#_(),this.#m(),this.#E=!0}refresh(){this.#E&&this.#m()}#_(){this.#N=document.createElement("header"),this.#p=document.createElement("button"),this.#p.type="button",this.#p.setAttribute("aria-label","Previous month"),this.#p.textContent="\u2039",this.listen(this.#p,"click",()=>this.#O(-1)),this.#A=document.createElement("span"),this.#A.className="calendar-title",this.#A.setAttribute("aria-live","polite"),this.#f=document.createElement("span"),this.#f.className="calendar-month",this.#h=document.createElement("select"),this.#h.className="calendar-year",this.#h.setAttribute("aria-label","Year"),this.listen(this.#h,"change",()=>{this.#t=parseInt(this.#h.value,10),this.#m(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}),this.#u=document.createElement("span"),this.#u.className="calendar-year-wrap",this.#u.appendChild(this.#h),this.#A.append(this.#f," ",this.#u),this.#b=document.createElement("button"),this.#b.type="button",this.#b.setAttribute("aria-label","Next month"),this.#b.textContent="\u203A",this.listen(this.#b,"click",()=>this.#O(1)),this.#N.append(this.#p,this.#A,this.#b),this.appendChild(this.#N);let t=document.createElement("div");t.className="calendar-banner",t.setAttribute("aria-hidden","true"),this.appendChild(t),this.#i=document.createElement("div"),this.#i.className="cal-months",this.appendChild(this.#i),this.listen(this.#i,"click",e=>{let n=e.target?.closest("button[data-date]");if(!n||n.disabled)return;let i=n.getAttribute("data-date");if(i)if(this.#s!=="none")this.#q(i);else{let o=this.#D.dayToEvents.get(i)||[];o.length&&this.#H(i,o.map(l=>l.evt))}}),this.listen(this.#i,"keydown",e=>this.#R(e)),this.#s==="range"&&this.listen(this.#i,"mouseover",e=>{let n=e.target?.closest("button[data-date]");n&&this.#n&&!this.#r&&(this.#w=$(n.getAttribute("data-date")),this.#S())})}#j(){this.#h.innerHTML="";let t=new Date().getFullYear(),e=this.#o?this.#o.getFullYear():t-10,s=this.#l?this.#l.getFullYear():t+10;for(let n=e;n<=s;n++){let i=document.createElement("option");i.value=String(n),i.textContent=String(n),n===this.#t&&(i.selected=!0),this.#h.appendChild(i)}}#O(t){this.#e+=t,this.#e<0&&(this.#e=11,this.#t--),this.#e>11&&(this.#e=0,this.#t++),this.#m(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}#q(t){if(this.#s==="none")return;let e=$(t);if(e){if(this.#s==="single")this.#y=e,this.#S(),this.#F(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#s==="range"){if(!this.#n||this.#r)this.#n=e,this.#r=null,this.#w=null,this.dataset.tentative=I(this.#n);else{this.#r=e,this.#n&&this.#n>this.#r&&([this.#n,this.#r]=[this.#r,this.#n]),this.#w=null,delete this.dataset.tentative;let s=I(this.#n),n=I(this.#r);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${s}/${n}`,start:s,end:n,startDate:this.#n,endDate:this.#r}}))}this.#S(),this.#F()}else if(this.#s==="multi"){this.#d.has(t)?this.#d.delete(t):this.#d.add(t),this.#S(),this.#F();let s=[...this.#d].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:s,dates:s.map($)}}))}}}#F(){this.#c&&this.getAttribute("name")&&this.#c.setFormValue(this.value)}get value(){switch(this.#s){case"single":return this.#y?I(this.#y):null;case"range":return this.#n&&this.#r?`${I(this.#n)}/${I(this.#r)}`:this.#n?I(this.#n):null;case"multi":return this.#d.size?[...this.#d].sort().join(" "):null;default:return null}}#S(){if(!this.#i)return;let t=this.#n,e=this.#r||this.#w;for(let s of this.#i.querySelectorAll("td")){let n=s.querySelector("button[data-date]");if(!n)continue;let i=n.getAttribute("data-date"),o=$(i);if(!(!o||!i)&&(s.removeAttribute("data-selected"),s.removeAttribute("data-range-start"),s.removeAttribute("data-range-end"),s.removeAttribute("data-in-range"),n.removeAttribute("aria-selected"),this.#s==="single"&&M(o,this.#y)&&(s.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="multi"&&this.#d.has(i)&&(s.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="range"&&t))if(e){let l=t<e?t:e,f=t<e?e:t;M(o,l)&&s.setAttribute("data-range-start",""),M(o,f)&&s.setAttribute("data-range-end",""),o>=l&&o<=f&&s.setAttribute("data-in-range","")}else M(o,t)&&s.setAttribute("data-range-start","")}}#x(t){let e=new Date(this.#t,this.#e+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#z(){let t=new Map,e=[];for(let[s,n]of Object.entries(this.#g||{})){let i=Z(n);for(let o of i){let l=Q(o,s);if(!l)continue;let f=l.days>1;f&&e.push({evt:o,range:l});let E=864e5;for(let C=l.start.getTime();C<=l.end.getTime();C+=E){let c=I(new Date(C)),y={evt:o,range:l,isSpan:f,isStart:c===l.startISO,isEnd:c===l.endISO};t.has(c)||t.set(c,[]),t.get(c).push(y)}}}return{dayToEvents:t,spans:e}}#m(){let t=this.#$;this.#D=this.#z();let e=new Intl.DateTimeFormat(this.#a,{month:"long"}),s=new Intl.DateTimeFormat(this.#a,{month:"long",year:"numeric"});try{let i=new Date(this.#t,this.#e,1);if(t===1)this.#f.textContent=e.format(i),this.#u&&(this.#u.style.display="");else{let o=this.#x(t-1);i.getFullYear()===o.year?this.#f.textContent=String(this.#t):this.#f.textContent=`${i.getFullYear()} \u2013 ${o.year}`,this.#u&&(this.#u.style.display="none")}}catch{this.#f.textContent=String(this.#e+1)}this.#j(),this.#p.disabled=!!(this.#o&&(this.#t<this.#o.getFullYear()||this.#t===this.#o.getFullYear()&&this.#e<=this.#o.getMonth()));let n=this.#x(t-1);this.#b.disabled=!!(this.#l&&(n.year>this.#l.getFullYear()||n.year===this.#l.getFullYear()&&n.month>=this.#l.getMonth())),this.setAttribute("data-month",String(this.#e+1)),this.setAttribute("data-year",String(this.#t)),this.#i.innerHTML="";for(let i=0;i<t;i++){let{year:o,month:l}=this.#x(i);if(t>1){let f=document.createElement("div");f.className="cal-month-column";let E=document.createElement("h4");E.className="cal-month-title",E.textContent=s.format(new Date(o,l,1)),f.appendChild(E);let C=this.#P(o,l);f.appendChild(C),this.#i.appendChild(f)}else{let f=this.#P(o,l);this.#i.appendChild(f)}}this.#B=this.#i.querySelector("table")}#P(t,e){let s=new Date,n=V(t,e),i=this.#T==="large",o=document.createElement("table");o.setAttribute("role","grid");try{let b=new Date(t,e,1),u=new Intl.DateTimeFormat(void 0,{month:"long"}).format(b);o.setAttribute("aria-label",`${u} ${t}`)}catch{}let l=document.createElement("thead"),f=document.createElement("tr"),E=H(this.#a,"short"),C=H(this.#a,"long");for(let b=0;b<7;b++){let u=(this.#M+b)%7,g=document.createElement("th");g.setAttribute("scope","col"),g.setAttribute("abbr",C[u]),g.textContent=E[u],f.appendChild(g)}l.appendChild(f),o.appendChild(l);let c=document.createElement("tbody"),y=1,h=document.createElement("tr");h.setAttribute("data-week",String(y));let r=(new Date(t,e,1).getDay()-this.#M+7)%7,d=V(t,e-1);for(let b=0;b<r;b++){let u=d-r+1+b,g=document.createElement("td");g.setAttribute("data-outside-month","");let m=document.createElement("button");m.type="button",m.disabled=!0,m.setAttribute("tabindex","-1"),m.setAttribute("data-day",String(u));let A=document.createElement("span");A.className="day-number",A.textContent=String(u),m.appendChild(A),g.appendChild(m),h.appendChild(g)}let w=this.#n,p=this.#r||this.#w;for(let b=1;b<=n;b++){let u=new Date(t,e,b),g=I(u),m=document.createElement("td"),A=document.createElement("button");A.type="button",A.setAttribute("data-date",g);let O=document.createElement("span");if(O.className="day-number",O.textContent=String(b),A.appendChild(O),A.setAttribute("data-day",String(b)),M(u,s)&&(A.setAttribute("aria-current","date"),m.setAttribute("data-today","")),this.#s==="single"&&M(u,this.#y)&&(A.setAttribute("aria-selected","true"),m.setAttribute("data-selected","")),this.#s==="multi"&&this.#d.has(g)&&(A.setAttribute("aria-selected","true"),m.setAttribute("data-selected","")),this.#s==="range"&&w&&p){let x=w<p?w:p,L=w<p?p:w;M(u,x)&&m.setAttribute("data-range-start",""),M(u,L)&&m.setAttribute("data-range-end",""),u>=x&&u<=L&&m.setAttribute("data-in-range","")}else this.#s==="range"&&w&&M(u,w)&&m.setAttribute("data-range-start","");let R=this.#o&&u<this.#o,U=this.#l&&u>this.#l,W=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(u);if((this.#k.has(g)||R||U||W)&&(A.setAttribute("aria-disabled","true"),A.disabled=!0),this.#I.has(g)&&A.setAttribute("data-highlight",this.#I.get(g)||""),typeof this.getDayParts=="function"){let x=this.getDayParts(u);x!=null&&(m.dataset.dayPart=Array.isArray(x)?x.join(" "):x)}let k=this.#D.dayToEvents.get(g)||[];if(k.length){m.setAttribute("data-events",""),m.setAttribute("data-event-count",String(k.length));let x=i?k.filter(D=>!D.isSpan):k,L=k.map(D=>D.evt);if(i){if(x.length){let D=document.createElement("span");D.className="event-list";let T=2;if(x.slice(0,T).forEach(({evt:v})=>{let F=document.createElement("span");if(F.className="event-item",v.color&&F.style.setProperty("--event-color",v.color),v.icon){let q=document.createElement("icon-wc");q.setAttribute("name",v.icon),q.setAttribute("size","xs"),F.appendChild(q)}let _=document.createElement("span");_.textContent=v.time?`${v.time} ${v.label}`:v.label,F.appendChild(_),D.appendChild(F)}),x.length>T){let v=document.createElement("span");v.className="event-more",v.textContent=`+${x.length-T} more`,D.appendChild(v)}A.appendChild(D)}}else{let D=document.createElement("span");D.className="event-dots",D.setAttribute("aria-hidden","true");let T=Math.min(k.length,3);for(let v=0;v<T;v++){let F=document.createElement("span");F.setAttribute("data-event-dot",""),k[v].evt.color&&F.style.setProperty("--event-color",k[v].evt.color),D.appendChild(F)}m.appendChild(D)}let J=L.map(D=>D.time?`${D.time} \u2014 ${D.label}`:D.label);A.setAttribute("title",J.join(`
2
- `))}let K=b===1||M(u,s);A.setAttribute("tabindex",K?"0":"-1"),m.insertBefore(A,m.firstChild),h.appendChild(m),(r+b)%7===0&&(c.appendChild(h),y++,h=document.createElement("tr"),h.setAttribute("data-week",String(y)))}let N=(r+n)%7;if(N>0){for(let b=1;b<=7-N;b++){let u=document.createElement("td");u.setAttribute("data-outside-month","");let g=document.createElement("button");g.type="button",g.disabled=!0,g.setAttribute("tabindex","-1"),g.setAttribute("data-day",String(b));let m=document.createElement("span");m.className="day-number",m.textContent=String(b),g.appendChild(m),u.appendChild(g),h.appendChild(u)}c.appendChild(h)}return o.appendChild(c),i&&this.#D.spans.length&&this.#V(c,t,e),o}#V(t,e,s){let n=[...t.querySelectorAll("tr")],i=new Intl.DateTimeFormat(this.#a,{month:"short",day:"numeric"});for(let o of n){let l=[...o.querySelectorAll("td")];if(!l.length)continue;let f=l.findIndex(r=>r.querySelector("button[data-date]")),E=l.map((r,d)=>{let w=r.querySelector("button"),p=w?.getAttribute("data-date");if(p)return $(p);let N=parseInt(w?.getAttribute("data-day")||"0",10);return f>=0&&d<f?new Date(e,s-1,N):new Date(e,s+1,N)}),C=E[0],c=E[E.length-1];if(!C||!c)continue;let y=[];for(let{evt:r,range:d}of this.#D.spans){if(d.end<C||d.start>c)continue;let w=d.start<C?0:E.findIndex(N=>M(N,d.start)),p=d.end>c?E.length-1:E.findIndex(N=>M(N,d.end));w<0||p<0||y.push({evt:r,range:d,startCol:w,endCol:p,continuesLeft:d.start<C,continuesRight:d.end>c})}if(!y.length)continue;y.sort((r,d)=>r.startCol-d.startCol||d.endCol-d.startCol-(r.endCol-r.startCol));let h=[];for(let r of y){let d=0;for(;d<h.length&&h[d]>=r.startCol;)d++;r.lane=d,h[d]=r.endCol}let S=h.length;o.style.setProperty("--cal-row-lanes",String(S)),o.setAttribute("data-row-lanes",String(S));for(let r of y){let d=l[r.startCol],w=r.endCol-r.startCol+1,p=document.createElement("span");p.className="event-span",p.style.setProperty("--span-cells",String(w)),p.style.setProperty("--span-lane",String(r.lane)),r.evt.color&&p.style.setProperty("--event-color",r.evt.color),r.continuesLeft&&p.setAttribute("data-continues-start",""),r.continuesRight&&p.setAttribute("data-continues-end",""),p.textContent=r.evt.label||"",p.setAttribute("title",`${r.evt.label} \u2014 ${i.format(r.range.start)} to ${i.format(r.range.end)}`),d.appendChild(p)}}}#H(t,e){this.#C();let s=$(t)??new Date,n=document.createElement("div");n.className="day-detail",n.setAttribute("role","dialog"),n.setAttribute("aria-label",`Events for ${t}`);let i=document.createElement("header"),o=document.createElement("h3");try{o.textContent=new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(s)}catch{o.textContent=t}let l=document.createElement("button");if(l.type="button",l.setAttribute("aria-label","Close"),l.textContent="\xD7",l.addEventListener("click",()=>this.#C()),i.append(o,l),n.appendChild(i),e.some(c=>c.time)){let c=document.createElement("day-view");c.dataset.date=t,c.dataset.startHour="auto",c.dataset.compact="";let y=new Intl.DateTimeFormat(this.#a,{hour:"numeric",minute:"2-digit"});e.forEach(h=>{let S=document.createElement("calendar-event");if(h.color&&S.style.setProperty("--event-color",h.color),h.icon){let r=document.createElement("icon-wc");r.setAttribute("name",h.icon),r.setAttribute("size","sm"),S.appendChild(r)}if(h.time){let r=document.createElement("time");r.setAttribute("datetime",h.time);try{let[d,w]=h.time.split(":"),p=new Date(2026,0,1,parseInt(d,10),parseInt(w,10));r.textContent=y.format(p)}catch{r.textContent=h.time}S.appendChild(r)}S.append(h.label||""),c.appendChild(S)}),n.appendChild(c)}else{let c=document.createElement("ul");c.className="detail-list",e.forEach(y=>{let h=document.createElement("li");y.color&&h.style.setProperty("--event-color",y.color);let S=document.createElement("span");S.className="detail-dot";let r=document.createElement("span");if(r.className="detail-content",y.icon){let w=document.createElement("icon-wc");w.setAttribute("name",y.icon),w.setAttribute("size","sm"),r.appendChild(w)}let d=document.createElement("span");d.className="detail-label",d.textContent=y.label||"",r.append(d),h.append(S,r),c.appendChild(h)}),n.appendChild(c)}this.appendChild(n),this.#v=n;let E=c=>{c.key==="Escape"&&this.#C()},C=c=>{n.contains(c.target)||this.#C()};this._detailCleanup=()=>{document.removeEventListener("keydown",E),document.removeEventListener("mousedown",C)},document.addEventListener("keydown",E),requestAnimationFrame(()=>{document.addEventListener("mousedown",C)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#C(){this.#v&&(this._detailCleanup?.(),this._detailCleanup=null,this.#v.remove(),this.#v=null)}teardown(){delete this.dataset.tentative,this.#C()}#R(t){let e=this.#i.querySelector('button[tabindex="0"]');if(!e)return;let s=e.getAttribute("data-date"),n=$(s);if(!n)return;let i;switch(t.key){case"ArrowRight":i=new Date(n),i.setDate(n.getDate()+1);break;case"ArrowLeft":i=new Date(n),i.setDate(n.getDate()-1);break;case"ArrowDown":i=new Date(n),i.setDate(n.getDate()+7);break;case"ArrowUp":i=new Date(n),i.setDate(n.getDate()-7);break;case"Enter":case" ":t.preventDefault(),e.disabled||this.#q(s);return;default:return}if(t.preventDefault(),this.#o&&i<this.#o||this.#l&&i>this.#l)return;let o=i.getMonth(),l=i.getFullYear(),f=this.#x(this.#$-1);(l>this.#t||l===this.#t&&o>=this.#e)&&(l<f.year||l===f.year&&o<=f.month)||(this.#e=o,this.#t=l,this.#m());let C=I(i),c=this.#i.querySelector(`button[data-date="${C}"]`);c&&(this.#i.querySelectorAll('button[tabindex="0"]').forEach(y=>y.setAttribute("tabindex","-1")),c.setAttribute("tabindex","0"),c.focus())}};z("calendar-wc",B);export{B as CalendarWc};
1
+ var tt=window.matchMedia("(prefers-reduced-motion: reduce)");var j=new Map;function R(r,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},i=j.get(r);if(customElements.get(r)){if(!i||i.priority>=n){i&&i.priority===n&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}j.set(r,s),customElements.define(r,t)}var L=class extends HTMLElement{#c=[];#a;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.#c)t();this.#c=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,s){t.addEventListener(e,n,s),this.#c.push(()=>t.removeEventListener(e,n,s))}_reinit(){for(let t of this.#c)t();this.#c=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#a||(this.#a=this.attachInternals());let n=this.#a.states;try{e?n.add(t):n.delete(t)}catch{let s=`--${t}`;e?n.add(s):n.delete(s)}}_adoptInternals(t){this.#a||(this.#a=t)}};function x(r){let t=r.getFullYear(),e=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${t}-${e}-${n}`}function F(r){if(!r)return null;let[t,e,n]=r.split("-").map(Number);return new Date(t,e-1,n)}function H(r,t){return new Date(r,t+1,0).getDate()}function N(r,t){return r&&t&&r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function O(r,t){let e=new Date(r);return e.setDate(e.getDate()+t),e}function G(r,t){if(!t)return null;let e=F(t);if(!e)return null;let n=e;if(typeof r=="object"&&r)if(typeof r.end=="string"){let s=F(r.end);s&&s>=e&&(n=s)}else typeof r.days=="number"&&Number.isFinite(r.days)&&r.days>=1&&(n=O(e,Math.floor(r.days)-1));return{start:e,end:n,startISO:t,endISO:x(n),days:Math.round((n.getTime()-e.getTime())/864e5)+1}}function Q(r){try{let t=new Intl.Locale(r),e=t.getWeekInfo?.()??t.weekInfo;if(e)return e.firstDay%7}catch{}return 0}var X=0;function Z(r){return r?typeof r=="string"?[{label:r}]:Array.isArray(r)?r:typeof r=="object"?[r]:[]:[]}var B=new Map;function V(r,t="short"){let e=`${r}:${t}`;if(B.has(e))return B.get(e);let n=new Intl.DateTimeFormat(r,{weekday:t}),s=Array.from({length:7},(i,a)=>n.format(new Date(2026,0,4+a)));return B.set(e,s),s}var _=class extends L{static formAssociated=!0;#c;#a="en-US";#n=new Date().getMonth();#t=new Date().getFullYear();#$=0;#A={};#o=null;#l=null;#k=new Set;#M=new Map;#f=null;#h=new Set;#i=null;#r=null;#E=null;#e="none";#_="default";#T=1;#I=null;#Y=!1;#L=!1;static get observedAttributes(){return["data-month","data-year","data-events"]}attributeChangedCallback(t,e,n){if(!this.#p||this.#L||e===n)return;if(t==="data-events"){let h={};if(n)try{h=JSON.parse(n)}catch{return}this.#Y=!1,this.#A=h,this.#d(),this.dispatchEvent(new CustomEvent("calendar-wc:events-changed",{detail:{events:h,source:"attribute"},bubbles:!0}));return}let s=parseInt(this.getAttribute("data-month")??"",10)-1,i=parseInt(this.getAttribute("data-year")??"",10),a=s>=0&&s<=11?s:this.#n,o=Number.isFinite(i)?i:this.#t;a===this.#n&&o===this.#t||(this.#n=a,this.#t=o,this.#d())}#z=null;get isDateDisallowed(){return this.#z}set isDateDisallowed(t){this.#z=t,this.#p&&this.#d()}#j=null;get getDayParts(){return this.#j}set getDayParts(t){this.#j=t,this.#p&&this.#d()}get events(){return this.#A}set events(t){let e=this._normalizeEventsInput(t);this.#A!==e&&(this.#A=e,this.#Y=!0,this.#p&&this.#d(),this.dispatchEvent(new CustomEvent("calendar-wc:events-changed",{detail:{events:e,source:"property"},bubbles:!0})))}_normalizeEventsInput(t){if(!t)return{};if(Array.isArray(t)){let e={};for(let n of t){let s=n?.date;s&&(e[s]||(e[s]=[]),e[s].push(n))}return e}return typeof t=="object"?t:{}}#p=!1;#w;#C;#b;#u;#m;#W;#s;#g;#y;#O=null;#P=null;#v=null;_detailCleanup=null;#D={dayToEvents:new Map,spans:[]};constructor(){super(),typeof this.attachInternals=="function"&&(this.#c=this.attachInternals(),this._adoptInternals(this.#c))}setup(){this.#a=this.closest("[lang]")?.lang||navigator.language;let t=new Date;this.#n=parseInt(this.getAttribute("data-month")??"",10)-1,isNaN(this.#n)&&(this.#n=t.getMonth()),this.#t=parseInt(this.getAttribute("data-year")??"",10),isNaN(this.#t)&&(this.#t=t.getFullYear()),this.#$=Q(this.#a),this.#e=this.getAttribute("data-selection")||"none",this.#_=this.getAttribute("data-size")||"default",this.#T=Math.max(1,Math.min(12,parseInt(this.dataset.months??"",10)||1));let e=this.getAttribute("data-events");if(e&&!this.#Y)try{this.#A=JSON.parse(e)}catch{}this.#o=F(this.dataset.minDate),this.#l=F(this.dataset.maxDate),this.#k.clear(),this.#M.clear();let n=this.getAttribute("data-disabled-dates");n&&n.split(",").forEach(i=>this.#k.add(i.trim()));let s=this.getAttribute("data-highlight-dates");s&&s.split(",").forEach(i=>{let[a,o]=i.trim().split(":");this.#M.set(a,o||"")}),this.#U(),this.#d(),this.#p=!0}refresh(){this.#p&&this.#d()}#S(t,e){return this.dataset[`label${t}`]||e}#U(){this.#w=document.createElement("header"),this.#g=document.createElement("button"),this.#g.type="button",this.#g.setAttribute("aria-label",this.#S("Prev","Previous month")),this.#g.textContent="\u2039",this.listen(this.#g,"click",()=>this.#R(-1)),this.#C=document.createElement("span"),this.#C.className="calendar-title",this.#C.setAttribute("aria-live","polite"),this.#b=document.createElement("span"),this.#b.className="calendar-month",this.#u=document.createElement("select"),this.#u.className="calendar-year",this.#u.setAttribute("aria-label",this.#S("Year","Year")),this.listen(this.#u,"change",()=>{this.#t=parseInt(this.#u.value,10),this.#d(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#n+1}}))}),this.#m=document.createElement("span"),this.#m.className="calendar-year-wrap",this.#m.appendChild(this.#u),this.#C.append(this.#b," ",this.#m),this.#y=document.createElement("button"),this.#y.type="button",this.#y.setAttribute("aria-label",this.#S("Next","Next month")),this.#y.textContent="\u203A",this.listen(this.#y,"click",()=>this.#R(1)),this.#w.append(this.#g,this.#C,this.#y),this.appendChild(this.#w);let t=document.createElement("div");t.className="calendar-banner",t.setAttribute("aria-hidden","true"),this.appendChild(t),this.#O=t,this.#s=document.createElement("div"),this.#s.className="cal-months",this.appendChild(this.#s),this.listen(this.#s,"click",e=>{let s=e.target?.closest("button[data-date]");if(!s||s.disabled)return;let i=s.getAttribute("data-date");if(i)if(this.#e!=="none")this.#G(i);else{let a=this.#D.dayToEvents.get(i)||[];a.length&&this.#Z(i,a.map(o=>o.evt))}}),this.listen(this.#s,"keydown",e=>this.#tt(e)),this.listen(this.#s,"focusin",e=>{let s=e.target?.closest?.("button[data-date]");s&&(this.#I=s.getAttribute("data-date"),this.#B())}),this.listen(this,"keydown",e=>{e.key==="Escape"&&this.#v&&(e.stopPropagation(),this.#x(!0))}),this.#e==="range"&&this.listen(this.#s,"mouseover",e=>{let s=e.target?.closest("button[data-date]");s&&this.#i&&!this.#r&&(this.#E=F(s.getAttribute("data-date")),this.#N())})}#J(){let t=parseInt(this.getAttribute("data-year-range")??"",10);return Number.isFinite(t)&&t>=0?Math.min(t,200):10}#K(){this.#u.innerHTML="";let t=new Date().getFullYear(),e=this.#J(),n=Math.min(this.#t,this.#o?this.#o.getFullYear():t-e),s=Math.max(this.#t,this.#l?this.#l.getFullYear():t+e);for(let i=n;i<=s;i++){let a=document.createElement("option");a.value=String(i),a.textContent=String(i),i===this.#t&&(a.selected=!0),this.#u.appendChild(a)}}#R(t){this.#n+=t,this.#n<0&&(this.#n=11,this.#t--),this.#n>11&&(this.#n=0,this.#t++),this.#d(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#n+1}}))}#G(t){if(this.#e==="none")return;let e=F(t);if(e){if(this.#e==="single")this.#f=e,this.#N(),this.#q(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#e==="range"){if(!this.#i||this.#r)this.#i=e,this.#r=null,this.#E=null,this.setAttribute("data-tentative",x(this.#i));else{this.#r=e,this.#i&&this.#i>this.#r&&([this.#i,this.#r]=[this.#r,this.#i]),this.#E=null,this.removeAttribute("data-tentative");let n=x(this.#i),s=x(this.#r);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${n}/${s}`,start:n,end:s,startDate:this.#i,endDate:this.#r}}))}this.#N(),this.#q()}else if(this.#e==="multi"){this.#h.has(t)?this.#h.delete(t):this.#h.add(t),this.#N(),this.#q();let n=[...this.#h].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:n,dates:n.map(F)}}))}}}#q(){this.#c&&this.getAttribute("name")&&this.#c.setFormValue(this.value)}get value(){switch(this.#e){case"single":return this.#f?x(this.#f):null;case"range":return this.#i&&this.#r?`${x(this.#i)}/${x(this.#r)}`:this.#i?x(this.#i):null;case"multi":return this.#h.size?[...this.#h].sort().join(" "):null;default:return null}}#N(){if(!this.#s)return;let t=this.#i,e=this.#r||this.#E;for(let n of this.#s.querySelectorAll("td")){let s=n.querySelector("button[data-date]");if(!s)continue;let i=s.getAttribute("data-date"),a=F(i);if(!(!a||!i)){if(n.removeAttribute("data-selected"),n.removeAttribute("data-range-start"),n.removeAttribute("data-range-end"),n.removeAttribute("data-in-range"),this.#e==="single"&&N(a,this.#f)&&n.setAttribute("data-selected",""),this.#e==="multi"&&this.#h.has(i)&&n.setAttribute("data-selected",""),this.#e==="range"&&t)if(e){let o=t<e?t:e,h=t<e?e:t;N(a,o)&&n.setAttribute("data-range-start",""),N(a,h)&&n.setAttribute("data-range-end",""),a>=o&&a<=h&&n.setAttribute("data-in-range","")}else N(a,t)&&n.setAttribute("data-range-start","");this.#H(n)}}}#H(t){if(this.#e==="none"){t.removeAttribute("aria-selected");return}let e=t.hasAttribute("data-selected")||t.hasAttribute("data-in-range")||t.hasAttribute("data-range-start")||t.hasAttribute("data-range-end");t.setAttribute("aria-selected",String(e))}#B(){if(!this.#s)return;let t=[...this.#s.querySelectorAll("button[data-date]")],e=t.filter(a=>!a.disabled),n=a=>a?e.find(o=>o.getAttribute("data-date")===a):void 0,s=null;this.#e==="single"&&this.#f?s=x(this.#f):this.#e==="range"&&this.#i?s=x(this.#i):this.#e==="multi"&&this.#h.size&&(s=[...this.#h].sort()[0]);let i=n(this.#I)||n(s)||e.find(a=>a.getAttribute("aria-current")==="date")||e[0];for(let a of t)a.setAttribute("tabindex",a===i?"0":"-1")}#F(t){let e=new Date(this.#t,this.#n+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#Q(){let t=new Map,e=[];for(let[n,s]of Object.entries(this.#A||{})){let i=Z(s);for(let a of i){let o=G(a,n);if(!o)continue;let h=o.days>1;h&&e.push({evt:a,range:o});for(let E=new Date(o.start),b=0;b<o.days;E=O(E,1),b++){let p=x(E),d={evt:a,range:o,isSpan:h,isStart:p===o.startISO,isEnd:p===o.endISO};t.has(p)||t.set(p,[]),t.get(p).push(d)}}}return{dayToEvents:t,spans:e}}#d(){let t=this.#T;this.#D=this.#Q();let e=new Intl.DateTimeFormat(this.#a,{month:"long"}),n=new Intl.DateTimeFormat(this.#a,{month:"long",year:"numeric"});try{let i=new Date(this.#t,this.#n,1);if(t===1)this.#b.textContent=e.format(i),this.#m&&(this.#m.style.display="");else{let a=this.#F(t-1);i.getFullYear()===a.year?this.#b.textContent=String(this.#t):this.#b.textContent=`${i.getFullYear()} \u2013 ${a.year}`,this.#m&&(this.#m.style.display="none")}}catch{this.#b.textContent=String(this.#n+1)}this.#K(),this.#g.disabled=!!(this.#o&&(this.#t<this.#o.getFullYear()||this.#t===this.#o.getFullYear()&&this.#n<=this.#o.getMonth()));let s=this.#F(t-1);this.#y.disabled=!!(this.#l&&(s.year>this.#l.getFullYear()||s.year===this.#l.getFullYear()&&s.month>=this.#l.getMonth())),this.#L=!0,this.setAttribute("data-month",String(this.#n+1)),this.setAttribute("data-year",String(this.#t)),this.#L=!1,this.#s.innerHTML="";for(let i=0;i<t;i++){let{year:a,month:o}=this.#F(i);if(t>1){let h=document.createElement("div");h.className="cal-month-column";let E=parseInt(this.getAttribute("data-heading-level")??"",10),b=document.createElement(E>=1&&E<=6?`h${E}`:"span");b.className="cal-month-title",b.textContent=n.format(new Date(a,o,1)),h.appendChild(b);let p=this.#V(a,o);h.appendChild(p),this.#s.appendChild(h)}else{let h=this.#V(a,o);this.#s.appendChild(h)}}this.#W=this.#s.querySelector("table"),this.#B()}#V(t,e){let n=new Date,s=H(t,e),i=this.#_==="large",a=document.createElement("table");a.setAttribute("role","grid"),(this.#e==="multi"||this.#e==="range")&&a.setAttribute("aria-multiselectable","true");try{let g=new Date(t,e,1);a.setAttribute("aria-label",new Intl.DateTimeFormat(this.#a,{month:"long",year:"numeric"}).format(g))}catch{}let o=document.createElement("thead"),h=document.createElement("tr"),E=V(this.#a,"short"),b=V(this.#a,"long");for(let g=0;g<7;g++){let y=(this.#$+g)%7,A=document.createElement("th");A.setAttribute("scope","col"),A.setAttribute("abbr",b[y]),A.textContent=E[y],h.appendChild(A)}o.appendChild(h),a.appendChild(o);let p=document.createElement("tbody"),d=1,f=document.createElement("tr");f.setAttribute("data-week",String(d));let l=(new Date(t,e,1).getDay()-this.#$+7)%7,c=H(t,e-1);for(let g=0;g<l;g++){let y=c-l+1+g,A=document.createElement("td");A.setAttribute("data-outside-month","");let m=document.createElement("button");m.type="button",m.disabled=!0,m.setAttribute("tabindex","-1"),m.setAttribute("data-day",String(y));let S=document.createElement("span");S.className="day-number",S.textContent=String(y),m.appendChild(S),A.appendChild(m),f.appendChild(A)}let C=this.#i,u=this.#r||this.#E;for(let g=1;g<=s;g++){let y=new Date(t,e,g),A=x(y),m=document.createElement("td"),S=document.createElement("button");S.type="button",S.setAttribute("data-date",A);let P=document.createElement("span");if(P.className="day-number",P.textContent=String(g),S.appendChild(P),S.setAttribute("data-day",String(g)),N(y,n)&&(S.setAttribute("aria-current","date"),m.setAttribute("data-today","")),this.#e==="single"&&N(y,this.#f)&&m.setAttribute("data-selected",""),this.#e==="multi"&&this.#h.has(A)&&m.setAttribute("data-selected",""),this.#e==="range"&&C&&u){let M=C<u?C:u,Y=C<u?u:C;N(y,M)&&m.setAttribute("data-range-start",""),N(y,Y)&&m.setAttribute("data-range-end",""),y>=M&&y<=Y&&m.setAttribute("data-in-range","")}else this.#e==="range"&&C&&N(y,C)&&m.setAttribute("data-range-start","");this.#H(m);let W=this.#o&&y<this.#o,U=this.#l&&y>this.#l,J=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(y);if((this.#k.has(A)||W||U||J)&&(S.setAttribute("aria-disabled","true"),S.disabled=!0),this.#M.has(A)&&S.setAttribute("data-highlight",this.#M.get(A)||""),typeof this.getDayParts=="function"){let M=this.getDayParts(y);M!=null&&(m.dataset.dayPart=Array.isArray(M)?M.join(" "):M)}let k=this.#D.dayToEvents.get(A)||[];if(k.length){m.setAttribute("data-events",""),m.setAttribute("data-event-count",String(k.length));let M=i?k.filter(v=>!v.isSpan):k,Y=k.map(v=>v.evt);if(i){if(M.length){let v=document.createElement("span");v.className="event-list";let T=2;if(M.slice(0,T).forEach(({evt:D})=>{let $=document.createElement("span");if($.className="event-item",D.color&&$.style.setProperty("--event-color",D.color),D.icon){let q=document.createElement("icon-wc");q.setAttribute("name",D.icon),q.setAttribute("size","xs"),$.appendChild(q)}let z=document.createElement("span");z.textContent=D.time?`${D.time} ${D.label}`:D.label,$.appendChild(z),v.appendChild($)}),M.length>T){let D=document.createElement("span");D.className="event-more",D.textContent=this.#S("More","+{n} more").replace("{n}",String(M.length-T)),v.appendChild(D)}S.appendChild(v)}}else{let v=document.createElement("span");v.className="event-dots",v.setAttribute("aria-hidden","true");let T=Math.min(k.length,3);for(let D=0;D<T;D++){let $=document.createElement("span");$.setAttribute("data-event-dot",""),k[D].evt.color&&$.style.setProperty("--event-color",k[D].evt.color),v.appendChild($)}m.appendChild(v)}let K=Y.map(v=>v.time?`${v.time} \u2014 ${v.label}`:v.label);S.setAttribute("title",K.join(`
2
+ `))}S.setAttribute("tabindex","-1"),m.insertBefore(S,m.firstChild),f.appendChild(m),(l+g)%7===0&&(p.appendChild(f),d++,f=document.createElement("tr"),f.setAttribute("data-week",String(d)))}let I=(l+s)%7;if(I>0){for(let g=1;g<=7-I;g++){let y=document.createElement("td");y.setAttribute("data-outside-month","");let A=document.createElement("button");A.type="button",A.disabled=!0,A.setAttribute("tabindex","-1"),A.setAttribute("data-day",String(g));let m=document.createElement("span");m.className="day-number",m.textContent=String(g),A.appendChild(m),y.appendChild(A),f.appendChild(y)}p.appendChild(f)}return a.appendChild(p),i&&this.#D.spans.length&&this.#X(p,t,e),a}#X(t,e,n){let s=[...t.querySelectorAll("tr")],i=new Intl.DateTimeFormat(this.#a,{month:"short",day:"numeric"});for(let a of s){let o=[...a.querySelectorAll("td")];if(!o.length)continue;let h=o.findIndex(l=>l.querySelector("button[data-date]")),E=o.map((l,c)=>{let C=l.querySelector("button"),u=C?.getAttribute("data-date");if(u)return F(u);let I=parseInt(C?.getAttribute("data-day")||"0",10);return h>=0&&c<h?new Date(e,n-1,I):new Date(e,n+1,I)}),b=E[0],p=E[E.length-1];if(!b||!p)continue;let d=[];for(let{evt:l,range:c}of this.#D.spans){if(c.end<b||c.start>p)continue;let C=c.start<b?0:E.findIndex(I=>N(I,c.start)),u=c.end>p?E.length-1:E.findIndex(I=>N(I,c.end));C<0||u<0||d.push({evt:l,range:c,startCol:C,endCol:u,continuesLeft:c.start<b,continuesRight:c.end>p})}if(!d.length)continue;d.sort((l,c)=>l.startCol-c.startCol||c.endCol-c.startCol-(l.endCol-l.startCol));let f=[];for(let l of d){let c=0;for(;c<f.length&&f[c]>=l.startCol;)c++;l.lane=c,f[c]=l.endCol}let w=f.length;a.style.setProperty("--cal-row-lanes",String(w)),a.setAttribute("data-row-lanes",String(w));for(let l of d){let c=o[l.startCol],C=l.endCol-l.startCol+1,u=document.createElement("span");u.className="event-span",u.style.setProperty("--span-cells",String(C)),u.style.setProperty("--span-lane",String(l.lane)),l.evt.color&&u.style.setProperty("--event-color",l.evt.color),l.continuesLeft&&u.setAttribute("data-continues-start",""),l.continuesRight&&u.setAttribute("data-continues-end",""),u.textContent=l.evt.label||"",u.setAttribute("title",`${l.evt.label} \u2014 ${i.format(l.range.start)} to ${i.format(l.range.end)}`),c.appendChild(u)}}}#Z(t,e){this.#x();let n=F(t)??new Date,s=document.createElement("div");s.className="day-detail",s.setAttribute("role","dialog");let i=`calendar-wc-detail-${++X}`;s.setAttribute("aria-labelledby",i);let a=document.createElement("header"),o=document.createElement("h3");o.id=i;try{o.textContent=new Intl.DateTimeFormat(this.#a,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(n)}catch{o.textContent=t}let h=document.createElement("button");if(h.type="button",h.setAttribute("aria-label",this.#S("Close","Close")),h.textContent="\xD7",h.addEventListener("click",()=>this.#x(!0)),a.append(o,h),s.appendChild(a),e.some(d=>d.time)){let d=document.createElement("day-view");d.dataset.date=t,d.dataset.startHour="auto",d.dataset.compact="";let f=new Intl.DateTimeFormat(this.#a,{hour:"numeric",minute:"2-digit"});e.forEach(w=>{let l=document.createElement("calendar-event");if(w.color&&l.style.setProperty("--event-color",w.color),w.icon){let c=document.createElement("icon-wc");c.setAttribute("name",w.icon),c.setAttribute("size","sm"),l.appendChild(c)}if(w.time){let c=document.createElement("time");c.setAttribute("datetime",w.time);try{let[C,u]=w.time.split(":"),I=new Date(2026,0,1,parseInt(C,10),parseInt(u,10));c.textContent=f.format(I)}catch{c.textContent=w.time}l.appendChild(c)}l.append(w.label||""),d.appendChild(l)}),s.appendChild(d)}else{let d=document.createElement("ul");d.className="detail-list",e.forEach(f=>{let w=document.createElement("li");f.color&&w.style.setProperty("--event-color",f.color);let l=document.createElement("span");l.className="detail-dot";let c=document.createElement("span");if(c.className="detail-content",f.icon){let u=document.createElement("icon-wc");u.setAttribute("name",f.icon),u.setAttribute("size","sm"),c.appendChild(u)}let C=document.createElement("span");C.className="detail-label",C.textContent=f.label||"",c.append(C),w.append(l,c),d.appendChild(w)}),s.appendChild(d)}this.#P=this.#s.querySelector(`button[data-date="${t}"]`),this.appendChild(s),this.#v=s,h.focus();let b=d=>{s.contains(d.target)||this.#x(!1)},p=0;this._detailCleanup=()=>{cancelAnimationFrame(p),document.removeEventListener("mousedown",b)},p=requestAnimationFrame(()=>{document.addEventListener("mousedown",b)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#x(t=!1){if(this.#v){this._detailCleanup?.(),this._detailCleanup=null,this.#v.remove(),this.#v=null;let e=this.#P;this.#P=null,t&&e?.isConnected&&e.focus()}}teardown(){this.removeAttribute("data-tentative"),this.#x(),this.#w?.remove(),this.#O?.remove(),this.#s?.remove(),this.#w=this.#O=this.#s=null,this.#p=!1}#tt(t){let n={ArrowRight:1,ArrowLeft:-1,ArrowDown:7,ArrowUp:-7}[t.key];if(!n)return;let i=t.target?.closest?.("button[data-date]");if(!i||!this.#s.contains(i))return;let a=F(i.getAttribute("data-date"));if(!a)return;t.preventDefault(),Math.abs(n)===1&&getComputedStyle(this).direction==="rtl"&&(n=-n);let o=O(a,n);for(let h=0;h<366;h++,o=O(o,n)){if(this.#o&&o<this.#o||this.#l&&o>this.#l)return;let E=o.getMonth(),b=o.getFullYear(),p=this.#F(this.#T-1),d=(b>this.#t||b===this.#t&&E>=this.#n)&&(b<p.year||b===p.year&&E<=p.month),f=x(o);d||(this.#n=E,this.#t=b,this.#I=f,this.#d());let w=this.#s.querySelector(`button[data-date="${f}"]`);if(w&&!w.disabled){this.#I=f,this.#B(),w.focus();return}}}};R("calendar-wc",_);export{_ as CalendarWc};
3
3
  //# sourceMappingURL=calendar-wc.js.map
@@ -1,2 +1,2 @@
1
- function y(s){if(!s||typeof s!="string")return"";let t=document.createElement("template");return t.innerHTML=s,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),t.content.querySelectorAll("*").forEach(n=>{for(let r of[...n.attributes]){if(r.name.startsWith("on")){n.removeAttribute(r.name);continue}if(["href","src","action","formaction","xlink:href"].includes(r.name)){let o=r.value.trim().toLowerCase();(o.startsWith("javascript:")||o.startsWith("data:text/html"))&&n.removeAttribute(r.name);continue}(r.name==="srcdoc"||r.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(r.name)}}),t.innerHTML}var T=window.matchMedia("(prefers-reduced-motion: reduce)");var A=new Map;function w(s,t,i={}){let e=i.priority??10,n={impl:t,bundle:i.bundle,contract:i.contract,priority:e},r=A.get(s);if(customElements.get(s)){if(!r||r.priority>=e){r&&r.priority===e&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=e){r.priority===e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}A.set(s,n),customElements.define(s,t)}var b=class extends HTMLElement{#e=[];#t;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.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,i,e,n){t.addEventListener(i,e,n),this.#e.push(()=>t.removeEventListener(i,e,n))}setup(){}teardown(){}setState(t,i){this.#t||(this.#t=this.attachInternals());let e=this.#t.states;try{i?e.add(t):e.delete(t)}catch{let n=`--${t}`;i?e.add(n):e.delete(n)}}_adoptInternals(t){this.#t||(this.#t=t)}};function S({newItems:s,nodes:t,keyOf:i,renderItem:e,containerFor:n}){let r=[],o=[],c=[],E=new Set;for(let a of s)E.add(i(a));for(let[a,d]of[...t])E.has(a)||(d.remove(),t.delete(a),c.push(a));let m=new Map;for(let a of s){let d=i(a),l=t.get(d)||null,f=n(a,l);m.has(f)||m.set(f,[]),m.get(f)?.push({item:a,key:d,existing:l})}for(let[a,d]of m)for(let l=0;l<d.length;l++){let{item:f,key:p,existing:k}=d[l],u=k;u?(u.parentElement!==a||a.children[l]!==u)&&o.push(p):(u=e(f),t.set(p,u),r.push(p));let v=a.children[l];v!==u&&a.insertBefore(u,v||null)}return{added:r,moved:o,removed:c}}var M=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function $(s){return!s||typeof s!="string"?!1:M.test(s.trim())}function h(s,t){if(!$(t)){console.warn(`[card-list] Unsafe property path rejected: "${t}"`);return}let e=t.replace(/\[(\d+)\]/g,".$1").split("."),n=s;for(let r of e){if(n==null)return;n=n[r]}return n}function x(s){return s?s.split(",").map(t=>{let[i,e]=t.split(":").map(n=>n.trim());return{attr:i,path:e}}).filter(({attr:t,path:i})=>t&&i):[]}var g=class extends b{#e=null;#t=[];#n="id";#i=new Map;static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#e=this.querySelector("template"),!this.#e)return console.warn("[card-list] No template found"),!1;this.#n=this.getAttribute("data-key")||"id";let t=this.getAttribute("data-items");if(t){try{this.#t=JSON.parse(t),this.#r()}catch(e){console.error("[card-list] Invalid JSON in data-items:",e)}return}let i=this.getAttribute("src");return i&&this.#o(i),!0}attributeChangedCallback(t,i,e){if(i!==e)if(t==="data-items"&&e)try{this.#t=JSON.parse(e),this.#r()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else t==="src"&&e?this.#o(e):t==="data-key"&&(this.#n=e||"id",this.#r())}async#o(t){try{this.setAttribute("data-loading","");let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}`);let e=await i.json();this.#t=Array.isArray(e)?e:e.items||e.data||[],this.#r()}catch(i){console.error("[card-list] Fetch error:",i),this.setAttribute("data-error",i.message)}finally{this.removeAttribute("data-loading")}}#r(t="internal"){if(!this.#e)return;if([...this.#e.content.children].length!==1){this.querySelectorAll(":scope > :not(template)").forEach(r=>r.remove()),this.#i.clear();let n=document.createDocumentFragment();for(let r of this.#t){let o=this.#e.content.cloneNode(!0);this.#s(o,r),n.appendChild(o)}this.appendChild(n)}else{let e=S({newItems:this.#t,nodes:this.#i,keyOf:r=>r?.[this.#n],renderItem:r=>{if(!this.#e)throw new Error("card-list: missing template");let c=this.#e.content.cloneNode(!0).firstElementChild;return this.#s(c,r),c},containerFor:()=>this}),n=new Set(e.added);for(let r of this.#t){let o=r?.[this.#n];if(n.has(o))continue;let c=this.#i.get(o);c&&this.#s(c,r)}}this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#t.length},bubbles:!0})),this.dispatchEvent(new CustomEvent("card-list:items-changed",{detail:{items:this.#t,source:t},bubbles:!0}))}#s(t,i){t.querySelectorAll("[data-field]").forEach(e=>{let n=e.getAttribute("data-field"),r=h(i,n);e.textContent=r??""}),t.querySelectorAll("[data-field-attr]").forEach(e=>{let n=x(e.getAttribute("data-field-attr"));for(let{attr:r,path:o}of n){if(!$(o))continue;let c=h(i,o);c!=null&&e.setAttribute(r,c)}}),t.querySelectorAll("[data-field-html]").forEach(e=>{let n=e.getAttribute("data-field-html"),r=h(i,n);e.innerHTML=y(r)}),t.querySelectorAll("[data-field-if]").forEach(e=>{let n=e.getAttribute("data-field-if");h(i,n)||e.remove()}),t.querySelectorAll("[data-field-unless]").forEach(e=>{let n=e.getAttribute("data-field-unless");h(i,n)&&e.remove()})}get items(){return this.#t}set items(t){this.#t=Array.isArray(t)?t:[],this.#r("api")}setItems(t){this.items=t}getItems(){return[...this.#t]}};w("card-list",g);export{g as CardList,h as getValueByPath,$ as isValidPath,y as sanitizeHTML};
1
+ function g(n){if(!n||typeof n!="string")return"";let t=document.createElement("template");return t.innerHTML=n,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(e=>e.remove()),t.content.querySelectorAll("*").forEach(e=>{for(let s of[...e.attributes]){if(s.name.startsWith("on")){e.removeAttribute(s.name);continue}if(["href","src","action","formaction","xlink:href"].includes(s.name)){let a=s.value.trim().toLowerCase();(a.startsWith("javascript:")||a.startsWith("data:text/html"))&&e.removeAttribute(s.name);continue}(s.name==="srcdoc"||s.name==="data"&&e.tagName==="OBJECT")&&e.removeAttribute(s.name)}}),t.innerHTML}var H=window.matchMedia("(prefers-reduced-motion: reduce)");var S=new Map;function v(n,t,r={}){let i=r.priority??10,e={impl:t,bundle:r.bundle,contract:r.contract,priority:i},s=S.get(n);if(customElements.get(n)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}S.set(n,e),customElements.define(n,t)}var y=class extends HTMLElement{#e=[];#t;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.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,r,i,e){t.addEventListener(r,i,e),this.#e.push(()=>t.removeEventListener(r,i,e))}_reinit(){for(let t of this.#e)t();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,r){this.#t||(this.#t=this.attachInternals());let i=this.#t.states;try{r?i.add(t):i.delete(t)}catch{let e=`--${t}`;r?i.add(e):i.delete(e)}}_adoptInternals(t){this.#t||(this.#t=t)}};function w({newItems:n,nodes:t,keyOf:r,renderItem:i,containerFor:e}){let s=[],a=[],l=[],c=new Set;for(let o of n)c.add(r(o));for(let[o,f]of[...t])c.has(o)||(f.remove(),t.delete(o),l.push(o));let d=new Map;for(let o of n){let f=r(o),u=t.get(f)||null,m=e(o,u);d.has(m)||d.set(m,[]),d.get(m)?.push({item:o,key:f,existing:u})}for(let[o,f]of d)for(let u=0;u<f.length;u++){let{item:m,key:b,existing:T}=f[u],h=T;h?(h.parentElement!==o||o.children[u]!==h)&&a.push(b):(h=i(m),t.set(b,h),s.push(b));let E=o.children[u];E!==h&&o.insertBefore(h,E||null)}return{added:s,moved:a,removed:l}}var L=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function $(n){return!n||typeof n!="string"?!1:L.test(n.trim())}function p(n,t){if(!$(t)){console.warn(`[card-list] Unsafe property path rejected: "${t}"`);return}let i=String(t).replace(/\[(\d+)\]/g,".$1").split("."),e=n;for(let s of i){if(e==null)return;e=e[s]}return e}function x(n){return n?n.split(",").map(t=>{let[r,i]=t.split(":").map(e=>e.trim());return{attr:(r||"").toLowerCase(),path:i}}).filter(({attr:t,path:r})=>t&&r):[]}var q=new Set(["href","src","action","formaction","xlink:href","poster","cite","background","ping","data","manifest","longdesc","codebase"]),C=new Set(["srcdoc","style","is"]),_=new Set(["http:","https:","mailto:","tel:"]);function M(n){let t=String(n).replace(/[\u0000-\u0020\u007f]+/g,"");if(!t)return!0;let r=/^([a-z][a-z0-9+.-]*):/i.exec(t);return r?_.has(`${r[1].toLowerCase()}:`):!0}function B(n){return String(n).split(",").every(t=>M(t.trim().split(/\s+/)[0]||""))}function N(n,t){return n.startsWith("on")||C.has(n)||!/^[a-z_][a-z0-9_.:-]*$/.test(n)?!1:n==="srcset"||n==="imagesrcset"?B(t):q.has(n)?M(t):!0}function z(n,t){let r=new Set;return n.map((i,e)=>{let s=i!=null&&typeof i=="object"?i[t]:void 0,a=s==null?null:`k:${String(s)}`;return a==null||r.has(a)?`i:${e}`:(r.add(a),a)})}var k=":scope > [data-card-list-status]",A=class extends y{#e=null;#t=[];#a="id";#c=new Map;#n=!1;#o=null;#r=null;static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#e=this.querySelector(":scope > template")||this.querySelector("template"),!this.#e)return console.warn("[card-list] No template found"),!1;if(this.#a=this.getAttribute("data-key")||"id",this.#n)return this.#o&&this.#i(this.#o),this.#o=null,!0;let t=this.getAttribute("data-items");if(t)return this.#u(t),!0;let r=this.getAttribute("src");return r&&this.#h(r),!0}teardown(){this.#s()}attributeChangedCallback(t,r,i){r!==i&&this.hasAttribute("data-upgraded")&&(t==="data-items"?i&&this.#u(i):t==="src"?i?this.#h(i):this.#s():t==="data-key"&&(this.#a=i||"id",this.#i("attribute")))}#u(t){this.#s();try{let r=JSON.parse(t);this.#t=Array.isArray(r)?r:[],this.#n=!0,this.#i("attribute")}catch(r){console.error("[card-list] Invalid JSON in data-items:",r)}}#s(){this.#r&&(this.#r.abort(),this.#r=null,this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"),this.#l(""))}#f(){let t=this.querySelector(k);return t||(t=document.createElement("p"),t.setAttribute("role","status"),t.setAttribute("data-card-list-status",""),this.append(t)),t}#l(t){let r=this.querySelector(k);!r&&!t||((r||this.#f()).textContent=t)}async#h(t){this.#s();let r=new AbortController;this.#r=r,this.removeAttribute("data-error"),this.setAttribute("data-loading",""),this.setAttribute("aria-busy","true"),this.#f().textContent="Loading\u2026";try{let i=await fetch(t,{signal:r.signal});if(!i.ok)throw new Error(`HTTP ${i.status}`);let e=await i.json();if(r.signal.aborted)return;this.#t=Array.isArray(e)?e:e?.items||e?.data||[],this.#n=!0,this.#l(""),this.#i("attribute")}catch(i){if(r.signal.aborted)return;let e=i instanceof Error?i.message:String(i);console.error("[card-list] Fetch error:",i),this.setAttribute("data-error",e),this.#l(`Error: ${e}`)}finally{this.#r===r&&(this.#r=null,this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"))}}#i(t){if(!this.#e)return;this.querySelectorAll(":scope > [data-fallback]").forEach(e=>e.remove());let r=this.#e;if([...r.content.children].length!==1){this.querySelectorAll(":scope > :not(template, [data-card-list-status])").forEach(s=>s.remove()),this.#c.clear();let e=document.createDocumentFragment();for(let s of this.#t){let a=r.content.cloneNode(!0);this.#d(a,s),e.appendChild(a)}this.prepend(e)}else{let e=z(this.#t,this.#a),s=this.#t.map((c,d)=>({item:c,key:e[d]})),a=w({newItems:s,nodes:this.#c,keyOf:c=>c.key,renderItem:c=>{let o=r.content.cloneNode(!0).firstElementChild;return this.#d(o,c.item),o},containerFor:()=>this}),l=new Set(a.added);for(let{item:c,key:d}of s){if(l.has(d))continue;let o=this.#c.get(d);o&&this.#d(o,c)}}this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#t.length},bubbles:!0})),this.dispatchEvent(new CustomEvent("card-list:items-changed",{detail:{items:this.#t,source:t},bubbles:!0}))}#d(t,r){let i=e=>{let s=[...t.querySelectorAll(e)];return t instanceof Element&&t.matches(e)&&s.unshift(t),s};i("[data-field]").forEach(e=>{let s=p(r,e.getAttribute("data-field"));e.textContent=s??""}),i("[data-field-attr]").forEach(e=>{for(let{attr:s,path:a}of x(e.getAttribute("data-field-attr"))){if(!$(a))continue;let l=p(r,a);if(s.startsWith("on")||C.has(s)){console.warn(`[card-list] Refusing to bind "${s}" from data`);continue}let c=s.startsWith("aria-");l==null||l===!1&&!c?e.removeAttribute(s):N(s,l)?e.setAttribute(s,l===!0&&!c?"":String(l)):(console.warn(`[card-list] Unsafe value refused for "${s}"`),e.removeAttribute(s))}}),i("[data-field-html]").forEach(e=>{e.innerHTML=g(p(r,e.getAttribute("data-field-html")))}),i("[data-field-if]").forEach(e=>{e.hidden=!p(r,e.getAttribute("data-field-if"))}),i("[data-field-unless]").forEach(e=>{e.hidden=!!p(r,e.getAttribute("data-field-unless"))})}get items(){return this.#t}set items(t){this.#s(),this.#t=Array.isArray(t)?t:[],this.#n=!0,this.#e&&this.hasAttribute("data-upgraded")?this.#i("api"):this.#o="api"}};v("card-list",A);export{A as CardList,p as getValueByPath,N as isSafeAttrBinding,M as isSafeUrl,$ as isValidPath,g as sanitizeHTML};
2
2
  //# sourceMappingURL=card-list.js.map
@@ -1,2 +1,2 @@
1
- var F=Object.defineProperty;var X=(t,e)=>()=>(t&&(e=t(t=0)),e);var O=(t,e)=>{for(var s in e)F(t,s,{get:e[s],enumerable:!0})};var Y={};O(Y,{addDialogDismiss:()=>I,addFlickListener:()=>$,addLongPress:()=>S,addPullToRefresh:()=>H,addSwipeListener:()=>T,haptic:()=>L,initGestures:()=>N,makeSwipeable:()=>P});function T(t,e={}){let s=e.threshold??50,r=e.restraint??100,n=e.timeout??300,i=e.velocity??.5,o=e.minFlickDistance??10,a,l,d;function p(u){u.isPrimary&&(a=u.clientX,l=u.clientY,d=Date.now())}function f(u){if(!u.isPrimary)return;let v=u.clientX-a,m=u.clientY-l,c=Date.now()-d;if(c>n)return;let h=Math.abs(v),b=Math.abs(m),E=Math.max(h,b),y=c>0?E/c:0,g=y>=i&&E>=o,w;if((h>=s||g&&h>b)&&b<=r?w=v<0?"left":"right":(b>=s||g&&b>h)&&h<=r&&(w=m<0?"up":"down"),w){let B=w==="left"||w==="right"?h:b;t.dispatchEvent(new CustomEvent(`swipe-${w}`,{bubbles:!0,detail:{distance:B,duration:c,velocity:y,flick:g}}))}}return t.addEventListener("pointerdown",p,{passive:!0}),t.addEventListener("pointerup",f,{passive:!0}),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointerup",f)}}function $(t,e={}){let s=e.minDistance??10,r=e.velocity??.6,n=e.timeout??250,i=e.restraint??80,o,a,l;function d(f){f.isPrimary&&(o=f.clientX,a=f.clientY,l=Date.now())}function p(f){if(!f.isPrimary)return;let u=f.clientX-o,v=f.clientY-a,m=Date.now()-l;if(m===0||m>n)return;let c=Math.abs(u),h=Math.abs(v),b=Math.max(c,h);if(b<s)return;let E=b/m;if(E<r)return;let y;if(c>h&&h<=i?y=u<0?"left":"right":h>c&&c<=i&&(y=v<0?"up":"down"),y){let g=y==="left"||y==="right"?c:h;t.dispatchEvent(new CustomEvent(`swipe-${y}`,{bubbles:!0,detail:{distance:g,duration:m,velocity:E,flick:!0}}))}}return t.addEventListener("pointerdown",d,{passive:!0}),t.addEventListener("pointerup",p,{passive:!0}),()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointerup",p)}}function P(t,e={}){let s=e.threshold??100,r=e.direction??"horizontal",n=e.removeOnDismiss??!0,i=r==="horizontal",o=0,a=0,l=!1;function d(c){!c.isPrimary||t.hasAttribute("data-dismissed")||(c.preventDefault(),l=!0,o=i?c.clientX:c.clientY,a=0,t.setPointerCapture(c.pointerId),t.setAttribute("data-swiping",""))}function p(c){if(!l||!c.isPrimary)return;a=(i?c.clientX:c.clientY)-o;let b=1-Math.min(Math.abs(a)/s,1)*.5;i?t.style.transform=`translateX(${a}px)`:t.style.transform=`translateY(${a}px)`,t.style.opacity=String(b)}function f(c){!l||!c.isPrimary||(l=!1,t.releasePointerCapture(c.pointerId),t.removeAttribute("data-swiping"),Math.abs(a)>=s?v(a>0?"right":"left"):m())}function u(c){!l||!c.isPrimary||(l=!1,t.releasePointerCapture(c.pointerId),t.removeAttribute("data-swiping"),m())}function v(c){let h=c==="right"?"100%":"-100%";t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform=i?`translateX(${h})`:`translateY(${h})`,t.style.opacity="0",t.setAttribute("data-dismissed",""),L.dismiss(),t.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:c,distance:Math.abs(a)}})),n&&t.addEventListener("transitionend",()=>t.remove(),{once:!0})}function m(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",d),t.addEventListener("pointermove",p),t.addEventListener("pointerup",f),t.addEventListener("pointercancel",u),()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointermove",p),t.removeEventListener("pointerup",f),t.removeEventListener("pointercancel",u)}}function H(t,e,s={}){let r=s.threshold??70,n=s.maxPull??120,i=document.createElement("div");i.setAttribute("data-pull-indicator",""),i.setAttribute("aria-hidden","true");let o=document.createElement("div");o.setAttribute("data-pull-spinner",""),i.appendChild(o),t.prepend(i);let a=0,l=!1,d=!1;function p(h){!h.isPrimary||d||t.scrollTop<=0&&(a=h.clientY,l=!0)}function f(h){if(!l||!h.isPrimary||d)return;let b=h.clientY-a;if(b<=0){i.style.transform="",i.style.opacity="";return}let E=Math.min(b,n),y=E/r;i.style.transform=`translateY(${E}px)`,i.style.opacity=String(Math.min(y,1)),y>=1?i.setAttribute("data-pull-ready",""):i.removeAttribute("data-pull-ready")}function u(h){!l||!h.isPrimary||(l=!1,i.hasAttribute("data-pull-ready")&&!d?m():c())}function v(h){!l||!h.isPrimary||(l=!1,c())}async function m(){d=!0,i.removeAttribute("data-pull-ready"),i.setAttribute("data-pull-loading",""),i.style.transform=`translateY(${r}px)`,i.style.opacity="1";try{await e()}finally{d=!1,i.removeAttribute("data-pull-loading"),c()}}function c(){i.style.transition="transform 0.3s ease, opacity 0.3s ease",i.style.transform="",i.style.opacity="",i.removeAttribute("data-pull-ready"),i.addEventListener("transitionend",()=>{i.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",p,{passive:!0}),t.addEventListener("pointermove",f,{passive:!0}),t.addEventListener("pointerup",u,{passive:!0}),t.addEventListener("pointercancel",v,{passive:!0}),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",f),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",v),i.remove()}}function S(t,e,s={}){let r=s.duration??500,n=s.hapticFeedback??!0,i=s.blockContextMenu??!0,o=null;function a(p){p.isPrimary&&(o=setTimeout(()=>{n&&L.tap(),e(p),o=null},r))}function l(){o&&(clearTimeout(o),o=null)}function d(p){i&&p.preventDefault()}return t.addEventListener("pointerdown",a,{passive:!0}),t.addEventListener("pointermove",l,{passive:!0}),t.addEventListener("pointerup",l,{passive:!0}),t.addEventListener("pointercancel",l,{passive:!0}),t.addEventListener("contextmenu",d),()=>{l(),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",l),t.removeEventListener("contextmenu",d)}}function I(t,e={}){let s=e.threshold??80,r=0,n=0,i=!1;function o(u){if(!u.isPrimary||!t.open)return;let v=u.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(i=!0,r=u.clientY,n=0,t.setPointerCapture(u.pointerId),t.style.transition="none")}function a(u){if(!i||!u.isPrimary)return;if(n=u.clientY-r,n<=0){t.style.transform="",t.style.opacity="";return}let m=1-Math.min(n/s,1)*.4;t.style.transform=`translateY(${n}px)`,t.style.opacity=String(m)}function l(u){!i||!u.isPrimary||(i=!1,t.releasePointerCapture(u.pointerId),n>=s?p():f())}function d(u){!i||!u.isPrimary||(i=!1,t.releasePointerCapture(u.pointerId),f())}function p(){t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform="translateY(100%)",t.style.opacity="0",L.dismiss(),t.addEventListener("transitionend",()=>{t.style.transition="",t.style.transform="",t.style.opacity="",t.close("dismiss")},{once:!0})}function f(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",o),t.addEventListener("pointermove",a),t.addEventListener("pointerup",l),t.addEventListener("pointercancel",d),()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",d)}}function N(t=document){let e=[];for(let s of t.querySelectorAll('[data-gesture="swipe"]'))e.push(T(s));for(let s of t.querySelectorAll('[data-gesture="flick"]'))e.push($(s));for(let s of t.querySelectorAll('[data-gesture="dismiss"]'))e.push(P(s));for(let s of t.querySelectorAll('[data-gesture="long-press"]'))e.push(S(s,()=>{s.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let s of t.querySelectorAll('dialog[data-gesture="dismiss-down"]'))e.push(I(s));return()=>e.forEach(s=>s())}var L,x,q=X(()=>{L={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};x=typeof document<"u"?document.documentElement:null;(!x||!x.hasAttribute("data-vb-gestures-init"))&&(x?.setAttribute("data-vb-gestures-init",""),N())});var U=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function M(t,e,s={}){let r=s.priority??10,n={impl:e,bundle:s.bundle,contract:s.contract,priority:r},i=C.get(t);if(customElements.get(t)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${i.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}C.set(t,n),customElements.define(t,e)}var A=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,s,r,n){e.addEventListener(s,r,n),this.#e.push(()=>e.removeEventListener(s,r,n))}setup(){}teardown(){}setState(e,s){this.#t||(this.#t=this.attachInternals());let r=this.#t.states;try{s?r.add(e):r.delete(e)}catch{let n=`--${e}`;s?r.add(n):r.delete(n)}}_adoptInternals(e){this.#t||(this.#t=e)}};function D(t){return document.startViewTransition?document.startViewTransition(t):t()}var z=0,k=class extends A{#e;#t=[];#s;#r;#n;#o;#l;#c=null;#i=0;#f=0;#u=!1;#h=!1;#a=!1;#d=null;get currentIndex(){return this.#i}get slideCount(){return this.#t.length}get playing(){return this.#c!==null}setup(){let e=[...this.children];if(e.length===0)return!1;if(this.#h=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#a=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#a&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#e=document.createElement("div"),this.#e.className="carousel-track",this.#e.setAttribute("tabindex","0"),this.#e.setAttribute("aria-label","Slides"),e.forEach((i,o)=>{i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-label",`${o+1} of ${e.length}`),this.#e.appendChild(i)}),this.#t=[...this.#e.children],this.#s=document.createElement("button"),this.#s.className="carousel-prev",this.#s.setAttribute("aria-label","Previous slide"),this.#s.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#r=document.createElement("button"),this.#r.className="carousel-next",this.#r.setAttribute("aria-label","Next slide"),this.#r.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#n=document.createElement("div"),this.#n.className="carousel-indicators",this.#n.setAttribute("aria-label","Slide indicators"),this.#t.forEach((i,o)=>{let a=document.createElement("button");a.className="carousel-dot",a.setAttribute("aria-label",`Go to slide ${o+1}`),a.setAttribute("aria-current",o===0?"true":"false"),this.listen(a,"click",()=>this.goTo(o)),this.#n.appendChild(a)})),this.#o=document.createElement("div"),this.#o.className="carousel-live",this.#o.setAttribute("aria-live","polite"),this.#o.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.appendChild(this.#e),this.appendChild(this.#r),this.#n&&this.appendChild(this.#n),this.appendChild(this.#o),this.listen(this.#s,"click",()=>this.prev()),this.listen(this.#r,"click",()=>this.next()),this.listen(this.#e,"keydown",this.#E),this.#a){let i=++z,o=this.getAttribute("transition")||"fade",a=o==="slide"?"vt-carousel-slide":o==="scale"?"vt-carousel-scale":"vt-carousel";this.#e.style.viewTransitionName=`carousel-${i}`,this.#e.style.viewTransitionClass=a}this.#a&&Promise.resolve().then(()=>(q(),Y)).then(({addSwipeListener:i})=>{this.#d=i(this.#e,{threshold:40}),this.listen(this.#e,"swipe-left",()=>this.next()),this.listen(this.#e,"swipe-right",()=>this.prev())}),this.#a||(this.#l=new IntersectionObserver(this.#y,{root:this.#e,threshold:.5}),this.#t.forEach(i=>this.#l.observe(i)),"onscrollend"in window&&this.listen(this.#e,"scrollend",()=>{this.#u=!1,this.#m()}));let n=this.#g()??(Number(this.getAttribute("start"))||0);if(this.#a){let i=n>0&&n<this.#t.length?n:0;this.#t.forEach((o,a)=>{o.hidden=a!==i}),this.#p(i)}else n>0&&n<this.#t.length&&this.goTo(n,!1);return this.#b(),this.hasAttribute("autoplay")&&!this.#h&&this.#w(),!0}teardown(){this.pause(),this.#l&&(this.#l.disconnect(),this.#l=null),this.#d&&(this.#d(),this.#d=null),this.#e?.parentElement===this&&[...this.#e.children].forEach(e=>this.appendChild(e)),this.#e?.remove(),this.#s?.remove(),this.#r?.remove(),this.#n?.remove(),this.#o?.remove(),this.#e=this.#s=this.#r=this.#n=this.#o=null,this.#t=[],this.#a=!1,this.#i=0,this.#f=0,this.#u=!1}get slides(){return this.#t.map((e,s)=>({id:e.id||void 0,html:e.innerHTML,label:e.getAttribute("aria-label")||`${s+1} of ${this.#t.length}`}))}set slides(e){let s=Array.isArray(e)?e:[];for(;this.firstChild;)this.firstChild.remove();for(let r of s){let n=document.createElement("div");r.id&&(n.id=r.id),r.label&&n.setAttribute("aria-label",r.label),n.innerHTML=r.html||"",this.appendChild(n)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("carousel-wc:slides-changed",{detail:{slides:s,source:"property"},bubbles:!0}))}next(){let e=this.hasAttribute("loop");this.#i<this.#t.length-1?this.goTo(this.#i+1):e&&this.goTo(0)}prev(){let e=this.hasAttribute("loop");this.#i>0?this.goTo(this.#i-1):e&&this.goTo(this.#t.length-1)}goTo(e,s=!0){if(!(e<0||e>=this.#t.length)){if(this.#a)if(s&&e!==this.#i){let r=e>this.#i?"forward":"backward";document.documentElement.dataset.vtDirection=r,D(()=>{this.#v(e)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#v(e);else{let r=this.#t[e].offsetLeft-this.#e.offsetLeft,n=s&&!this.#h?"smooth":"instant";this.#e.scrollTo({left:r,behavior:n})}this.#p(e)}}#v(e){this.#t.forEach((s,r)=>{s.hidden=r!==e})}play(){if(this.#c||this.#h)return;let e=Number(this.getAttribute("autoplay-delay"))||5e3;this.#c=setInterval(()=>this.next(),e),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}pause(){this.#c&&(clearInterval(this.#c),this.#c=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}reset(){let e=Number(this.getAttribute("start"))||0;this.goTo(e,!1),this.#L()}#p(e){this.#i=e,this.#b(),this.#A(),this.#o&&(this.#o.textContent=`Slide ${e+1} of ${this.#t.length}`),!this.#u&&(this.#m(),!this.#a&&"onscrollend"in window&&(this.#u=!0))}#m(){this.#i!==this.#f&&(this.#f=this.#i,this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:this.#i,slide:this.#t[this.#i]},bubbles:!0})))}#b(){let e=this.hasAttribute("loop"),s=this.#i===0,r=this.#i===this.#t.length-1;if(this.#s&&(this.#s.disabled=!e&&s),this.#r&&(this.#r.disabled=!e&&r),this.#n){let n=this.#n.children;for(let i=0;i<n.length;i++){let o=i===this.#i;n[i].setAttribute("aria-current",o?"true":"false"),o?n[i].setAttribute("data-active",""):n[i].removeAttribute("data-active")}}}#y=e=>{for(let s of e)if(s.isIntersecting){let r=this.#t.indexOf(s.target);r!==-1&&r!==this.#i&&this.#p(r)}};#E=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.prev();break;case"ArrowRight":e.preventDefault(),this.next();break;case"Home":e.preventDefault(),this.goTo(0);break;case"End":e.preventDefault(),this.goTo(this.#t.length-1);break}};#w(){this.play(),this.listen(this,"mouseenter",()=>this.pause()),this.listen(this,"mouseleave",()=>{this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"focusin",()=>this.pause()),this.listen(this,"focusout",e=>{!this.contains(e.relatedTarget)&&this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"touchstart",()=>this.pause(),{passive:!0})}#g(){let e=this.getAttribute("persist");if(!e)return null;try{let s=localStorage.getItem(`carousel:${e}`);return s!==null?Number(s):null}catch{return null}}#A(){let e=this.getAttribute("persist");if(e)try{localStorage.setItem(`carousel:${e}`,String(this.#i))}catch{}}#L(){let e=this.getAttribute("persist");if(e)try{localStorage.removeItem(`carousel:${e}`)}catch{}}};M("carousel-wc",k);export{k as CarouselWc};
1
+ var R=Object.defineProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var X=(e,t)=>{for(var i in t)R(e,i,{get:t[i],enumerable:!0})};var Y={};X(Y,{addDialogDismiss:()=>I,addFlickListener:()=>D,addLongPress:()=>S,addPullToRefresh:()=>z,addSwipeListener:()=>$,haptic:()=>L,initGestures:()=>N,makeSwipeable:()=>P});function $(e,t={}){let i=t.threshold??50,r=t.restraint??100,a=t.timeout??300,s=t.velocity??.5,n=t.minFlickDistance??10,c,o,d;function p(u){u.isPrimary&&(c=u.clientX,o=u.clientY,d=Date.now())}function f(u){if(!u.isPrimary)return;let v=u.clientX-c,m=u.clientY-o,l=Date.now()-d;if(l>a)return;let h=Math.abs(v),b=Math.abs(m),E=Math.max(h,b),y=l>0?E/l:0,g=y>=s&&E>=n,w;if((h>=i||g&&h>b)&&b<=r?w=v<0?"left":"right":(b>=i||g&&b>h)&&h<=r&&(w=m<0?"up":"down"),w){let q=w==="left"||w==="right"?h:b;e.dispatchEvent(new CustomEvent(`swipe-${w}`,{bubbles:!0,detail:{distance:q,duration:l,velocity:y,flick:g}}))}}return e.addEventListener("pointerdown",p,{passive:!0}),e.addEventListener("pointerup",f,{passive:!0}),()=>{e.removeEventListener("pointerdown",p),e.removeEventListener("pointerup",f)}}function D(e,t={}){let i=t.minDistance??10,r=t.velocity??.6,a=t.timeout??250,s=t.restraint??80,n,c,o;function d(f){f.isPrimary&&(n=f.clientX,c=f.clientY,o=Date.now())}function p(f){if(!f.isPrimary)return;let u=f.clientX-n,v=f.clientY-c,m=Date.now()-o;if(m===0||m>a)return;let l=Math.abs(u),h=Math.abs(v),b=Math.max(l,h);if(b<i)return;let E=b/m;if(E<r)return;let y;if(l>h&&h<=s?y=u<0?"left":"right":h>l&&l<=s&&(y=v<0?"up":"down"),y){let g=y==="left"||y==="right"?l:h;e.dispatchEvent(new CustomEvent(`swipe-${y}`,{bubbles:!0,detail:{distance:g,duration:m,velocity:E,flick:!0}}))}}return e.addEventListener("pointerdown",d,{passive:!0}),e.addEventListener("pointerup",p,{passive:!0}),()=>{e.removeEventListener("pointerdown",d),e.removeEventListener("pointerup",p)}}function P(e,t={}){let i=t.threshold??100,r=t.direction??"horizontal",a=t.removeOnDismiss??!0,s=r==="horizontal",n=0,c=0,o=!1;function d(l){!l.isPrimary||e.hasAttribute("data-dismissed")||(l.preventDefault(),o=!0,n=s?l.clientX:l.clientY,c=0,e.setPointerCapture(l.pointerId),e.setAttribute("data-swiping",""))}function p(l){if(!o||!l.isPrimary)return;c=(s?l.clientX:l.clientY)-n;let b=1-Math.min(Math.abs(c)/i,1)*.5;s?e.style.transform=`translateX(${c}px)`:e.style.transform=`translateY(${c}px)`,e.style.opacity=String(b)}function f(l){!o||!l.isPrimary||(o=!1,e.releasePointerCapture(l.pointerId),e.removeAttribute("data-swiping"),Math.abs(c)>=i?v(c>0?"right":"left"):m())}function u(l){!o||!l.isPrimary||(o=!1,e.releasePointerCapture(l.pointerId),e.removeAttribute("data-swiping"),m())}function v(l){let h=l==="right"?"100%":"-100%";e.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",e.style.transform=s?`translateX(${h})`:`translateY(${h})`,e.style.opacity="0",e.setAttribute("data-dismissed",""),L.dismiss(),e.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:l,distance:Math.abs(c)}})),a&&e.addEventListener("transitionend",()=>e.remove(),{once:!0})}function m(){e.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",e.style.transform="",e.style.opacity="",e.addEventListener("transitionend",()=>{e.style.transition=""},{once:!0})}return e.addEventListener("pointerdown",d),e.addEventListener("pointermove",p),e.addEventListener("pointerup",f),e.addEventListener("pointercancel",u),()=>{e.removeEventListener("pointerdown",d),e.removeEventListener("pointermove",p),e.removeEventListener("pointerup",f),e.removeEventListener("pointercancel",u)}}function z(e,t,i={}){let r=i.threshold??70,a=i.maxPull??120,s=document.createElement("div");s.setAttribute("data-pull-indicator",""),s.setAttribute("aria-hidden","true");let n=document.createElement("div");n.setAttribute("data-pull-spinner",""),s.appendChild(n),e.prepend(s);let c=0,o=!1,d=!1;function p(h){!h.isPrimary||d||e.scrollTop<=0&&(c=h.clientY,o=!0)}function f(h){if(!o||!h.isPrimary||d)return;let b=h.clientY-c;if(b<=0){s.style.transform="",s.style.opacity="";return}let E=Math.min(b,a),y=E/r;s.style.transform=`translateY(${E}px)`,s.style.opacity=String(Math.min(y,1)),y>=1?s.setAttribute("data-pull-ready",""):s.removeAttribute("data-pull-ready")}function u(h){!o||!h.isPrimary||(o=!1,s.hasAttribute("data-pull-ready")&&!d?m():l())}function v(h){!o||!h.isPrimary||(o=!1,l())}async function m(){d=!0,s.removeAttribute("data-pull-ready"),s.setAttribute("data-pull-loading",""),s.style.transform=`translateY(${r}px)`,s.style.opacity="1";try{await t()}finally{d=!1,s.removeAttribute("data-pull-loading"),l()}}function l(){s.style.transition="transform 0.3s ease, opacity 0.3s ease",s.style.transform="",s.style.opacity="",s.removeAttribute("data-pull-ready"),s.addEventListener("transitionend",()=>{s.style.transition=""},{once:!0})}return e.addEventListener("pointerdown",p,{passive:!0}),e.addEventListener("pointermove",f,{passive:!0}),e.addEventListener("pointerup",u,{passive:!0}),e.addEventListener("pointercancel",v,{passive:!0}),()=>{e.removeEventListener("pointerdown",p),e.removeEventListener("pointermove",f),e.removeEventListener("pointerup",u),e.removeEventListener("pointercancel",v),s.remove()}}function S(e,t,i={}){let r=i.duration??500,a=i.hapticFeedback??!0,s=i.blockContextMenu??!0,n=null;function c(p){p.isPrimary&&(n=setTimeout(()=>{a&&L.tap(),t(p),n=null},r))}function o(){n&&(clearTimeout(n),n=null)}function d(p){s&&p.preventDefault()}return e.addEventListener("pointerdown",c,{passive:!0}),e.addEventListener("pointermove",o,{passive:!0}),e.addEventListener("pointerup",o,{passive:!0}),e.addEventListener("pointercancel",o,{passive:!0}),e.addEventListener("contextmenu",d),()=>{o(),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",o),e.removeEventListener("pointerup",o),e.removeEventListener("pointercancel",o),e.removeEventListener("contextmenu",d)}}function I(e,t={}){let i=t.threshold??80,r=0,a=0,s=!1;function n(u){if(!u.isPrimary||!e.open)return;let v=u.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(s=!0,r=u.clientY,a=0,e.setPointerCapture(u.pointerId),e.style.transition="none")}function c(u){if(!s||!u.isPrimary)return;if(a=u.clientY-r,a<=0){e.style.transform="",e.style.opacity="";return}let m=1-Math.min(a/i,1)*.4;e.style.transform=`translateY(${a}px)`,e.style.opacity=String(m)}function o(u){!s||!u.isPrimary||(s=!1,e.releasePointerCapture(u.pointerId),a>=i?p():f())}function d(u){!s||!u.isPrimary||(s=!1,e.releasePointerCapture(u.pointerId),f())}function p(){e.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",e.style.transform="translateY(100%)",e.style.opacity="0",L.dismiss(),e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform="",e.style.opacity="",e.close("dismiss")},{once:!0})}function f(){e.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",e.style.transform="",e.style.opacity="",e.addEventListener("transitionend",()=>{e.style.transition=""},{once:!0})}return e.addEventListener("pointerdown",n),e.addEventListener("pointermove",c),e.addEventListener("pointerup",o),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",n),e.removeEventListener("pointermove",c),e.removeEventListener("pointerup",o),e.removeEventListener("pointercancel",d)}}function N(e=document){let t=[];for(let i of e.querySelectorAll('[data-gesture="swipe"]'))t.push($(i));for(let i of e.querySelectorAll('[data-gesture="flick"]'))t.push(D(i));for(let i of e.querySelectorAll('[data-gesture="dismiss"]'))t.push(P(i));for(let i of e.querySelectorAll('[data-gesture="long-press"]'))t.push(S(i,()=>{i.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let i of e.querySelectorAll('dialog[data-gesture="dismiss-down"]'))t.push(I(i));return()=>t.forEach(i=>i())}var L,x,B=F(()=>{L={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};x=typeof document<"u"?document.documentElement:null;(!x||!x.hasAttribute("data-vb-gestures-init"))&&(x?.setAttribute("data-vb-gestures-init",""),N())});var _=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function T(e,t,i={}){let r=i.priority??10,a={impl:t,bundle:i.bundle,contract:i.contract,priority:r},s=k.get(e);if(customElements.get(e)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${e}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}k.set(e,a),customElements.define(e,t)}var A=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,i,r,a){t.addEventListener(i,r,a),this.#t.push(()=>t.removeEventListener(i,r,a))}_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,i){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{i?r.add(t):r.delete(t)}catch{let a=`--${t}`;i?r.add(a):r.delete(a)}}_adoptInternals(t){this.#e||(this.#e=t)}};function M(e){return document.startViewTransition?document.startViewTransition(e):e()}var H=0,C=class extends A{#t;#e=[];#c;#n;#o;#s;#r;#p;#h=null;#i=0;#E=0;#m=!1;#d=!1;#a=!1;#b=null;#l=!1;#w=!1;#f=!1;#v=!1;#A=new WeakSet;get currentIndex(){return this.#i}get slideCount(){return this.#e.length}get playing(){return this.#h!==null}setup(){let t=[...this.children];if(t.length===0)return!1;this.#d=window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.hasAttribute("data-motion-reduced"),this.#a=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#a&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Carousel"),this.#t=document.createElement("div"),this.#t.className="carousel-track",this.#t.setAttribute("tabindex","0");let i=this.getAttribute("item-width");if(i&&i!=="auto"&&i!=="full"&&CSS.supports("inline-size",i)&&this.#t.style.setProperty("--_item-width",i),t.forEach((n,c)=>{n.setAttribute("role","group"),n.setAttribute("aria-roledescription","slide"),n.hasAttribute("aria-label")||(n.setAttribute("aria-label",`${c+1} of ${t.length}`),this.#A.add(n)),this.#t.appendChild(n)}),this.#e=[...this.#t.children],this.hasAttribute("autoplay")&&!this.#d&&this.#x(),this.#n=document.createElement("button"),this.#n.className="carousel-prev",this.#n.setAttribute("aria-label","Previous slide"),this.#n.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#o=document.createElement("button"),this.#o.className="carousel-next",this.#o.setAttribute("aria-label","Next slide"),this.#o.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#s=document.createElement("div"),this.#s.className="carousel-indicators",this.#s.setAttribute("role","group"),this.#s.setAttribute("aria-label","Slide indicators"),this.#e.forEach((n,c)=>{let o=document.createElement("button");o.className="carousel-dot",o.setAttribute("aria-label",`Go to slide ${c+1}`),o.setAttribute("aria-current",c===0?"true":"false"),this.listen(o,"click",()=>this.goTo(c)),this.#s.appendChild(o)})),this.#r=document.createElement("div"),this.#r.className="carousel-live",this.#r.setAttribute("aria-live","polite"),this.#r.setAttribute("aria-atomic","true"),this.#c&&this.appendChild(this.#c),this.appendChild(this.#n),this.appendChild(this.#t),this.appendChild(this.#o),this.#s&&this.appendChild(this.#s),this.appendChild(this.#r),this.listen(this.#n,"click",()=>this.prev()),this.listen(this.#o,"click",()=>this.next()),this.listen(this.#t,"keydown",this.#P),this.listen(this,"mouseenter",()=>{this.#f=!0,this.#u()}),this.listen(this,"mouseleave",()=>{this.#f=!1,this.#u()}),this.listen(this,"touchstart",()=>{this.#f=!0,this.#u()},{passive:!0}),this.listen(this,"focusin",()=>{this.#v=!0,this.#u()}),this.listen(this,"focusout",n=>{this.contains(n.relatedTarget)||(this.#v=!1,this.#u())}),this.#a){let n=++H,c=this.getAttribute("transition")||"fade",o=c==="slide"?"vt-carousel-slide":c==="scale"?"vt-carousel-scale":"vt-carousel";this.#t.style.viewTransitionName=`carousel-${n}`,this.#t.style.viewTransitionClass=o}if(this.#a){let n=this.#t;Promise.resolve().then(()=>(B(),Y)).then(({addSwipeListener:c})=>{!this.isConnected||this.#t!==n||(this.#b=c(n,{threshold:40}),this.listen(n,"swipe-left",()=>this.#y()?this.prev():this.next()),this.listen(n,"swipe-right",()=>this.#y()?this.next():this.prev()))})}this.#a||(this.#p=new IntersectionObserver(this.#D,{root:this.#t,threshold:.5}),this.#e.forEach(n=>this.#p.observe(n)),"onscrollend"in window&&this.listen(this.#t,"scrollend",()=>{this.#m=!1,this.#T()}));let s=this.#S()??(Number(this.getAttribute("start"))||0);if(this.#a){let n=s>0&&s<this.#e.length?s:0;this.#e.forEach((c,o)=>{c.hidden=o!==n}),this.#g(n)}else s>0&&s<this.#e.length&&this.goTo(s,!1);return this.#M(),this.#f=this.#v=!1,this.#l=this.hasAttribute("autoplay")&&!this.#d&&!this.#w,this.#u(),!0}teardown(){this.#l=!1,this.#k(),this.#p&&(this.#p.disconnect(),this.#p=null),this.#b&&(this.#b(),this.#b=null),this.#t?.parentElement===this&&[...this.#t.children].forEach(t=>this.appendChild(t)),this.#e.forEach(t=>{this.#A.has(t)&&t.removeAttribute("aria-label")}),this.#t?.remove(),this.#c?.remove(),this.#n?.remove(),this.#o?.remove(),this.#s?.remove(),this.#r?.remove(),this.#t=this.#c=this.#n=this.#o=this.#s=this.#r=null,this.#e=[],this.#a=!1,this.#i=0,this.#E=0,this.#m=!1}get slides(){return this.#e.map((t,i)=>({id:t.id||void 0,html:t.innerHTML,label:t.getAttribute("aria-label")||`${i+1} of ${this.#e.length}`}))}set slides(t){let i=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();for(let r of i){let a=document.createElement("div");r.id&&(a.id=r.id),r.label&&a.setAttribute("aria-label",r.label),a.innerHTML=r.html||"",this.appendChild(a)}this._reinit(),this.dispatchEvent(new CustomEvent("carousel-wc:slides-changed",{detail:{slides:i,source:"property"},bubbles:!0}))}next(){let t=this.hasAttribute("loop");this.#i<this.#e.length-1?this.goTo(this.#i+1):t&&this.goTo(0)}prev(){let t=this.hasAttribute("loop");this.#i>0?this.goTo(this.#i-1):t&&this.goTo(this.#e.length-1)}goTo(t,i=!0){if(!(t<0||t>=this.#e.length)){if(this.#a)if(i&&t!==this.#i){let r=t>this.#i?"forward":"backward";document.documentElement.dataset.vtDirection=r,M(()=>{this.#L(t)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#L(t);else{let r=this.#e[t].getBoundingClientRect(),a=this.#t.getBoundingClientRect(),s=this.#y()?r.right-a.right:r.left-a.left,n=i&&!this.#d?"smooth":"instant";this.#t.scrollTo({left:this.#t.scrollLeft+s,behavior:n})}this.#g(t)}}#L(t){this.#e.forEach((i,r)=>{i.hidden=r!==t})}play(){this.#d||!this.#t||(this.#w=!1,this.#l=!0,this.#f=this.#v=!1,this.#c||(this.#x(),this.insertBefore(this.#c,this.firstChild)),this.#u())}pause(){this.#w=!0,this.#l=!1,this.#u()}#x(){let t=document.createElement("button");t.type="button",t.className="carousel-rotate",this.listen(t,"click",()=>{this.#l?this.pause():this.play()}),this.#c=t,this.#C()}#C(){let t=this.#c;if(!t)return;let i=this.#l?"Pause automatic slide show":"Start automatic slide show";t.getAttribute("aria-label")!==i&&(t.setAttribute("aria-label",i),t.innerHTML=`<icon-wc name="${this.#l?"pause":"play"}" size="sm"></icon-wc>`)}#u(){this.#l&&!this.#f&&!this.#v&&!this.#d&&this.isConnected&&!!this.#t?this.#$():this.#k(),this.#C()}#$(){if(this.#h)return;let t=Number(this.getAttribute("autoplay-delay"))||5e3;this.#h=setInterval(()=>this.next(),t),this.#r?.setAttribute("aria-live","off"),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}#k(){this.#r?.setAttribute("aria-live","polite"),this.#h&&(clearInterval(this.#h),this.#h=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}#y(){return getComputedStyle(this).direction==="rtl"}reset(){let t=Number(this.getAttribute("start"))||0;this.goTo(t,!1),this.#N()}#g(t){this.#i=t,this.#M(),this.#I(),this.#r&&(this.#r.textContent=`Slide ${t+1} of ${this.#e.length}`),!this.#m&&(this.#T(),!this.#a&&"onscrollend"in window&&(this.#m=!0))}#T(){this.#i!==this.#E&&(this.#E=this.#i,this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:this.#i,slide:this.#e[this.#i]},bubbles:!0})))}#M(){let t=this.hasAttribute("loop"),i=this.#i===0,r=this.#i===this.#e.length-1;if(this.#n&&(this.#n.disabled=!t&&i),this.#o&&(this.#o.disabled=!t&&r),this.#s){let a=this.#s.children;for(let s=0;s<a.length;s++){let n=s===this.#i;a[s].setAttribute("aria-current",n?"true":"false"),n?a[s].setAttribute("data-active",""):a[s].removeAttribute("data-active")}}}#D=t=>{for(let i of t)if(i.isIntersecting){let r=this.#e.indexOf(i.target);r!==-1&&r!==this.#i&&this.#g(r)}};#P=t=>{let i=(t.key==="ArrowLeft"||t.key==="ArrowRight")&&this.#y();switch(t.key){case"ArrowLeft":t.preventDefault(),i?this.next():this.prev();break;case"ArrowRight":t.preventDefault(),i?this.prev():this.next();break;case"Home":t.preventDefault(),this.goTo(0);break;case"End":t.preventDefault(),this.goTo(this.#e.length-1);break}};#S(){let t=this.getAttribute("persist");if(!t)return null;try{let i=localStorage.getItem(`carousel:${t}`);return i!==null?Number(i):null}catch{return null}}#I(){let t=this.getAttribute("persist");if(t)try{localStorage.setItem(`carousel:${t}`,String(this.#i))}catch{}}#N(){let t=this.getAttribute("persist");if(t)try{localStorage.removeItem(`carousel:${t}`)}catch{}}};T("carousel-wc",C);export{C as CarouselWc};
2
2
  //# sourceMappingURL=carousel-wc.js.map
@@ -1,12 +1,2 @@
1
- var l=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(o,t,r={}){let e=r.priority??10,n={impl:t,bundle:r.bundle,contract:r.contract,priority:e},i=c.get(o);if(customElements.get(o)){if(!i||i.priority>=e){i&&i.priority===e&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=e){i.priority===e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}c.set(o,n),customElements.define(o,t)}var s=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,r,e,n){t.addEventListener(r,e,n),this.#t.push(()=>t.removeEventListener(r,e,n))}setup(){}teardown(){}setState(t,r){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{r?e.add(t):e.delete(t)}catch{let n=`--${t}`;r?e.add(n):e.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}};var a=class extends s{setup(){this.querySelector("[data-controls]")||this.#t()}#t(){let t=document.createElement("nav");t.setAttribute("data-controls",""),t.setAttribute("aria-label","Change view controls"),t.innerHTML=`
2
- <button type="button" data-action="tracking" aria-pressed="true">
3
- Tracking
4
- </button>
5
- <button type="button" data-action="final" aria-pressed="false">
6
- Final
7
- </button>
8
- <button type="button" data-action="original" aria-pressed="false">
9
- Original
10
- </button>
11
- `,this.prepend(t),t.addEventListener("click",r=>{let n=r.target.closest("[data-action]")?.dataset.action;if(n){n==="tracking"?this.removeAttribute("view"):this.setAttribute("view",n);for(let i of t.querySelectorAll("button"))i.setAttribute("aria-pressed",String(i.dataset.action===n));this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:n},bubbles:!0}))}})}get view(){return this.getAttribute("view")??"tracking"}set view(t){if(this.view===t)return;t==="tracking"?this.removeAttribute("view"):this.setAttribute("view",t);let e=this.querySelector("[data-controls]");if(e)for(let n of e.querySelectorAll("button"))n.setAttribute("aria-pressed",String(n.dataset.action===t));this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:t,source:"api"},bubbles:!0}))}};d("change-set",a);export{a as ChangeSet};
1
+ var h=window.matchMedia("(prefers-reduced-motion: reduce)");var d=new Map;function l(s,t,e={}){let n=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:n},i=d.get(s);if(customElements.get(s)){if(!i||i.priority>=n){i&&i.priority===n&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}d.set(s,r),customElements.define(s,t)}var o=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,r){t.addEventListener(e,n,r),this.#t.push(()=>t.removeEventListener(e,n,r))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{e?n.add(t):n.delete(t)}catch{let r=`--${t}`;e?n.add(r):n.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}};var a=["tracking","final","original"],u={tracking:"Tracking",final:"Final",original:"Original"},c=class extends o{static observedAttributes=["view","author","datetime","controls"];setup(){this.#t(),this.listen(this,"click",this.#o)}attributeChangedCallback(t,e,n){!this.hasAttribute("data-upgraded")||e===n||(t==="view"?this.#n():this.#t())}#t(){this.querySelector(":scope > [data-change-caption]")?.remove(),this.querySelector(":scope > [data-controls]")?.remove();let t=this.#e(),e=[];t&&e.push(t),this.getAttribute("controls")!=="none"&&e.push(this.#r(t)),this.prepend(...e),this.#n()}#e(){let t=this.getAttribute("author"),e=this.getAttribute("datetime");if(!t&&!e)return null;let n=document.createElement("p");if(n.setAttribute("data-change-caption",""),n.append(t?`Changes by ${t}`:"Changes"),e){n.append(t?", ":" from ");let r=document.createElement("time");r.setAttribute("datetime",e),r.textContent=this.#s(e),n.append(r)}return n}#r(t){let e=document.createElement("div");e.setAttribute("data-controls",""),e.setAttribute("role","group");let n=t?`, ${t.textContent}`:"";e.setAttribute("aria-label",`Change view${n}`);for(let r of a){let i=document.createElement("button");i.type="button",i.dataset.action=r,i.textContent=u[r],e.append(i)}return e}#s(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let n=this.closest("[lang]")?.lang||void 0,r=/^\d{4}-\d{2}-\d{2}$/.test(t);return new Intl.DateTimeFormat(n,{dateStyle:"medium",...r?{timeZone:"UTC"}:{timeStyle:"short"}}).format(e)}#n(){let t=this.view;for(let e of this.querySelectorAll(":scope > [data-controls] > button[data-action]"))e.setAttribute("aria-pressed",String(e.dataset.action===t))}#o=t=>{let e=t.target.closest?.("[data-action]");if(!e||e.parentElement?.parentElement!==this||!e.parentElement.hasAttribute("data-controls"))return;let n=e.dataset.action;!n||!a.includes(n)||n!==this.view&&(this.#i(n),this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:n},bubbles:!0})))};#i(t){t==="tracking"?this.removeAttribute("view"):this.setAttribute("view",t),this.#n()}get view(){let t=this.getAttribute("view");return t==="final"||t==="original"?t:"tracking"}set view(t){!a.includes(t)||this.view===t||(this.#i(t),this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:t,source:"api"},bubbles:!0})))}};l("change-set",c);export{c as ChangeSet};
12
2
  //# sourceMappingURL=change-set.js.map