vanilla-breeze 0.1.3 → 0.1.4

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 (268) hide show
  1. package/dist/cdn/components/accessibility-specimen.js +11 -0
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +2 -0
  4. package/dist/cdn/components/adr-wc.js +17 -17
  5. package/dist/cdn/components/ai-chat.js +28 -0
  6. package/dist/cdn/components/ai-summary.js +10 -0
  7. package/dist/cdn/components/analytics-panel.js +5 -5
  8. package/dist/cdn/components/audio-player.js +3 -3
  9. package/dist/cdn/components/audio-visualizer.js +2 -2
  10. package/dist/cdn/components/author-index.js +2 -2
  11. package/dist/cdn/components/brand-mark.js +1 -1
  12. package/dist/cdn/components/bread-crumb.js +2 -0
  13. package/dist/cdn/components/breakpoint-specimen.js +26 -0
  14. package/dist/cdn/components/burndown-chart.js +2 -0
  15. package/dist/cdn/components/calendar-wc.js +2 -2
  16. package/dist/cdn/components/capacity-plan.js +25 -0
  17. package/dist/cdn/components/card-list.js +1 -1
  18. package/dist/cdn/components/carousel-wc.js +1 -1
  19. package/dist/cdn/components/change-set.js +2 -2
  20. package/dist/cdn/components/chart-wc.js +58 -36
  21. package/dist/cdn/components/chat-input.js +1 -1
  22. package/dist/cdn/components/chat-window.js +1 -1
  23. package/dist/cdn/components/color-palette.js +9 -9
  24. package/dist/cdn/components/color-picker.js +1 -1
  25. package/dist/cdn/components/combo-box.js +1 -1
  26. package/dist/cdn/components/command-palette.js +1 -1
  27. package/dist/cdn/components/comment-box.js +60 -0
  28. package/dist/cdn/components/comment-thread.js +60 -0
  29. package/dist/cdn/components/comment-wc.js +1 -1
  30. package/dist/cdn/components/compare-surface.js +1 -1
  31. package/dist/cdn/components/component-sampler.js +2 -2
  32. package/dist/cdn/components/consent-banner.js +1 -1
  33. package/dist/cdn/components/content-lens.js +1 -1
  34. package/dist/cdn/components/content-swap.js +1 -1
  35. package/dist/cdn/components/context-menu.js +1 -1
  36. package/dist/cdn/components/data-table.js +1 -1
  37. package/dist/cdn/components/date-picker.js +1 -1
  38. package/dist/cdn/components/day-view.js +1 -1
  39. package/dist/cdn/components/diagram-wc.js +3 -0
  40. package/dist/cdn/components/drag-surface.js +1 -1
  41. package/dist/cdn/components/drop-down.js +1 -1
  42. package/dist/cdn/components/emoji-picker.js +1 -1
  43. package/dist/cdn/components/empathy-map.js +41 -43
  44. package/dist/cdn/components/flow-diagram.js +1 -1
  45. package/dist/cdn/components/font-pairer.js +81 -81
  46. package/dist/cdn/components/foot-notes.js +1 -1
  47. package/dist/cdn/components/form-field.js +1 -1
  48. package/dist/cdn/components/gantt-chart.js +1 -1
  49. package/dist/cdn/components/geo-map.js +25 -23
  50. package/dist/cdn/components/glossary-index.js +1 -1
  51. package/dist/cdn/components/glossary-wc.js +1 -1
  52. package/dist/cdn/components/gradient-builder.js +29 -29
  53. package/dist/cdn/components/heading-links.js +1 -1
  54. package/dist/cdn/components/highlight-wc.js +2 -2
  55. package/dist/cdn/components/image-gallery.js +1 -1
  56. package/dist/cdn/components/image-map.js +1 -1
  57. package/dist/cdn/components/impact-effort.js +1 -1
  58. package/dist/cdn/components/include-file.js +1 -1
  59. package/dist/cdn/components/iron-triangle.js +2 -0
  60. package/dist/cdn/components/kanban-board.js +1 -1
  61. package/dist/cdn/components/layout-specimen.js +35 -0
  62. package/dist/cdn/components/manifest.json +228 -100
  63. package/dist/cdn/components/markdown-editor.js +1 -1
  64. package/dist/cdn/components/markdown-viewer.js +12 -12
  65. package/dist/cdn/components/motion-specimen.js +12 -12
  66. package/dist/cdn/components/nav-bar.js +2 -0
  67. package/dist/cdn/components/note-wc.js +2 -2
  68. package/dist/cdn/components/notification-wc.js +4 -4
  69. package/dist/cdn/components/page-info.js +4 -4
  70. package/dist/cdn/components/page-stats.js +1 -1
  71. package/dist/cdn/components/page-toc.js +1 -1
  72. package/dist/cdn/components/page-tools.js +1 -1
  73. package/dist/cdn/components/page-tour.js +6 -6
  74. package/dist/cdn/components/pager-wc.js +2 -0
  75. package/dist/cdn/components/palette-generator.js +11 -11
  76. package/dist/cdn/components/poll-wc.js +2 -0
  77. package/dist/cdn/components/pop-over.js +2 -0
  78. package/dist/cdn/components/popularity-index.js +2 -2
  79. package/dist/cdn/components/print-page.js +1 -1
  80. package/dist/cdn/components/product-roadmap.js +3 -0
  81. package/dist/cdn/components/progress-tracker.js +2 -0
  82. package/dist/cdn/components/qr-code.js +1 -1
  83. package/dist/cdn/components/quadrant-grid.js +3 -0
  84. package/dist/cdn/components/quality-target.js +12 -0
  85. package/dist/cdn/components/reaction-bar.js +2 -0
  86. package/dist/cdn/components/reader-view.js +3 -3
  87. package/dist/cdn/components/reading-progress.js +2 -0
  88. package/dist/cdn/components/recently-visited.js +10 -10
  89. package/dist/cdn/components/requirement-card.js +122 -0
  90. package/dist/cdn/components/review-surface.js +34 -40
  91. package/dist/cdn/components/risk-register.js +25 -0
  92. package/dist/cdn/components/roadmap.js +3 -0
  93. package/dist/cdn/components/score-card.js +197 -0
  94. package/dist/cdn/components/selection-menu.js +1 -1
  95. package/dist/cdn/components/semantic-palette.js +15 -15
  96. package/dist/cdn/components/settings-panel.js +12 -12
  97. package/dist/cdn/components/share-wc.js +2 -2
  98. package/dist/cdn/components/short-cuts.js +1 -1
  99. package/dist/cdn/components/site-index.js +4 -4
  100. package/dist/cdn/components/site-map-wc.js +1 -1
  101. package/dist/cdn/components/site-map.js +1 -1
  102. package/dist/cdn/components/site-search.js +9 -9
  103. package/dist/cdn/components/slide-accept.js +1 -1
  104. package/dist/cdn/components/social-embed.js +1 -1
  105. package/dist/cdn/components/spacing-specimen.js +5 -5
  106. package/dist/cdn/components/split-surface.js +1 -1
  107. package/dist/cdn/components/star-rating.js +1 -1
  108. package/dist/cdn/components/status-wc.js +2 -0
  109. package/dist/cdn/components/stepper-wc.js +2 -0
  110. package/dist/cdn/components/story-map.js +1 -1
  111. package/dist/cdn/components/tab-set.js +1 -1
  112. package/dist/cdn/components/text-reader.js +2 -2
  113. package/dist/cdn/components/theme-catalog.js +28 -0
  114. package/dist/cdn/components/theme-export.js +20 -12
  115. package/dist/cdn/components/theme-import.js +44 -0
  116. package/dist/cdn/components/theme-picker.js +29 -26
  117. package/dist/cdn/components/time-index.js +2 -2
  118. package/dist/cdn/components/time-picker.js +1 -1
  119. package/dist/cdn/components/toast-msg.js +3 -3
  120. package/dist/cdn/components/token-specimen.js +14 -14
  121. package/dist/cdn/components/tool-tip.js +1 -1
  122. package/dist/cdn/components/topic-map.js +3 -3
  123. package/dist/cdn/components/traceability-matrix.js +3 -0
  124. package/dist/cdn/components/trust-filter.js +3 -3
  125. package/dist/cdn/components/type-specimen.js +15 -15
  126. package/dist/cdn/components/user-journey.js +63 -70
  127. package/dist/cdn/components/user-persona.js +75 -13
  128. package/dist/cdn/components/user-story.js +9 -8
  129. package/dist/cdn/components/version-switcher.js +17 -0
  130. package/dist/cdn/components/video-player.js +3 -3
  131. package/dist/cdn/components/watch-wc.js +2 -2
  132. package/dist/cdn/components/week-view.js +1 -1
  133. package/dist/cdn/components/work-item.js +29 -28
  134. package/dist/cdn/components/youtube-player.js +1 -1
  135. package/dist/cdn/packs/design-system.full.js +59 -51
  136. package/dist/cdn/packs/effects.full.js +1 -1
  137. package/dist/cdn/packs/icons.effects.js +1 -1
  138. package/dist/cdn/packs/icons.full.js +1 -1
  139. package/dist/cdn/packs/kawaii.full.css +1 -1
  140. package/dist/cdn/packs/kawaii.full.js +6 -6
  141. package/dist/cdn/packs/kawaii.theme.css +1 -1
  142. package/dist/cdn/packs/manifest.json +11 -11
  143. package/dist/cdn/packs/ui.full.css +1 -1
  144. package/dist/cdn/packs/ui.full.js +54 -51
  145. package/dist/cdn/packs/ux-planning.full.css +1 -1
  146. package/dist/cdn/packs/ux-planning.full.js +317 -241
  147. package/dist/cdn/themes/8bit.css +1 -1
  148. package/dist/cdn/themes/8bit.tokens.json +662 -0
  149. package/dist/cdn/themes/alpha1999-dark.tokens.json +693 -0
  150. package/dist/cdn/themes/alpha1999.css +1 -1
  151. package/dist/cdn/themes/alpha1999.tokens.json +869 -0
  152. package/dist/cdn/themes/anthropic.css +2 -0
  153. package/dist/cdn/themes/anthropic.tokens.json +564 -0
  154. package/dist/cdn/themes/art-deco-dark.tokens.json +407 -0
  155. package/dist/cdn/themes/art-deco.css +1 -1
  156. package/dist/cdn/themes/art-deco.tokens.json +581 -0
  157. package/dist/cdn/themes/bauhaus-dark.tokens.json +260 -0
  158. package/dist/cdn/themes/bauhaus.css +1 -1
  159. package/dist/cdn/themes/bauhaus.tokens.json +589 -0
  160. package/dist/cdn/themes/brutalist-dark.tokens.json +503 -0
  161. package/dist/cdn/themes/brutalist.tokens.json +677 -0
  162. package/dist/cdn/themes/catalog/atlassian.tokens.json +303 -0
  163. package/dist/cdn/themes/catalog/bootstrap.tokens.json +304 -0
  164. package/dist/cdn/themes/catalog/carbon.tokens.json +301 -0
  165. package/dist/cdn/themes/catalog/catppuccin-mocha.tokens.json +301 -0
  166. package/dist/cdn/themes/catalog/govuk.tokens.json +301 -0
  167. package/dist/cdn/themes/catalog/manifest.json +132 -0
  168. package/dist/cdn/themes/catalog/material.tokens.json +289 -0
  169. package/dist/cdn/themes/catalog/salesforce.tokens.json +301 -0
  170. package/dist/cdn/themes/catalog/tailwind.tokens.json +302 -0
  171. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  172. package/dist/cdn/themes/catppuccin-frappe.tokens.json +608 -0
  173. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +472 -0
  174. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  175. package/dist/cdn/themes/catppuccin-latte.tokens.json +608 -0
  176. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  177. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +608 -0
  178. package/dist/cdn/themes/catppuccin-mocha.tokens.json +608 -0
  179. package/dist/cdn/themes/classic-dark.tokens.json +503 -0
  180. package/dist/cdn/themes/classic.tokens.json +640 -0
  181. package/dist/cdn/themes/claymorphism-dark.tokens.json +493 -0
  182. package/dist/cdn/themes/claymorphism.css +1 -1
  183. package/dist/cdn/themes/claymorphism.tokens.json +626 -0
  184. package/dist/cdn/themes/clinical-dark.tokens.json +472 -0
  185. package/dist/cdn/themes/clinical.tokens.json +608 -0
  186. package/dist/cdn/themes/cottagecore-dark.tokens.json +412 -0
  187. package/dist/cdn/themes/cottagecore.css +1 -1
  188. package/dist/cdn/themes/cottagecore.tokens.json +544 -0
  189. package/dist/cdn/themes/cyber.tokens.json +668 -0
  190. package/dist/cdn/themes/dawn-dark.tokens.json +472 -0
  191. package/dist/cdn/themes/dawn.css +1 -1
  192. package/dist/cdn/themes/dawn.tokens.json +608 -0
  193. package/dist/cdn/themes/dracula.tokens.json +534 -0
  194. package/dist/cdn/themes/dusk.tokens.json +533 -0
  195. package/dist/cdn/themes/editorial-dark.tokens.json +400 -0
  196. package/dist/cdn/themes/editorial.tokens.json +690 -0
  197. package/dist/cdn/themes/financial-dark.tokens.json +472 -0
  198. package/dist/cdn/themes/financial.css +1 -1
  199. package/dist/cdn/themes/financial.tokens.json +607 -0
  200. package/dist/cdn/themes/genai.tokens.json +534 -0
  201. package/dist/cdn/themes/glassmorphism-dark.tokens.json +489 -0
  202. package/dist/cdn/themes/glassmorphism.css +1 -1
  203. package/dist/cdn/themes/glassmorphism.tokens.json +632 -0
  204. package/dist/cdn/themes/government-dark.tokens.json +472 -0
  205. package/dist/cdn/themes/government.tokens.json +608 -0
  206. package/dist/cdn/themes/gruvbox-dark.tokens.json +472 -0
  207. package/dist/cdn/themes/gruvbox.tokens.json +608 -0
  208. package/dist/cdn/themes/high-noon-dark.tokens.json +397 -0
  209. package/dist/cdn/themes/high-noon.tokens.json +533 -0
  210. package/dist/cdn/themes/ibm.css +2 -0
  211. package/dist/cdn/themes/ibm.tokens.json +568 -0
  212. package/dist/cdn/themes/kawaii-dark.tokens.json +549 -0
  213. package/dist/cdn/themes/kawaii.css +1 -1
  214. package/dist/cdn/themes/kawaii.tokens.json +641 -0
  215. package/dist/cdn/themes/magna-dark.tokens.json +482 -0
  216. package/dist/cdn/themes/magna.css +1 -1
  217. package/dist/cdn/themes/magna.tokens.json +632 -0
  218. package/dist/cdn/themes/manifest.json +162 -62
  219. package/dist/cdn/themes/mcdonalds.css +2 -0
  220. package/dist/cdn/themes/mcdonalds.tokens.json +533 -0
  221. package/dist/cdn/themes/midnight.tokens.json +534 -0
  222. package/dist/cdn/themes/minimal-dark.tokens.json +294 -0
  223. package/dist/cdn/themes/minimal.tokens.json +494 -0
  224. package/dist/cdn/themes/modern-dark.tokens.json +490 -0
  225. package/dist/cdn/themes/modern.tokens.json +573 -0
  226. package/dist/cdn/themes/nes-dark.tokens.json +564 -0
  227. package/dist/cdn/themes/nes.css +1 -1
  228. package/dist/cdn/themes/nes.tokens.json +687 -0
  229. package/dist/cdn/themes/neumorphism-dark.tokens.json +471 -0
  230. package/dist/cdn/themes/neumorphism.css +1 -1
  231. package/dist/cdn/themes/neumorphism.tokens.json +589 -0
  232. package/dist/cdn/themes/nord-dark.tokens.json +484 -0
  233. package/dist/cdn/themes/nord.tokens.json +619 -0
  234. package/dist/cdn/themes/organic-dark.tokens.json +532 -0
  235. package/dist/cdn/themes/organic.tokens.json +685 -0
  236. package/dist/cdn/themes/rose-pine-dark.tokens.json +472 -0
  237. package/dist/cdn/themes/rose-pine.tokens.json +608 -0
  238. package/dist/cdn/themes/rough-dark.tokens.json +515 -0
  239. package/dist/cdn/themes/rough.css +1 -1
  240. package/dist/cdn/themes/rough.tokens.json +650 -0
  241. package/dist/cdn/themes/solarized-dark.tokens.json +397 -0
  242. package/dist/cdn/themes/solarized.tokens.json +532 -0
  243. package/dist/cdn/themes/starbucks.css +2 -0
  244. package/dist/cdn/themes/starbucks.tokens.json +593 -0
  245. package/dist/cdn/themes/startup-dark.tokens.json +522 -0
  246. package/dist/cdn/themes/startup.css +1 -1
  247. package/dist/cdn/themes/startup.tokens.json +607 -0
  248. package/dist/cdn/themes/super2026-dark.tokens.json +667 -0
  249. package/dist/cdn/themes/super2026.tokens.json +863 -0
  250. package/dist/cdn/themes/swiss-dark.tokens.json +390 -0
  251. package/dist/cdn/themes/swiss.tokens.json +750 -0
  252. package/dist/cdn/themes/terminal.css +1 -1
  253. package/dist/cdn/themes/terminal.tokens.json +689 -0
  254. package/dist/cdn/themes/tokyo-night-dark.tokens.json +472 -0
  255. package/dist/cdn/themes/tokyo-night.tokens.json +608 -0
  256. package/dist/cdn/themes/vaporwave-dark.tokens.json +413 -0
  257. package/dist/cdn/themes/vaporwave.tokens.json +549 -0
  258. package/dist/cdn/themes/win9x-dark.tokens.json +563 -0
  259. package/dist/cdn/themes/win9x.tokens.json +700 -0
  260. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  261. package/dist/cdn/vanilla-breeze-charts.js +58 -36
  262. package/dist/cdn/vanilla-breeze-core.css +1 -1
  263. package/dist/cdn/vanilla-breeze-core.js +246 -51
  264. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  265. package/dist/cdn/vanilla-breeze-extras.js +90 -80
  266. package/dist/cdn/vanilla-breeze.css +1 -1
  267. package/dist/cdn/vanilla-breeze.js +1363 -398
  268. package/package.json +10 -3
@@ -0,0 +1,26 @@
1
+ var $=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function p(o,s,t={}){let e=t.priority??10,i={impl:s,bundle:t.bundle,contract:t.contract,priority:e},r=u.get(o);if(customElements.get(o)){if(!r||r.priority>=e){r&&r.priority===e&&r.impl!==s&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=e){r.priority===e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}u.set(o,i),customElements.define(o,s)}var l=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 s of this.#e)s();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(s,t,e,i){s.addEventListener(t,e,i),this.#e.push(()=>s.removeEventListener(t,e,i))}setup(){}teardown(){}setState(s,t){this.#t||(this.#t=this.attachInternals());let e=this.#t.states;try{t?e.add(s):e.delete(s)}catch{let i=`--${s}`;t?e.add(i):e.delete(i)}}_adoptInternals(s){this.#t||(this.#t=s)}};var d=class extends l{static observedAttributes=["tokens","prefix","label","data-observe"];setup(){this.#e(),this.#t()}attributeChangedCallback(){this.isConnected&&(this.#c(),this.#e(),this.#t())}teardown(){this.#c()}#e(){let s=this.getAttribute("tokens")||"sm,md,lg,xl",t=this.getAttribute("prefix")||"--bp-",e=this.getAttribute("label")||"",i=s.split(",").map(n=>n.trim()).filter(Boolean),r=getComputedStyle(document.documentElement),a=i.map(n=>{let c=r.getPropertyValue(`${t}${n}`).trim(),y=this.#u(c);return{name:n,raw:c,px:y}}).filter(n=>n.px>0).sort((n,c)=>n.px-c.px);this.#l=a,this.#i=a.length?a[a.length-1].px*1.15:1;let h=e?`<header class="bps-label">${e}</header>`:"",f=`
2
+ <output class="bps-readout" aria-live="polite">
3
+ <span class="bps-width">\u2014</span>
4
+ <span class="bps-active" data-active="">\u2014</span>
5
+ </output>
6
+ `,b=`
7
+ <figure class="bps-ruler" aria-hidden="true">
8
+ <span class="bps-cursor" data-cursor></span>
9
+ ${a.map(n=>`
10
+ <span class="bps-stop" style="--bps-pos:${n.px/this.#i*100}%" data-bp="${n.name}">
11
+ <span class="bps-tick"></span>
12
+ <span class="bps-stop-label">${n.name}<br><small>${Math.round(n.px)}px</small></span>
13
+ </span>
14
+ `).join("")}
15
+ </figure>
16
+ `,m=`
17
+ <dl class="bps-list">
18
+ ${a.map(n=>`
19
+ <div class="bps-row" data-bp="${n.name}">
20
+ <dt>${n.name}</dt>
21
+ <dd><code>${n.raw}</code> \u2014 ${Math.round(n.px)}px and up</dd>
22
+ </div>
23
+ `).join("")}
24
+ </dl>
25
+ `;this.innerHTML=`${h}${f}${b}${m}`,this.#o=this.querySelector(".bps-width"),this.#n=this.querySelector(".bps-active"),this.#a=this.querySelector("[data-cursor]")}#t(){let s=this.getAttribute("data-observe");if(s){let e=document.querySelector(s);if(!e)return;this.#s=new ResizeObserver(()=>this.#r(e.clientWidth)),this.#s.observe(e),this.#r(e.clientWidth);return}let t=()=>this.#r(window.innerWidth);t(),this.listen(window,"resize",t,{passive:!0})}#c(){this.#s&&(this.#s.disconnect(),this.#s=null)}#r(s){if(!this.#o||!this.#n)return;this.#o.textContent=`${Math.round(s)}px`;let t=this.#d(s);if(this.#n.textContent=t?t.name:"base",this.#n.dataset.active=t?t.name:"",this.#a){let e=Math.min(100,s/this.#i*100);this.#a.style.setProperty("--bps-pos",`${e}%`)}this.querySelectorAll("[data-bp]").forEach(e=>{let i=t&&e.getAttribute("data-bp")===t.name;e.toggleAttribute("data-current",!!i)})}#d(s){let t=null;for(let e of this.#l)s>=e.px&&(t=e);return t}#u(s){if(!s)return 0;let t=parseFloat(s);if(Number.isNaN(t))return 0;if(s.endsWith("rem")||s.endsWith("em")){let e=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return t*e}return t}#l=[];#i=1;#s=null;#o=null;#n=null;#a=null};p("breakpoint-specimen",d);export{d as BreakpointSpecimen};
26
+ //# sourceMappingURL=breakpoint-specimen.js.map
@@ -0,0 +1,2 @@
1
+ var S=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function E(i,e,t={}){let n=t.priority??10,r={impl:e,bundle:t.bundle,contract:t.contract,priority:n},s=y.get(i);if(customElements.get(i)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}y.set(i,r),customElements.define(i,e)}var b=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 e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,n,r){e.addEventListener(t,n,r),this.#t.push(()=>e.removeEventListener(t,n,r))}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{t?n.add(e):n.delete(e)}catch{let r=`--${e}`;t?n.add(r):n.delete(r)}}_adoptInternals(e){this.#e||(this.#e=e)}};var $=864e5,g=class i extends b{setup(){let e=this.getAttribute("start"),t=this.getAttribute("end"),n=parseFloat(this.getAttribute("total")||"");if(!e||!t||!Number.isFinite(n))return console.warn("burndown-chart: requires start, end, and total attributes"),!1;let r=i.#n(e),s=i.#n(t);if(!r||!s||s<r)return console.warn("burndown-chart: start/end dates invalid",e,t),!1;let d=(this.getAttribute("weekends")||"include")!=="exclude",c=this.getAttribute("unit")||"points",u=this.getAttribute("label")||"",h=this.querySelector(":scope > template"),a=h?i.#e(h):[],o=a.filter(p=>p.delta!==0),l=i.#s(r,s),m=i.#o(l,n,d),f=i.#a(l,a);return this.#t({label:u,unit:c,dayLabels:l,actual:f,ideal:m,scopeChanges:o}),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("burndown-chart:ready",{bubbles:!0,detail:{dayCount:l.length,total:n,scopeChanges:o.length}}))}),!0}#t({label:e,unit:t,dayLabels:n,actual:r,ideal:s,scopeChanges:d}){if([...this.children].forEach(o=>{o.tagName!=="TEMPLATE"&&o.remove()}),e){let o=document.createElement("header");o.className="bdc-label",o.textContent=e,this.appendChild(o)}let c=document.createElement("chart-wc");c.setAttribute("data-type","line"),c.setAttribute("data-legend",""),c.setAttribute("data-tooltip",""),c.setAttribute("data-label-x","Day"),c.setAttribute("data-label-y",t);let u={},h={};n.forEach((o,l)=>{u[o]=s[l],r[l]!==null&&(h[o]=r[l])});let a=[{name:"Actual",values:h},{name:"Ideal",values:u}];if(c.setAttribute("data-values",JSON.stringify(a)),this.appendChild(c),d.length){let o=document.createElement("aside");o.className="bdc-scope-changes";let l=document.createElement("h4");l.textContent="Scope changes",o.appendChild(l);let m=document.createElement("ul");for(let f of d){let p=document.createElement("li"),w=f.delta>0?"+":"";p.innerHTML=`<time datetime="${f.date}">${f.date}</time>: <strong>${w}${f.delta} ${t}</strong>`,m.appendChild(p)}o.appendChild(m),this.appendChild(o)}}static#e(e){let t=[],n=e.content.querySelectorAll("tr");for(let r of n){let s=[...r.children],d=s[0]?.textContent?.trim(),c=parseFloat(s[1]?.textContent??""),u=parseFloat(s[2]?.textContent??"0")||0;!d||!Number.isFinite(c)||t.push({date:d,remaining:c,delta:u})}return t}static#n(e){let t=String(e).match(/^(\d{4})-(\d{2})-(\d{2})/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3])):null}static#r(e){let t=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${t}-${n}`}static#s(e,t){let n=[];for(let r=e.getTime();r<=t.getTime();r+=$)n.push(i.#r(new Date(r)));return n}static#o(e,t,n){let r=a=>{let o=i.#n(a);if(!o)return!1;let l=o.getDay();return l===0||l===6},s=e.map((a,o)=>({d:a,i:o,weekend:r(a)})).filter(a=>n||!a.weekend),d=s.length>1?t/(s.length-1):0,c=new Array(e.length).fill(null),u=t,h=0;for(let a=0;a<e.length;a++){let o=r(e[a]);n||!o?(c[a]=Math.max(0,t-d*h),h++,u=c[a]):c[a]=u}return c}static#a(e,t){let n=new Map(t.map(r=>[r.date,r.remaining]));return e.map(r=>n.has(r)?n.get(r):null)}};E("burndown-chart",g);export{g as BurndownChart};
2
+ //# sourceMappingURL=burndown-chart.js.map
@@ -1,3 +1,3 @@
1
- var G=window.matchMedia("(prefers-reduced-motion: reduce)");var V=new Map;function z(a,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=V.get(a);if(customElements.get(a)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}V.set(a,n),customElements.define(a,t)}var Y=class extends HTMLElement{#h=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#h)t();this.#h=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#h.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function M(a){let t=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0");return`${t}-${e}-${i}`}function $(a){if(!a)return null;let[t,e,i]=a.split("-").map(Number);return new Date(t,e-1,i)}function _(a,t){return new Date(a,t+1,0).getDate()}function w(a,t){return a&&t&&a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()}function J(){try{let a=new Intl.Locale(navigator.language);if(a.weekInfo)return a.weekInfo.firstDay%7}catch{}return 0}function j(a){return a?typeof a=="string"?[{label:a}]:Array.isArray(a)?a:typeof a=="object"?[a]:[]:[]}var O=new Map;function H(a,t="short"){let e=`${a}:${t}`;if(O.has(e))return O.get(e);let i=new Intl.DateTimeFormat(a,{weekday:t}),n=Array.from({length:7},(s,r)=>i.format(new Date(2026,0,4+r)));return O.set(e,n),n}var B=class extends Y{static formAssociated=!0;#h;#b;#e;#t;#x;#S={};#r=null;#o=null;#F=new Set;#M=new Map;#g=null;#l=new Set;#n=null;#a=null;#y=null;#s="none";#I="default";#N=1;#Y=null;get isDateDisallowed(){return this.#Y}set isDateDisallowed(t){this.#Y=t,this.#w&&this.#p()}#L=null;get getDayParts(){return this.#L}set getDayParts(t){this.#L=t,this.#w&&this.#p()}#w=!1;#$;#E;#u;#c;#d;#q;#i;#m;#f;#D=null;constructor(){super(),typeof this.attachInternals=="function"&&(this.#h=this.attachInternals())}setup(){this.#b=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.#x=J(),this.#s=this.getAttribute("data-selection")||"none",this.#I=this.getAttribute("data-size")||"default",this.#N=Math.max(1,Math.min(12,parseInt(this.dataset.months,10)||1));let e=this.getAttribute("data-events");if(e)try{this.#S=JSON.parse(e)}catch{}this.#r=$(this.dataset.minDate),this.#o=$(this.dataset.maxDate);let i=this.getAttribute("data-disabled-dates");i&&i.split(",").forEach(s=>this.#F.add(s.trim()));let n=this.getAttribute("data-highlight-dates");n&&n.split(",").forEach(s=>{let[r,c]=s.trim().split(":");this.#M.set(r,c||null)}),this.#P(),this.#p(),this.#w=!0}refresh(){this.#w&&this.#p()}#P(){this.#$=document.createElement("header"),this.#m=document.createElement("button"),this.#m.type="button",this.#m.setAttribute("aria-label","Previous month"),this.#m.textContent="\u2039",this.listen(this.#m,"click",()=>this.#T(-1)),this.#E=document.createElement("span"),this.#E.className="calendar-title",this.#E.setAttribute("aria-live","polite"),this.#u=document.createElement("span"),this.#u.className="calendar-month",this.#c=document.createElement("select"),this.#c.className="calendar-year",this.#c.setAttribute("aria-label","Year"),this.listen(this.#c,"change",()=>{this.#t=parseInt(this.#c.value,10),this.#p(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}),this.#d=document.createElement("span"),this.#d.className="calendar-year-wrap",this.#d.appendChild(this.#c),this.#E.append(this.#u," ",this.#d),this.#f=document.createElement("button"),this.#f.type="button",this.#f.setAttribute("aria-label","Next month"),this.#f.textContent="\u203A",this.listen(this.#f,"click",()=>this.#T(1)),this.#$.append(this.#m,this.#E,this.#f),this.appendChild(this.#$);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 i=e.target.closest("button[data-date]");if(!i||i.disabled)return;let n=i.getAttribute("data-date");if(this.#s!=="none")this.#O(n);else{let s=j(this.#S[n]);s.length&&this.#z(n,s)}}),this.listen(this.#i,"keydown",e=>this.#_(e)),this.#s==="range"&&this.listen(this.#i,"mouseover",e=>{let i=e.target.closest("button[data-date]");i&&this.#n&&!this.#a&&(this.#y=$(i.getAttribute("data-date")),this.#C())})}#V(){this.#c.innerHTML="";let t=new Date().getFullYear(),e=this.#r?this.#r.getFullYear():t-10,i=this.#o?this.#o.getFullYear():t+10;for(let n=e;n<=i;n++){let s=document.createElement("option");s.value=n,s.textContent=n,n===this.#t&&(s.selected=!0),this.#c.appendChild(s)}}#T(t){this.#e+=t,this.#e<0&&(this.#e=11,this.#t--),this.#e>11&&(this.#e=0,this.#t++),this.#p(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}#O(t){if(this.#s==="none")return;let e=$(t);if(this.#s==="single")this.#g=e,this.#C(),this.#k(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#s==="range"){if(!this.#n||this.#a)this.#n=e,this.#a=null,this.#y=null,this.dataset.tentative=M(this.#n);else{this.#a=e,this.#n>this.#a&&([this.#n,this.#a]=[this.#a,this.#n]),this.#y=null,delete this.dataset.tentative;let i=M(this.#n),n=M(this.#a);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${i}/${n}`,start:i,end:n,startDate:this.#n,endDate:this.#a}}))}this.#C(),this.#k()}else if(this.#s==="multi"){this.#l.has(t)?this.#l.delete(t):this.#l.add(t),this.#C(),this.#k();let i=[...this.#l].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:i,dates:i.map($)}}))}}#k(){this.#h&&this.getAttribute("name")&&this.#h.setFormValue(this.value)}get value(){switch(this.#s){case"single":return this.#g?M(this.#g):null;case"range":return this.#n&&this.#a?`${M(this.#n)}/${M(this.#a)}`:this.#n?M(this.#n):null;case"multi":return this.#l.size?[...this.#l].sort().join(" "):null;default:return null}}#C(){if(!this.#i)return;let t=this.#n,e=this.#a||this.#y;for(let i of this.#i.querySelectorAll("td")){let n=i.querySelector("button[data-date]");if(!n)continue;let s=n.getAttribute("data-date"),r=$(s);if(i.removeAttribute("data-selected"),i.removeAttribute("data-range-start"),i.removeAttribute("data-range-end"),i.removeAttribute("data-in-range"),n.removeAttribute("aria-selected"),this.#s==="single"&&w(r,this.#g)&&(i.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="multi"&&this.#l.has(s)&&(i.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="range"&&t)if(e){let c=t<e?t:e,b=t<e?e:t;w(r,c)&&i.setAttribute("data-range-start",""),w(r,b)&&i.setAttribute("data-range-end",""),r>=c&&r<=b&&i.setAttribute("data-in-range","")}else w(r,t)&&i.setAttribute("data-range-start","")}}#v(t){let e=new Date(this.#t,this.#e+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#p(){let t=this.#N,e=new Intl.DateTimeFormat(this.#b,{month:"long"}),i=new Intl.DateTimeFormat(this.#b,{month:"long",year:"numeric"});try{let s=new Date(this.#t,this.#e,1);if(t===1)this.#u.textContent=e.format(s),this.#d&&(this.#d.style.display="");else{let r=this.#v(t-1);s.getFullYear()===r.year?this.#u.textContent=String(this.#t):this.#u.textContent=`${s.getFullYear()} \u2013 ${r.year}`,this.#d&&(this.#d.style.display="none")}}catch{this.#u.textContent=String(this.#e+1)}this.#V(),this.#m.disabled=!!(this.#r&&(this.#t<this.#r.getFullYear()||this.#t===this.#r.getFullYear()&&this.#e<=this.#r.getMonth()));let n=this.#v(t-1);this.#f.disabled=!!(this.#o&&(n.year>this.#o.getFullYear()||n.year===this.#o.getFullYear()&&n.month>=this.#o.getMonth())),this.setAttribute("data-month",String(this.#e+1)),this.setAttribute("data-year",String(this.#t)),this.#i.innerHTML="";for(let s=0;s<t;s++){let{year:r,month:c}=this.#v(s);if(t>1){let b=document.createElement("div");b.className="cal-month-column";let D=document.createElement("h4");D.className="cal-month-title",D.textContent=i.format(new Date(r,c,1)),b.appendChild(D);let N=this.#B(r,c);b.appendChild(N),this.#i.appendChild(b)}else{let b=this.#B(r,c);this.#i.appendChild(b)}}this.#q=this.#i.querySelector("table")}#B(t,e){let i=new Date,n=_(t,e),s=this.#I==="large",r=document.createElement("table");r.setAttribute("role","grid");try{let u=new Date(t,e,1),o=new Intl.DateTimeFormat(void 0,{month:"long"}).format(u);r.setAttribute("aria-label",`${o} ${t}`)}catch{}let c=document.createElement("thead"),b=document.createElement("tr"),D=H(this.#b,"short"),N=H(this.#b,"long");for(let u=0;u<7;u++){let o=(this.#x+u)%7,m=document.createElement("th");m.setAttribute("scope","col"),m.setAttribute("abbr",N[o]),m.textContent=D[o],b.appendChild(m)}c.appendChild(b),r.appendChild(c);let d=document.createElement("tbody"),E=1,h=document.createElement("tr");h.setAttribute("data-week",String(E));let f=(new Date(t,e,1).getDay()-this.#x+7)%7,k=_(t,e-1);for(let u=0;u<f;u++){let o=k-f+1+u,m=document.createElement("td");m.setAttribute("data-outside-month","");let l=document.createElement("button");l.type="button",l.disabled=!0,l.setAttribute("tabindex","-1"),l.setAttribute("data-day",String(o));let p=document.createElement("span");p.className="day-number",p.textContent=String(o),l.appendChild(p),m.appendChild(l),h.appendChild(m)}let A=this.#n,F=this.#a||this.#y;for(let u=1;u<=n;u++){let o=new Date(t,e,u),m=M(o),l=document.createElement("td"),p=document.createElement("button");p.type="button",p.setAttribute("data-date",m);let L=document.createElement("span");if(L.className="day-number",L.textContent=String(u),p.appendChild(L),p.setAttribute("data-day",String(u)),w(o,i)&&(p.setAttribute("aria-current","date"),l.setAttribute("data-today","")),this.#s==="single"&&w(o,this.#g)&&(p.setAttribute("aria-selected","true"),l.setAttribute("data-selected","")),this.#s==="multi"&&this.#l.has(m)&&(p.setAttribute("aria-selected","true"),l.setAttribute("data-selected","")),this.#s==="range"&&A&&F){let x=A<F?A:F,g=A<F?F:A;w(o,x)&&l.setAttribute("data-range-start",""),w(o,g)&&l.setAttribute("data-range-end",""),o>=x&&o<=g&&l.setAttribute("data-in-range","")}else this.#s==="range"&&A&&w(o,A)&&l.setAttribute("data-range-start","");let W=this.#r&&o<this.#r,K=this.#o&&o>this.#o,R=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(o);if((this.#F.has(m)||W||K||R)&&(p.setAttribute("aria-disabled","true"),p.disabled=!0),this.#M.has(m)&&p.setAttribute("data-highlight",this.#M.get(m)||""),typeof this.getDayParts=="function"){let x=this.getDayParts(o);x!=null&&(l.dataset.dayPart=Array.isArray(x)?x.join(" "):x)}let v=j(this.#S[m]);if(v.length){if(l.setAttribute("data-events",""),l.setAttribute("data-event-count",String(v.length)),s){let g=document.createElement("span");g.className="event-list";let I=2;if(v.slice(0,I).forEach(y=>{let S=document.createElement("span");if(S.className="event-item",y.color&&S.style.setProperty("--event-color",y.color),y.icon){let T=document.createElement("icon-wc");T.setAttribute("name",y.icon),T.setAttribute("size","xs"),S.appendChild(T)}let P=document.createElement("span");P.textContent=y.time?`${y.time} ${y.label}`:y.label,S.appendChild(P),g.appendChild(S)}),v.length>I){let y=document.createElement("span");y.className="event-more",y.textContent=`+${v.length-I} more`,g.appendChild(y)}p.appendChild(g)}else{let g=document.createElement("span");g.className="event-dots",g.setAttribute("aria-hidden","true");let I=Math.min(v.length,3);for(let y=0;y<I;y++){let S=document.createElement("span");S.setAttribute("data-event-dot",""),v[y].color&&S.style.setProperty("--event-color",v[y].color),g.appendChild(S)}l.appendChild(g)}let x=v.map(g=>g.time?`${g.time} \u2014 ${g.label}`:g.label);p.setAttribute("title",x.join(`
2
- `))}let U=u===1||w(o,i);p.setAttribute("tabindex",U?"0":"-1"),l.insertBefore(p,l.firstChild),h.appendChild(l),(f+u)%7===0&&(d.appendChild(h),E++,h=document.createElement("tr"),h.setAttribute("data-week",String(E)))}let q=(f+n)%7;if(q>0){for(let u=1;u<=7-q;u++){let o=document.createElement("td");o.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 l=document.createElement("span");l.className="day-number",l.textContent=String(u),m.appendChild(l),o.appendChild(m),h.appendChild(o)}d.appendChild(h)}return r.appendChild(d),r}#z(t,e){this.#A();let i=$(t),n=document.createElement("div");n.className="day-detail",n.setAttribute("role","dialog"),n.setAttribute("aria-label",`Events for ${t}`);let s=document.createElement("header"),r=document.createElement("h3");try{r.textContent=new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(i)}catch{r.textContent=t}let c=document.createElement("button");if(c.type="button",c.setAttribute("aria-label","Close"),c.textContent="\xD7",c.addEventListener("click",()=>this.#A()),s.append(r,c),n.appendChild(s),e.some(d=>d.time)){let d=document.createElement("day-view");d.dataset.date=t,d.dataset.startHour="auto",d.dataset.compact="";let E=new Intl.DateTimeFormat(this.#b,{hour:"numeric",minute:"2-digit"});e.forEach(h=>{let C=document.createElement("calendar-event");if(h.color&&C.style.setProperty("--event-color",h.color),h.icon){let f=document.createElement("icon-wc");f.setAttribute("name",h.icon),f.setAttribute("size","sm"),C.appendChild(f)}if(h.time){let f=document.createElement("time");f.setAttribute("datetime",h.time);try{let[k,A]=h.time.split(":"),F=new Date(2026,0,1,parseInt(k,10),parseInt(A,10));f.textContent=E.format(F)}catch{f.textContent=h.time}C.appendChild(f)}C.append(h.label||""),d.appendChild(C)}),n.appendChild(d)}else{let d=document.createElement("ul");d.className="detail-list",e.forEach(E=>{let h=document.createElement("li");E.color&&h.style.setProperty("--event-color",E.color);let C=document.createElement("span");C.className="detail-dot";let f=document.createElement("span");if(f.className="detail-content",E.icon){let A=document.createElement("icon-wc");A.setAttribute("name",E.icon),A.setAttribute("size","sm"),f.appendChild(A)}let k=document.createElement("span");k.className="detail-label",k.textContent=E.label||"",f.append(k),h.append(C,f),d.appendChild(h)}),n.appendChild(d)}this.appendChild(n),this.#D=n;let D=d=>{d.key==="Escape"&&this.#A()},N=d=>{n.contains(d.target)||this.#A()};this._detailCleanup=()=>{document.removeEventListener("keydown",D),document.removeEventListener("mousedown",N)},document.addEventListener("keydown",D),requestAnimationFrame(()=>{document.addEventListener("mousedown",N)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#A(){this.#D&&(this._detailCleanup?.(),this._detailCleanup=null,this.#D.remove(),this.#D=null)}teardown(){delete this.dataset.tentative,this.#A()}#_(t){let e=this.#i.querySelector('button[tabindex="0"]');if(!e)return;let i=e.getAttribute("data-date"),n=$(i);if(!n)return;let s;switch(t.key){case"ArrowRight":s=new Date(n),s.setDate(n.getDate()+1);break;case"ArrowLeft":s=new Date(n),s.setDate(n.getDate()-1);break;case"ArrowDown":s=new Date(n),s.setDate(n.getDate()+7);break;case"ArrowUp":s=new Date(n),s.setDate(n.getDate()-7);break;case"Enter":case" ":t.preventDefault(),e.disabled||this.#O(i);return;default:return}if(t.preventDefault(),this.#r&&s<this.#r||this.#o&&s>this.#o)return;let r=s.getMonth(),c=s.getFullYear(),b=this.#v(this.#N-1);(c>this.#t||c===this.#t&&r>=this.#e)&&(c<b.year||c===b.year&&r<=b.month)||(this.#e=r,this.#t=c,this.#p());let N=M(s),d=this.#i.querySelector(`button[data-date="${N}"]`);d&&(this.#i.querySelectorAll('button[tabindex="0"]').forEach(E=>E.setAttribute("tabindex","-1")),d.setAttribute("tabindex","0"),d.focus())}};z("calendar-wc",B);export{B as CalendarWc};
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};
3
3
  //# sourceMappingURL=calendar-wc.js.map
@@ -0,0 +1,25 @@
1
+ var n=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,e,r,i){t.addEventListener(e,r,i),this.#e.push(()=>t.removeEventListener(e,r,i))}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let r=this.#t.states;try{e?r.add(t):r.delete(t)}catch{let i=`--${t}`;e?r.add(i):r.delete(i)}}_adoptInternals(t){this.#t||(this.#t=t)}};var k=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function f(s,t,e={}){let r=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:r},a=u.get(s);if(customElements.get(s)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=r){a.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}u.set(s,i),customElements.define(s,t)}function m(s){if(!s)return 0;let t=s.dataset?.capacityCost??s.getAttribute?.("data-capacity-cost"),e=Number(t);return Number.isFinite(e)&&e>0?e:0}function h(s){let t=0;for(let e of s||[])t+=m(e);return t}function l({capacityPoints:s,qualitySum:t,featureSum:e}){let r=Number.isFinite(s)?s:1/0,i=Math.max(0,Number(t)||0),a=Math.max(0,Number(e)||0),o=Number.isFinite(r)?r-i-a:1/0;return{capacity:r,quality:i,features:a,slack:o}}function p({capacity:s,quality:t,features:e}){if(!Number.isFinite(s)||s<=0){let a=t+e;return a<=0?{quality:0,features:0,slack:100}:{quality:t/a*100,features:e/a*100,slack:0}}let r=t+e,i=Math.max(s,r);return{quality:t/i*100,features:e/i*100,slack:Math.max(0,(s-r)/i*100)}}var c=class extends n{static get observedAttributes(){return["data-bind-triangle","data-bind-quality"]}#e=null;#t=null;#r=null;#i=null;#l=!1;setup(){this.#c(),this.#d(),this.#u(),this.#s()}teardown(){this.#e?.(),this.#t?.(),this.#r?.disconnect(),this.#e=null,this.#t=null,this.#r=null}attributeChangedCallback(t){this.isConnected&&(t==="data-bind-triangle"?(this.#c(),this.#s()):t==="data-bind-quality"&&(this.#d(),this.#s()))}get capacityPoints(){return this.#n()}get qualitySum(){return this.#o()}get featureSum(){return this.#i!=null?this.#i:h(this.querySelectorAll("[data-capacity-cost]"))}set featureSum(t){this.#i=Number.isFinite(+t)?+t:null,this.#s()}get slack(){return l({capacityPoints:this.#n(),qualitySum:this.#o(),featureSum:this.featureSum}).slack}#a(t){if(!t)return null;let e=this.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}#c(){this.#e?.(),this.#e=null;let t=this.#a(this.dataset.bindTriangle);if(!t||t.localName!=="iron-triangle")return;let e=()=>this.#s();t.addEventListener("iron-triangle:change",e),this.#e=()=>t.removeEventListener("iron-triangle:change",e)}#d(){this.#t?.(),this.#t=null;let t=this.#a(this.dataset.bindQuality);if(!t||t.localName!=="quality-target")return;let e=()=>this.#s();t.addEventListener("quality-target:change",e),this.#t=()=>t.removeEventListener("quality-target:change",e)}#u(){this.#r||(this.#r=new MutationObserver(t=>{t.some(r=>!r.target.closest?.("[data-capacity-table]"))&&this.#s()}),this.#r.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-capacity-cost"]}))}#n(){let t=this.#a(this.dataset.bindTriangle);if(!t||t.localName!=="iron-triangle")return 1/0;let e=t.capacityPoints;return Number.isFinite(e)&&e>0?e:1/0}#o(){let t=this.#a(this.dataset.bindQuality);return!t||t.localName!=="quality-target"?0:Number(t.criticalSum)||0}#s(){let t=l({capacityPoints:this.#n(),qualitySum:this.#o(),featureSum:this.featureSum}),e=p(t),r=this.querySelector(":scope > [data-capacity-table]");r||(r=document.createElement("section"),r.dataset.capacityTable="",this.prepend(r));let i=y(t.capacity),a=t.quality>0?`\u2212${t.quality} pts`:"0 pts",o=t.features>0?`\u2212${t.features} pts`:"0 pts",b=g(t.slack);r.innerHTML=`
2
+ <dl data-layout="grid" class="capacity-ledger" aria-label="Capacity ledger">
3
+ <div data-row="capacity">
4
+ <dt>Capacity</dt>
5
+ <dd class="num">${i}</dd>
6
+ <dd class="bar"><span class="bar-track"><span class="bar-fill bar-capacity" style="--w:100%"></span></span></dd>
7
+ </div>
8
+ <div data-row="quality">
9
+ <dt>Quality</dt>
10
+ <dd class="num">${a}</dd>
11
+ <dd class="bar"><span class="bar-track"><span class="bar-fill bar-quality" style="--w:${e.quality.toFixed(1)}%"></span></span></dd>
12
+ </div>
13
+ <div data-row="features">
14
+ <dt>Features</dt>
15
+ <dd class="num">${o}</dd>
16
+ <dd class="bar"><span class="bar-track"><span class="bar-fill bar-features" style="--w:${e.features.toFixed(1)}%"></span></span></dd>
17
+ </div>
18
+ <div data-row="slack" data-state="${t.slack<0?"over":"under"}">
19
+ <dt>Slack</dt>
20
+ <dd class="num">${b}</dd>
21
+ <dd class="bar"><span class="bar-track"><span class="bar-fill bar-slack" style="--w:${e.slack.toFixed(1)}%"></span></span></dd>
22
+ </div>
23
+ </dl>
24
+ `,this.setState("overdrawn",t.slack<0);let d=t.slack<0;d!==this.#l&&(this.dispatchEvent(new CustomEvent("capacity-plan:overdrawn",{bubbles:!0,composed:!0,detail:{ledger:t,source:"render"}})),this.#l=d)}};function y(s){return Number.isFinite(s)?`${s} pts`:"\u221E"}function g(s){return Number.isFinite(s)?s===0?"0 pts":s>0?`+${s} pts`:`${s} pts`:"\u221E"}f("capacity-plan",c);export{c as CapacityPlan};
25
+ //# sourceMappingURL=capacity-plan.js.map
@@ -1,2 +1,2 @@
1
- function l(o){if(!o||typeof o!="string")return"";let e=document.createElement("template");return e.innerHTML=o,e.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),e.content.querySelectorAll("*").forEach(n=>{for(let i of[...n.attributes]){if(i.name.startsWith("on")){n.removeAttribute(i.name);continue}if(["href","src","action","formaction","xlink:href"].includes(i.name)){let a=i.value.trim().toLowerCase();(a.startsWith("javascript:")||a.startsWith("data:text/html"))&&n.removeAttribute(i.name);continue}(i.name==="srcdoc"||i.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(i.name)}}),e.innerHTML}var E=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function h(o,e,r={}){let t=r.priority??10,n={impl:e,bundle:r.bundle,contract:r.contract,priority:t},i=f.get(o);if(customElements.get(o)){if(!i||i.priority>=t){i&&i.priority===t&&i.impl!==e&&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>=t){i.priority===t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}f.set(o,n),customElements.define(o,e)}var c=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,t,n){e.addEventListener(r,t,n),this.#t.push(()=>e.removeEventListener(r,t,n))}setup(){}teardown(){}};var p=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function m(o){return!o||typeof o!="string"?!1:p.test(o.trim())}function s(o,e){if(!m(e)){console.warn(`[card-list] Unsafe property path rejected: "${e}"`);return}let t=e.replace(/\[(\d+)\]/g,".$1").split("."),n=o;for(let i of t){if(n==null)return;n=n[i]}return n}function b(o){return o?o.split(",").map(e=>{let[r,t]=e.split(":").map(n=>n.trim());return{attr:r,path:t}}).filter(({attr:e,path:r})=>e&&r):[]}var d=class extends c{#t=null;#e=[];#n="id";static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#t=this.querySelector("template"),!this.#t)return console.warn("[card-list] No template found"),!1;this.#n=this.getAttribute("data-key")||"id";let e=this.getAttribute("data-items");if(e){try{this.#e=JSON.parse(e),this.#r()}catch(t){console.error("[card-list] Invalid JSON in data-items:",t)}return}let r=this.getAttribute("src");r&&this.#i(r)}attributeChangedCallback(e,r,t){if(r!==t)if(e==="data-items"&&t)try{this.#e=JSON.parse(t),this.#r()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else e==="src"&&t?this.#i(t):e==="data-key"&&(this.#n=t||"id",this.#r())}async#i(e){try{this.setAttribute("data-loading","");let r=await fetch(e);if(!r.ok)throw new Error(`HTTP ${r.status}`);let t=await r.json();this.#e=Array.isArray(t)?t:t.items||t.data||[],this.#r()}catch(r){console.error("[card-list] Fetch error:",r),this.setAttribute("data-error",r.message)}finally{this.removeAttribute("data-loading")}}#r(){if(!this.#t)return;this.querySelectorAll(":scope > :not(template)").forEach(t=>t.remove());let r=document.createDocumentFragment();for(let t of this.#e){let n=this.#t.content.cloneNode(!0);this.#o(n,t),r.appendChild(n)}this.appendChild(r),this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#e.length},bubbles:!0}))}#o(e,r){e.querySelectorAll("[data-field]").forEach(t=>{let n=t.getAttribute("data-field"),i=s(r,n);t.textContent=i??""}),e.querySelectorAll("[data-field-attr]").forEach(t=>{let n=b(t.getAttribute("data-field-attr"));for(let{attr:i,path:a}of n){if(!m(a))continue;let u=s(r,a);u!=null&&t.setAttribute(i,u)}}),e.querySelectorAll("[data-field-html]").forEach(t=>{let n=t.getAttribute("data-field-html"),i=s(r,n);t.innerHTML=l(i)}),e.querySelectorAll("[data-field-if]").forEach(t=>{let n=t.getAttribute("data-field-if");s(r,n)||t.remove()}),e.querySelectorAll("[data-field-unless]").forEach(t=>{let n=t.getAttribute("data-field-unless");s(r,n)&&t.remove()})}setItems(e){this.#e=Array.isArray(e)?e:[],this.#r()}getItems(){return[...this.#e]}};h("card-list",d);export{d as CardList,s as getValueByPath,m as isValidPath,l as sanitizeHTML};
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};
2
2
  //# sourceMappingURL=card-list.js.map
@@ -1,2 +1,2 @@
1
- var I=Object.defineProperty;var N=(t,e)=>()=>(t&&(e=t(t=0)),e);var Y=(t,e)=>{for(var i in e)I(t,i,{get:e[i],enumerable:!0})};var S={};Y(S,{addDialogDismiss:()=>C,addLongPress:()=>M,addPullToRefresh:()=>B,addSwipeListener:()=>$,haptic:()=>E,initGestures:()=>P,makeSwipeable:()=>k});function $(t,e={}){let i=e.threshold??50,r=e.restraint??100,n=e.timeout??300,s,o,a;function c(h){h.isPrimary&&(s=h.clientX,o=h.clientY,a=Date.now())}function p(h){if(!h.isPrimary)return;let f=h.clientX-s,l=h.clientY-o,v=Date.now()-a;if(v>n)return;let m=Math.abs(f),u=Math.abs(l),d;if(m>=i&&u<=r?d=f<0?"left":"right":u>=i&&m<=r&&(d=l<0?"up":"down"),d){let b=d==="left"||d==="right"?m:u;t.dispatchEvent(new CustomEvent(`swipe-${d}`,{bubbles:!0,detail:{distance:b,duration:v}}))}}return t.addEventListener("pointerdown",c,{passive:!0}),t.addEventListener("pointerup",p,{passive:!0}),()=>{t.removeEventListener("pointerdown",c),t.removeEventListener("pointerup",p)}}function k(t,e={}){let i=e.threshold??100,r=e.direction??"horizontal",n=e.removeOnDismiss??!0,s=r==="horizontal",o=0,a=0,c=!1;function p(u){!u.isPrimary||t.hasAttribute("data-dismissed")||(u.preventDefault(),c=!0,o=s?u.clientX:u.clientY,a=0,t.setPointerCapture(u.pointerId),t.setAttribute("data-swiping",""))}function h(u){if(!c||!u.isPrimary)return;a=(s?u.clientX:u.clientY)-o;let b=1-Math.min(Math.abs(a)/i,1)*.5;s?t.style.transform=`translateX(${a}px)`:t.style.transform=`translateY(${a}px)`,t.style.opacity=String(b)}function f(u){!c||!u.isPrimary||(c=!1,t.releasePointerCapture(u.pointerId),t.removeAttribute("data-swiping"),Math.abs(a)>=i?v(a>0?"right":"left"):m())}function l(u){!c||!u.isPrimary||(c=!1,t.releasePointerCapture(u.pointerId),t.removeAttribute("data-swiping"),m())}function v(u){let d=u==="right"?"100%":"-100%";t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform=s?`translateX(${d})`:`translateY(${d})`,t.style.opacity="0",t.setAttribute("data-dismissed",""),E.dismiss(),t.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:u,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",p),t.addEventListener("pointermove",h),t.addEventListener("pointerup",f),t.addEventListener("pointercancel",l),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",h),t.removeEventListener("pointerup",f),t.removeEventListener("pointercancel",l)}}function B(t,e,i={}){let r=i.threshold??70,n=i.maxPull??120,s=document.createElement("div");s.setAttribute("data-pull-indicator",""),s.setAttribute("aria-hidden","true");let o=document.createElement("div");o.setAttribute("data-pull-spinner",""),s.appendChild(o),t.prepend(s);let a=0,c=!1,p=!1;function h(d){!d.isPrimary||p||t.scrollTop<=0&&(a=d.clientY,c=!0)}function f(d){if(!c||!d.isPrimary||p)return;let b=d.clientY-a;if(b<=0){s.style.transform="",s.style.opacity="";return}let g=Math.min(b,n),A=g/r;s.style.transform=`translateY(${g}px)`,s.style.opacity=String(Math.min(A,1)),A>=1?s.setAttribute("data-pull-ready",""):s.removeAttribute("data-pull-ready")}function l(d){!c||!d.isPrimary||(c=!1,s.hasAttribute("data-pull-ready")&&!p?m():u())}function v(d){!c||!d.isPrimary||(c=!1,u())}async function m(){p=!0,s.removeAttribute("data-pull-ready"),s.setAttribute("data-pull-loading",""),s.style.transform=`translateY(${r}px)`,s.style.opacity="1";try{await e()}finally{p=!1,s.removeAttribute("data-pull-loading"),u()}}function u(){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 t.addEventListener("pointerdown",h,{passive:!0}),t.addEventListener("pointermove",f,{passive:!0}),t.addEventListener("pointerup",l,{passive:!0}),t.addEventListener("pointercancel",v,{passive:!0}),()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointermove",f),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",v),s.remove()}}function M(t,e,i={}){let r=i.duration??500,n=i.hapticFeedback??!0,s=i.blockContextMenu??!0,o=null;function a(h){h.isPrimary&&(o=setTimeout(()=>{n&&E.tap(),e(h),o=null},r))}function c(){o&&(clearTimeout(o),o=null)}function p(h){s&&h.preventDefault()}return t.addEventListener("pointerdown",a,{passive:!0}),t.addEventListener("pointermove",c,{passive:!0}),t.addEventListener("pointerup",c,{passive:!0}),t.addEventListener("pointercancel",c,{passive:!0}),t.addEventListener("contextmenu",p),()=>{c(),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",c),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",c),t.removeEventListener("contextmenu",p)}}function C(t,e={}){let i=e.threshold??80,r=0,n=0,s=!1;function o(l){if(!l.isPrimary||!t.open)return;let v=l.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(s=!0,r=l.clientY,n=0,t.setPointerCapture(l.pointerId),t.style.transition="none")}function a(l){if(!s||!l.isPrimary)return;if(n=l.clientY-r,n<=0){t.style.transform="",t.style.opacity="";return}let m=1-Math.min(n/i,1)*.4;t.style.transform=`translateY(${n}px)`,t.style.opacity=String(m)}function c(l){!s||!l.isPrimary||(s=!1,t.releasePointerCapture(l.pointerId),n>=i?h():f())}function p(l){!s||!l.isPrimary||(s=!1,t.releasePointerCapture(l.pointerId),f())}function h(){t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform="translateY(100%)",t.style.opacity="0",E.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",c),t.addEventListener("pointercancel",p),()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",c),t.removeEventListener("pointercancel",p)}}function P(t=document){let e=[];for(let i of t.querySelectorAll('[data-gesture="swipe"]'))e.push($(i));for(let i of t.querySelectorAll('[data-gesture="dismiss"]'))e.push(k(i));for(let i of t.querySelectorAll('[data-gesture="long-press"]'))e.push(M(i,()=>{i.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let i of t.querySelectorAll('dialog[data-gesture="dismiss-down"]'))e.push(C(i));return()=>e.forEach(i=>i())}var E,D=N(()=>{E={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};P()});var X=window.matchMedia("(prefers-reduced-motion: reduce)");var L=new Map;function x(t,e,i={}){let r=i.priority??10,n={impl:e,bundle:i.bundle,contract:i.contract,priority:r},s=L.get(t);if(customElements.get(t)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> 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 <${t}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}L.set(t,n),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,i,r,n){e.addEventListener(i,r,n),this.#t.push(()=>e.removeEventListener(i,r,n))}setup(){}teardown(){}};function T(t){return document.startViewTransition?document.startViewTransition(t):t()}var q=0,w=class extends y{#t;#e=[];#i;#r;#n;#a;#u;#c=null;#s=0;#l=!1;#o=!1;#h=null;get currentIndex(){return this.#s}get slideCount(){return this.#e.length}get playing(){return this.#c!==null}setup(){let e=[...this.children];if(e.length===0)return!1;if(this.#l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#o=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#o&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#t=document.createElement("div"),this.#t.className="carousel-track",this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-label","Slides"),e.forEach((s,o)=>{s.setAttribute("role","group"),s.setAttribute("aria-roledescription","slide"),s.setAttribute("aria-label",`${o+1} of ${e.length}`),this.#t.appendChild(s)}),this.#e=[...this.#t.children],this.#i=document.createElement("button"),this.#i.className="carousel-prev",this.#i.setAttribute("aria-label","Previous slide"),this.#i.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.#e.forEach((s,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.#a=document.createElement("div"),this.#a.className="carousel-live",this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.appendChild(this.#i),this.appendChild(this.#t),this.appendChild(this.#r),this.#n&&this.appendChild(this.#n),this.appendChild(this.#a),this.listen(this.#i,"click",()=>this.prev()),this.listen(this.#r,"click",()=>this.next()),this.listen(this.#t,"keydown",this.#m),this.#o){let s=++q,o=this.getAttribute("transition")||"fade",a=o==="slide"?"vt-carousel-slide":o==="scale"?"vt-carousel-scale":"vt-carousel";this.#t.style.viewTransitionName=`carousel-${s}`,this.#t.style.viewTransitionClass=a}this.#o&&Promise.resolve().then(()=>(D(),S)).then(({addSwipeListener:s})=>{this.#h=s(this.#t,{threshold:40}),this.listen(this.#t,"swipe-left",()=>this.next()),this.listen(this.#t,"swipe-right",()=>this.prev())}),this.#o||(this.#u=new IntersectionObserver(this.#v,{root:this.#t,threshold:.5}),this.#e.forEach(s=>this.#u.observe(s)));let n=this.#y()??(Number(this.getAttribute("start"))||0);if(this.#o){let s=n>0&&n<this.#e.length?n:0;this.#e.forEach((o,a)=>{o.hidden=a!==s}),this.#d(s)}else n>0&&n<this.#e.length&&this.goTo(n,!1);this.#f(),this.hasAttribute("autoplay")&&!this.#l&&this.#b()}teardown(){this.pause(),this.#u&&(this.#u.disconnect(),this.#u=null),this.#h&&(this.#h(),this.#h=null),this.#e=[],this.#o=!1}next(){let e=this.hasAttribute("loop");this.#s<this.#e.length-1?this.goTo(this.#s+1):e&&this.goTo(0)}prev(){let e=this.hasAttribute("loop");this.#s>0?this.goTo(this.#s-1):e&&this.goTo(this.#e.length-1)}goTo(e,i=!0){if(!(e<0||e>=this.#e.length)){if(this.#o)if(i&&e!==this.#s){let r=e>this.#s?"forward":"backward";document.documentElement.dataset.vtDirection=r,T(()=>{this.#p(e)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#p(e);else{let r=this.#e[e].offsetLeft-this.#t.offsetLeft,n=i&&!this.#l?"smooth":"instant";this.#t.scrollTo({left:r,behavior:n})}this.#d(e)}}#p(e){this.#e.forEach((i,r)=>{i.hidden=r!==e})}play(){if(this.#c||this.#l)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.#w()}#d(e){this.#s=e,this.#f(),this.#E(),this.#a&&(this.#a.textContent=`Slide ${e+1} of ${this.#e.length}`),this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:e,slide:this.#e[e]},bubbles:!0}))}#f(){let e=this.hasAttribute("loop"),i=this.#s===0,r=this.#s===this.#e.length-1;if(this.#i&&(this.#i.disabled=!e&&i),this.#r&&(this.#r.disabled=!e&&r),this.#n){let n=this.#n.children;for(let s=0;s<n.length;s++){let o=s===this.#s;n[s].setAttribute("aria-current",o?"true":"false"),o?n[s].setAttribute("data-active",""):n[s].removeAttribute("data-active")}}}#v=e=>{for(let i of e)if(i.isIntersecting){let r=this.#e.indexOf(i.target);r!==-1&&r!==this.#s&&this.#d(r)}};#m=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.#e.length-1);break}};#b(){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})}#y(){let e=this.getAttribute("persist");if(!e)return null;try{let i=localStorage.getItem(`carousel:${e}`);return i!==null?Number(i):null}catch{return null}}#E(){let e=this.getAttribute("persist");if(e)try{localStorage.setItem(`carousel:${e}`,String(this.#s))}catch{}}#w(){let e=this.getAttribute("persist");if(e)try{localStorage.removeItem(`carousel:${e}`)}catch{}}};x("carousel-wc",w);export{w as CarouselWc};
1
+ var B=Object.defineProperty;var F=(t,e)=>()=>(t&&(e=t(t=0)),e);var X=(t,e)=>{for(var s in e)B(t,s,{get:e[s],enumerable:!0})};var N={};X(N,{addDialogDismiss:()=>S,addFlickListener:()=>T,addLongPress:()=>P,addPullToRefresh:()=>O,addSwipeListener:()=>D,haptic:()=>L,initGestures:()=>I,makeSwipeable:()=>$});function D(t,e={}){let s=e.threshold??50,r=e.restraint??100,n=e.timeout??300,i=e.velocity??.5,o=e.minFlickDistance??10,a,u,h;function f(l){l.isPrimary&&(a=l.clientX,u=l.clientY,h=Date.now())}function p(l){if(!l.isPrimary)return;let v=l.clientX-a,m=l.clientY-u,c=Date.now()-h;if(c>n)return;let d=Math.abs(v),b=Math.abs(m),E=Math.max(d,b),y=c>0?E/c:0,g=y>=i&&E>=o,w;if((d>=s||g&&d>b)&&b<=r?w=v<0?"left":"right":(b>=s||g&&b>d)&&d<=r&&(w=m<0?"up":"down"),w){let q=w==="left"||w==="right"?d:b;t.dispatchEvent(new CustomEvent(`swipe-${w}`,{bubbles:!0,detail:{distance:q,duration:c,velocity:y,flick:g}}))}}return t.addEventListener("pointerdown",f,{passive:!0}),t.addEventListener("pointerup",p,{passive:!0}),()=>{t.removeEventListener("pointerdown",f),t.removeEventListener("pointerup",p)}}function T(t,e={}){let s=e.minDistance??10,r=e.velocity??.6,n=e.timeout??250,i=e.restraint??80,o,a,u;function h(p){p.isPrimary&&(o=p.clientX,a=p.clientY,u=Date.now())}function f(p){if(!p.isPrimary)return;let l=p.clientX-o,v=p.clientY-a,m=Date.now()-u;if(m===0||m>n)return;let c=Math.abs(l),d=Math.abs(v),b=Math.max(c,d);if(b<s)return;let E=b/m;if(E<r)return;let y;if(c>d&&d<=i?y=l<0?"left":"right":d>c&&c<=i&&(y=v<0?"up":"down"),y){let g=y==="left"||y==="right"?c:d;t.dispatchEvent(new CustomEvent(`swipe-${y}`,{bubbles:!0,detail:{distance:g,duration:m,velocity:E,flick:!0}}))}}return t.addEventListener("pointerdown",h,{passive:!0}),t.addEventListener("pointerup",f,{passive:!0}),()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointerup",f)}}function $(t,e={}){let s=e.threshold??100,r=e.direction??"horizontal",n=e.removeOnDismiss??!0,i=r==="horizontal",o=0,a=0,u=!1;function h(c){!c.isPrimary||t.hasAttribute("data-dismissed")||(c.preventDefault(),u=!0,o=i?c.clientX:c.clientY,a=0,t.setPointerCapture(c.pointerId),t.setAttribute("data-swiping",""))}function f(c){if(!u||!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 p(c){!u||!c.isPrimary||(u=!1,t.releasePointerCapture(c.pointerId),t.removeAttribute("data-swiping"),Math.abs(a)>=s?v(a>0?"right":"left"):m())}function l(c){!u||!c.isPrimary||(u=!1,t.releasePointerCapture(c.pointerId),t.removeAttribute("data-swiping"),m())}function v(c){let d=c==="right"?"100%":"-100%";t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform=i?`translateX(${d})`:`translateY(${d})`,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",h),t.addEventListener("pointermove",f),t.addEventListener("pointerup",p),t.addEventListener("pointercancel",l),()=>{t.removeEventListener("pointerdown",h),t.removeEventListener("pointermove",f),t.removeEventListener("pointerup",p),t.removeEventListener("pointercancel",l)}}function O(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,u=!1,h=!1;function f(d){!d.isPrimary||h||t.scrollTop<=0&&(a=d.clientY,u=!0)}function p(d){if(!u||!d.isPrimary||h)return;let b=d.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 l(d){!u||!d.isPrimary||(u=!1,i.hasAttribute("data-pull-ready")&&!h?m():c())}function v(d){!u||!d.isPrimary||(u=!1,c())}async function m(){h=!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{h=!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",f,{passive:!0}),t.addEventListener("pointermove",p,{passive:!0}),t.addEventListener("pointerup",l,{passive:!0}),t.addEventListener("pointercancel",v,{passive:!0}),()=>{t.removeEventListener("pointerdown",f),t.removeEventListener("pointermove",p),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",v),i.remove()}}function P(t,e,s={}){let r=s.duration??500,n=s.hapticFeedback??!0,i=s.blockContextMenu??!0,o=null;function a(f){f.isPrimary&&(o=setTimeout(()=>{n&&L.tap(),e(f),o=null},r))}function u(){o&&(clearTimeout(o),o=null)}function h(f){i&&f.preventDefault()}return t.addEventListener("pointerdown",a,{passive:!0}),t.addEventListener("pointermove",u,{passive:!0}),t.addEventListener("pointerup",u,{passive:!0}),t.addEventListener("pointercancel",u,{passive:!0}),t.addEventListener("contextmenu",h),()=>{u(),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",u),t.removeEventListener("contextmenu",h)}}function S(t,e={}){let s=e.threshold??80,r=0,n=0,i=!1;function o(l){if(!l.isPrimary||!t.open)return;let v=l.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(i=!0,r=l.clientY,n=0,t.setPointerCapture(l.pointerId),t.style.transition="none")}function a(l){if(!i||!l.isPrimary)return;if(n=l.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 u(l){!i||!l.isPrimary||(i=!1,t.releasePointerCapture(l.pointerId),n>=s?f():p())}function h(l){!i||!l.isPrimary||(i=!1,t.releasePointerCapture(l.pointerId),p())}function f(){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 p(){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",u),t.addEventListener("pointercancel",h),()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",h)}}function I(t=document){let e=[];for(let s of t.querySelectorAll('[data-gesture="swipe"]'))e.push(D(s));for(let s of t.querySelectorAll('[data-gesture="flick"]'))e.push(T(s));for(let s of t.querySelectorAll('[data-gesture="dismiss"]'))e.push($(s));for(let s of t.querySelectorAll('[data-gesture="long-press"]'))e.push(P(s,()=>{s.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let s of t.querySelectorAll('dialog[data-gesture="dismiss-down"]'))e.push(S(s));return()=>e.forEach(s=>s())}var L,Y=F(()=>{L={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};I()});var V=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function M(t,e,s={}){let r=s.priority??10,n={impl:e,bundle:s.bundle,contract:s.contract,priority:r},i=k.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}k.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 C(t){return document.startViewTransition?document.startViewTransition(t):t()}var H=0,x=class extends A{#e;#t=[];#s;#r;#n;#a;#u;#c=null;#i=0;#l=!1;#o=!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.#l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#o=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#o&&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.#a=document.createElement("div"),this.#a.className="carousel-live",this.#a.setAttribute("aria-live","polite"),this.#a.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.#a),this.listen(this.#s,"click",()=>this.prev()),this.listen(this.#r,"click",()=>this.next()),this.listen(this.#e,"keydown",this.#m),this.#o){let i=++H,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.#o&&Promise.resolve().then(()=>(Y(),N)).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.#o||(this.#u=new IntersectionObserver(this.#v,{root:this.#e,threshold:.5}),this.#t.forEach(i=>this.#u.observe(i)));let n=this.#y()??(Number(this.getAttribute("start"))||0);if(this.#o){let i=n>0&&n<this.#t.length?n:0;this.#t.forEach((o,a)=>{o.hidden=a!==i}),this.#h(i)}else n>0&&n<this.#t.length&&this.goTo(n,!1);return this.#f(),this.hasAttribute("autoplay")&&!this.#l&&this.#b(),!0}teardown(){this.pause(),this.#u&&(this.#u.disconnect(),this.#u=null),this.#d&&(this.#d(),this.#d=null),this.#t=[],this.#o=!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.#o)if(s&&e!==this.#i){let r=e>this.#i?"forward":"backward";document.documentElement.dataset.vtDirection=r,C(()=>{this.#p(e)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#p(e);else{let r=this.#t[e].offsetLeft-this.#e.offsetLeft,n=s&&!this.#l?"smooth":"instant";this.#e.scrollTo({left:r,behavior:n})}this.#h(e)}}#p(e){this.#t.forEach((s,r)=>{s.hidden=r!==e})}play(){if(this.#c||this.#l)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.#w()}#h(e){this.#i=e,this.#f(),this.#E(),this.#a&&(this.#a.textContent=`Slide ${e+1} of ${this.#t.length}`),this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:e,slide:this.#t[e]},bubbles:!0}))}#f(){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")}}}#v=e=>{for(let s of e)if(s.isIntersecting){let r=this.#t.indexOf(s.target);r!==-1&&r!==this.#i&&this.#h(r)}};#m=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}};#b(){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})}#y(){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}}#E(){let e=this.getAttribute("persist");if(e)try{localStorage.setItem(`carousel:${e}`,String(this.#i))}catch{}}#w(){let e=this.getAttribute("persist");if(e)try{localStorage.removeItem(`carousel:${e}`)}catch{}}};M("carousel-wc",x);export{x as CarouselWc};
2
2
  //# sourceMappingURL=carousel-wc.js.map
@@ -1,4 +1,4 @@
1
- var u=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(o,e,n={}){let i=n.priority??10,r={impl:e,bundle:n.bundle,contract:n.contract,priority:i},t=c.get(o);if(customElements.get(o)){if(!t||t.priority>=i){t&&t.priority===i&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=i){t.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${t.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}c.set(o,r),customElements.define(o,e)}var s=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),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,n,i,r){e.addEventListener(n,i,r),this.#e.push(()=>e.removeEventListener(n,i,r))}setup(){}teardown(){}};var a=class extends s{setup(){this.querySelector("[data-controls]")||this.#e()}#e(){let e=document.createElement("nav");e.setAttribute("data-controls",""),e.setAttribute("aria-label","Change view controls"),e.innerHTML=`
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
2
  <button type="button" data-action="tracking" aria-pressed="true">
3
3
  Tracking
4
4
  </button>
@@ -8,5 +8,5 @@ var u=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;functi
8
8
  <button type="button" data-action="original" aria-pressed="false">
9
9
  Original
10
10
  </button>
11
- `,this.prepend(e),e.addEventListener("click",n=>{let r=n.target.closest("[data-action]")?.dataset.action;if(r){r==="tracking"?this.removeAttribute("view"):this.setAttribute("view",r);for(let t of e.querySelectorAll("button"))t.setAttribute("aria-pressed",t.dataset.action===r);this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:r},bubbles:!0}))}})}get view(){return this.getAttribute("view")??"tracking"}set view(e){e==="tracking"?this.removeAttribute("view"):this.setAttribute("view",e)}};d("change-set",a);export{a as ChangeSet};
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};
12
12
  //# sourceMappingURL=change-set.js.map