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
@@ -1,2 +1,2 @@
1
- var x=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,n,c){e.addEventListener(r,n,c),this.#t.push(()=>e.removeEventListener(r,n,c))}setup(){}teardown(){}};var P=window.matchMedia("(prefers-reduced-motion: reduce)");var H=new Map;function B(d,e,r={}){let n=r.priority??10,c={impl:e,bundle:r.bundle,contract:r.contract,priority:n},t=H.get(d);if(customElements.get(d)){if(!t||t.priority>=n){t&&t.priority===n&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${d}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${d}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=n){t.priority===n&&console.warn(`[VB Bundle] Tag <${d}> already registered by "${t.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}H.set(d,c),customElements.define(d,e)}function O(d){let e=d.getFullYear(),r=String(d.getMonth()+1).padStart(2,"0"),n=String(d.getDate()).padStart(2,"0");return`${e}-${r}-${n}`}var T=class extends x{#t;setup(){if(this.#t=this.querySelector("table"),this.#t||this.#n(),!this.#t)return!1;this.#e(),this.listen(this.#t,"click",r=>{let n=r.target.closest("calendar-event");if(!n)return;let t=n.closest("tr")?.querySelector("th time[datetime]");this.dispatchEvent(new CustomEvent("week-view:event-click",{bubbles:!0,detail:{date:n.dataset.date,time:n.querySelector("time[datetime]")?.getAttribute("datetime")||t?.getAttribute("datetime"),text:n.textContent.trim(),element:n,category:n.dataset.category,duration:n.dataset.duration}}))}),this.#r();let e=this.#t.querySelector("calendar-event");e&&e.setAttribute("tabindex","0")}teardown(){this.querySelectorAll("calendar-event.wv-spanning").forEach(e=>{e.style.cssText="",e.classList.remove("wv-spanning")})}refresh(){this.teardown(),this.#e()}#n(){let e=[...this.querySelectorAll(":scope > calendar-event")];if(e.length===0)return;let r=this.dataset.startDate;if(!r)return;let n=parseInt(this.dataset.days||"7",10),[c,t,h]=r.split("-").map(Number),m=new Date(c,t-1,h),l=[];for(let s=0;s<n;s++){let i=new Date(m);i.setDate(i.getDate()+s),l.push(i)}let u=l.map(O),o=new Map,a=new Set;e.forEach(s=>{let i=s.dataset.date;if(!i||!u.includes(i))return;let p=s.querySelector("time[datetime]");if(!p)return;let v=p.getAttribute("datetime").split(":"),A=parseInt(v[0],10),C=parseInt(v[1]||"0",10);if(isNaN(A))return;C>=30&&!s.dataset.start&&(s.dataset.start="30");let D=String(A).padStart(2,"0"),y=`${i}:${D}`;o.has(y)||o.set(y,[]),o.get(y).push(s),a.add(A)});let f=[...a].sort((s,i)=>s-i),b=this.dataset.startHour==="auto"||!this.dataset.startHour,w=b?f.length>0?Math.max(0,f[0]-1):7:parseInt(this.dataset.startHour,10),g=b?f.length>0?Math.min(23,f[f.length-1]+1):19:parseInt(this.dataset.endHour||"19",10),S=this.closest("[lang]")?.lang||navigator.language,M=new Intl.DateTimeFormat(S,{weekday:"short",day:"numeric"}),$=new Intl.DateTimeFormat(S,{hour:"numeric"});this.style.setProperty("--wv-days",n);let E=document.createElement("table"),F=document.createElement("thead"),q=document.createElement("tr"),L=document.createElement("th");L.setAttribute("aria-label","Time"),q.appendChild(L),l.forEach(s=>{let i=document.createElement("th");i.setAttribute("scope","col");let p=document.createElement("time");p.setAttribute("datetime",O(s)),p.textContent=M.format(s),i.appendChild(p),q.appendChild(i)}),F.appendChild(q),E.appendChild(F);let N=document.createElement("tbody");for(let s=w;s<=g;s++){let i=document.createElement("tr"),p=document.createElement("th");p.setAttribute("scope","row");let k=document.createElement("time"),v=String(s).padStart(2,"0");k.setAttribute("datetime",`${v}:00`),k.textContent=$.format(new Date(2026,0,1,s)),p.appendChild(k),i.appendChild(p),u.forEach(A=>{let C=document.createElement("td"),D=`${A}:${v}`,y=o.get(D)||[];if(y.length>0){let I=document.createElement("hour-view");y.length>1&&(I.dataset.overlap=""),y.forEach(R=>I.appendChild(R)),C.appendChild(I)}i.appendChild(C)}),N.appendChild(i)}E.appendChild(N),this.appendChild(E),this.#t=E}#e(){let e=this.#t.querySelector("tbody");if(!e)return;let r=e.querySelectorAll("calendar-event[data-duration]");r.length!==0&&requestAnimationFrame(()=>{let n=e.getBoundingClientRect(),c=new Map;e.querySelectorAll(":scope > tr").forEach(t=>{let h=t.querySelector("th time[datetime]");if(!h)return;let m=parseInt(h.getAttribute("datetime").split(":")[0],10),l=t.getBoundingClientRect();c.set(m,{top:l.top-n.top,height:l.height})}),r.forEach(t=>{let h=t.closest("td"),m=h?.closest("tr");if(!h||!m)return;let l=m.querySelector("th time[datetime]"),u=parseInt(l?.getAttribute("datetime")?.split(":")[0],10),o=parseInt(t.dataset.start||"0",10),a=t.dataset.duration,f=60,b=a.match(/(\d+)h/),w=a.match(/(\d+)m/);(b||w)&&(f=(b?parseInt(b[1],10)*60:0)+(w?parseInt(w[1],10):0));let g=c.get(u);if(!g)return;let S=h.getBoundingClientRect(),M=o/60,$=g.top+g.height*M,E=g.height*(f/60);t.style.position="absolute",t.style.top=$+"px",t.style.height=E+"px",t.style.left=S.left-n.left+2+"px",t.style.right=n.right-S.right+2+"px",t.classList.add("wv-spanning")})})}#r(){this.listen(this.#t,"keydown",e=>{if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;let r=e.target.closest("calendar-event");if(!r)return;let n=r.closest("td"),c=n?.closest("tr");if(!n||!c)return;let t=[...c.parentElement.children],h=t.indexOf(c),m=[...c.children],l=m.indexOf(n),u=null;if(e.key==="ArrowDown")for(let o=h+1;o<t.length;o++){let a=t[o].children[l]?.querySelector("calendar-event");if(a){u=a;break}}else if(e.key==="ArrowUp")for(let o=h-1;o>=0;o--){let a=t[o].children[l]?.querySelector("calendar-event");if(a){u=a;break}}else if(e.key==="ArrowRight")for(let o=l+1;o<m.length;o++){let a=m[o]?.querySelector("calendar-event");if(a){u=a;break}}else if(e.key==="ArrowLeft")for(let o=l-1;o>=1;o--){let a=m[o]?.querySelector("calendar-event");if(a){u=a;break}}u&&(e.preventDefault(),u.setAttribute("tabindex","0"),r.setAttribute("tabindex","-1"),u.focus())})}};B("week-view",T);export{T as WeekView};
1
+ var I=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,n,t,r){e.addEventListener(n,t,r),this.#t.push(()=>e.removeEventListener(n,t,r))}setup(){}teardown(){}setState(e,n){this.#e||(this.#e=this.attachInternals());let t=this.#e.states;try{n?t.add(e):t.delete(e)}catch{let r=`--${e}`;n?t.add(r):t.delete(r)}}_adoptInternals(e){this.#e||(this.#e=e)}};var P=window.matchMedia("(prefers-reduced-motion: reduce)");var H=new Map;function B(h,e,n={}){let t=n.priority??10,r={impl:e,bundle:n.bundle,contract:n.contract,priority:t},s=H.get(h);if(customElements.get(h)){if(!s||s.priority>=t){s&&s.priority===t&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${h}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=t){s.priority===t&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${s.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}H.set(h,r),customElements.define(h,e)}function O(h){let e=h.getFullYear(),n=String(h.getMonth()+1).padStart(2,"0"),t=String(h.getDate()).padStart(2,"0");return`${e}-${n}-${t}`}var N=class extends I{#t=null;setup(){if(this.#t=this.querySelector("table"),this.#t||this.#e(),!this.#t)return!1;this.#n(),this.listen(this.#t,"click",n=>{let r=n.target?.closest("calendar-event");if(!r)return;let a=r.closest("tr")?.querySelector("th time[datetime]");this.dispatchEvent(new CustomEvent("week-view:event-click",{bubbles:!0,detail:{date:r.dataset.date,time:r.querySelector("time[datetime]")?.getAttribute("datetime")||a?.getAttribute("datetime"),text:r.textContent?.trim()??"",element:r,category:r.dataset.category,duration:r.dataset.duration}}))}),this.#r();let e=this.#t.querySelector("calendar-event");return e&&e.setAttribute("tabindex","0"),!0}teardown(){this.querySelectorAll("calendar-event.wv-spanning").forEach(e=>{e.style.cssText="",e.classList.remove("wv-spanning")})}refresh(){this.teardown(),this.#n()}get events(){return[...this.querySelectorAll("calendar-event")].map(e=>{let n=e;return{date:n.dataset.date||void 0,time:n.querySelector("time[datetime]")?.getAttribute("datetime")||void 0,text:n.textContent?.trim()??"",category:n.dataset.category||void 0,duration:n.dataset.duration||void 0}})}set events(e){let n=Array.isArray(e)?e:[];for(;this.firstChild;)this.firstChild.remove();for(let t of n){let r=document.createElement("calendar-event");if(t.date&&(r.dataset.date=t.date),t.category&&(r.dataset.category=t.category),t.duration&&(r.dataset.duration=String(t.duration)),t.time){let s=document.createElement("time");s.setAttribute("datetime",t.time),s.textContent=t.time,r.appendChild(s),r.appendChild(document.createTextNode(" "))}r.appendChild(document.createTextNode(t.text||"")),this.appendChild(r)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("week-view:events-changed",{detail:{events:n,source:"property"},bubbles:!0}))}#e(){let e=[...this.querySelectorAll(":scope > calendar-event")];if(e.length===0)return;let n=this.dataset.startDate;if(!n)return;let t=parseInt(this.dataset.days||"7",10),[r,s,a]=n.split("-").map(Number),u=new Date(r,s-1,a),m=[];for(let l=0;l<t;l++){let i=new Date(u);i.setDate(i.getDate()+l),m.push(i)}let y=m.map(O),f=new Map,g=new Set;e.forEach(l=>{let i=l,p=i.dataset.date;if(!p||!y.includes(p))return;let S=i.querySelector("time[datetime]");if(!S)return;let k=S.getAttribute("datetime");if(!k)return;let T=k.split(":"),A=parseInt(T[0],10),D=parseInt(T[1]||"0",10);if(isNaN(A))return;D>=30&&!i.dataset.start&&(i.dataset.start="30");let q=String(A).padStart(2,"0"),b=`${p}:${q}`;f.has(b)||f.set(b,[]),f.get(b).push(i),g.add(A)});let d=[...g].sort((l,i)=>l-i),o=this.dataset.startHour==="auto"||!this.dataset.startHour,c=o?d.length>0?Math.max(0,d[0]-1):7:parseInt(this.dataset.startHour??"",10),C=o?d.length>0?Math.min(23,d[d.length-1]+1):19:parseInt(this.dataset.endHour||"19",10),v=this.closest("[lang]")?.lang||navigator.language,E=new Intl.DateTimeFormat(v,{weekday:"short",day:"numeric"}),M=new Intl.DateTimeFormat(v,{hour:"numeric"});this.style.setProperty("--wv-days",String(t));let w=document.createElement("table"),$=document.createElement("thead"),x=document.createElement("tr"),F=document.createElement("th");F.setAttribute("aria-label","Time"),x.appendChild(F),m.forEach(l=>{let i=document.createElement("th");i.setAttribute("scope","col");let p=document.createElement("time");p.setAttribute("datetime",O(l)),p.textContent=E.format(l),i.appendChild(p),x.appendChild(i)}),$.appendChild(x),w.appendChild($);let L=document.createElement("tbody");for(let l=c;l<=C;l++){let i=document.createElement("tr"),p=document.createElement("th");p.setAttribute("scope","row");let S=document.createElement("time"),k=String(l).padStart(2,"0");S.setAttribute("datetime",`${k}:00`),S.textContent=M.format(new Date(2026,0,1,l)),p.appendChild(S),i.appendChild(p),y.forEach(T=>{let A=document.createElement("td"),D=`${T}:${k}`,q=f.get(D)||[];if(q.length>0){let b=document.createElement("hour-view");q.length>1&&(b.dataset.overlap=""),q.forEach(R=>b.appendChild(R)),A.appendChild(b)}i.appendChild(A)}),L.appendChild(i)}w.appendChild(L),this.appendChild(w),this.#t=w}#n(){let e=this.#t?.querySelector("tbody");if(!e)return;let n=e.querySelectorAll("calendar-event[data-duration]");n.length!==0&&requestAnimationFrame(()=>{let t=e.getBoundingClientRect(),r=new Map;e.querySelectorAll(":scope > tr").forEach(s=>{let a=s.querySelector("th time[datetime]");if(!a)return;let u=a.getAttribute("datetime");if(!u)return;let m=parseInt(u.split(":")[0],10),y=s.getBoundingClientRect();r.set(m,{top:y.top-t.top,height:y.height})}),n.forEach(s=>{let a=s,u=a.closest("td"),m=u?.closest("tr");if(!u||!m)return;let f=m.querySelector("th time[datetime]")?.getAttribute("datetime");if(!f)return;let g=parseInt(f.split(":")[0],10),d=parseInt(a.dataset.start||"0",10),o=a.dataset.duration??"",c=60,C=o.match(/(\d+)h/),v=o.match(/(\d+)m/);(C||v)&&(c=(C?parseInt(C[1],10)*60:0)+(v?parseInt(v[1],10):0));let E=r.get(g);if(!E)return;let M=u.getBoundingClientRect(),w=d/60,$=E.top+E.height*w,x=E.height*(c/60);a.style.position="absolute",a.style.top=$+"px",a.style.height=x+"px",a.style.left=M.left-t.left+2+"px",a.style.right=t.right-M.right+2+"px",a.classList.add("wv-spanning")})})}#r(){let e=this.#t;e&&this.listen(e,"keydown",n=>{let t=n;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key))return;let s=t.target?.closest("calendar-event");if(!s)return;let a=s.closest("td"),u=a?.closest("tr");if(!a||!u||!u.parentElement)return;let m=[...u.parentElement.children],y=m.indexOf(u),f=[...u.children],g=f.indexOf(a),d=null;if(t.key==="ArrowDown")for(let o=y+1;o<m.length;o++){let c=m[o].children[g]?.querySelector("calendar-event");if(c){d=c;break}}else if(t.key==="ArrowUp")for(let o=y-1;o>=0;o--){let c=m[o].children[g]?.querySelector("calendar-event");if(c){d=c;break}}else if(t.key==="ArrowRight")for(let o=g+1;o<f.length;o++){let c=f[o]?.querySelector("calendar-event");if(c){d=c;break}}else if(t.key==="ArrowLeft")for(let o=g-1;o>=1;o--){let c=f[o]?.querySelector("calendar-event");if(c){d=c;break}}d&&(t.preventDefault(),d.setAttribute("tabindex","0"),s.setAttribute("tabindex","-1"),d.focus())})}};B("week-view",N);export{N as WeekView};
2
2
  //# sourceMappingURL=week-view.js.map
@@ -88,12 +88,13 @@ var c=`
88
88
  height: 12px;
89
89
  }
90
90
 
91
- /* Type colors */
92
- .wi-type[data-type="task"] { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
93
- .wi-type[data-type="bug"] { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
94
- .wi-type[data-type="chore"] { color: #6b7280; background: rgba(107, 114, 128, 0.1); }
95
- .wi-type[data-type="spike"] { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
96
- .wi-type[data-type="feature"] { color: #059669; background: rgba(5, 150, 105, 0.1); }
91
+ /* Type colors \u2014 driven by VB theme tokens, with color-mix surfaces so the
92
+ pill background shifts with the active theme. */
93
+ .wi-type[data-type="task"] { color: var(--color-info, #3b82f6); background: color-mix(in oklch, var(--color-info, #3b82f6) 12%, transparent); }
94
+ .wi-type[data-type="bug"] { color: var(--color-error, #dc2626); background: color-mix(in oklch, var(--color-error, #dc2626) 12%, transparent); }
95
+ .wi-type[data-type="chore"] { color: var(--color-text-muted, #6b7280); background: color-mix(in oklch, var(--color-text-muted, #6b7280) 12%, transparent); }
96
+ .wi-type[data-type="spike"] { color: var(--color-accent, #8b5cf6); background: color-mix(in oklch, var(--color-accent, #8b5cf6) 12%, transparent); }
97
+ .wi-type[data-type="feature"] { color: var(--color-success, #059669); background: color-mix(in oklch, var(--color-success, #059669) 12%, transparent); }
97
98
 
98
99
  /* \u2500\u2500 Badges \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
99
100
  .wi-badges {
@@ -176,7 +177,7 @@ var c=`
176
177
  display: flex;
177
178
  align-items: center;
178
179
  justify-content: center;
179
- color: #fff;
180
+ color: var(--color-text-inverted, #fff);
180
181
  flex-shrink: 0;
181
182
  }
182
183
 
@@ -243,12 +244,12 @@ var c=`
243
244
  .wi-section-icon svg {
244
245
  width: 13px;
245
246
  height: 13px;
246
- fill: white;
247
+ fill: var(--color-text-inverted, #fff);
247
248
  }
248
249
 
249
- .wi-section-icon.description { background: #3b82f6; }
250
- .wi-section-icon.checklist { background: #22c55e; }
251
- .wi-section-icon.notes { background: #f59e0b; }
250
+ .wi-section-icon.description { background: var(--color-info, #3b82f6); }
251
+ .wi-section-icon.checklist { background: var(--color-success, #22c55e); }
252
+ .wi-section-icon.notes { background: var(--color-warning, #f59e0b); }
252
253
 
253
254
  .wi-section-title {
254
255
  font-size: var(--_font-xs);
@@ -359,31 +360,31 @@ var c=`
359
360
  }
360
361
 
361
362
  .state-msg { padding: var(--_space-m); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
362
- .state-msg--error { color: #dc2626; }
363
- `;var k=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function w(a,t,e={}){let i=e.priority??10,o={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=g.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}g.set(a,o),customElements.define(a,t)}function r(a){return String(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function b(a){return a.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function v(a){let t=0;for(let i=0;i<a.length;i++)t=a.charCodeAt(i)+((t<<5)-t);return`hsl(${(t%360+360)%360}, 65%, 55%)`}function d(a){return`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${a}</svg>`}var l={user:'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',check:'<path d="M20 6 9 17l-5-5"/>',target:'<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',alertTriangle:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',messageCircle:'<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"/>',lightbulb:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',wrench:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',heart:'<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/>',mapPin:'<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/>',checkCircle:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',send:'<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/>'},M={says:{label:"Says",icon:l.messageCircle,color:"#3b82f6"},thinks:{label:"Thinks",icon:l.lightbulb,color:"#8b5cf6"},does:{label:"Does",icon:l.wrench,color:"#f59e0b"},feels:{label:"Feels",icon:l.heart,color:"#ef4444"}};var y={task:'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="m9 12 2 2 4-4"/>',bug:'<path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/>',chore:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',spike:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',feature:'<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>'},p={critical:{label:"Critical",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"},high:{label:"High",color:"#ea580c",bg:"rgba(234, 88, 12, 0.1)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(202, 138, 4, 0.1)"},low:{label:"Low",color:"#16a34a",bg:"rgba(22, 163, 74, 0.1)"}},h={backlog:{label:"Backlog",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},"to-do":{label:"To Do",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},"in-progress":{label:"In Progress",color:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},review:{label:"Review",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},done:{label:"Done",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},blocked:{label:"Blocked",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"}},m=class extends HTMLElement{static get observedAttributes(){return["item-id","type","priority","status","estimate","assignee","story-ids","detail","compact","src"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#i(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}connectedCallback(){this.#i(),this.itemId&&!this.id&&(this.id=this.itemId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#t(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,i){e!==i&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(i):this.#t())}get itemId(){return this.getAttribute("item-id")||""}get itemTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get itemType(){return this.getAttribute("type")||"task"}get priority(){return this.getAttribute("priority")||"medium"}get status(){return this.getAttribute("status")||"backlog"}get estimate(){return this.getAttribute("estimate")||""}get assignee(){return this.getAttribute("assignee")||""}get storyIds(){let t=this.getAttribute("story-ids")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}get _minimalLabel(){return this.itemTitle||this.itemId||"Work item"}updateStatus(t){h[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("work-item:status",{detail:{status:t,itemId:this.itemId},bubbles:!0,composed:!0})))}updatePriority(t){p[t]&&(this.setAttribute("priority",t),this.dispatchEvent(new CustomEvent("work-item:priority",{detail:{priority:t,itemId:this.itemId},bubbles:!0,composed:!0})))}get data(){return{itemId:this.itemId||void 0,type:this.itemType,priority:this.priority,status:this.status,estimate:this.estimate||void 0,assignee:this.assignee||void 0,storyIds:this.storyIds.length?this.storyIds:void 0,detail:this.getAttribute("detail")||void 0,title:this.itemTitle||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.shadowRoot&&this.#t(),this.dispatchEvent(new CustomEvent("work-item:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,i]of[["itemId","item-id"],["type","type"],["priority","priority"],["status","status"],["estimate","estimate"],["assignee","assignee"],["detail","detail"]])t[e]!=null&&this.setAttribute(i,String(t[e]));if(t.storyIds&&this.setAttribute("story-ids",Array.isArray(t.storyIds)?t.storyIds.join(","):t.storyIds),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h3");e.slot="title",e.textContent=t.title,this.appendChild(e)}for(let e of["description","notes"])if(t[e]&&!this.querySelector(`[slot="${e}"]`)){let i=document.createElement("p");i.slot=e,i.textContent=t[e],this.appendChild(i)}if(t.checklist&&!this.querySelector('[slot="checklist"]')){let e=document.createElement("ul");e.slot="checklist";let i=Array.isArray(t.checklist)?t.checklist:[t.checklist];for(let o of i){let s=document.createElement("li");s.textContent=o,e.appendChild(s)}this.appendChild(e)}}async _loadSrc(t){if(t){this.shadowRoot.innerHTML=`<style>${c}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let i=await e.json();this._applyData(i),this.#t()}catch(e){this.shadowRoot.innerHTML=`<style>${c}</style><div class="state-msg state-msg--error">Could not load: ${r(e.message)}</div>`}}}#t(){let t=p[this.priority]||p.medium,e=h[this.status]||h.backlog,i=this.itemType,o=y[i]||y.task,s=this._detailLevel,u=this.itemId?`Work item: ${r(this.itemId)}`:"Work item";if(s==="minimal"){this.shadowRoot.innerHTML=`<style>${c}</style>
364
- <article class="wi-card wi-card--minimal" role="article" aria-label="${u}"
363
+ .state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
364
+ `;var _=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function w(r,t,e={}){let i=e.priority??10,o={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=v.get(r);if(customElements.get(r)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> 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 <${r}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}v.set(r,o),customElements.define(r,t)}function a(r){return String(r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function b(r){return r.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function y(r){let t=0;for(let i=0;i<r.length;i++)t=r.charCodeAt(i)+((t<<5)-t);return`hsl(${(t%360+360)%360}, 65%, 55%)`}function d(r){return`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${r}</svg>`}var l={user:'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',check:'<path d="M20 6 9 17l-5-5"/>',target:'<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',alertTriangle:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',messageCircle:'<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"/>',lightbulb:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',wrench:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',heart:'<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/>',mapPin:'<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/>',checkCircle:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',send:'<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/>'},$={says:{label:"Says",icon:l.messageCircle,color:"#3b82f6"},thinks:{label:"Thinks",icon:l.lightbulb,color:"#8b5cf6"},does:{label:"Does",icon:l.wrench,color:"#f59e0b"},feels:{label:"Feels",icon:l.heart,color:"#ef4444"}};var x={task:'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="m9 12 2 2 4-4"/>',bug:'<path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/>',chore:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',spike:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',feature:'<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>'},h={critical:{label:"Critical",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"},high:{label:"High",color:"#ea580c",bg:"rgba(234, 88, 12, 0.1)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(202, 138, 4, 0.1)"},low:{label:"Low",color:"#16a34a",bg:"rgba(22, 163, 74, 0.1)"}},m={backlog:{label:"Backlog",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},"to-do":{label:"To Do",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},"in-progress":{label:"In Progress",color:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},review:{label:"Review",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},done:{label:"Done",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},blocked:{label:"Blocked",color:"#dc2626",bg:"rgba(220, 38, 38, 0.1)"}},u=class extends HTMLElement{static get observedAttributes(){return["item-id","type","priority","status","estimate","assignee","story-ids","detail","compact","src"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#i(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}connectedCallback(){this.#i(),this.itemId&&!this.id&&(this.id=this.itemId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#t(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,i){e!==i&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(i):this.#t())}get itemId(){return this.getAttribute("item-id")||""}get itemTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get itemType(){return this.getAttribute("type")||"task"}get priority(){return this.getAttribute("priority")||"medium"}get status(){return this.getAttribute("status")||"backlog"}get estimate(){return this.getAttribute("estimate")||""}get assignee(){return this.getAttribute("assignee")||""}get storyIds(){let t=this.getAttribute("story-ids")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}get _minimalLabel(){return this.itemTitle||this.itemId||"Work item"}updateStatus(t){m[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("work-item:status",{detail:{status:t,itemId:this.itemId},bubbles:!0,composed:!0})))}updatePriority(t){h[t]&&(this.setAttribute("priority",t),this.dispatchEvent(new CustomEvent("work-item:priority",{detail:{priority:t,itemId:this.itemId},bubbles:!0,composed:!0})))}get data(){return{itemId:this.itemId||void 0,type:this.itemType,priority:this.priority,status:this.status,estimate:this.estimate||void 0,assignee:this.assignee||void 0,storyIds:this.storyIds.length?this.storyIds:void 0,detail:this.getAttribute("detail")||void 0,title:this.itemTitle||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.shadowRoot&&this.#t(),this.dispatchEvent(new CustomEvent("work-item:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,i]of[["itemId","item-id"],["type","type"],["priority","priority"],["status","status"],["estimate","estimate"],["assignee","assignee"],["detail","detail"]])t[e]!=null&&this.setAttribute(i,String(t[e]));if(t.storyIds&&this.setAttribute("story-ids",Array.isArray(t.storyIds)?t.storyIds.join(","):String(t.storyIds)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h3");e.slot="title",e.textContent=String(t.title),this.appendChild(e)}for(let e of["description","notes"])if(t[e]&&!this.querySelector(`[slot="${e}"]`)){let i=document.createElement("p");i.slot=e,i.textContent=String(t[e]),this.appendChild(i)}if(t.checklist&&!this.querySelector('[slot="checklist"]')){let e=document.createElement("ul");e.slot="checklist";let i=Array.isArray(t.checklist)?t.checklist:[t.checklist];for(let o of i){let s=document.createElement("li");s.textContent=String(o),e.appendChild(s)}this.appendChild(e)}}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${c}</style><div class="state-msg">Loading\u2026</div>`;try{let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}`);let o=await i.json();this._applyData(o),this.#t()}catch(i){e.innerHTML=`<style>${c}</style><div class="state-msg state-msg--error">Could not load: ${a(i.message)}</div>`}}#t(){let t=this.shadowRoot,e=h[this.priority]||h.medium,i=m[this.status]||m.backlog,o=this.itemType,s=x[o]||x.task,p=this._detailLevel,f=this.itemId?`Work item: ${a(this.itemId)}`:"Work item";if(p==="minimal"){t.innerHTML=`<style>${c}</style>
365
+ <article class="wi-card wi-card--minimal" role="article" aria-label="${f}"
365
366
  tabindex="0">
366
367
  <div class="wi-body">
367
368
  <div class="wi-meta">
368
- ${this.itemId?`<span class="wi-id">${r(this.itemId)}</span>`:""}
369
- <span class="wi-type" data-type="${r(i)}">${d(o)} ${r(i)}</span>
369
+ ${this.itemId?`<span class="wi-id">${a(this.itemId)}</span>`:""}
370
+ <span class="wi-type" data-type="${a(o)}">${d(s)} ${a(o)}</span>
370
371
  </div>
371
372
  <div class="wi-title-wrap">
372
- <slot name="title"><span class="wi-title-fallback">${r(this._minimalLabel)}</span></slot>
373
+ <slot name="title"><span class="wi-title-fallback">${a(this._minimalLabel)}</span></slot>
373
374
  </div>
374
375
  </div>
375
- </article>`;return}if(this.shadowRoot.innerHTML=`<style>${c}</style>
376
- <article class="wi-card wi-card--${s}" role="article" aria-label="${u}">
376
+ </article>`;return}if(t.innerHTML=`<style>${c}</style>
377
+ <article class="wi-card wi-card--${p}" role="article" aria-label="${f}">
377
378
 
378
379
  <header class="wi-header">
379
380
  <div class="wi-meta">
380
- ${this.itemId?`<span class="wi-id">${r(this.itemId)}</span>`:""}
381
- <span class="wi-type" data-type="${r(i)}">${d(o)} ${r(i)}</span>
381
+ ${this.itemId?`<span class="wi-id">${a(this.itemId)}</span>`:""}
382
+ <span class="wi-type" data-type="${a(o)}">${d(s)} ${a(o)}</span>
382
383
  </div>
383
384
  <div class="wi-badges">
384
- <span class="wi-priority" style="color:${t.color};background:${t.bg}">${r(t.label)}</span>
385
- <span class="wi-status" style="color:${e.color};background:${e.bg}">${r(e.label)}</span>
386
- ${this.estimate?`<span class="wi-estimate" title="Estimate">${r(this.estimate)}</span>`:""}
385
+ <span class="wi-priority" style="color:${e.color};background:${e.bg}">${a(e.label)}</span>
386
+ <span class="wi-status" style="color:${i.color};background:${i.bg}">${a(i.label)}</span>
387
+ ${this.estimate?`<span class="wi-estimate" title="Estimate">${a(this.estimate)}</span>`:""}
387
388
  </div>
388
389
  </header>
389
390
 
@@ -394,13 +395,13 @@ var c=`
394
395
 
395
396
  ${this.assignee?`
396
397
  <div class="wi-assignee">
397
- <span class="wi-assignee__avatar" style="background:${v(this.assignee)}">${b(this.assignee)}</span>
398
- ${r(this.assignee)}
398
+ <span class="wi-assignee__avatar" style="background:${y(this.assignee)}">${b(this.assignee)}</span>
399
+ ${a(this.assignee)}
399
400
  </div>`:""}
400
401
 
401
402
  ${this.storyIds.length?`
402
403
  <div class="wi-links">
403
- ${this.storyIds.map(n=>`<a class="wi-link" href="#${r(n)}">${d('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h10"/>')} ${r(n)}</a>`).join("")}
404
+ ${this.storyIds.map(n=>`<a class="wi-link" href="#${a(n)}">${d('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h10"/>')} ${a(n)}</a>`).join("")}
404
405
  </div>`:""}
405
406
  </div>
406
407
 
@@ -442,5 +443,5 @@ var c=`
442
443
  </div>
443
444
  </div>
444
445
 
445
- </article>`,s==="compact")for(let n of this.shadowRoot.querySelectorAll(".wi-section")){let f=n.querySelector("slot");f&&f.assignedNodes().length===0&&n.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("work-item:ready",{detail:{itemId:this.itemId,title:this.itemTitle,type:i,priority:this.priority,status:this.status},bubbles:!0,composed:!0}))}};w("work-item",m);export{m as WorkItem};
446
+ </article>`,p==="compact")for(let n of t.querySelectorAll(".wi-section")){let g=n.querySelector("slot");g&&g.assignedNodes().length===0&&n.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("work-item:ready",{detail:{itemId:this.itemId,title:this.itemTitle,type:o,priority:this.priority,status:this.status},bubbles:!0,composed:!0}))}};w("work-item",u);export{u as WorkItem};
446
447
  //# sourceMappingURL=work-item.js.map
@@ -1,2 +1,2 @@
1
- var o=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,i,r,n){e.addEventListener(i,r,n),this.#e.push(()=>e.removeEventListener(i,r,n))}setup(){}teardown(){}};var f=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(s,e,i={}){let r=i.priority??10,n={impl:e,bundle:i.bundle,contract:i.contract,priority:r},t=c.get(s);if(customElements.get(s)){if(!t||t.priority>=r){t&&t.priority===r&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=r){t.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${t.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}c.set(s,n),customElements.define(s,e)}var l='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',u={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},a=class extends o{#e;#t;setup(){if(this.#e=this.getAttribute("video-id"),this.#t=this.getAttribute("title")??"Play video",!this.#e)return console.warn("youtube-player: missing required video-id attribute"),!1;this.hasAttribute("autoplay")?this.#i():this.#a()}#n(){let e=new URLSearchParams({autoplay:"1"}),i=this.getAttribute("start");i&&e.set("start",i);let r=this.getAttribute("list");return r&&e.set("list",r),this.getAttribute("params")&&new URLSearchParams(this.getAttribute("params")).forEach((n,t)=>e.set(t,n)),`https://www.youtube-nocookie.com/embed/${this.#e}?${e}`}#o(){let e=this.getAttribute("thumbnail")??"hq";return`https://i.ytimg.com/vi/${this.#e}/${u[e]??"hqdefault"}.jpg`}#a(){this.setAttribute("state","ready"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",`Play ${this.#t}`),this.innerHTML=`<img src="${this.#o()}" alt="" loading="lazy" decoding="async"><button type="button" aria-label="Play ${this.#t}">${l}</button>`,this.addEventListener("click",this.#r,{once:!0}),this.addEventListener("keydown",this.#s)}#r=()=>{this.removeEventListener("keydown",this.#s),this.#i()};#s=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.removeEventListener("click",this.#r),this.#i())};#i(){this.setAttribute("state","active"),this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.innerHTML=`<iframe src="${this.#n()}" title="${this.#t}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>`,this.querySelector("iframe")?.focus()}};d("youtube-player",a);export{a as YouTubePlayer};
1
+ var o=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)}};var f=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function l(s,t,i={}){let e=i.priority??10,n={impl:t,bundle:i.bundle,contract:i.contract,priority:e},r=c.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}c.set(s,n),customElements.define(s,t)}var d='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',u={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},a=class extends o{#e;#t;setup(){return this.#e=this.getAttribute("video-id"),this.#t=this.getAttribute("title")??"Play video",this.#e?(this.hasAttribute("autoplay")?this.#i():this.#a(),!0):(console.warn("youtube-player: missing required video-id attribute"),!1)}#n(){let t=new URLSearchParams({autoplay:"1"}),i=this.getAttribute("start");i&&t.set("start",i);let e=this.getAttribute("list");return e&&t.set("list",e),this.getAttribute("params")&&new URLSearchParams(this.getAttribute("params")||"").forEach((n,r)=>t.set(r,n)),`https://www.youtube-nocookie.com/embed/${this.#e}?${t}`}#o(){let t=this.getAttribute("thumbnail")??"hq";return`https://i.ytimg.com/vi/${this.#e}/${u[t]??"hqdefault"}.jpg`}#a(){this.setAttribute("state","ready"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",`Play ${this.#t}`),this.innerHTML=`<img src="${this.#o()}" alt="" loading="lazy" decoding="async"><button type="button" aria-label="Play ${this.#t}">${d}</button>`,this.addEventListener("click",this.#r,{once:!0}),this.addEventListener("keydown",this.#s)}#r=()=>{this.removeEventListener("keydown",this.#s),this.#i()};#s=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.removeEventListener("click",this.#r),this.#i())};#i(){this.setAttribute("state","active"),this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.innerHTML=`<iframe src="${this.#n()}" title="${this.#t}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>`,this.querySelector("iframe")?.focus()}};l("youtube-player",a);export{a as YouTubePlayer};
2
2
  //# sourceMappingURL=youtube-player.js.map