vanilla-breeze 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/custom-elements.json +25084 -6649
  2. package/dist/cdn/components/accessibility-specimen.js +11 -0
  3. package/dist/cdn/components/accordion-wc.js +1 -1
  4. package/dist/cdn/components/activity-feed.js +2 -0
  5. package/dist/cdn/components/adr-wc.js +17 -17
  6. package/dist/cdn/components/ai-chat.js +28 -0
  7. package/dist/cdn/components/ai-summary.js +10 -0
  8. package/dist/cdn/components/analytics-panel.js +5 -5
  9. package/dist/cdn/components/audio-player.js +3 -3
  10. package/dist/cdn/components/audio-visualizer.js +2 -2
  11. package/dist/cdn/components/author-index.js +2 -2
  12. package/dist/cdn/components/brand-mark.js +1 -1
  13. package/dist/cdn/components/bread-crumb.js +2 -0
  14. package/dist/cdn/components/breakpoint-specimen.js +26 -0
  15. package/dist/cdn/components/burndown-chart.js +2 -0
  16. package/dist/cdn/components/calendar-wc.js +2 -2
  17. package/dist/cdn/components/capacity-plan.js +25 -0
  18. package/dist/cdn/components/card-list.js +1 -1
  19. package/dist/cdn/components/carousel-wc.js +1 -1
  20. package/dist/cdn/components/change-set.js +2 -2
  21. package/dist/cdn/components/chart-wc.js +58 -36
  22. package/dist/cdn/components/chat-input.js +1 -1
  23. package/dist/cdn/components/chat-window.js +1 -1
  24. package/dist/cdn/components/color-palette.js +9 -9
  25. package/dist/cdn/components/color-picker.js +1 -1
  26. package/dist/cdn/components/combo-box.js +1 -1
  27. package/dist/cdn/components/command-palette.js +1 -1
  28. package/dist/cdn/components/comment-box.js +60 -0
  29. package/dist/cdn/components/comment-thread.js +60 -0
  30. package/dist/cdn/components/comment-wc.js +1 -1
  31. package/dist/cdn/components/compare-surface.js +1 -1
  32. package/dist/cdn/components/component-sampler.js +2 -2
  33. package/dist/cdn/components/consent-banner.js +1 -1
  34. package/dist/cdn/components/content-lens.js +1 -1
  35. package/dist/cdn/components/content-swap.js +1 -1
  36. package/dist/cdn/components/context-menu.js +1 -1
  37. package/dist/cdn/components/data-table.js +1 -1
  38. package/dist/cdn/components/date-picker.js +1 -1
  39. package/dist/cdn/components/day-view.js +1 -1
  40. package/dist/cdn/components/diagram-wc.js +3 -0
  41. package/dist/cdn/components/drag-surface.js +1 -1
  42. package/dist/cdn/components/drop-down.js +1 -1
  43. package/dist/cdn/components/emoji-picker.js +1 -1
  44. package/dist/cdn/components/empathy-map.js +41 -43
  45. package/dist/cdn/components/flow-diagram.js +1 -1
  46. package/dist/cdn/components/font-pairer.js +81 -81
  47. package/dist/cdn/components/foot-notes.js +1 -1
  48. package/dist/cdn/components/form-field.js +1 -1
  49. package/dist/cdn/components/gantt-chart.js +1 -1
  50. package/dist/cdn/components/geo-map.js +25 -23
  51. package/dist/cdn/components/glossary-index.js +1 -1
  52. package/dist/cdn/components/glossary-wc.js +1 -1
  53. package/dist/cdn/components/gradient-builder.js +29 -29
  54. package/dist/cdn/components/heading-links.js +1 -1
  55. package/dist/cdn/components/highlight-wc.js +2 -2
  56. package/dist/cdn/components/icon-wc.js +4 -4
  57. package/dist/cdn/components/image-gallery.js +1 -1
  58. package/dist/cdn/components/image-map.js +1 -1
  59. package/dist/cdn/components/impact-effort.js +1 -1
  60. package/dist/cdn/components/include-file.js +1 -1
  61. package/dist/cdn/components/iron-triangle.js +2 -0
  62. package/dist/cdn/components/kanban-board.js +1 -1
  63. package/dist/cdn/components/layout-specimen.js +35 -0
  64. package/dist/cdn/components/manifest.json +227 -103
  65. package/dist/cdn/components/markdown-editor.js +1 -1
  66. package/dist/cdn/components/markdown-viewer.js +12 -12
  67. package/dist/cdn/components/motion-specimen.js +12 -12
  68. package/dist/cdn/components/nav-bar.js +2 -0
  69. package/dist/cdn/components/note-wc.js +2 -2
  70. package/dist/cdn/components/notification-wc.js +4 -4
  71. package/dist/cdn/components/page-info.js +4 -4
  72. package/dist/cdn/components/page-stats.js +1 -1
  73. package/dist/cdn/components/page-toc.js +1 -1
  74. package/dist/cdn/components/page-tools.js +1 -1
  75. package/dist/cdn/components/page-tour.js +6 -6
  76. package/dist/cdn/components/pager-wc.js +2 -0
  77. package/dist/cdn/components/palette-generator.js +11 -11
  78. package/dist/cdn/components/poll-wc.js +2 -0
  79. package/dist/cdn/components/pop-over.js +2 -0
  80. package/dist/cdn/components/popularity-index.js +2 -2
  81. package/dist/cdn/components/print-page.js +1 -1
  82. package/dist/cdn/components/product-roadmap.js +3 -0
  83. package/dist/cdn/components/progress-tracker.js +2 -0
  84. package/dist/cdn/components/qr-code.js +1 -1
  85. package/dist/cdn/components/quadrant-grid.js +3 -0
  86. package/dist/cdn/components/quality-target.js +12 -0
  87. package/dist/cdn/components/reaction-bar.js +2 -0
  88. package/dist/cdn/components/reader-view.js +3 -3
  89. package/dist/cdn/components/reading-progress.js +2 -0
  90. package/dist/cdn/components/recently-visited.js +10 -10
  91. package/dist/cdn/components/requirement-card.js +122 -0
  92. package/dist/cdn/components/review-surface.js +34 -40
  93. package/dist/cdn/components/risk-register.js +25 -0
  94. package/dist/cdn/components/roadmap.js +3 -0
  95. package/dist/cdn/components/score-card.js +197 -0
  96. package/dist/cdn/components/selection-menu.js +1 -1
  97. package/dist/cdn/components/semantic-palette.js +15 -15
  98. package/dist/cdn/components/settings-panel.js +12 -12
  99. package/dist/cdn/components/share-wc.js +2 -2
  100. package/dist/cdn/components/short-cuts.js +1 -1
  101. package/dist/cdn/components/site-index.js +4 -4
  102. package/dist/cdn/components/site-map-wc.js +1 -1
  103. package/dist/cdn/components/site-map.js +1 -1
  104. package/dist/cdn/components/site-search.js +9 -9
  105. package/dist/cdn/components/slide-accept.js +1 -1
  106. package/dist/cdn/components/social-embed.js +1 -1
  107. package/dist/cdn/components/spacing-specimen.js +5 -5
  108. package/dist/cdn/components/split-surface.js +1 -1
  109. package/dist/cdn/components/star-rating.js +1 -1
  110. package/dist/cdn/components/status-wc.js +2 -0
  111. package/dist/cdn/components/stepper-wc.js +2 -0
  112. package/dist/cdn/components/story-map.js +1 -1
  113. package/dist/cdn/components/tab-set.js +1 -1
  114. package/dist/cdn/components/text-reader.js +2 -2
  115. package/dist/cdn/components/theme-catalog.js +28 -0
  116. package/dist/cdn/components/theme-export.js +20 -12
  117. package/dist/cdn/components/theme-import.js +44 -0
  118. package/dist/cdn/components/theme-picker.js +29 -26
  119. package/dist/cdn/components/time-index.js +2 -2
  120. package/dist/cdn/components/time-picker.js +1 -1
  121. package/dist/cdn/components/toast-msg.js +3 -3
  122. package/dist/cdn/components/token-specimen.js +14 -14
  123. package/dist/cdn/components/tool-tip.js +1 -1
  124. package/dist/cdn/components/topic-map.js +3 -3
  125. package/dist/cdn/components/traceability-matrix.js +3 -0
  126. package/dist/cdn/components/trust-filter.js +3 -3
  127. package/dist/cdn/components/type-specimen.js +15 -15
  128. package/dist/cdn/components/user-journey.js +63 -70
  129. package/dist/cdn/components/user-persona.js +75 -13
  130. package/dist/cdn/components/user-story.js +12 -11
  131. package/dist/cdn/components/version-switcher.js +17 -0
  132. package/dist/cdn/components/video-player.js +3 -3
  133. package/dist/cdn/components/watch-wc.js +2 -2
  134. package/dist/cdn/components/week-view.js +1 -1
  135. package/dist/cdn/components/work-item.js +29 -28
  136. package/dist/cdn/components/youtube-player.js +1 -1
  137. package/dist/cdn/icons/bold.css +17 -0
  138. package/dist/cdn/icons/bold.json +1 -0
  139. package/dist/cdn/icons/custom.css +6 -0
  140. package/dist/cdn/icons/custom.json +1 -0
  141. package/dist/cdn/icons/lucide.css +1914 -0
  142. package/dist/cdn/icons/lucide.json +1 -0
  143. package/dist/cdn/icons/mage.css +17 -0
  144. package/dist/cdn/icons/mage.json +1 -0
  145. package/dist/cdn/icons/phosphor.css +17 -0
  146. package/dist/cdn/icons/phosphor.json +1 -0
  147. package/dist/cdn/icons/tabler.css +17 -0
  148. package/dist/cdn/icons/tabler.json +1 -0
  149. package/dist/cdn/packs/design-system.full.js +59 -51
  150. package/dist/cdn/packs/effects.full.js +1 -1
  151. package/dist/cdn/packs/icons.effects.js +1 -1
  152. package/dist/cdn/packs/icons.full.js +1 -1
  153. package/dist/cdn/packs/kawaii.full.css +1 -1
  154. package/dist/cdn/packs/kawaii.full.js +6 -6
  155. package/dist/cdn/packs/kawaii.theme.css +1 -1
  156. package/dist/cdn/packs/manifest.json +11 -11
  157. package/dist/cdn/packs/ui.full.css +1 -1
  158. package/dist/cdn/packs/ui.full.js +54 -51
  159. package/dist/cdn/packs/ux-planning.full.css +1 -1
  160. package/dist/cdn/packs/ux-planning.full.js +318 -243
  161. package/dist/cdn/themes/8bit.css +1 -1
  162. package/dist/cdn/themes/8bit.tokens.json +662 -0
  163. package/dist/cdn/themes/alpha1999-dark.tokens.json +693 -0
  164. package/dist/cdn/themes/alpha1999.css +1 -1
  165. package/dist/cdn/themes/alpha1999.tokens.json +869 -0
  166. package/dist/cdn/themes/anthropic.css +2 -0
  167. package/dist/cdn/themes/anthropic.tokens.json +564 -0
  168. package/dist/cdn/themes/art-deco-dark.tokens.json +407 -0
  169. package/dist/cdn/themes/art-deco.css +1 -1
  170. package/dist/cdn/themes/art-deco.tokens.json +581 -0
  171. package/dist/cdn/themes/bauhaus-dark.tokens.json +260 -0
  172. package/dist/cdn/themes/bauhaus.css +1 -1
  173. package/dist/cdn/themes/bauhaus.tokens.json +589 -0
  174. package/dist/cdn/themes/brutalist-dark.tokens.json +503 -0
  175. package/dist/cdn/themes/brutalist.tokens.json +677 -0
  176. package/dist/cdn/themes/catalog/atlassian.tokens.json +303 -0
  177. package/dist/cdn/themes/catalog/bootstrap.tokens.json +304 -0
  178. package/dist/cdn/themes/catalog/carbon.tokens.json +301 -0
  179. package/dist/cdn/themes/catalog/catppuccin-mocha.tokens.json +301 -0
  180. package/dist/cdn/themes/catalog/govuk.tokens.json +301 -0
  181. package/dist/cdn/themes/catalog/manifest.json +132 -0
  182. package/dist/cdn/themes/catalog/material.tokens.json +289 -0
  183. package/dist/cdn/themes/catalog/salesforce.tokens.json +301 -0
  184. package/dist/cdn/themes/catalog/tailwind.tokens.json +302 -0
  185. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  186. package/dist/cdn/themes/catppuccin-frappe.tokens.json +608 -0
  187. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +472 -0
  188. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  189. package/dist/cdn/themes/catppuccin-latte.tokens.json +608 -0
  190. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  191. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +608 -0
  192. package/dist/cdn/themes/catppuccin-mocha.tokens.json +608 -0
  193. package/dist/cdn/themes/classic-dark.tokens.json +503 -0
  194. package/dist/cdn/themes/classic.tokens.json +640 -0
  195. package/dist/cdn/themes/claymorphism-dark.tokens.json +493 -0
  196. package/dist/cdn/themes/claymorphism.css +1 -1
  197. package/dist/cdn/themes/claymorphism.tokens.json +626 -0
  198. package/dist/cdn/themes/clinical-dark.tokens.json +472 -0
  199. package/dist/cdn/themes/clinical.tokens.json +608 -0
  200. package/dist/cdn/themes/cottagecore-dark.tokens.json +412 -0
  201. package/dist/cdn/themes/cottagecore.css +1 -1
  202. package/dist/cdn/themes/cottagecore.tokens.json +544 -0
  203. package/dist/cdn/themes/cyber.tokens.json +668 -0
  204. package/dist/cdn/themes/dawn-dark.tokens.json +472 -0
  205. package/dist/cdn/themes/dawn.css +1 -1
  206. package/dist/cdn/themes/dawn.tokens.json +608 -0
  207. package/dist/cdn/themes/dracula.tokens.json +534 -0
  208. package/dist/cdn/themes/dusk.tokens.json +533 -0
  209. package/dist/cdn/themes/editorial-dark.tokens.json +400 -0
  210. package/dist/cdn/themes/editorial.tokens.json +690 -0
  211. package/dist/cdn/themes/financial-dark.tokens.json +472 -0
  212. package/dist/cdn/themes/financial.css +1 -1
  213. package/dist/cdn/themes/financial.tokens.json +607 -0
  214. package/dist/cdn/themes/genai.tokens.json +534 -0
  215. package/dist/cdn/themes/glassmorphism-dark.tokens.json +489 -0
  216. package/dist/cdn/themes/glassmorphism.css +1 -1
  217. package/dist/cdn/themes/glassmorphism.tokens.json +632 -0
  218. package/dist/cdn/themes/government-dark.tokens.json +472 -0
  219. package/dist/cdn/themes/government.tokens.json +608 -0
  220. package/dist/cdn/themes/gruvbox-dark.tokens.json +472 -0
  221. package/dist/cdn/themes/gruvbox.tokens.json +608 -0
  222. package/dist/cdn/themes/high-noon-dark.tokens.json +397 -0
  223. package/dist/cdn/themes/high-noon.tokens.json +533 -0
  224. package/dist/cdn/themes/ibm.css +2 -0
  225. package/dist/cdn/themes/ibm.tokens.json +568 -0
  226. package/dist/cdn/themes/kawaii-dark.tokens.json +549 -0
  227. package/dist/cdn/themes/kawaii.css +1 -1
  228. package/dist/cdn/themes/kawaii.tokens.json +641 -0
  229. package/dist/cdn/themes/magna-dark.tokens.json +482 -0
  230. package/dist/cdn/themes/magna.css +1 -1
  231. package/dist/cdn/themes/magna.tokens.json +632 -0
  232. package/dist/cdn/themes/manifest.json +162 -62
  233. package/dist/cdn/themes/mcdonalds.css +2 -0
  234. package/dist/cdn/themes/mcdonalds.tokens.json +533 -0
  235. package/dist/cdn/themes/midnight.tokens.json +534 -0
  236. package/dist/cdn/themes/minimal-dark.tokens.json +294 -0
  237. package/dist/cdn/themes/minimal.tokens.json +494 -0
  238. package/dist/cdn/themes/modern-dark.tokens.json +490 -0
  239. package/dist/cdn/themes/modern.tokens.json +573 -0
  240. package/dist/cdn/themes/nes-dark.tokens.json +564 -0
  241. package/dist/cdn/themes/nes.css +1 -1
  242. package/dist/cdn/themes/nes.tokens.json +687 -0
  243. package/dist/cdn/themes/neumorphism-dark.tokens.json +471 -0
  244. package/dist/cdn/themes/neumorphism.css +1 -1
  245. package/dist/cdn/themes/neumorphism.tokens.json +589 -0
  246. package/dist/cdn/themes/nord-dark.tokens.json +484 -0
  247. package/dist/cdn/themes/nord.tokens.json +619 -0
  248. package/dist/cdn/themes/organic-dark.tokens.json +532 -0
  249. package/dist/cdn/themes/organic.tokens.json +685 -0
  250. package/dist/cdn/themes/rose-pine-dark.tokens.json +472 -0
  251. package/dist/cdn/themes/rose-pine.tokens.json +608 -0
  252. package/dist/cdn/themes/rough-dark.tokens.json +515 -0
  253. package/dist/cdn/themes/rough.css +1 -1
  254. package/dist/cdn/themes/rough.tokens.json +650 -0
  255. package/dist/cdn/themes/solarized-dark.tokens.json +397 -0
  256. package/dist/cdn/themes/solarized.tokens.json +532 -0
  257. package/dist/cdn/themes/starbucks.css +2 -0
  258. package/dist/cdn/themes/starbucks.tokens.json +593 -0
  259. package/dist/cdn/themes/startup-dark.tokens.json +522 -0
  260. package/dist/cdn/themes/startup.css +1 -1
  261. package/dist/cdn/themes/startup.tokens.json +607 -0
  262. package/dist/cdn/themes/super2026-dark.tokens.json +667 -0
  263. package/dist/cdn/themes/super2026.tokens.json +863 -0
  264. package/dist/cdn/themes/swiss-dark.tokens.json +390 -0
  265. package/dist/cdn/themes/swiss.tokens.json +750 -0
  266. package/dist/cdn/themes/terminal.css +1 -1
  267. package/dist/cdn/themes/terminal.tokens.json +689 -0
  268. package/dist/cdn/themes/tokyo-night-dark.tokens.json +472 -0
  269. package/dist/cdn/themes/tokyo-night.tokens.json +608 -0
  270. package/dist/cdn/themes/vaporwave-dark.tokens.json +413 -0
  271. package/dist/cdn/themes/vaporwave.tokens.json +549 -0
  272. package/dist/cdn/themes/win9x-dark.tokens.json +563 -0
  273. package/dist/cdn/themes/win9x.tokens.json +700 -0
  274. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  275. package/dist/cdn/vanilla-breeze-charts.js +58 -36
  276. package/dist/cdn/vanilla-breeze-core.css +1 -1
  277. package/dist/cdn/vanilla-breeze-core.js +246 -51
  278. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  279. package/dist/cdn/vanilla-breeze-extras.js +90 -80
  280. package/dist/cdn/vanilla-breeze.css +1 -1
  281. package/dist/cdn/vanilla-breeze.js +1370 -405
  282. package/package.json +12 -4
@@ -1,4 +1,4 @@
1
- var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;function x(d,t,e={}){let s=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:s},a=mt.get(d);if(customElements.get(d)){if(!a||a.priority>=s){a&&a.priority===s&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${d}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${d}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=s){a.priority===s&&console.warn(`[VB Bundle] Tag <${d}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}mt.set(d,r),customElements.define(d,t)}var A=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 t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,r){t.addEventListener(e,s,r),this.#t.push(()=>t.removeEventListener(e,s,r))}setup(){}teardown(){}};var F=class d extends A{#t=null;#e=null;#s=!1;#r=null;setup(){this.setAttribute("role","list"),this.#s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#o(),this.#l(),this.#v(),this.#a()}teardown(){this.#t&&(this.#t.remove(),this.#t=null),d.#A?.source===this&&(d.#A=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#a(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#o(){this.#t=document.createElement("div"),this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.#t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#t)}#i(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#l(){this.listen(this,"pointerdown",t=>{this.#r=t.target}),this.listen(this,"dragstart",this.#n.bind(this)),this.listen(this,"dragover",this.#c.bind(this)),this.listen(this,"dragleave",this.#d.bind(this)),this.listen(this,"drop",this.#b.bind(this)),this.listen(this,"dragend",this.#p.bind(this))}#n(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let s=e.querySelector("[data-drag-handle]");if(s&&!s.contains(this.#r)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let r=this.#u(e);d.#A={item:e,source:this,originalIndex:r},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#c(t){let e=d.#A;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let s=this.orientation==="horizontal"?t.clientX:t.clientY;this.#q(s)}#d(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#k())}#b(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#k();let e=d.#A;if(!e)return;let{item:s,source:r,originalIndex:a}=e,i=this.orientation==="horizontal"?t.clientX:t.clientY,o=this.#w(i);if(r===this){this.#_(s,o),this.#f();let n=this.#u(s);this.#m(s),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:s,itemId:s.dataset.id,oldIndex:a,newIndex:n,order:this.sortedOrder}}))}else this.#_(s,o),this.#f(),r.#f(),this.#m(s),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:s,itemId:s.dataset.id,fromSurface:r,toSurface:this,newIndex:this.#u(s),fromOrder:r.sortedOrder,toOrder:this.sortedOrder}}))}#p(){let t=d.#A;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#k(),d.#A=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#v(){this.listen(this,"keydown",this.#y.bind(this))}#y(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let s=e.getAttribute("aria-grabbed")==="true",r=this.orientation==="horizontal",a=r?"ArrowLeft":"ArrowUp",i=r?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),s){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#f(),this.#m(e);let c=this.#u(e),l=this.draggableChildren;this.#i(`${this.#g(e)}, dropped at position ${c+1} of ${l.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#e,newIndex:c,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null}else{this.#e=this.#u(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let c=this.draggableChildren;this.#i(`${this.#g(e)}, grabbed. Position ${this.#e+1} of ${c.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!s&&(t.key===a||t.key===i)){t.preventDefault();let c=this.draggableChildren,l=c.indexOf(e),h=t.key===a?Math.max(0,l-1):Math.min(c.length-1,l+1);h!==l&&c[h].focus();return}if(s&&(t.key===a||t.key===i)){t.preventDefault();let c=this.draggableChildren,l=c.indexOf(e),h=t.key===a?Math.max(0,l-1):Math.min(c.length-1,l+1);h!==l&&(this.#_(e,h),e.focus(),this.#i(`Position ${h+1} of ${c.length}`));return}let o=r?"ArrowUp":"ArrowLeft",n=r?"ArrowDown":"ArrowRight";if(s&&(t.key===o||t.key===n)){if(t.preventDefault(),!this.group)return;let c=t.key===n?1:-1,l=this.#x(c);if(!l)return;l.appendChild(e),l.#f(),this.#f(),l.#m(e),e.focus();let h=l.getAttribute("aria-label")||"next surface";l.#i(`Moved to ${h}`),l.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:l,newIndex:l.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:l.sortedOrder}})),this.removeAttribute("data-reorder-mode"),l.setAttribute("data-reorder-mode",""),this.#e=null;return}if(s&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#e!=null&&(this.#_(e,this.#e),e.focus()),this.#i("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null;return}!s&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#m(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#x(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((a,i)=>{let o=a.getBoundingClientRect(),n=i.getBoundingClientRect();return o.left-n.left||o.top-n.top});let s=e.indexOf(this);return e[s+t]||null}#g(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#u(t){return this.draggableChildren.indexOf(t)}#_(t,e){let r=this.draggableChildren.filter(a=>a!==t)[e]||null;r?this.insertBefore(t,r):this.appendChild(t)}#f(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#w(t){let e=this.orientation==="horizontal",s=this.draggableChildren.filter(r=>!r.hasAttribute("data-dragging"));for(let r=0;r<s.length;r++){let a=s[r].getBoundingClientRect(),i=e?a.left+a.width/2:a.top+a.height/2;if(t<i)return r}return s.length}#q(t){this.#k();let e=this.orientation==="horizontal",s=this.draggableChildren.filter(r=>!r.hasAttribute("data-dragging"));for(let r=0;r<s.length;r++){let a=s[r].getBoundingClientRect(),i=e?a.left+a.width/2:a.top+a.height/2;if(t<i){s[r].setAttribute("data-drop-target","before");return}}s.length>0&&s[s.length-1].setAttribute("data-drop-target","after")}#k(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#A=null};x("drag-surface",F);var ft=`
1
+ var pe=window.matchMedia("(prefers-reduced-motion: reduce)");var St=new Map;function x(c,t,e={}){let r=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:r},a=St.get(c);if(customElements.get(c)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> 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 <${c}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}St.set(c,s),customElements.define(c,t)}var C=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,s){t.addEventListener(e,r,s),this.#e.push(()=>t.removeEventListener(e,r,s))}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 s=`--${t}`;e?r.add(s):r.delete(s)}}_adoptInternals(t){this.#t||(this.#t=t)}};var J=class c extends C{#e=null;#t=null;#r=!1;#i=null;setup(){this.setAttribute("role","list"),this.#r=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#o(),this.#n(),this.#f(),this.#s()}teardown(){this.#e&&(this.#e.remove(),this.#e=null),c.#_?.source===this&&(c.#_=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#s(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#o(){this.#e=document.createElement("div"),this.#e.setAttribute("role","status"),this.#e.setAttribute("aria-live","polite"),this.#e.setAttribute("aria-atomic","true"),this.#e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#e)}#a(t){let e=this.#e;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#n(){this.listen(this,"pointerdown",t=>{this.#i=t.target}),this.listen(this,"dragstart",this.#c.bind(this)),this.listen(this,"dragover",this.#d.bind(this)),this.listen(this,"dragleave",this.#b.bind(this)),this.listen(this,"drop",this.#m.bind(this)),this.listen(this,"dragend",this.#u.bind(this))}#c(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let r=e.querySelector("[data-drag-handle]");if(r&&!r.contains(this.#i)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#g(e);c.#_={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#d(t){let e=c.#_;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let r=this.orientation==="horizontal"?t.clientX:t.clientY;this.#w(r)}#b(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#A())}#m(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#A();let e=c.#_;if(!e)return;let{item:r,source:s,originalIndex:a}=e,i=this.orientation==="horizontal"?t.clientX:t.clientY,o=this.#k(i);if(s===this){this.#p(r,o),this.#x();let n=this.#g(r);this.#l(r),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:r,itemId:r.dataset.id,oldIndex:a,newIndex:n,order:this.sortedOrder}}))}else this.#p(r,o),this.#x(),s.#x(),this.#l(r),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:r,itemId:r.dataset.id,fromSurface:s,toSurface:this,newIndex:this.#g(r),fromOrder:s.sortedOrder,toOrder:this.sortedOrder}}))}#u(){let t=c.#_;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#A(),c.#_=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#f(){this.listen(this,"keydown",this.#v.bind(this))}#v(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let r=e.getAttribute("aria-grabbed")==="true",s=this.orientation==="horizontal",a=s?"ArrowLeft":"ArrowUp",i=s?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),r){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#x(),this.#l(e);let l=this.#g(e),d=this.draggableChildren;this.#a(`${this.#y(e)}, dropped at position ${l+1} of ${d.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#t,newIndex:l,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#t=null}else{this.#t=this.#g(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let l=this.draggableChildren;this.#a(`${this.#y(e)}, grabbed. Position ${this.#t+1} of ${l.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!r&&(t.key===a||t.key===i)){t.preventDefault();let l=this.draggableChildren,d=l.indexOf(e),p=t.key===a?Math.max(0,d-1):Math.min(l.length-1,d+1);p!==d&&l[p].focus();return}if(r&&(t.key===a||t.key===i)){t.preventDefault();let l=this.draggableChildren,d=l.indexOf(e),p=t.key===a?Math.max(0,d-1):Math.min(l.length-1,d+1);p!==d&&(this.#p(e,p),e.focus(),this.#a(`Position ${p+1} of ${l.length}`));return}let o=s?"ArrowUp":"ArrowLeft",n=s?"ArrowDown":"ArrowRight";if(r&&(t.key===o||t.key===n)){if(t.preventDefault(),!this.group)return;let l=t.key===n?1:-1,d=this.#h(l);if(!d)return;d.appendChild(e),d.#x(),this.#x(),d.#l(e),e.focus();let p=d.getAttribute("aria-label")||"next surface";d.#a(`Moved to ${p}`),d.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:d,newIndex:d.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:d.sortedOrder}})),this.removeAttribute("data-reorder-mode"),d.setAttribute("data-reorder-mode",""),this.#t=null;return}if(r&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#t!=null&&(this.#p(e,this.#t),e.focus()),this.#a("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#t=null;return}!r&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#l(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#h(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((a,i)=>{let o=a.getBoundingClientRect(),n=i.getBoundingClientRect();return o.left-n.left||o.top-n.top});let r=e.indexOf(this);return e[r+t]||null}#y(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#g(t){return this.draggableChildren.indexOf(t)}#p(t,e){let s=this.draggableChildren.filter(a=>a!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#x(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#k(t){let e=this.orientation==="horizontal",r=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<r.length;s++){let a=r[s].getBoundingClientRect(),i=e?a.left+a.width/2:a.top+a.height/2;if(t<i)return s}return r.length}#w(t){this.#A();let e=this.orientation==="horizontal",r=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<r.length;s++){let a=r[s].getBoundingClientRect(),i=e?a.left+a.width/2:a.top+a.height/2;if(t<i){r[s].setAttribute("data-drop-target","before");return}}r.length>0&&r[r.length-1].setAttribute("data-drop-target","after")}#A(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#_=null};x("drag-surface",J);var $t=`
2
2
  :host {
3
3
  display: block;
4
4
  font-family: var(--user-persona-font, var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif));
@@ -13,6 +13,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
13
13
  --_goals: var(--user-persona-goals, #22c55e);
14
14
  --_frustrations: var(--user-persona-frustrations, #ef4444);
15
15
  --_behaviors: var(--user-persona-behaviors, #8b5cf6);
16
+ --_stories: var(--user-persona-stories, #3b82f6);
16
17
  --_shadow: var(--user-persona-shadow, var(--shadow-md));
17
18
  --_space-2xs: var(--user-persona-space-2xs, var(--size-2xs, 0.25rem));
18
19
  --_space-xs: var(--user-persona-space-xs, var(--size-xs, 0.5rem));
@@ -197,6 +198,53 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
197
198
  .section-icon.goals { background: var(--_goals); }
198
199
  .section-icon.frustrations { background: var(--_frustrations); }
199
200
  .section-icon.behaviors { background: var(--_behaviors); }
201
+ .section-icon.stories { background: var(--_stories); }
202
+
203
+ /* Stories section \u2014 auto-rendered list of related <user-story> elements */
204
+ .section-count {
205
+ margin-inline-start: var(--_space-2xs);
206
+ padding: 0.05em 0.5ch;
207
+ border-radius: 999px;
208
+ background: var(--color-surface-raised, oklch(95% 0 0));
209
+ color: var(--color-text-muted);
210
+ font-size: 0.75em;
211
+ font-weight: 600;
212
+ }
213
+ .story-list {
214
+ list-style: none;
215
+ margin: 0;
216
+ padding: 0;
217
+ display: grid;
218
+ gap: var(--_space-2xs);
219
+ }
220
+ .story-item {
221
+ display: flex;
222
+ align-items: center;
223
+ gap: var(--_space-s);
224
+ padding-block: var(--_space-2xs);
225
+ border-block-end: 1px solid var(--color-border-muted, var(--color-border, #e5e7eb));
226
+ }
227
+ .story-item:last-child { border-block-end: none; }
228
+ .story-item a {
229
+ color: var(--color-interactive, currentColor);
230
+ text-decoration: none;
231
+ flex: 1;
232
+ }
233
+ .story-item a:hover { text-decoration: underline; }
234
+ .story-meta {
235
+ font-size: var(--_font-xs);
236
+ color: var(--color-text-muted);
237
+ text-transform: uppercase;
238
+ letter-spacing: 0.05em;
239
+ padding: 0 0.5ch;
240
+ border: 1px solid var(--color-border-muted, var(--color-border, #e5e7eb));
241
+ border-radius: var(--_radius-m);
242
+ }
243
+ .empty-stories {
244
+ margin: 0;
245
+ color: var(--color-text-muted);
246
+ font-style: italic;
247
+ }
200
248
 
201
249
  .section-title {
202
250
  font-size: var(--_font-sm);
@@ -246,33 +294,45 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
246
294
  transition: none !important;
247
295
  }
248
296
  }
249
- `;function m(d){return String(d).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function E(d){return d.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function S(d){let t=0;for(let s=0;s<d.length;s++)t=d.charCodeAt(s)+((t<<5)-t);return`hsl(${(t%360+360)%360}, 65%, 55%)`}function y(d){return`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${d}</svg>`}var _={user:'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',check:'<path d="M20 6 9 17l-5-5"/>',target:'<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',alertTriangle:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',messageCircle:'<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"/>',lightbulb:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',wrench:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',heart:'<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/>',mapPin:'<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/>',checkCircle:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',send:'<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/>'},V={says:{label:"Says",icon:_.messageCircle,color:"#3b82f6"},thinks:{label:"Thinks",icon:_.lightbulb,color:"#8b5cf6"},does:{label:"Does",icon:_.wrench,color:"#f59e0b"},feels:{label:"Feels",icon:_.heart,color:"#ef4444"}},C={delighted:{emoji:"\u{1F604}",score:.95,color:"#16a34a"},satisfied:{emoji:"\u{1F60A}",score:.8,color:"#22c55e"},hopeful:{emoji:"\u{1F642}",score:.68,color:"#84cc16"},curious:{emoji:"\u{1F914}",score:.55,color:"#eab308"},neutral:{emoji:"\u{1F610}",score:.5,color:"#94a3b8"},uncertain:{emoji:"\u{1F615}",score:.4,color:"#f97316"},confused:{emoji:"\u{1F635}",score:.3,color:"#fb923c"},frustrated:{emoji:"\u{1F624}",score:.18,color:"#ef4444"},angry:{emoji:"\u{1F620}",score:.05,color:"#dc2626"}};var St="https://cdn.jsdelivr.net/gh/faker-js/assets-person-portrait",N=[32,64,128,256,512];function $t(d){let t=0;for(let e=0;e<d.length;e++)t=d.charCodeAt(e)+((t<<5)-t);return t}function qt(d){let t=N[0],e=Math.abs(d-t);for(let s=1;s<N.length;s++){let r=Math.abs(d-N[s]);r<e&&(t=N[s],e=r)}return t}function bt(d,t=128){let e=$t(String(d)),s=(e%100+100)%100,r=(e>>>16&1)===0?"female":"male",a=qt(t);return`${St}/${r}/${a}/${s}.jpg`}function W(d){let t=0;for(let e=0;e<d.length;e++)t=d.charCodeAt(e)+((t<<5)-t);return t}var It=["Sarah Chen","Marcus Johnson","Aisha Patel","James O'Brien","Yuki Tanaka","Elena Rodriguez","David Kim","Fatima Al-Hassan","Lucas Silva","Priya Sharma","Noah Williams","Mei Lin","Carlos Mendez","Amara Osei","Henrik Larsson","Zara Ahmed"],zt=["Product Manager","UX Designer","Frontend Developer","Data Analyst","Marketing Lead","QA Engineer","DevOps Lead","Content Strategist","Startup Founder","IT Director","Customer Success Lead","Research Scientist"],Tt=["San Francisco, CA","Austin, TX","London, UK","Toronto, CA","Berlin, DE","Tokyo, JP","Sydney, AU","S\xE3o Paulo, BR"],Nt=["I need tools that help me stay organized without slowing me down.","The dashboard is where I live \u2014 it has to be fast and reliable.","I want to understand the data, not fight the interface.","If it takes more than two clicks, I\u2019ll find another way.","Collaboration shouldn\u2019t mean endless notification noise.","I just want it to work the way I expect it to.","Give me the big picture first, then let me drill into details.","Accessibility isn\u2019t a nice-to-have \u2014 it\u2019s how I use the web."],Mt=["Streamline daily workflows","Reduce context-switching","Stay aligned with the team","Make data-driven decisions quickly","Ship features on a predictable cadence","Automate repetitive tasks","Improve onboarding experience","Keep documentation up to date"],Lt=["Too many disconnected tools","Slow page loads break focus","Unclear ownership of tasks","Settings that reset unexpectedly","Notifications that bury important updates","Poor mobile experience","Inconsistent design across features","No offline support"],jt=["Checks dashboards every morning","Prefers keyboard shortcuts over mouse","Skims docs, reads deeply only when stuck","Shares screenshots in Slack","Batches email to twice a day","Tests features in incognito first","Bookmarks frequently used reports","Uses dark mode exclusively"],X=class extends HTMLElement{static get observedAttributes(){return["role","age","location","avatar","compact","src"]}#t=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#e(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&!this.getAttribute(e)&&this.#t.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#t.get(t)||""}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(let r of["role","age","location","avatar"])s[r]&&this.setAttribute(r,s[r]);if(s.name&&!this.querySelector('[slot="name"]')){let r=document.createElement("h2");r.slot="name",r.textContent=s.name,this.appendChild(r)}if(s.quote&&!this.querySelector('[slot="quote"]')){let r=document.createElement("p");r.slot="quote",r.textContent=s.quote,this.appendChild(r)}for(let r of["bio","goals","frustrations","behaviors"])s[r]&&(Array.isArray(s[r])?this.#t.set(r,s[r]):this.#t.set(r,s[r]));this.#r()}catch(e){console.warn(`[user-persona] Failed to load src="${t}":`,e)}}connectedCallback(){this.#e(),this.hasAttribute("data-mock")?this.#s():this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#r(),this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent("persona-ready",{bubbles:!0,composed:!0,detail:{name:this.personaName,role:this.personaRole}}))}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,s){e!==s&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(s):this.#r())}get personaName(){return this.querySelector('[slot="name"]')?.textContent?.trim()||this.#t.get("name")||"Unnamed Persona"}get personaRole(){return this.getAttribute("role")||""}get age(){return this.getAttribute("age")||""}get location(){return this.getAttribute("location")||""}get avatar(){return this.getAttribute("avatar")||""}get quote(){return this.querySelector('[slot="quote"]')?.textContent?.trim()||this.#t.get("quote")||""}get compact(){return this.hasAttribute("compact")}#s(){let t=this.dataset.seed||this.dataset.mock||String(Date.now()),e=a=>a[(W(t+a.length)%a.length+a.length)%a.length],s=(a,i)=>{let o=[];for(let n=0;n<i;n++)o.push(a[(W(t+n+a.length)%a.length+a.length)%a.length]);return[...new Set(o)]};if(!this.querySelector('[slot="name"]')){let a=document.createElement("h2");a.slot="name",a.textContent=e(It),this.appendChild(a)}if(this.getAttribute("role")||this.setAttribute("role",e(zt)),this.getAttribute("age")||this.setAttribute("age",String(25+(W(t)%30+30)%30)),this.getAttribute("location")||this.setAttribute("location",e(Tt)),!this.getAttribute("avatar")){let a=this.querySelector('[slot="name"]')?.textContent?.trim()||"Persona";this.setAttribute("avatar",bt(a,256))}if(!this.querySelector('[slot="quote"]')){let a=document.createElement("p");a.slot="quote",a.textContent=e(Nt),this.appendChild(a)}let r=(a,i)=>{if(this.querySelector(`[slot="${a}"]`))return;let o=document.createElement("ul");o.setAttribute("slot",a);for(let n of i){let c=document.createElement("li");c.textContent=n,o.appendChild(c)}this.appendChild(o)};r("goals",s(Mt,3)),r("frustrations",s(Lt,3)),r("behaviors",s(jt,3))}#r(){let t=this.personaName,e=this.personaRole,s=this.age,r=this.location,a=this.avatar,i=this.quote,o=S(t),n=a?`background:url(${m(a)}) center/cover`:`background:${o}`;this.shadowRoot.innerHTML=`
250
- <style>${ft}</style>
297
+ `;function h(c){return String(c).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function z(c){return c.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function L(c){let t=0;for(let r=0;r<c.length;r++)t=c.charCodeAt(r)+((t<<5)-t);return`hsl(${(t%360+360)%360}, 65%, 55%)`}function A(c){return`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${c}</svg>`}var k={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"/>'},Z={says:{label:"Says",icon:k.messageCircle,color:"#3b82f6"},thinks:{label:"Thinks",icon:k.lightbulb,color:"#8b5cf6"},does:{label:"Does",icon:k.wrench,color:"#f59e0b"},feels:{label:"Feels",icon:k.heart,color:"#ef4444"}},q={delighted:{emoji:"\u{1F604}",score:.95,color:"#16a34a"},satisfied:{emoji:"\u{1F60A}",score:.8,color:"#22c55e"},hopeful:{emoji:"\u{1F642}",score:.68,color:"#84cc16"},curious:{emoji:"\u{1F914}",score:.55,color:"#eab308"},neutral:{emoji:"\u{1F610}",score:.5,color:"#94a3b8"},uncertain:{emoji:"\u{1F615}",score:.4,color:"#f97316"},confused:{emoji:"\u{1F635}",score:.3,color:"#fb923c"},frustrated:{emoji:"\u{1F624}",score:.18,color:"#ef4444"},angry:{emoji:"\u{1F620}",score:.05,color:"#dc2626"}};var Ft="https://cdn.jsdelivr.net/gh/faker-js/assets-person-portrait",B=[32,64,128,256,512];function Bt(c){let t=0;for(let e=0;e<c.length;e++)t=c.charCodeAt(e)+((t<<5)-t);return t}function Ht(c){let t=B[0],e=Math.abs(c-t);for(let r=1;r<B.length;r++){let s=Math.abs(c-B[r]);s<e&&(t=B[r],e=s)}return t}function qt(c,t=128){let e=Bt(String(c)),r=(e%100+100)%100,s=(e>>>16&1)===0?"female":"male",a=Ht(t);return`${Ft}/${s}/${a}/${r}.jpg`}function tt(c){let t=0;for(let e=0;e<c.length;e++)t=c.charCodeAt(e)+((t<<5)-t);return t}var Ut=["Sarah Chen","Marcus Johnson","Aisha Patel","James O'Brien","Yuki Tanaka","Elena Rodriguez","David Kim","Fatima Al-Hassan","Lucas Silva","Priya Sharma","Noah Williams","Mei Lin","Carlos Mendez","Amara Osei","Henrik Larsson","Zara Ahmed"],Vt=["Product Manager","UX Designer","Frontend Developer","Data Analyst","Marketing Lead","QA Engineer","DevOps Lead","Content Strategist","Startup Founder","IT Director","Customer Success Lead","Research Scientist"],Qt=["San Francisco, CA","Austin, TX","London, UK","Toronto, CA","Berlin, DE","Tokyo, JP","Sydney, AU","S\xE3o Paulo, BR"],Xt=["I need tools that help me stay organized without slowing me down.","The dashboard is where I live \u2014 it has to be fast and reliable.","I want to understand the data, not fight the interface.","If it takes more than two clicks, I\u2019ll find another way.","Collaboration shouldn\u2019t mean endless notification noise.","I just want it to work the way I expect it to.","Give me the big picture first, then let me drill into details.","Accessibility isn\u2019t a nice-to-have \u2014 it\u2019s how I use the web."],Yt=["Streamline daily workflows","Reduce context-switching","Stay aligned with the team","Make data-driven decisions quickly","Ship features on a predictable cadence","Automate repetitive tasks","Improve onboarding experience","Keep documentation up to date"],Kt=["Too many disconnected tools","Slow page loads break focus","Unclear ownership of tasks","Settings that reset unexpectedly","Notifications that bury important updates","Poor mobile experience","Inconsistent design across features","No offline support"],Wt=["Checks dashboards every morning","Prefers keyboard shortcuts over mouse","Skims docs, reads deeply only when stuck","Shares screenshots in Slack","Batches email to twice a day","Tests features in incognito first","Bookmarks frequently used reports","Uses dark mode exclusively"],et=class extends HTMLElement{static get observedAttributes(){return["role","age","location","avatar","compact","src","data-list-stories","id"]}#e=new Map;#t=null;constructor(){super(),this.attachShadow({mode:"open"})}relatedStories(){if(!this.id)return[];let t=this.getRootNode(),e=t.querySelectorAll?t:document;return Array.from(e.querySelectorAll(`user-story[persona-id="${Gt(this.id)}"]`))}#r(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&!this.getAttribute(e)&&this.#e.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#e.get(t)||""}get data(){return{name:this.personaName,role:this.personaRole||void 0,age:this.age||void 0,location:this.location||void 0,avatar:this.avatar||void 0,quote:this.quote||void 0,bio:this.#e.get("bio")||void 0,goals:this.#e.get("goals")||void 0,frustrations:this.#e.get("frustrations")||void 0,behaviors:this.#e.get("behaviors")||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.shadowRoot&&this.#n(),this.dispatchEvent(new CustomEvent("user-persona:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let e of["role","age","location","avatar"])t[e]&&this.setAttribute(e,String(t[e]));if(t.name&&!this.querySelector('[slot="name"]')){let e=document.createElement("h2");e.slot="name",e.textContent=String(t.name),this.appendChild(e)}if(t.quote&&!this.querySelector('[slot="quote"]')){let e=document.createElement("p");e.slot="quote",e.textContent=String(t.quote),this.appendChild(e)}for(let e of["bio","goals","frustrations","behaviors"])t[e]&&this.#e.set(e,String(t[e]))}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();this._applyData(r),this.#n()}catch(e){console.warn(`[user-persona] Failed to load src="${t}":`,e)}}connectedCallback(){this.#r(),this.hasAttribute("data-mock")?this.#a():this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#n(),this.#i(),this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent("persona-ready",{bubbles:!0,composed:!0,detail:{name:this.personaName,role:this.personaRole}}))}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.#t?.disconnect(),this.#t=null}#i(){if(!this.hasAttribute("data-list-stories")||!this.id){this.#t?.disconnect(),this.#t=null;return}this.#t||(this.#t=new MutationObserver(()=>this.#s()),this.#t.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["persona-id"]}))}#s(){if(!this.shadowRoot)return;let t=this.shadowRoot.querySelector("[data-stories-section]");t&&(t.outerHTML=this.#o())}#o(){if(!this.hasAttribute("data-list-stories")||!this.id)return"";let t=this.relatedStories();return`
298
+ <section class="section" part="section-stories" data-stories-section>
299
+ <div class="section-header">
300
+ <div class="section-icon stories" aria-hidden="true">
301
+ <svg viewBox="0 0 24 24"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/></svg>
302
+ </div>
303
+ <span class="section-title">Stories <span class="section-count">${t.length}</span></span>
304
+ </div>
305
+ <div class="section-content">
306
+ ${t.length===0?'<p class="empty-stories">No user stories reference this persona yet.</p>':`<ul class="story-list">${t.map(e=>{let r=e.id||e.getAttribute("story-id")||"",s=e.querySelector('[slot="action"]')?.textContent?.trim()||e.getAttribute("action")||e.id||"untitled",a=e.getAttribute("priority")||"",i=e.getAttribute("status")||"";return`<li class="story-item" data-priority="${h(a)}" data-status="${h(i)}">${r?`<a href="#${h(r)}">${h(s)}</a>`:`<span>${h(s)}</span>`}${a?`<span class="story-meta">${h(a)}</span>`:""}${i?`<span class="story-meta">${h(i)}</span>`:""}</li>`}).join("")}</ul>`}
307
+ </div>
308
+ </section>
309
+ `}attributeChangedCallback(t,e,r){if(!(e===r||!this.shadowRoot)){if(t==="src"&&this.isConnected){this._loadSrc(r);return}(t==="data-list-stories"||t==="id")&&this.#i(),this.#n()}}get personaName(){return this.querySelector('[slot="name"]')?.textContent?.trim()||this.#e.get("name")||"Unnamed Persona"}get personaRole(){return this.getAttribute("role")||""}get age(){return this.getAttribute("age")||""}get location(){return this.getAttribute("location")||""}get avatar(){return this.getAttribute("avatar")||""}get quote(){return this.querySelector('[slot="quote"]')?.textContent?.trim()||this.#e.get("quote")||""}get compact(){return this.hasAttribute("compact")}#a(){let t=this.dataset.seed||this.dataset.mock||String(Date.now()),e=a=>a[(tt(t+a.length)%a.length+a.length)%a.length],r=(a,i)=>{let o=[];for(let n=0;n<i;n++)o.push(a[(tt(t+n+a.length)%a.length+a.length)%a.length]);return[...new Set(o)]};if(!this.querySelector('[slot="name"]')){let a=document.createElement("h2");a.slot="name",a.textContent=e(Ut),this.appendChild(a)}if(this.getAttribute("role")||this.setAttribute("role",e(Vt)),this.getAttribute("age")||this.setAttribute("age",String(25+(tt(t)%30+30)%30)),this.getAttribute("location")||this.setAttribute("location",e(Qt)),!this.getAttribute("avatar")){let a=this.querySelector('[slot="name"]')?.textContent?.trim()||"Persona";this.setAttribute("avatar",qt(a,256))}if(!this.querySelector('[slot="quote"]')){let a=document.createElement("p");a.slot="quote",a.textContent=e(Xt),this.appendChild(a)}let s=(a,i)=>{if(this.querySelector(`[slot="${a}"]`))return;let o=document.createElement("ul");o.setAttribute("slot",a);for(let n of i){let l=document.createElement("li");l.textContent=n,o.appendChild(l)}this.appendChild(o)};s("goals",r(Yt,3)),s("frustrations",r(Kt,3)),s("behaviors",r(Wt,3))}#n(){let t=this.personaName,e=this.personaRole,r=this.age,s=this.location,a=this.avatar,i=this.quote,o=L(t),n=a?`background:url(${h(a)}) center/cover`:`background:${o}`;this.shadowRoot.innerHTML=`
310
+ <style>${$t}</style>
251
311
 
252
312
  <article class="persona-card" part="card" role="article"
253
- aria-label="User persona: ${m(t)}">
313
+ aria-label="User persona: ${h(t)}">
254
314
 
255
315
  <header class="persona-header" part="header">
256
316
  <div class="avatar" part="avatar" style="${n}"
257
- role="img" aria-label="Avatar for ${m(t)}">
258
- ${a?"":m(E(t))}
317
+ role="img" aria-label="Avatar for ${h(t)}">
318
+ ${a?"":h(z(t))}
259
319
  </div>
260
320
  <div class="header-info">
261
321
  <div class="persona-name-wrap" part="name">
262
- <slot name="name"><h2 class="persona-name-fallback">${m(t)}</h2></slot>
322
+ <slot name="name"><h2 class="persona-name-fallback">${h(t)}</h2></slot>
263
323
  </div>
264
- ${e?`<p class="persona-role" part="role">${m(e)}</p>`:""}
324
+ ${e?`<p class="persona-role" part="role">${h(e)}</p>`:""}
265
325
  <div class="persona-meta" part="meta">
266
- ${s?`
326
+ ${r?`
267
327
  <span class="meta-item">
268
328
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>
269
- ${m(s)} years old
329
+ ${h(r)} years old
270
330
  </span>
271
331
  `:""}
272
- ${r?`
332
+ ${s?`
273
333
  <span class="meta-item">
274
334
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>
275
- ${m(r)}
335
+ ${h(s)}
276
336
  </span>
277
337
  `:""}
278
338
  </div>
@@ -282,7 +342,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
282
342
  ${i||this.querySelector('[slot="quote"]')?`
283
343
  <div class="persona-quote" part="quote">
284
344
  <span class="quote-mark" aria-hidden="true">&ldquo;</span>
285
- <div class="quote-text-wrap"><slot name="quote"><p class="quote-text">${m(i)}</p></slot></div>
345
+ <div class="quote-text-wrap"><slot name="quote"><p class="quote-text">${h(i)}</p></slot></div>
286
346
  </div>
287
347
  `:""}
288
348
 
@@ -334,9 +394,11 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
334
394
  <slot name="behaviors">No behaviors documented.</slot>
335
395
  </div>
336
396
  </div>
397
+
398
+ ${this.#o()}
337
399
  </div>
338
400
  </article>
339
- `}};x("user-persona",X);var K=`
401
+ `}};function Gt(c){return typeof CSS<"u"&&CSS.escape?CSS.escape(String(c)):String(c).replace(/["\\]/g,"\\$&")}x("user-persona",et);var rt=`
340
402
  :host {
341
403
  --_bg: var(--user-story-bg, var(--color-surface, #ffffff));
342
404
  --_text: var(--user-story-text, var(--color-text, #1a1a1a));
@@ -535,10 +597,11 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
535
597
  fill: white;
536
598
  }
537
599
 
538
- /* Semantic section-icon colors (hardcoded by intent) */
539
- .section-icon.acceptance { background: #22c55e; }
540
- .section-icon.notes { background: #f59e0b; }
541
- .section-icon.tasks { background: #8b5cf6; }
600
+ /* Semantic section-icon colors \u2014 driven by VB theme tokens so they shift
601
+ with the active theme rather than fighting it. */
602
+ .section-icon.acceptance { background: var(--color-success, #22c55e); }
603
+ .section-icon.notes { background: var(--color-warning, #f59e0b); }
604
+ .section-icon.tasks { background: var(--color-accent, #8b5cf6); }
542
605
 
543
606
  .section-title {
544
607
  font-size: var(--_font-xs);
@@ -658,41 +721,41 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
658
721
  :host([detail="compact"]) .slot-fallback {
659
722
  display: none;
660
723
  }
661
- `;var Y=class d extends HTMLElement{static get observedAttributes(){return["persona-id","priority","points","status","epic","story-id","compact","detail","src"]}static PRIORITIES={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)"}};static STATUSES={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)"}};#t=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#e(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#t.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#t.get(t)||""}get data(){return{storyId:this.storyId||void 0,personaId:this.personaId||void 0,priority:this.priority,status:this.status,points:this.points||void 0,epic:this.epic||void 0,detail:this.getAttribute("detail")||void 0,persona:this.persona||void 0,action:this.action||void 0,benefit:this.benefit||void 0,title:this.storyTitle||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.#e(),this.shadowRoot&&this.#s(),this.dispatchEvent(new CustomEvent("user-story:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,s]of[["storyId","story-id"],["personaId","persona-id"],["priority","priority"],["status","status"],["points","points"],["epic","epic"],["detail","detail"]])t[e]!=null&&this.setAttribute(s,String(t[e]));if(t.persona&&!this.querySelector('[slot="persona"]')){let e=document.createElement("span");e.slot="persona",e.textContent=t.persona,this.appendChild(e)}if(t.action&&!this.querySelector('[slot="action"]')){let e=document.createElement("span");e.slot="action",e.textContent=t.action,this.appendChild(e)}if(t.benefit&&!this.querySelector('[slot="benefit"]')){let e=document.createElement("span");e.slot="benefit",e.textContent=t.benefit,this.appendChild(e)}if(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["acceptance-criteria","tasks","notes"]){let s=e==="acceptance-criteria"?"acceptanceCriteria":e;if(t[s]&&!this.querySelector(`[slot="${e}"]`))if(Array.isArray(t[s])){let r=document.createElement("ul");r.slot=e;for(let a of t[s]){let i=document.createElement("li");i.textContent=a,r.appendChild(i)}this.appendChild(r)}else{let r=document.createElement("p");r.slot=e,r.textContent=t[s],this.appendChild(r)}}}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();this._applyData(s),this.#e(),this.#s()}catch(e){console.warn(`[user-story] Failed to load src="${t}":`,e)}}connectedCallback(){this.#e(),this.storyId&&!this.id&&(this.id=this.storyId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#s(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,s){e!==s&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(s):this.#s())}get persona(){return this.querySelector('[slot="persona"]')?.textContent?.trim()||this.#t.get("persona")||"user"}get personaId(){return this.getAttribute("persona-id")||""}get action(){return this.querySelector('[slot="action"]')?.textContent?.trim()||this.#t.get("action")||""}get benefit(){return this.querySelector('[slot="benefit"]')?.textContent?.trim()||this.#t.get("benefit")||""}get priority(){return this.getAttribute("priority")||"medium"}get points(){return this.getAttribute("points")||""}get status(){return this.getAttribute("status")||"backlog"}get epic(){return this.getAttribute("epic")||""}get storyId(){return this.getAttribute("story-id")||""}get storyTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#t.get("title")||""}get _minimalLabel(){if(this.storyTitle)return this.storyTitle;let t=this.action;return t.length>40?t.slice(0,40)+"\u2026":t}get compact(){return this.hasAttribute("compact")}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}updateStatus(t){d.STATUSES[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("status-changed",{detail:{status:t,storyId:this.storyId},bubbles:!0,composed:!0})))}updatePriority(t){d.PRIORITIES[t]&&(this.setAttribute("priority",t),this.dispatchEvent(new CustomEvent("priority-changed",{detail:{priority:t,storyId:this.storyId},bubbles:!0,composed:!0})))}showDetail(){let t=`story-dialog-${this.storyId||this.id||"detail"}`,e=document.getElementById(t);e||(e=document.createElement("dialog"),e.id=t,e.setAttribute("data-size","l"),document.body.appendChild(e));let s=document.createElement("form");s.method="dialog";let r=document.createElement("header"),a=document.createElement("h3");a.textContent=this.storyTitle||this.storyId||"Story Detail";let i=document.createElement("button");i.type="submit",i.setAttribute("aria-label","Close"),i.textContent="\xD7",r.appendChild(a),r.appendChild(i);let o=document.createElement("section"),n=document.createElement("user-story");for(let l of this.getAttributeNames())l==="detail"||l==="compact"||l==="data-upgraded"||l==="draggable"||l==="data-id"||l==="data-quadrant"||n.setAttribute(l,this.getAttribute(l));let c=[...this.children].some(l=>l.getAttribute("slot")&&l.tagName!=="DIALOG");n.setAttribute("detail",c?"full":"compact"),n.removeAttribute("id");for(let l of[...this.children])l.tagName!=="DIALOG"&&n.appendChild(l.cloneNode(!0));o.appendChild(n),s.appendChild(r),s.appendChild(o),e.innerHTML="",e.appendChild(s),e.addEventListener("close",()=>{e.innerHTML=""},{once:!0}),e.showModal()}#s(){let t=d.PRIORITIES[this.priority]||d.PRIORITIES.medium,e=d.STATUSES[this.status]||d.STATUSES.backlog,s=this._detailLevel,r=this.storyId?`User story: ${m(this.storyId)}`:"User story";if(s==="minimal"){this.shadowRoot.innerHTML=`
662
- <style>${K}</style>
663
- <article class="story-card story-card--minimal" role="article" aria-label="${r}"
724
+ `;var st=class c extends HTMLElement{static get observedAttributes(){return["persona-id","priority","points","status","epic","story-id","compact","detail","src"]}static PRIORITIES={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)"}};static STATUSES={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)"}};#e=new Map;#t=null;constructor(){super(),this.attachShadow({mode:"open"})}#r(){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)||""}get data(){return{storyId:this.storyId||void 0,personaId:this.personaId||void 0,priority:this.priority,status:this.status,points:this.points||void 0,epic:this.epic||void 0,detail:this.getAttribute("detail")||void 0,persona:this.persona||void 0,action:this.action||void 0,benefit:this.benefit||void 0,title:this.storyTitle||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.#r(),this.shadowRoot&&this.#n(),this.dispatchEvent(new CustomEvent("user-story:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,r]of[["storyId","story-id"],["personaId","persona-id"],["priority","priority"],["status","status"],["points","points"],["epic","epic"],["detail","detail"]])t[e]!=null&&this.setAttribute(r,String(t[e]));if(t.persona&&!this.querySelector('[slot="persona"]')){let e=document.createElement("span");e.slot="persona",e.textContent=String(t.persona),this.appendChild(e)}if(t.action&&!this.querySelector('[slot="action"]')){let e=document.createElement("span");e.slot="action",e.textContent=String(t.action),this.appendChild(e)}if(t.benefit&&!this.querySelector('[slot="benefit"]')){let e=document.createElement("span");e.slot="benefit",e.textContent=String(t.benefit),this.appendChild(e)}if(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["acceptance-criteria","tasks","notes"]){let r=e==="acceptance-criteria"?"acceptanceCriteria":e;if(t[r]&&!this.querySelector(`[slot="${e}"]`))if(Array.isArray(t[r])){let s=document.createElement("ul");s.slot=e;for(let a of t[r]){let i=document.createElement("li");i.textContent=String(a),s.appendChild(i)}this.appendChild(s)}else{let s=document.createElement("p");s.slot=e,s.textContent=String(t[r]),this.appendChild(s)}}}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();this._applyData(r),this.#r(),this.#n()}catch(e){console.warn(`[user-story] Failed to load src="${t}":`,e)}}connectedCallback(){this.#r(),this.storyId&&!this.id&&(this.id=this.storyId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#n(),this.#i(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.#t?.disconnect(),this.#t=null}attributeChangedCallback(t,e,r){e!==r&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(r):(this.#n(),t==="persona-id"&&this.#i()))}#i(){if(this.#t?.disconnect(),this.#t=null,!this.personaId||this.#s())return;let t=this.getRootNode(),r=(t&&typeof t.getElementById=="function"?t:document).getElementById(this.personaId);!r||r.tagName!=="USER-PERSONA"||(this.#t=new MutationObserver(()=>this.#n()),this.#t.observe(r,{attributes:!0,attributeFilter:["role"]}))}get persona(){return this.#s()||this.#o()||"user"}get personaId(){return this.getAttribute("persona-id")||""}#s(){return this.querySelector('[slot="persona"]')?.textContent?.trim()||this.#e.get("persona")||""}#o(){if(!this.personaId)return"";let t=this.getRootNode(),r=(t&&typeof t.getElementById=="function"?t:document).getElementById(this.personaId);return!r||r.tagName!=="USER-PERSONA"?"":r.getAttribute("role")?.trim()||""}#a(){return/^[aeio]/i.test(this.persona.trim())?"an":"a"}get action(){return this.querySelector('[slot="action"]')?.textContent?.trim()||this.#e.get("action")||""}get benefit(){return this.querySelector('[slot="benefit"]')?.textContent?.trim()||this.#e.get("benefit")||""}get priority(){return this.getAttribute("priority")||"medium"}get points(){return this.getAttribute("points")||""}get status(){return this.getAttribute("status")||"backlog"}get epic(){return this.getAttribute("epic")||""}get storyId(){return this.getAttribute("story-id")||""}get storyTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get _minimalLabel(){if(this.storyTitle)return this.storyTitle;let t=this.action;return t.length>40?t.slice(0,40)+"\u2026":t}get compact(){return this.hasAttribute("compact")}get _detailLevel(){return this.getAttribute("detail")?this.getAttribute("detail"):this.hasAttribute("compact")?"compact":"full"}updateStatus(t){c.STATUSES[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("status-changed",{detail:{status:t,storyId:this.storyId},bubbles:!0,composed:!0})))}updatePriority(t){c.PRIORITIES[t]&&(this.setAttribute("priority",t),this.dispatchEvent(new CustomEvent("priority-changed",{detail:{priority:t,storyId:this.storyId},bubbles:!0,composed:!0})))}showDetail(){let t=`story-dialog-${this.storyId||this.id||"detail"}`,e=document.getElementById(t);e||(e=document.createElement("dialog"),e.id=t,e.setAttribute("data-size","l"),document.body.appendChild(e));let r=document.createElement("form");r.method="dialog";let s=document.createElement("header"),a=document.createElement("h3");a.textContent=this.storyTitle||this.storyId||"Story Detail";let i=document.createElement("button");i.type="submit",i.setAttribute("aria-label","Close"),i.textContent="\xD7",s.appendChild(a),s.appendChild(i);let o=document.createElement("section"),n=document.createElement("user-story");for(let d of this.getAttributeNames())d==="detail"||d==="compact"||d==="data-upgraded"||d==="draggable"||d==="data-id"||d==="data-quadrant"||n.setAttribute(d,this.getAttribute(d)??"");let l=[...this.children].some(d=>d.getAttribute("slot")&&d.tagName!=="DIALOG");n.setAttribute("detail",l?"full":"compact"),n.removeAttribute("id");for(let d of[...this.children])d.tagName!=="DIALOG"&&n.appendChild(d.cloneNode(!0));o.appendChild(n),r.appendChild(s),r.appendChild(o),e.innerHTML="",e.appendChild(r),e.addEventListener("close",()=>{e.innerHTML=""},{once:!0}),e.showModal()}#n(){let t=c.PRIORITIES[this.priority]||c.PRIORITIES.medium,e=c.STATUSES[this.status]||c.STATUSES.backlog,r=this._detailLevel,s=this.storyId?`User story: ${h(this.storyId)}`:"User story";if(this.shadowRoot){if(r==="minimal"){this.shadowRoot.innerHTML=`
725
+ <style>${rt}</style>
726
+ <article class="story-card story-card--minimal" role="article" aria-label="${s}"
664
727
  tabindex="0">
665
728
  <div class="story-body">
666
- ${this.storyId?`<span class="story-id">${m(this.storyId)}</span>`:""}
729
+ ${this.storyId?`<span class="story-id">${h(this.storyId)}</span>`:""}
667
730
  <div class="story-title-wrap">
668
- <slot name="title"><span class="story-title-fallback">${m(this._minimalLabel||"[describe the action]")}</span></slot>
731
+ <slot name="title"><span class="story-title-fallback">${h(this._minimalLabel||"[describe the action]")}</span></slot>
669
732
  </div>
670
733
  </div>
671
734
  </article>
672
- `;let a=this.shadowRoot.querySelector(".story-card--minimal");a.addEventListener("click",()=>this.showDetail()),a.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),this.showDetail())})}else this.shadowRoot.innerHTML=`
673
- <style>${K}</style>
735
+ `;let a=this.shadowRoot.querySelector(".story-card--minimal");if(!a)return;a.addEventListener("click",()=>this.showDetail()),a.addEventListener("keydown",i=>{let o=i;(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.showDetail())})}else this.shadowRoot.innerHTML=`
736
+ <style>${rt}</style>
674
737
 
675
- <article class="story-card story-card--${s}" part="card" role="article" aria-label="${r}">
738
+ <article class="story-card story-card--${r}" part="card" role="article" aria-label="${s}">
676
739
  <header class="story-header" part="header">
677
740
  <div class="story-meta">
678
- ${this.storyId?`<span class="story-id" part="id">${m(this.storyId)}</span>`:""}
679
- ${this.epic?`<span class="epic-badge" part="epic">${m(this.epic)}</span>`:""}
741
+ ${this.storyId?`<span class="story-id" part="id">${h(this.storyId)}</span>`:""}
742
+ ${this.epic?`<span class="epic-badge" part="epic">${h(this.epic)}</span>`:""}
680
743
  </div>
681
744
  <div class="story-badges">
682
745
  <span class="priority-badge" part="priority"
683
746
  style="color: ${t.color}; background: ${t.bg};"
684
- >${m(t.label)}</span>
747
+ >${h(t.label)}</span>
685
748
  <span class="status-badge" part="status"
686
749
  style="color: ${e.color}; background: ${e.bg};"
687
- >${m(e.label)}</span>
688
- ${this.points?`<span class="points-badge" part="points">${m(this.points)}</span>`:""}
750
+ >${h(e.label)}</span>
751
+ ${this.points?`<span class="points-badge" part="points">${h(this.points)}</span>`:""}
689
752
  </div>
690
753
  </header>
691
754
 
692
755
  <div class="story-body" part="body">
693
756
  <p class="story-statement" part="statement">
694
- <span class="keyword">As a</span>
695
- ${this.personaId?`<a class="persona-text persona-text--link" href="#${m(this.personaId)}">${y(_.user)} <slot name="persona"><span>user</span></slot></a>`:'<span class="persona-text"><slot name="persona"><span>user</span></slot></span>'},
757
+ <span class="keyword">As ${this.#a()}</span>
758
+ ${this.personaId?`<a class="persona-text persona-text--link" href="#${h(this.personaId)}">${A(k.user)} <slot name="persona"><span>${h(this.#o()||"user")}</span></slot></a>`:'<span class="persona-text"><slot name="persona"><span>user</span></slot></span>'},
696
759
  <span class="keyword">I want</span>
697
760
  <span class="action-text"><slot name="action"><span>[describe the action]</span></slot></span>${this.benefit||this.querySelector('[slot="benefit"]')?`
698
761
  <span class="keyword">so that</span>
@@ -744,7 +807,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
744
807
  </div>
745
808
  </div>
746
809
  </article>
747
- `,s==="compact"&&this.shadowRoot.querySelectorAll(".section").forEach(i=>{let o=i.querySelector("slot");o&&o.assignedNodes().length===0&&i.setAttribute("data-empty","")});this.dispatchEvent(new CustomEvent("story-ready",{detail:{id:this.storyId,persona:this.persona,action:this.action,benefit:this.benefit,priority:this.priority,status:this.status,points:this.points},bubbles:!0,composed:!0}))}};x("user-story",Y);var M=`
810
+ `,r==="compact"&&this.shadowRoot.querySelectorAll(".section").forEach(i=>{let o=i.querySelector("slot");o&&o.assignedNodes().length===0&&i.setAttribute("data-empty","")});this.dispatchEvent(new CustomEvent("story-ready",{detail:{id:this.storyId,persona:this.persona,action:this.action,benefit:this.benefit,priority:this.priority,status:this.status,points:this.points},bubbles:!0,composed:!0}))}}};x("user-story",st);var H=`
748
811
  :host {
749
812
  display: block;
750
813
  font-family: var(--_font-sans);
@@ -752,13 +815,17 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
752
815
  color: var(--_text);
753
816
  container-type: inline-size;
754
817
 
755
- --_bg: var(--user-journey-bg, var(--color-surface-raised, #f8f9fa));
756
- --_card: var(--user-journey-card, var(--color-surface, #ffffff));
757
- --_border: var(--user-journey-border, var(--color-border, #e0e0e0));
758
- --_muted: var(--user-journey-muted, var(--color-text-muted, #666666));
759
- --_text: var(--user-journey-text, var(--color-text, #1a1a1a));
760
- --_curve-stroke: var(--user-journey-curve-stroke, #6366f1);
761
- --_radius: var(--user-journey-radius, var(--radius-l, 0.75rem));
818
+ --_bg: var(--user-journey-bg, var(--color-surface-raised, #f8f9fa));
819
+ --_card: var(--user-journey-card, var(--color-surface, #ffffff));
820
+ --_border: var(--user-journey-border, var(--color-border, #e0e0e0));
821
+ --_muted: var(--user-journey-muted, var(--color-text-muted, #666666));
822
+ --_text: var(--user-journey-text, var(--color-text, #1a1a1a));
823
+ --_inverted: var(--user-journey-text-inverted, var(--color-text-inverted, #ffffff));
824
+ --_primary: var(--user-journey-primary, var(--color-primary, var(--color-interactive, #6366f1)));
825
+ --_accent: var(--user-journey-accent, var(--color-accent, #8b5cf6));
826
+ --_link: var(--user-journey-link, var(--color-interactive, var(--color-primary, #6366f1)));
827
+ --_curve-stroke: var(--user-journey-curve-stroke, var(--_primary));
828
+ --_radius: var(--user-journey-radius, var(--radius-l, 0.75rem));
762
829
 
763
830
  --_font-sans: var(--user-journey-font, var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif));
764
831
  --_font-mono: var(--user-journey-font-mono, var(--font-mono, ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace));
@@ -771,6 +838,20 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
771
838
  --_space-s: var(--user-journey-space-s, var(--size-s, 0.75rem));
772
839
  --_space-m: var(--user-journey-space-m, var(--size-m, 1rem));
773
840
  --_space-l: var(--user-journey-space-l, var(--size-l, 1.5rem));
841
+
842
+ /* Semantic tints derived from theme tokens via color-mix.
843
+ Subtle backgrounds (10\u201314%) for body cells, header at 22%. */
844
+ --_tint-pos: color-mix(in oklch, var(--color-success, #22c55e) 14%, var(--_card));
845
+ --_tint-neu: color-mix(in oklch, var(--color-warning, #f59e0b) 12%, var(--_card));
846
+ --_tint-neg: color-mix(in oklch, var(--color-error, #ef4444) 12%, var(--_card));
847
+ --_tint-row-pain: color-mix(in oklch, var(--color-error, #ef4444) 8%, var(--_card));
848
+ --_tint-row-opp: color-mix(in oklch, var(--color-success, #22c55e) 8%, var(--_card));
849
+ --_chip-type-bg: color-mix(in oklch, var(--_accent) 18%, var(--_card));
850
+ --_chip-type-fg: var(--color-accent-text, var(--_accent));
851
+ --_chip-story-bg: color-mix(in oklch, var(--_link) 18%, var(--_card));
852
+ --_chip-story-bg-hover: color-mix(in oklch, var(--_link) 28%, var(--_card));
853
+ --_chip-story-fg: var(--_link);
854
+ --_grid-head-bg: color-mix(in oklch, var(--_primary) 85%, var(--color-text, #000));
774
855
  }
775
856
 
776
857
  *, *::before, *::after { box-sizing: border-box; margin: 0; }
@@ -797,7 +878,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
797
878
  inset-block: 0;
798
879
  inset-inline-start: 0;
799
880
  width: 4px;
800
- background: linear-gradient(135deg, #6366f1, #8b5cf6);
881
+ background: linear-gradient(135deg, var(--_primary), var(--_accent));
801
882
  }
802
883
 
803
884
  .journey__header-top {
@@ -829,22 +910,16 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
829
910
  }
830
911
 
831
912
  .chip--type {
832
- color: #6366f1;
833
- background: #ede9fe;
913
+ color: var(--_chip-type-fg);
914
+ background: var(--_chip-type-bg);
834
915
  }
835
916
 
836
917
  .chip--story {
837
- color: #0369a1;
838
- background: #e0f2fe;
918
+ color: var(--_chip-story-fg);
919
+ background: var(--_chip-story-bg);
839
920
  }
840
921
 
841
- .chip--story:hover { background: #bae6fd; }
842
-
843
- @media (prefers-color-scheme: dark) {
844
- .chip--type { color: #a78bfa; background: #2e1065; }
845
- .chip--story { color: #38bdf8; background: #082f49; }
846
- .chip--story:hover { background: #0c4a6e; }
847
- }
922
+ .chip--story:hover { background: var(--_chip-story-bg-hover); }
848
923
 
849
924
  /* Persona ref */
850
925
  .persona-ref {
@@ -858,7 +933,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
858
933
  white-space: nowrap;
859
934
  }
860
935
  .persona-ref svg { width: 14px; height: 14px; flex-shrink: 0; }
861
- a.persona-ref:hover { color: #6366f1; text-decoration: underline; }
936
+ a.persona-ref:hover { color: var(--_link); text-decoration: underline; }
862
937
 
863
938
  /* Title & summary (slotted content) */
864
939
  .journey__title-wrap {
@@ -907,16 +982,10 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
907
982
 
908
983
  .journey--compact .curve-svg { height: 54px; }
909
984
 
910
- .zone { opacity: 0.35; }
911
- .zone--pos { fill: #dcfce7; }
912
- .zone--neu { fill: #fef9c3; }
913
- .zone--neg { fill: #fee2e2; }
914
-
915
- @media (prefers-color-scheme: dark) {
916
- .zone--pos { fill: #14532d; }
917
- .zone--neu { fill: #713f12; }
918
- .zone--neg { fill: #7f1d1d; }
919
- }
985
+ .zone { opacity: 0.55; }
986
+ .zone--pos { fill: var(--_tint-pos); }
987
+ .zone--neu { fill: var(--_tint-neu); }
988
+ .zone--neg { fill: var(--_tint-neg); }
920
989
 
921
990
  .vline { stroke: var(--_border); stroke-width: 1; stroke-dasharray: 3 4; }
922
991
  .curve-line { stroke: var(--_curve-stroke); stroke-width: 2.5; stroke-linecap: round; }
@@ -933,12 +1002,8 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
933
1002
 
934
1003
  /* Head row */
935
1004
  .journey__grid thead tr {
936
- background: #1e1b4b;
937
- color: #fff;
938
- }
939
-
940
- @media (prefers-color-scheme: dark) {
941
- .journey__grid thead tr { background: #0f0d30; }
1005
+ background: var(--_grid-head-bg);
1006
+ color: var(--_inverted);
942
1007
  }
943
1008
 
944
1009
  .corner {
@@ -953,19 +1018,15 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
953
1018
  min-width: 100px;
954
1019
  position: sticky;
955
1020
  left: 0;
956
- background: #1e1b4b;
1021
+ background: var(--_grid-head-bg);
957
1022
  z-index: 2;
958
1023
  }
959
1024
 
960
- @media (prefers-color-scheme: dark) {
961
- .corner { background: #0f0d30; }
962
- }
963
-
964
1025
  .phase-head {
965
1026
  padding: 10px 14px;
966
1027
  text-align: left;
967
1028
  vertical-align: top;
968
- border-inline-start: 1px solid rgba(255 255 255 / 0.12);
1029
+ border-inline-start: 1px solid color-mix(in oklch, var(--_inverted) 12%, transparent);
969
1030
  min-width: 160px;
970
1031
  position: relative;
971
1032
  }
@@ -977,7 +1038,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
977
1038
  inset-block-start: 0;
978
1039
  inset-inline: 0;
979
1040
  height: 3px;
980
- background: var(--ec, #6366f1);
1041
+ background: var(--ec, var(--_primary));
981
1042
  }
982
1043
 
983
1044
  .ph-num { display: block; font-size: 10px; opacity: 0.5; margin-block-end: 2px; }
@@ -1017,13 +1078,8 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1017
1078
  .data-cell--empty { color: var(--_muted); opacity: 0.35; }
1018
1079
 
1019
1080
  /* Semantic row tints */
1020
- .grid-row--painpoints .data-cell { background: #fff5f5; }
1021
- .grid-row--opportunities .data-cell { background: #f0fdf4; }
1022
-
1023
- @media (prefers-color-scheme: dark) {
1024
- .grid-row--painpoints .data-cell { background: #2d0a0a; }
1025
- .grid-row--opportunities .data-cell { background: #052e16; }
1026
- }
1081
+ .grid-row--painpoints .data-cell { background: var(--_tint-row-pain); }
1082
+ .grid-row--opportunities .data-cell { background: var(--_tint-row-opp); }
1027
1083
 
1028
1084
  /* Compact */
1029
1085
  .journey--compact .phase-head { min-width: 120px; padding: 8px 10px; }
@@ -1032,7 +1088,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1032
1088
 
1033
1089
  /* Utility */
1034
1090
  .state-msg { padding: var(--_space-l); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
1035
- .state-msg--error { color: #dc2626; }
1091
+ .state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
1036
1092
  .journey__placeholder { padding: 20px 24px; font-size: var(--_font-sm); color: var(--_muted); }
1037
1093
  code { font-family: var(--_font-mono); font-size: 0.88em; }
1038
1094
 
@@ -1049,18 +1105,18 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1049
1105
  .journey__grid-wrap { overflow: visible; }
1050
1106
  .row-label, .corner { position: relative; }
1051
1107
  }
1052
- `;var Rt=[{key:"actions",label:"Actions"},{key:"thoughts",label:"Thoughts"},{key:"touchpoints",label:"Touchpoints"},{key:"painPoints",label:"Pain Points"},{key:"opportunities",label:"Opportunities"}],Q=class extends HTMLElement{static get observedAttributes(){return["src","persona","persona-id","story-ids","compact"]}#t=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__phases=null}get phases(){return this.__phases}set phases(t){this.__phases=t,this.isConnected&&this._render()}#e(){for(let t of this.children){let e=t.getAttribute("slot");e&&this.#t.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#t.get(t)||""}connectedCallback(){this.#e(),this.setAttribute("data-upgraded",""),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._render()}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):this._render())}async _loadSrc(t){if(t){this.shadowRoot.innerHTML=`<style>${M}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();if(s.persona&&this.setAttribute("persona",s.persona),s.personaId&&this.setAttribute("persona-id",s.personaId),s.title&&!this.querySelector('[slot="title"]')){let r=document.createElement("h2");r.slot="title",r.textContent=s.title,this.appendChild(r)}if(s.summary&&!this.querySelector('[slot="summary"]')){let r=document.createElement("p");r.slot="summary",r.textContent=s.summary,this.appendChild(r)}this.__phases=s.phases||[],this._render()}catch(e){this.shadowRoot.innerHTML=`<style>${M}</style><div class="state-msg state-msg--error">Could not load journey: ${m(e.message)}</div>`}}}_render(){let t=this._resolve("persona")||"",e=this._resolve("persona-id")||"",s=(this.getAttribute("story-ids")||"").split(",").map(o=>o.trim()).filter(Boolean),r=this.hasAttribute("compact"),a=this.__phases,i=!!this.querySelector('[slot="summary"]')||this.#t.has("summary");this.shadowRoot.innerHTML=`<style>${M}</style>
1053
- <article class="journey${r?" journey--compact":""}">
1108
+ `;var Jt=0;function S(c,t,e="vb-vt"){if(!c?.isConnected||typeof document>"u"||!("startViewTransition"in document)||matchMedia("(prefers-reduced-motion: reduce)").matches)return t(),null;let r=`${e}-${++Jt}`;c.style.viewTransitionName=r;let s=document.startViewTransition(t);return s.finished.finally(()=>{c.style.viewTransitionName===r&&(c.style.viewTransitionName="")}),s}var Zt=[{key:"actions",label:"Actions"},{key:"thoughts",label:"Thoughts"},{key:"touchpoints",label:"Touchpoints"},{key:"painPoints",label:"Pain Points"},{key:"opportunities",label:"Opportunities"}],at=class extends HTMLElement{static get observedAttributes(){return["src","persona","persona-id","story-ids","compact"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__phases=null}get phases(){return this.__phases}set phases(t){this.__phases!==t&&(this.__phases=t,this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("user-journey:phases-changed",{detail:{phases:t,source:"property"},bubbles:!0,composed:!0})))}get data(){return{persona:this.getAttribute("persona")||void 0,personaId:this.getAttribute("persona-id")||void 0,title:this.querySelector('[slot="title"]')?.textContent?.trim()||void 0,summary:this.querySelector('[slot="summary"]')?.textContent?.trim()||void 0,phases:this.__phases||void 0}}set data(t){if(!(!t||typeof t!="object")){if(t.persona&&this.setAttribute("persona",String(t.persona)),t.personaId&&this.setAttribute("persona-id",String(t.personaId)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h2");e.slot="title",e.textContent=t.title,this.appendChild(e)}if(t.summary&&!this.querySelector('[slot="summary"]')){let e=document.createElement("p");e.slot="summary",e.textContent=t.summary,this.appendChild(e)}t.phases!=null&&(this.__phases=t.phases),this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("user-journey:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}#t(){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.#t(),this.setAttribute("data-upgraded",""),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._render()}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):this._render())}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${H}</style><div class="state-msg">Loading\u2026</div>`;try{let r=await fetch(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);let s=await r.json();if(s.persona&&this.setAttribute("persona",s.persona),s.personaId&&this.setAttribute("persona-id",s.personaId),s.title&&!this.querySelector('[slot="title"]')){let a=document.createElement("h2");a.slot="title",a.textContent=s.title,this.appendChild(a)}if(s.summary&&!this.querySelector('[slot="summary"]')){let a=document.createElement("p");a.slot="summary",a.textContent=s.summary,this.appendChild(a)}this.__phases=s.phases||[],this._render()}catch(r){e.innerHTML=`<style>${H}</style><div class="state-msg state-msg--error">Could not load journey: ${h(r.message)}</div>`}}_render(){let t=this._resolve("persona")||"",e=this._resolve("persona-id")||"",r=(this.getAttribute("story-ids")||"").split(",").map(p=>p.trim()).filter(Boolean),s=this.hasAttribute("compact"),a=this.__phases,i=!!this.querySelector('[slot="summary"]')||this.#e.has("summary"),o=this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||"",n=`<style>${H}</style>
1109
+ <article class="journey${s?" journey--compact":""}">
1054
1110
 
1055
1111
  <header class="journey__header">
1056
1112
  <div class="journey__header-top">
1057
1113
  <div class="journey__chips">
1058
1114
  <span class="chip chip--type">Journey Map</span>
1059
- ${s.map(o=>`<a class="chip chip--story" href="#${o}">${this._label(o)}</a>`).join("")}
1115
+ ${r.map(p=>`<a class="chip chip--story" href="#${p}">${this._label(p)}</a>`).join("")}
1060
1116
  </div>
1061
1117
  ${t?`
1062
1118
  <div class="journey__persona">
1063
- ${e?`<a class="persona-ref" href="#${e}">${y(_.user)} ${m(t)}</a>`:`<span class="persona-ref">${y(_.user)} ${m(t)}</span>`}
1119
+ ${e?`<a class="persona-ref" href="#${e}">${A(k.user)} ${h(t)}</a>`:`<span class="persona-ref">${A(k.user)} ${h(t)}</span>`}
1064
1120
  </div>`:""}
1065
1121
  </div>
1066
1122
  <div class="journey__title-wrap">
@@ -1073,11 +1129,11 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1073
1129
  <p>Add phase data via <code>src</code> (JSON) or set <code>.phases</code> programmatically.</p>
1074
1130
  </div>`}
1075
1131
 
1076
- </article>`,this.dispatchEvent(new CustomEvent("journey-ready",{bubbles:!0,composed:!0,detail:{title,persona:t,phaseCount:a?a.length:0}}))}_curve(t){let n=t.length,c=p=>28+(n<2?944/2:p/(n-1)*944),l=p=>14+(1-(C[p.emotion]||C.neutral).score)*72,h=t.map((p,b)=>({x:c(b),y:l(p),ph:p})),u=`M ${h[0].x},${h[0].y}`;for(let p=1;p<h.length;p++){let b=h[p-1],v=h[p],w=(b.x+v.x)/2;u+=` C ${w},${b.y} ${w},${v.y} ${v.x},${v.y}`}let f=`uj-${Math.random().toString(36).slice(2,8)}`,g=h.at(-1);return`
1132
+ </article>`,l=this.shadowRoot,d=()=>{l.innerHTML=n};l.querySelector("article")?S(this,d,"uj-vt"):d(),this.dispatchEvent(new CustomEvent("journey-ready",{bubbles:!0,composed:!0,detail:{title:o,persona:t,phaseCount:a?a.length:0}}))}_curve(t){let n=t.length,l=g=>28+(n<2?944/2:g/(n-1)*944),d=g=>14+(1-(q[g.emotion]||q.neutral).score)*72,p=t.map((g,v)=>({x:l(v),y:d(g),ph:g})),u=`M ${p[0].x},${p[0].y}`;for(let g=1;g<p.length;g++){let v=p[g-1],y=p[g],_=(v.x+y.x)/2;u+=` C ${_},${v.y} ${_},${y.y} ${y.x},${y.y}`}let m=`uj-${Math.random().toString(36).slice(2,8)}`,f=p.at(-1);return`
1077
1133
  <div class="journey__curve" aria-hidden="true">
1078
1134
  <svg viewBox="0 0 1000 100" preserveAspectRatio="none" class="curve-svg">
1079
1135
  <defs>
1080
- <linearGradient id="${f}" x1="0" y1="0" x2="0" y2="1">
1136
+ <linearGradient id="${m}" x1="0" y1="0" x2="0" y2="1">
1081
1137
  <stop offset="0%" stop-color="#6366f1" stop-opacity="0.22"/>
1082
1138
  <stop offset="100%" stop-color="#6366f1" stop-opacity="0"/>
1083
1139
  </linearGradient>
@@ -1085,37 +1141,37 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1085
1141
  <rect x="0" y="0" width="1000" height="${100*.4}" class="zone zone--pos"/>
1086
1142
  <rect x="0" y="${100*.4}" width="1000" height="${100*.2}" class="zone zone--neu"/>
1087
1143
  <rect x="0" y="${100*.6}" width="1000" height="${100*.4}" class="zone zone--neg"/>
1088
- ${h.map(({x:p})=>`<line x1="${p}" y1="0" x2="${p}" y2="100" class="vline"/>`).join("")}
1089
- <path d="${u} L ${g.x},100 L ${h[0].x},100 Z" fill="url(#${f})"/>
1144
+ ${p.map(({x:g})=>`<line x1="${g}" y1="0" x2="${g}" y2="100" class="vline"/>`).join("")}
1145
+ <path d="${u} L ${f.x},100 L ${p[0].x},100 Z" fill="url(#${m})"/>
1090
1146
  <path d="${u}" fill="none" class="curve-line"/>
1091
- ${h.map(({x:p,y:b,ph:v})=>{let w=C[v.emotion]||C.neutral;return`<circle cx="${p}" cy="${b}" r="5" class="dot" style="fill:${w.color}"/>`}).join("")}
1147
+ ${p.map(({x:g,y:v,ph:y})=>{let _=q[y.emotion]||q.neutral;return`<circle cx="${g}" cy="${v}" r="5" class="dot" style="fill:${_.color}"/>`}).join("")}
1092
1148
  </svg>
1093
- </div>`}_grid(t){let e=t.map((r,a)=>{let i=C[r.emotion]||C.neutral,o=r.storyIds||[];return`
1094
- <th class="phase-head" data-emotion="${r.emotion||"neutral"}"
1149
+ </div>`}_grid(t){let e=t.map((s,a)=>{let i=q[s.emotion]||q.neutral,o=s.storyIds||[];return`
1150
+ <th class="phase-head" data-emotion="${s.emotion||"neutral"}"
1095
1151
  style="--ec:${i.color}">
1096
1152
  <span class="ph-num">${a+1}</span>
1097
- <span class="ph-name">${m(r.name||"")}</span>
1098
- <span class="ph-emoji" title="${r.emotion||"neutral"}"><span role="img" aria-label="${m(r.emotion||"neutral")}">${i.emoji}</span></span>
1153
+ <span class="ph-name">${h(s.name||"")}</span>
1154
+ <span class="ph-emoji" title="${s.emotion||"neutral"}"><span role="img" aria-label="${h(s.emotion||"neutral")}">${i.emoji}</span></span>
1099
1155
  ${o.length?`<div class="ph-stories">${o.map(n=>`<a class="chip chip--story" href="#${n}">${this._label(n)}</a>`).join("")}</div>`:""}
1100
- </th>`}).join(""),s=Rt.map(({key:r,label:a})=>{let i=t.map(o=>{let n=o[r]||[];return n.length?`<td class="data-cell data-cell--${r.toLowerCase()}">
1101
- ${n.map(c=>`<p>${m(c)}</p>`).join("")}
1156
+ </th>`}).join(""),r=Zt.map(({key:s,label:a})=>{let i=t.map(o=>{let n=o[s]||[];return n.length?`<td class="data-cell data-cell--${s.toLowerCase()}">
1157
+ ${n.map(l=>`<p>${h(l)}</p>`).join("")}
1102
1158
  </td>`:'<td class="data-cell data-cell--empty">\u2014</td>'}).join("");return`
1103
- <tr class="grid-row grid-row--${r.toLowerCase()}">
1159
+ <tr class="grid-row grid-row--${s.toLowerCase()}">
1104
1160
  <th class="row-label">${a}</th>
1105
1161
  ${i}
1106
1162
  </tr>`}).join("");return`
1107
1163
  <div class="journey__grid-wrap">
1108
1164
  <table class="journey__grid"
1109
- aria-label="${m(this.getAttribute("title")||"User Journey")} \u2014 phase breakdown">
1165
+ aria-label="${h(this.getAttribute("title")||"User Journey")} \u2014 phase breakdown">
1110
1166
  <thead>
1111
1167
  <tr>
1112
1168
  <th class="corner">Stage</th>
1113
1169
  ${e}
1114
1170
  </tr>
1115
1171
  </thead>
1116
- <tbody>${s}</tbody>
1172
+ <tbody>${r}</tbody>
1117
1173
  </table>
1118
- </div>`}_label(t){return t.replace(/^(activity|persona|journey|story|user)-/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("user-journey",Q);var L=`
1174
+ </div>`}_label(t){return t.replace(/^(activity|persona|journey|story|user)-/,"").replace(/-/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("user-journey",at);var U=`
1119
1175
  :host {
1120
1176
  display: block;
1121
1177
  font-family: var(--_font-sans);
@@ -1129,11 +1185,20 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1129
1185
  --_muted: var(--empathy-map-muted, var(--color-text-muted, #666666));
1130
1186
  --_text: var(--empathy-map-text, var(--color-text, #1a1a1a));
1131
1187
  --_radius: var(--empathy-map-radius, var(--radius-xl, 1rem));
1132
- --_accent: var(--empathy-map-accent, var(--color-interactive, #0066cc));
1133
- --_says: var(--empathy-map-says, #3b82f6);
1134
- --_thinks: var(--empathy-map-thinks, #8b5cf6);
1135
- --_does: var(--empathy-map-does, #f59e0b);
1136
- --_feels: var(--empathy-map-feels, #ef4444);
1188
+ --_accent: var(--empathy-map-accent, var(--color-interactive, var(--color-primary, #0066cc)));
1189
+ --_link: var(--empathy-map-link, var(--color-interactive, var(--color-primary, #6366f1)));
1190
+ --_primary: var(--empathy-map-primary, var(--color-primary, #6366f1));
1191
+ --_accent-bar: var(--empathy-map-accent-bar, var(--color-accent, #8b5cf6));
1192
+ --_says: var(--empathy-map-says, var(--color-info, #3b82f6));
1193
+ --_thinks: var(--empathy-map-thinks, var(--color-accent, #8b5cf6));
1194
+ --_does: var(--empathy-map-does, var(--color-warning, #f59e0b));
1195
+ --_feels: var(--empathy-map-feels, var(--color-error, #ef4444));
1196
+ --_says-bg: color-mix(in oklch, var(--_says) 16%, var(--_card));
1197
+ --_thinks-bg: color-mix(in oklch, var(--_thinks) 16%, var(--_card));
1198
+ --_does-bg: color-mix(in oklch, var(--_does) 16%, var(--_card));
1199
+ --_feels-bg: color-mix(in oklch, var(--_feels) 16%, var(--_card));
1200
+ --_chip-type-bg: color-mix(in oklch, var(--_accent-bar) 18%, var(--_card));
1201
+ --_chip-type-fg: var(--_accent-bar);
1137
1202
  --_font-sans: var(--empathy-map-font, var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif));
1138
1203
  --_font-xs: var(--empathy-map-font-xs, var(--font-size-xs, 0.75rem));
1139
1204
  --_font-sm: var(--empathy-map-font-sm, var(--font-size-sm, 0.875rem));
@@ -1175,7 +1240,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1175
1240
  inset-block: 0;
1176
1241
  inset-inline-start: 0;
1177
1242
  width: 4px;
1178
- background: linear-gradient(135deg, #6366f1, #8b5cf6);
1243
+ background: linear-gradient(135deg, var(--_primary), var(--_accent-bar));
1179
1244
  }
1180
1245
 
1181
1246
  .empathy-map__header-top {
@@ -1207,12 +1272,8 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1207
1272
  }
1208
1273
 
1209
1274
  .chip--type {
1210
- color: #6366f1;
1211
- background: #ede9fe;
1212
- }
1213
-
1214
- @media (prefers-color-scheme: dark) {
1215
- .chip--type { color: #a78bfa; background: #2e1065; }
1275
+ color: var(--_chip-type-fg);
1276
+ background: var(--_chip-type-bg);
1216
1277
  }
1217
1278
 
1218
1279
  /* \u2500\u2500 Persona ref \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 */
@@ -1233,7 +1294,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1233
1294
  flex-shrink: 0;
1234
1295
  }
1235
1296
 
1236
- a.persona-ref:hover { color: #6366f1; text-decoration: underline; }
1297
+ a.persona-ref:hover { color: var(--_link); text-decoration: underline; }
1237
1298
 
1238
1299
  /* \u2500\u2500 Title & summary (slotted content) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1239
1300
  .empathy-map__title-wrap {
@@ -1322,17 +1383,10 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1322
1383
  height: 16px;
1323
1384
  }
1324
1385
 
1325
- .quadrant--says .quadrant__icon { background: #dbeafe; color: var(--_says); }
1326
- .quadrant--thinks .quadrant__icon { background: #ede9fe; color: var(--_thinks); }
1327
- .quadrant--does .quadrant__icon { background: #fef3c7; color: var(--_does); }
1328
- .quadrant--feels .quadrant__icon { background: #fee2e2; color: var(--_feels); }
1329
-
1330
- @media (prefers-color-scheme: dark) {
1331
- .quadrant--says .quadrant__icon { background: #1e3a5f; }
1332
- .quadrant--thinks .quadrant__icon { background: #2e1065; }
1333
- .quadrant--does .quadrant__icon { background: #451a03; }
1334
- .quadrant--feels .quadrant__icon { background: #450a0a; }
1335
- }
1386
+ .quadrant--says .quadrant__icon { background: var(--_says-bg); color: var(--_says); }
1387
+ .quadrant--thinks .quadrant__icon { background: var(--_thinks-bg); color: var(--_thinks); }
1388
+ .quadrant--does .quadrant__icon { background: var(--_does-bg); color: var(--_does); }
1389
+ .quadrant--feels .quadrant__icon { background: var(--_feels-bg); color: var(--_feels); }
1336
1390
 
1337
1391
  .quadrant__label {
1338
1392
  font-size: 13px;
@@ -1609,7 +1663,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1609
1663
  @media print {
1610
1664
  .empathy-map {
1611
1665
  break-inside: avoid;
1612
- border-color: #ccc;
1666
+ border-color: var(--_border);
1613
1667
  }
1614
1668
 
1615
1669
  .quadrant__edit-btn,
@@ -1628,10 +1682,10 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1628
1682
 
1629
1683
  /* \u2500\u2500 Utility \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 */
1630
1684
  .state-msg { padding: var(--_space-l); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
1631
- .state-msg--error { color: #dc2626; }
1632
- code { font-family: Monaco, Menlo, monospace; font-size: 0.88em; }
1633
- `;var G=["says","thinks","does","feels"],J=class extends HTMLElement{static get observedAttributes(){return["persona","persona-id","src","editable","compact"]}#t=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__quadrants=null,this.__goals=null,this.__painPoints=null,this._editingQuadrants=new Set}get quadrants(){return this.__quadrants}set quadrants(t){this.__quadrants=t,this.isConnected&&this._render()}get goals(){return this.__goals}set goals(t){this.__goals=t,this.isConnected&&this._render()}get painPoints(){return this.__painPoints}set painPoints(t){this.__painPoints=t,this.isConnected&&this._render()}#e(){for(let t of this.children){let e=t.getAttribute("slot");e&&this.#t.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#t.get(t)||""}connectedCallback(){this.#e(),this.setAttribute("data-upgraded",""),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._render()}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):this._render())}editQuadrant(t){G.includes(t)&&this.hasAttribute("editable")&&this._openEdit(t)}closeQuadrant(t){G.includes(t)&&this._closeEdit(t)}async _loadSrc(t){if(t){this.shadowRoot.innerHTML=`<style>${L}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();if(s.persona&&this.setAttribute("persona",s.persona),s.personaId&&this.setAttribute("persona-id",s.personaId),s.title&&!this.querySelector('[slot="title"]')){let r=document.createElement("h2");r.slot="title",r.textContent=s.title,this.appendChild(r)}if(s.summary&&!this.querySelector('[slot="summary"]')){let r=document.createElement("p");r.slot="summary",r.textContent=s.summary,this.appendChild(r)}this.__quadrants=s.quadrants||null,this.__goals=s.goals||null,this.__painPoints=s.painPoints||null,this._render()}catch(e){this.shadowRoot.innerHTML=`<style>${L}</style><div class="state-msg state-msg--error">Could not load empathy map: ${m(e.message)}</div>`}}}_render(){let t=this._resolve("persona")||"",e=this._resolve("persona-id")||"",s=this.hasAttribute("compact"),r=this.hasAttribute("editable"),a=!!this.querySelector('[slot="title"]')||this.#t.has("title"),i=!!this.querySelector('[slot="summary"]')||this.#t.has("summary"),o=this.__goals?.length||this.querySelector('[slot="goals"]'),n=this.__painPoints?.length||this.querySelector('[slot="pain-points"]');this.shadowRoot.innerHTML=`<style>${L}</style>
1634
- <article class="empathy-map${s?" empathy-map--compact":""}">
1685
+ .state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
1686
+ code { font-family: var(--font-mono, Monaco, Menlo, monospace); font-size: 0.88em; }
1687
+ `;var it=["says","thinks","does","feels"],ot=class extends HTMLElement{static get observedAttributes(){return["persona","persona-id","src","editable","compact"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__quadrants=null,this.__goals=null,this.__painPoints=null,this._editingQuadrants=new Set}get quadrants(){return this.__quadrants}set quadrants(t){this.__quadrants=t,this.isConnected&&this._render()}get goals(){return this.__goals}set goals(t){this.__goals=t,this.isConnected&&this._render()}get painPoints(){return this.__painPoints}set painPoints(t){this.__painPoints=t,this.isConnected&&this._render()}#t(){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.#t(),this.setAttribute("data-upgraded",""),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._render()}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):this._render())}get data(){let t=this.querySelector('[slot="title"]'),e=this.querySelector('[slot="summary"]');return{persona:this.getAttribute("persona")||void 0,personaId:this.getAttribute("persona-id")||void 0,title:t?.textContent?.trim()||void 0,summary:e?.textContent?.trim()||void 0,quadrants:this.__quadrants||void 0,goals:this.__goals||void 0,painPoints:this.__painPoints||void 0}}set data(t){if(!(!t||typeof t!="object")){if(t.persona&&this.setAttribute("persona",String(t.persona)),t.personaId&&this.setAttribute("persona-id",String(t.personaId)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h2");e.slot="title",e.textContent=t.title,this.appendChild(e)}if(t.summary&&!this.querySelector('[slot="summary"]')){let e=document.createElement("p");e.slot="summary",e.textContent=t.summary,this.appendChild(e)}t.quadrants!=null&&(this.__quadrants=t.quadrants),t.goals!=null&&(this.__goals=t.goals),t.painPoints!=null&&(this.__painPoints=t.painPoints),this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("empathy-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}editQuadrant(t){it.includes(t)&&this.hasAttribute("editable")&&this._openEdit(t)}closeQuadrant(t){it.includes(t)&&this._closeEdit(t)}async _loadSrc(t){if(!(!t||!this.shadowRoot)){this.shadowRoot.innerHTML=`<style>${U}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();if(r.persona&&this.setAttribute("persona",r.persona),r.personaId&&this.setAttribute("persona-id",r.personaId),r.title&&!this.querySelector('[slot="title"]')){let s=document.createElement("h2");s.slot="title",s.textContent=r.title,this.appendChild(s)}if(r.summary&&!this.querySelector('[slot="summary"]')){let s=document.createElement("p");s.slot="summary",s.textContent=r.summary,this.appendChild(s)}this.__quadrants=r.quadrants||null,this.__goals=r.goals||null,this.__painPoints=r.painPoints||null,this._render()}catch(e){if(!this.shadowRoot)return;let r=e instanceof Error?e.message:String(e);this.shadowRoot.innerHTML=`<style>${U}</style><div class="state-msg state-msg--error">Could not load empathy map: ${h(r)}</div>`}}}_render(){let t=this._resolve("persona")||"",e=this._resolve("persona-id")||"",r=this.hasAttribute("compact"),s=this.hasAttribute("editable"),a=!!this.querySelector('[slot="title"]')||this.#e.has("title"),i=!!this.querySelector('[slot="summary"]')||this.#e.has("summary"),o=this.__goals?.length||this.querySelector('[slot="goals"]'),n=this.__painPoints?.length||this.querySelector('[slot="pain-points"]'),l=`<style>${U}</style>
1688
+ <article class="empathy-map${r?" empathy-map--compact":""}">
1635
1689
 
1636
1690
  <header class="empathy-map__header">
1637
1691
  <div class="empathy-map__header-top">
@@ -1640,7 +1694,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1640
1694
  </div>
1641
1695
  ${t?`
1642
1696
  <div class="empathy-map__persona">
1643
- ${e?`<a class="persona-ref" href="#${m(e)}">${y(_.user)} ${m(t)}</a>`:`<span class="persona-ref">${y(_.user)} ${m(t)}</span>`}
1697
+ ${e?`<a class="persona-ref" href="#${h(e)}">${A(k.user)} ${h(t)}</a>`:`<span class="persona-ref">${A(k.user)} ${h(t)}</span>`}
1644
1698
  </div>`:""}
1645
1699
  </div>
1646
1700
  <div class="empathy-map__title-wrap">
@@ -1650,25 +1704,25 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1650
1704
  </header>
1651
1705
 
1652
1706
  <div class="empathy-map__grid">
1653
- ${G.map(c=>this._renderQuadrant(c,r)).join("")}
1707
+ ${it.map(p=>this._renderQuadrant(p,s)).join("")}
1654
1708
  </div>
1655
1709
 
1656
1710
  ${o||n?`
1657
1711
  <footer class="empathy-map__footer">
1658
- ${this._renderSummaryRow("goals",y(_.target),"Goals")}
1659
- ${this._renderSummaryRow("pain-points",y(_.alertTriangle),"Pain Points")}
1712
+ ${this._renderSummaryRow("goals",A(k.target),"Goals")}
1713
+ ${this._renderSummaryRow("pain-points",A(k.alertTriangle),"Pain Points")}
1660
1714
  </footer>
1661
1715
  `:""}
1662
1716
 
1663
- </article>`,r&&this._bindEditListeners(),this.dispatchEvent(new CustomEvent("empathy-map:ready",{bubbles:!0,composed:!0,detail:{title:this.querySelector('[slot="title"]')?.textContent?.trim()||"Empathy Map",persona:t}}))}_renderQuadrant(t,e){let s=V[t],r=this.__quadrants?.[t],a=this._editingQuadrants.has(t),i=r&&r.length?t==="feels"?r.map(n=>this._renderEmotion(n)).join(""):r.map(n=>`<p>${m(n)}</p>`).join(""):`<slot name="${t}"><p class="placeholder">Add ${s.label.toLowerCase()} items\u2026</p></slot>`,o=r?.length?r.join(`
1717
+ </article>`,d=()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=l,s&&this._bindEditListeners())};this.shadowRoot?.querySelector("article")?S(this,d,"em-vt"):d(),this.dispatchEvent(new CustomEvent("empathy-map:ready",{bubbles:!0,composed:!0,detail:{title:this.querySelector('[slot="title"]')?.textContent?.trim()||"Empathy Map",persona:t}}))}_renderQuadrant(t,e){let r=Z[t],s=this.__quadrants?.[t],a=this._editingQuadrants.has(t),i=s&&s.length?t==="feels"?s.map(n=>this._renderEmotion(n)).join(""):s.map(n=>`<p>${h(n)}</p>`).join(""):`<slot name="${t}"><p class="placeholder">Add ${r.label.toLowerCase()} items\u2026</p></slot>`,o=s?.length?s.join(`
1664
1718
  `):"";return`
1665
1719
  <section class="quadrant quadrant--${t}"${a?" data-editing":""}>
1666
1720
  <div class="quadrant__inner">
1667
1721
  <div class="quadrant__header">
1668
- <div class="quadrant__icon" aria-hidden="true">${y(s.icon)}</div>
1669
- <span class="quadrant__label">${s.label}</span>
1722
+ <div class="quadrant__icon" aria-hidden="true">${A(r.icon)}</div>
1723
+ <span class="quadrant__label">${r.label}</span>
1670
1724
  ${e?`<button class="quadrant__edit-btn" data-quadrant="${t}"
1671
- aria-label="Edit ${s.label}" title="Edit ${s.label}">${y(_.pencil)}</button>`:""}
1725
+ aria-label="Edit ${r.label}" title="Edit ${r.label}">${A(k.pencil)}</button>`:""}
1672
1726
  </div>
1673
1727
  <div class="quadrant__faces">
1674
1728
  <div class="quadrant__face quadrant__face--front"${a?" inert":""}>
@@ -1680,24 +1734,50 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1680
1734
  <div class="quadrant__face quadrant__face--back"${a?"":" inert"}>
1681
1735
  <textarea class="quadrant__editor" data-quadrant="${t}"
1682
1736
  placeholder="One item per line\u2026"
1683
- aria-label="Edit ${s.label} items">${m(o)}</textarea>
1737
+ aria-label="Edit ${r.label} items">${h(o)}</textarea>
1684
1738
  <button class="quadrant__done-btn" data-quadrant="${t}"
1685
- aria-label="Done editing ${s.label}">${y(_.check)} Done</button>
1739
+ aria-label="Done editing ${r.label}">${A(k.check)} Done</button>
1686
1740
  </div>
1687
1741
  `:""}
1688
1742
  </div>
1689
1743
  </div>
1690
- </section>`}_renderEmotion(t){let e=t.toLowerCase().trim(),s=C[e];return s?`<span class="emotion-tag" style="--ec:${s.color}"><span role="img" aria-label="${m(t)}">${s.emoji}</span> ${m(t)}</span>`:`<p>${m(t)}</p>`}_renderSummaryRow(t,e,s){let a=(t==="pain-points"?"painPoints":t)==="painPoints"?this.__painPoints:this.__goals,i=a?.length?a.map(o=>`<p>${m(o)}</p>`).join(""):`<slot name="${t}"><p class="placeholder">No ${s.toLowerCase()} specified.</p></slot>`;return`
1744
+ </section>`}_renderEmotion(t){let e=t.toLowerCase().trim(),r=q[e];return r?`<span class="emotion-tag" style="--ec:${r.color}"><span role="img" aria-label="${h(t)}">${r.emoji}</span> ${h(t)}</span>`:`<p>${h(t)}</p>`}_renderSummaryRow(t,e,r){let a=(t==="pain-points"?"painPoints":t)==="painPoints"?this.__painPoints:this.__goals,i=a?.length?a.map(o=>`<p>${h(o)}</p>`).join(""):`<slot name="${t}"><p class="placeholder">No ${r.toLowerCase()} specified.</p></slot>`;return`
1691
1745
  <div class="summary-row">
1692
1746
  <span class="summary-row__icon" aria-hidden="true">${e}</span>
1693
1747
  <div class="summary-row__body">
1694
- <div class="summary-row__label">${s}</div>
1748
+ <div class="summary-row__label">${r}</div>
1695
1749
  <div class="summary-row__content">${i}</div>
1696
1750
  </div>
1697
- </div>`}_bindEditListeners(){let t=this.shadowRoot;t.querySelectorAll(".quadrant__edit-btn").forEach(e=>{e.addEventListener("click",()=>{this._openEdit(e.dataset.quadrant)})}),t.querySelectorAll(".quadrant__done-btn").forEach(e=>{e.addEventListener("click",()=>{this._closeEdit(e.dataset.quadrant)})}),t.querySelectorAll(".quadrant__editor").forEach(e=>{e.addEventListener("keydown",s=>{s.key==="Escape"&&(s.preventDefault(),this._closeEdit(e.dataset.quadrant))})})}_openEdit(t){this._editingQuadrants.add(t);let e=this.shadowRoot.querySelector(`.quadrant--${t}`);if(!e)return;e.setAttribute("data-editing","");let s=e.querySelector(".quadrant__face--front"),r=e.querySelector(".quadrant__face--back");s&&s.setAttribute("inert",""),r&&r.removeAttribute("inert");let a=e.querySelector(".quadrant__editor");if(a){let i=this.__quadrants?.[t];if(i?.length)a.value=i.join(`
1698
- `);else{let o=e.querySelector(`slot[name="${t}"]`);if(o){let n=o.assignedElements();if(n.length){let c=[];n.forEach(l=>{let h=l.querySelectorAll("li");h.length?h.forEach(u=>c.push(u.textContent.trim())):c.push(l.textContent.trim())}),a.value=c.filter(Boolean).join(`
1699
- `)}}}a.focus()}}_closeEdit(t){let e=this.shadowRoot.querySelector(`.quadrant--${t}`);if(!e)return;let s=e.querySelector(".quadrant__editor");if(s){let i=s.value.split(`
1700
- `).map(n=>n.trim()).filter(Boolean);this.__quadrants||(this.__quadrants={}),this.__quadrants[t]=i;let o=e.querySelector(".quadrant__content");if(o)if(i.length)o.innerHTML=t==="feels"?i.map(n=>this._renderEmotion(n)).join(""):i.map(n=>`<p>${m(n)}</p>`).join("");else{let n=V[t];o.innerHTML=`<p class="placeholder">Add ${n.label.toLowerCase()} items\u2026</p>`}}this._editingQuadrants.delete(t),e.removeAttribute("data-editing");let r=e.querySelector(".quadrant__face--front"),a=e.querySelector(".quadrant__face--back");r&&r.removeAttribute("inert"),a&&a.setAttribute("inert",""),this.dispatchEvent(new CustomEvent("empathy-map:update",{bubbles:!0,composed:!0,detail:{quadrant:t,items:this.__quadrants?.[t]||[]}}))}};x("empathy-map",J);var Z=class d extends A{static QUADRANTS=["quick-wins","big-bets","fill-ins","money-pit"];static LABELS={"quick-wins":"Quick Wins","big-bets":"Big Bets","fill-ins":"Fill-Ins","money-pit":"Money Pit"};static DESCRIPTIONS={"quick-wins":"High impact \xB7 Low effort","big-bets":"High impact \xB7 High effort","fill-ins":"Low impact \xB7 Low effort","money-pit":"Low impact \xB7 High effort"};static#t=0;static get observedAttributes(){return["src","compact","title"]}#e=null;#s={};#r=null;#a="";#o=null;setup(){this.#a=`ie-${++d.#t}`;let t=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [draggable]")],e=document.createElement("div");e.className="ie-wrapper";let s=document.createElement("div");s.className="ie-y-label",s.setAttribute("aria-hidden","true"),s.textContent="Impact \u2191";let r=document.createElement("div");r.style.cssText="display:flex;flex-direction:column;flex:1;min-width:0;";let a=document.createElement("div");a.className="ie-grid",a.setAttribute("role","region"),a.setAttribute("aria-label","Impact-Effort prioritization matrix");let i=document.createElement("div");i.className="ie-x-label",i.setAttribute("aria-hidden","true"),i.textContent="Effort \u2192";for(let l of d.QUADRANTS){let h=document.createElement("section");h.className="ie-quadrant",h.dataset.quadrantZone=l,h.setAttribute("aria-label",`${d.LABELS[l]}: ${d.DESCRIPTIONS[l]}`);let u=document.createElement("header");u.className="ie-quadrant-label",u.innerHTML=`${d.LABELS[l]}<br><span class="ie-quadrant-desc">${d.DESCRIPTIONS[l]}</span>`;let f=document.createElement("drag-surface");f.setAttribute("group",this.#a),f.setAttribute("aria-label",d.LABELS[l]),f.setAttribute("data-layout","stack"),f.setAttribute("data-layout-gap","xs"),h.appendChild(u),h.appendChild(f),a.appendChild(h),this.#s[l]=f}t.forEach((l,h)=>{let u=l.getAttribute("data-quadrant")||"quick-wins",f=this.#s[u]||this.#s["quick-wins"];l.hasAttribute("draggable")||l.setAttribute("draggable","true"),l.hasAttribute("data-id")||(l.dataset.id=`ie-item-${h}`),f.appendChild(l)});let o=document.createElement("div");o.className="ie-live-region",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true");let n=this.getAttribute("title");if(n){let l=document.createElement("h3");l.className="ie-title",l.textContent=n,this.prepend(l)}r.appendChild(a),r.appendChild(i),e.appendChild(s),e.appendChild(r),this.appendChild(e),this.appendChild(o),this.#e=a,this.#r=o,this.#o=e,this.listen(this,"drag-surface:transfer",l=>{let{item:h,fromSurface:u,toSurface:f}=l.detail,g=this.#l(u),p=this.#l(f);!g||!p||(h.setAttribute("data-quadrant",p),this.#n(`Moved ${this.#c(h)} to ${d.LABELS[p]}`),this.dispatchEvent(new CustomEvent("impact-effort:move",{bubbles:!0,detail:{itemId:h.dataset.id,from:g,to:p,item:h}})))});let c=this.getAttribute("src");c&&this.#i(c),this.#d()}teardown(){this.#o&&(this.#o.remove(),this.#o=null),this.#r&&(this.#r.remove(),this.#r=null),this.#e=null,this.#s={}}attributeChangedCallback(t,e,s){this.hasAttribute("data-upgraded")&&t==="src"&&s&&s!==e&&this.#i(s)}async#i(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();if(!Array.isArray(s))return;for(let r of d.QUADRANTS){let a=this.#s[r];if(a)for(let i of[...a.querySelectorAll("[draggable]")])i.remove()}s.forEach((r,a)=>{let i=r.quadrant||"quick-wins",o=r.id||`ie-item-${a}`,n;r.persona||r.action||r.storyId?(n=document.createElement("user-story"),n.setAttribute("detail","minimal"),r.storyId&&n.setAttribute("story-id",r.storyId),r.persona&&n.setAttribute("persona",r.persona),r.action&&n.setAttribute("action",r.action),r.benefit&&n.setAttribute("benefit",r.benefit),r.priority&&n.setAttribute("priority",r.priority),r.status&&n.setAttribute("status",r.status),r.points&&n.setAttribute("points",String(r.points))):(n=document.createElement("article"),n.textContent=r.label||r.text||""),n.setAttribute("draggable","true"),n.dataset.id=o,n.dataset.quadrant=i,(this.#s[i]||this.#s["quick-wins"]).appendChild(n)}),this.#d()}catch(e){console.warn(`[impact-effort] Failed to load src="${t}":`,e)}}#l(t){for(let[e,s]of Object.entries(this.#s))if(s===t)return e;return null}#n(t){let e=this.#r;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#c(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#d(){let t={};for(let e of d.QUADRANTS){let s=this.#s[e];t[e]=s?s.querySelectorAll('[draggable="true"]').length:0}this.dispatchEvent(new CustomEvent("impact-effort:ready",{bubbles:!0,detail:{quadrantCounts:t}}))}};x("impact-effort",Z);function gt({newItems:d,nodes:t,keyOf:e,renderItem:s,containerFor:r}){let a=[],i=[],o=[],n=new Set;for(let l of d)n.add(e(l));for(let[l,h]of[...t])n.has(l)||(h.remove(),t.delete(l),o.push(l));let c=new Map;for(let l of d){let h=e(l),u=t.get(h)||null,f=r(l,u);c.has(f)||c.set(f,[]),c.get(f).push({item:l,key:h,existing:u})}for(let[l,h]of c)for(let u=0;u<h.length;u++){let{item:f,key:g,existing:p}=h[u],b=p;b?(b.parentElement!==l||l.children[u]!==b)&&i.push(g):(b=s(f),t.set(g,b),a.push(g));let v=l.children[u];v!==b&&l.insertBefore(b,v||null)}return{added:a,moved:i,removed:o}}function vt(d){return class extends d{static keyOf(t){return t.id}#t=[];#e=new Map;get items(){return this.#t}set items(t){let e=t||[],s=gt({newItems:e,nodes:this.#e,keyOf:this.constructor.keyOf,renderItem:r=>this._renderItem(r),containerFor:(r,a)=>this._containerFor(r,a)});this.#t=e,this._postRender({...s,items:e}),this._emit("items-changed",{items:e},"api")}_renderItem(t){throw new Error(`${this.constructor.name}: must implement _renderItem(item)`)}_containerFor(t,e){return this}_postRender(t){}_emit(t,e,s="api"){this.dispatchEvent(new CustomEvent(`${this.localName}:${t}`,{detail:{...e,source:s},bubbles:!0}))}_nodeFor(t){return this.#e.get(t)||null}_seedCollection(t,e){this.#t=t,this.#e.clear();for(let[s,r]of e)this.#e.set(s,r)}_setItemsSilently(t){this.#t=t}}}var tt=class d extends vt(A){static get observedAttributes(){return["src","compact","title"]}static keyOf(t){return t.id??t.storyId}static#t=0;#e=null;#s={};#r={};#a=null;#o="";#i=[];#l=null;setup(){this.#o=`kb-${++d.#t}`;let t=[...this.querySelectorAll(":scope > section[data-column]")];this.#i=t.map(a=>{let i=a.getAttribute("data-column")||"",n=a.getAttribute("data-column-label")||""||this.#g(i),c=a.getAttribute("data-wip"),l=c?parseInt(c,10):null,h=a.getAttribute("data-column-color")||null,u=[...a.children];return{id:i,label:n,wip:l,color:h,children:u}});for(let a of t)a.remove();this.#e=document.createElement("div"),this.#e.className="kb-columns",this.#e.setAttribute("role","region"),this.#e.setAttribute("aria-label","Kanban board");let e=0;for(let a of this.#i){let i=document.createElement("section");i.className="kb-column",i.setAttribute("data-column-id",a.id),a.color&&i.setAttribute("data-column-tint",a.color);let o=document.createElement("header");o.className="kb-column-header";let n=document.createElement("h3");n.textContent=a.label;let c=document.createElement("output");if(c.className="kb-count",c.textContent=String(a.children.length),n.appendChild(c),a.wip!==null&&!isNaN(a.wip)){let h=document.createElement("span");h.className="kb-wip",h.textContent=`/ ${a.wip}`,h.setAttribute("aria-label",`WIP limit ${a.wip}`),n.appendChild(h)}o.appendChild(n),i.appendChild(o);let l=document.createElement("drag-surface");if(l.setAttribute("group",this.#o),l.setAttribute("aria-label",`${a.label} items`),l.setAttribute("data-layout","stack"),l.setAttribute("data-layout-gap","xs"),a.children.length>0){for(let h of a.children)h.hasAttribute("draggable")||h.setAttribute("draggable","true"),h.hasAttribute("data-id")||(h.dataset.id=`kb-item-${e}`),l.appendChild(h);e+=a.children.length}else{let h=document.createElement("p");h.className="kb-empty",h.textContent="No items",l.appendChild(h)}i.appendChild(l),this.#e.appendChild(i),this.#s[a.id]=l,this.#r[a.id]=i,a.wip!==null&&a.children.length>a.wip&&i.setAttribute("data-wip-exceeded","")}let s=this.getAttribute("title");if(s){let a=document.createElement("h2");a.className="kb-title",a.textContent=s,this.appendChild(a)}this.appendChild(this.#e),this.#a=document.createElement("div"),this.#a.className="kb-live-region",this.#a.setAttribute("role","status"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.appendChild(this.#a),this.listen(this,"drag-surface:reorder",a=>{let i=a.detail,o=a.target.closest("drag-surface"),n=this.#p(o);n&&(this.#v(n),this.#c("drag"),this.dispatchEvent(new CustomEvent("kanban-board:reorder",{bubbles:!0,detail:{itemId:i.itemId,column:n,oldIndex:i.oldIndex,newIndex:i.newIndex}})))}),this.listen(this,"drag-surface:transfer",a=>{let i=a.detail,o=i.fromSurface,n=i.toSurface,c=this.#p(o),l=this.#p(n);if(!c||!l)return;i.item&&i.item.setAttribute("data-column",l),this.#v(c),this.#v(l);let h=n.querySelector(".kb-empty");if(h&&h.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".kb-empty")){let w=document.createElement("p");w.className="kb-empty",w.textContent="No items",o.appendChild(w)}let f=this.#x(i.item),g=this.#y(c),p=this.#y(l);this.#m(`${f} moved from ${g} to ${p}`),this.#c("drag"),this.dispatchEvent(new CustomEvent("kanban-board:transfer",{bubbles:!0,detail:{itemId:i.itemId,fromColumn:c,toColumn:l,newIndex:i.newIndex,item:i.item}}));let b=n.querySelectorAll(':scope > [draggable="true"]').length,v=this.#i.find(w=>w.id===l);v?.wip!==null&&v?.wip!==void 0&&b>v.wip&&this.dispatchEvent(new CustomEvent("kanban-board:wip-exceeded",{bubbles:!0,detail:{column:l,limit:v.wip,count:b}}))}),this.#n();let r=this.getAttribute("src");if(r){this._loadSrc(r);return}this.dispatchEvent(new CustomEvent("kanban-board:ready",{bubbles:!0,detail:{columnCount:this.#i.length,itemCount:e}}))}#n(){let t=[],e=new Map;for(let[s,r]of Object.entries(this.#s)){let a=r.querySelectorAll(':scope > [draggable="true"]');for(let i of a){let o=i.getAttribute("data-id");o&&(t.push({id:o,column:s}),e.set(o,i))}}this._seedCollection(t,e)}#c(t){let e=[],s=new Map;for(let r of this.items){let a=String(r.id??r.storyId??"");a&&s.set(a,r)}for(let[r,a]of Object.entries(this.#s)){let i=a.querySelectorAll(':scope > [draggable="true"]');for(let o of i){let n=o.getAttribute("data-id");if(!n)continue;let c=s.get(n);e.push(c?{...c,column:r}:{id:n,column:r})}}this._setItemsSilently(e),this._emit("items-changed",{items:e},t)}teardown(){let t=this.querySelector(".kb-title");t&&t.remove(),this.#e&&(this.#e.remove(),this.#e=null),this.#a&&(this.#a.remove(),this.#a=null),this.#s={},this.#r={},this.#i=[]}get columns(){return this.#i.map(t=>({id:t.id,label:t.label,wip:t.wip??void 0,color:t.color??void 0}))}set columns(t){let e=(t||[]).map(s=>({id:s.id,label:s.label||this.#g(s.id),wip:s.wip??null,color:s.color??null,children:[]}));this.#e&&(this.#e.remove(),this.#e=null),this.#s={},this.#r={},this.#i=e,this.#b()}get renderItem(){return this.#l}set renderItem(t){this.#l=typeof t=="function"?t:null}_renderItem(t){let e;if(this.#l){let s=this.#l(t);if(!(s instanceof Element))throw new Error("kanban-board: renderItem must return an Element");e=s}else e=this.#d(t);return e.hasAttribute("draggable")||e.setAttribute("draggable","true"),e.hasAttribute("data-id")||e.setAttribute("data-id",String(d.keyOf(t))),e}_containerFor(t,e){let s=this.#s[t.column];if(!s)throw new Error(`kanban-board: no column "${t.column}" \u2014 set .columns first or include item.column matching an existing column id`);let r=s.querySelector(":scope > .kb-empty");return r&&r.remove(),s}_postRender(){for(let t of Object.keys(this.#s)){this.#v(t);let e=this.#s[t],s=e.querySelectorAll(':scope > [draggable="true"]'),r=e.querySelector(":scope > .kb-empty");if(s.length===0&&!r){let a=document.createElement("p");a.className="kb-empty",a.textContent="No items",e.appendChild(a)}else s.length>0&&r&&r.remove()}}#d(t){let e=customElements.get("work-item")?"work-item":"article",s=document.createElement(e);return e==="work-item"?s.data={itemId:t.id??t.storyId,type:t.type,priority:t.priority,status:t.status,estimate:t.estimate!=null?String(t.estimate):void 0,assignee:t.assignee,title:t.title,description:t.description,checklist:t.checklist,notes:t.notes,detail:t.detail}:(s.className="kb-card",s.textContent=t.title||t.label||t.id),s}#b(){this.#e=document.createElement("div"),this.#e.className="kb-columns",this.#e.setAttribute("role","region"),this.#e.setAttribute("aria-label","Kanban board");for(let t of this.#i){let e=document.createElement("section");e.className="kb-column",e.setAttribute("data-column-id",t.id),t.color&&e.setAttribute("data-column-tint",t.color);let s=document.createElement("header");s.className="kb-column-header";let r=document.createElement("h3");r.textContent=t.label;let a=document.createElement("output");if(a.className="kb-count",a.textContent="0",r.appendChild(a),t.wip!=null&&!isNaN(t.wip)){let n=document.createElement("span");n.className="kb-wip",n.textContent=`/ ${t.wip}`,n.setAttribute("aria-label",`WIP limit ${t.wip}`),r.appendChild(n)}s.appendChild(r),e.appendChild(s);let i=document.createElement("drag-surface");i.setAttribute("group",this.#o),i.setAttribute("aria-label",`${t.label} items`),i.setAttribute("data-layout","stack"),i.setAttribute("data-layout-gap","xs");let o=document.createElement("p");o.className="kb-empty",o.textContent="No items",i.appendChild(o),e.appendChild(i),this.#e.appendChild(e),this.#s[t.id]=i,this.#r[t.id]=e}this.appendChild(this.#e)}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let r of s.columns||[]){let a=document.createElement("section");a.setAttribute("data-column",r.id),r.label&&a.setAttribute("data-column-label",r.label),r.wip!=null&&a.setAttribute("data-wip",String(r.wip)),r.color&&a.setAttribute("data-column-color",r.color);for(let i of r.items||[]){let o;i.persona||i.action||i.storyId?(o=document.createElement("user-story"),o.setAttribute("detail",i.detail||"minimal"),i.storyId&&o.setAttribute("story-id",i.storyId),i.persona&&o.setAttribute("persona",i.persona),i.action&&o.setAttribute("action",i.action),i.benefit&&o.setAttribute("benefit",i.benefit),i.priority&&o.setAttribute("priority",i.priority),i.status&&o.setAttribute("status",i.status),i.points&&o.setAttribute("points",String(i.points))):(o=document.createElement("article"),o.className="kb-card",o.textContent=i.text||i.label||""),o.setAttribute("draggable","true"),o.dataset.id=i.id||i.storyId||"",a.appendChild(o)}this.appendChild(a)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[kanban-board] Failed to load src="${t}":`,e)}}#p(t){if(!t)return null;for(let[e,s]of Object.entries(this.#s))if(s===t)return e;return null}#v(t){let e=this.#s[t],s=this.#r[t];if(!e||!s)return;let r=e.querySelectorAll(':scope > [draggable="true"]').length,a=s.querySelector(".kb-count");a&&(a.textContent=String(r));let i=this.#i.find(o=>o.id===t);i?.wip!==null&&i?.wip!==void 0&&(r>i.wip?s.setAttribute("data-wip-exceeded",""):s.removeAttribute("data-wip-exceeded"))}#y(t){return this.#i.find(s=>s.id===t)?.label||this.#g(t)}#m(t){this.#a&&(this.#a.textContent="",requestAnimationFrame(()=>{this.#a&&(this.#a.textContent=t)}))}#x(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#g(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("kanban-board",tt);var et=class d extends A{static get observedAttributes(){return["src","compact","title"]}static#t=0;#e=null;#s=null;#r={};#a=null;#o="";#i=[];setup(){this.#o=`sm-${++d.#t}`;let t=[...this.querySelectorAll(":scope > section[data-activity]")];this.#i=t.map(a=>{let i=a.getAttribute("data-activity")||"",n=a.getAttribute("data-activity-label")||""||this.#b(i),c=a.getAttribute("data-journey-phase")||null,l=[...a.children];return{id:i,label:n,journeyPhase:c,children:l}});for(let a of t)a.remove();this.#e=document.createElement("div"),this.#e.className="sm-scroll",this.#e.setAttribute("role","region"),this.#e.setAttribute("aria-label","Story map"),this.#e.setAttribute("tabindex","0"),this.#s=document.createElement("div"),this.#s.className="sm-columns";let e=0;for(let a of this.#i){let i=document.createElement("section");i.className="sm-column",i.setAttribute("data-activity-column",a.id);let o=document.createElement("header");o.className="sm-activity-header";let n=document.createElement("h3");n.textContent=a.label;let c=document.createElement("span");c.className="sm-activity-count",c.textContent=String(a.children.length),n.appendChild(c),o.appendChild(n),i.appendChild(o);let l=document.createElement("drag-surface");if(l.setAttribute("group",this.#o),l.setAttribute("aria-label",`${a.label} stories`),l.setAttribute("data-layout","stack"),l.setAttribute("data-layout-gap","xs"),a.children.length>0){for(let h of a.children)l.appendChild(h);e+=a.children.length}else{let h=document.createElement("p");h.className="sm-empty",h.textContent="No stories yet",l.appendChild(h)}i.appendChild(l),this.#s.appendChild(i),this.#r[a.id]=l}let s=this.getAttribute("title");if(s){let a=document.createElement("h2");a.className="sm-title",a.textContent=s,this.appendChild(a)}this.#e.appendChild(this.#s),this.appendChild(this.#e),this.#a=document.createElement("div"),this.#a.className="sm-live-region",this.#a.setAttribute("role","status"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.appendChild(this.#a),this.listen(this,"drag-surface:reorder",a=>{let i=a.detail,o=a.target.closest("drag-surface"),n=this.#l(o);n&&(this.#n(n),this.dispatchEvent(new CustomEvent("story-map:reorder",{bubbles:!0,detail:{itemId:i.itemId,activity:n,oldIndex:i.oldIndex,newIndex:i.newIndex}})))}),this.listen(this,"drag-surface:transfer",a=>{let i=a.detail,o=i.fromSurface,n=i.toSurface,c=this.#l(o),l=this.#l(n);if(!c||!l)return;this.#n(c),this.#n(l);let h=n.querySelector(".sm-empty");if(h&&h.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".sm-empty")){let g=document.createElement("p");g.className="sm-empty",g.textContent="No stories yet",o.appendChild(g)}let f=this.#d(i.item);this.#c(`${f} moved from ${c} to ${l}`),this.dispatchEvent(new CustomEvent("story-map:transfer",{bubbles:!0,detail:{itemId:i.itemId,fromActivity:c,toActivity:l,newIndex:i.newIndex}}))});let r=this.getAttribute("src");if(r){this._loadSrc(r);return}this.dispatchEvent(new CustomEvent("story-map:ready",{bubbles:!0,detail:{activityCount:this.#i.length,storyCount:e}}))}teardown(){this.#e&&(this.#e.remove(),this.#e=null),this.#a&&(this.#a.remove(),this.#a=null),this.#s=null,this.#r={},this.#i=[]}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let r of s.activities||[]){let a=document.createElement("section");a.setAttribute("data-activity",r.id),a.setAttribute("data-activity-label",r.label||r.id),r.journeyPhase&&a.setAttribute("data-journey-phase",r.journeyPhase);for(let i of r.stories||[]){let o=document.createElement("user-story");o.setAttribute("draggable","true"),o.dataset.id=i.id||i.storyId,(i.storyId||i.id)&&o.setAttribute("story-id",i.storyId||i.id),i.title&&o.setAttribute("title",i.title),i.persona&&o.setAttribute("persona",i.persona),i.action&&o.setAttribute("action",i.action),i.benefit&&o.setAttribute("benefit",i.benefit),i.priority&&o.setAttribute("priority",i.priority),i.status&&o.setAttribute("status",i.status),i.points&&o.setAttribute("points",String(i.points)),o.setAttribute("detail",i.detail||"compact"),a.appendChild(o)}this.appendChild(a)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[story-map] Failed to load src="${t}":`,e)}}#l(t){if(!t)return null;for(let[e,s]of Object.entries(this.#r))if(s===t)return e;return null}#n(t){let e=this.#r[t];if(!e)return;let s=e.querySelectorAll(':scope > [draggable="true"]').length,r=e.closest("[data-activity-column]");if(!r)return;let a=r.querySelector(".sm-activity-count");a&&(a.textContent=String(s))}#c(t){this.#a&&(this.#a.textContent="",requestAnimationFrame(()=>{this.#a&&(this.#a.textContent=t)}))}#d(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#b(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("story-map",et);var j=`
1751
+ </div>`}_bindEditListeners(){let t=this.shadowRoot;t&&(t.querySelectorAll(".quadrant__edit-btn").forEach(e=>{e.addEventListener("click",()=>{let r=e.dataset.quadrant;r&&this._openEdit(r)})}),t.querySelectorAll(".quadrant__done-btn").forEach(e=>{e.addEventListener("click",()=>{let r=e.dataset.quadrant;r&&this._closeEdit(r)})}),t.querySelectorAll(".quadrant__editor").forEach(e=>{let r=e;r.addEventListener("keydown",s=>{let a=s;if(a.key==="Escape"){a.preventDefault();let i=r.dataset.quadrant;i&&this._closeEdit(i)}})}))}_openEdit(t){this._editingQuadrants.add(t);let e=this.shadowRoot?.querySelector(`.quadrant--${t}`);if(!e)return;e.setAttribute("data-editing","");let r=e.querySelector(".quadrant__face--front"),s=e.querySelector(".quadrant__face--back");r&&r.setAttribute("inert",""),s&&s.removeAttribute("inert");let a=e.querySelector(".quadrant__editor");if(a){let i=this.__quadrants?.[t];if(i?.length)a.value=i.join(`
1752
+ `);else{let o=e.querySelector(`slot[name="${t}"]`);if(o){let n=o.assignedElements();if(n.length){let l=[];n.forEach(d=>{let p=d.querySelectorAll("li");p.length?p.forEach(u=>l.push(u.textContent?.trim()??"")):l.push(d.textContent?.trim()??"")}),a.value=l.filter(Boolean).join(`
1753
+ `)}}}a.focus()}}_closeEdit(t){let e=this.shadowRoot?.querySelector(`.quadrant--${t}`);if(!e)return;let r=e.querySelector(".quadrant__editor");if(r){let i=r.value.split(`
1754
+ `).map(n=>n.trim()).filter(Boolean);this.__quadrants||(this.__quadrants={}),this.__quadrants[t]=i;let o=e.querySelector(".quadrant__content");if(o)if(i.length)o.innerHTML=t==="feels"?i.map(n=>this._renderEmotion(n)).join(""):i.map(n=>`<p>${h(n)}</p>`).join("");else{let n=Z[t];o.innerHTML=`<p class="placeholder">Add ${n.label.toLowerCase()} items\u2026</p>`}}this._editingQuadrants.delete(t),e.removeAttribute("data-editing");let s=e.querySelector(".quadrant__face--front"),a=e.querySelector(".quadrant__face--back");s&&s.removeAttribute("inert"),a&&a.setAttribute("inert",""),this.dispatchEvent(new CustomEvent("empathy-map:update",{bubbles:!0,composed:!0,detail:{quadrant:t,items:this.__quadrants?.[t]||[]}}))}};x("empathy-map",ot);function V({newItems:c,nodes:t,keyOf:e,renderItem:r,containerFor:s}){let a=[],i=[],o=[],n=new Set;for(let d of c)n.add(e(d));for(let[d,p]of[...t])n.has(d)||(p.remove(),t.delete(d),o.push(d));let l=new Map;for(let d of c){let p=e(d),u=t.get(p)||null,m=s(d,u);l.has(m)||l.set(m,[]),l.get(m)?.push({item:d,key:p,existing:u})}for(let[d,p]of l)for(let u=0;u<p.length;u++){let{item:m,key:f,existing:g}=p[u],v=g;v?(v.parentElement!==d||d.children[u]!==v)&&i.push(f):(v=r(m),t.set(f,v),a.push(f));let y=d.children[u];y!==v&&d.insertBefore(v,y||null)}return{added:a,moved:i,removed:o}}var nt=class c extends C{static QUADRANTS=["quick-wins","big-bets","fill-ins","money-pit"];static LABELS={"quick-wins":"Quick Wins","big-bets":"Big Bets","fill-ins":"Fill-Ins","money-pit":"Money Pit"};static DESCRIPTIONS={"quick-wins":"High impact \xB7 Low effort","big-bets":"High impact \xB7 High effort","fill-ins":"Low impact \xB7 Low effort","money-pit":"Low impact \xB7 High effort"};static#e=0;static get observedAttributes(){return["src","compact","title"]}#t=null;#r={};#i=null;#s="";#o=null;setup(){this.#s=`ie-${++c.#e}`;let t=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [draggable]")],e=document.createElement("div");e.className="ie-wrapper";let r=document.createElement("div");r.className="ie-y-label",r.setAttribute("aria-hidden","true"),r.textContent="Impact \u2191";let s=document.createElement("div");s.style.cssText="display:flex;flex-direction:column;flex:1;min-width:0;";let a=document.createElement("div");a.className="ie-grid",a.setAttribute("role","region"),a.setAttribute("aria-label","Impact-Effort prioritization matrix");let i=document.createElement("div");i.className="ie-x-label",i.setAttribute("aria-hidden","true"),i.textContent="Effort \u2192";for(let d of c.QUADRANTS){let p=document.createElement("section");p.className="ie-quadrant",p.dataset.quadrantZone=d,p.setAttribute("aria-label",`${c.LABELS[d]}: ${c.DESCRIPTIONS[d]}`);let u=document.createElement("header");u.className="ie-quadrant-label",u.innerHTML=`${c.LABELS[d]}<br><span class="ie-quadrant-desc">${c.DESCRIPTIONS[d]}</span>`;let m=document.createElement("drag-surface");m.setAttribute("group",this.#s),m.setAttribute("aria-label",c.LABELS[d]),m.setAttribute("data-layout","stack"),m.setAttribute("data-layout-gap","xs"),p.appendChild(u),p.appendChild(m),a.appendChild(p),this.#r[d]=m}t.forEach((d,p)=>{let u=d,m=u.getAttribute("data-quadrant")||"quick-wins",f=this.#r[m]||this.#r["quick-wins"];u.hasAttribute("draggable")||u.setAttribute("draggable","true"),u.hasAttribute("data-id")||(u.dataset.id=`ie-item-${p}`),f.appendChild(u)});let o=document.createElement("div");o.className="ie-live-region",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true");let n=this.getAttribute("title");if(n){let d=document.createElement("h3");d.className="ie-title",d.textContent=n,this.prepend(d)}s.appendChild(a),s.appendChild(i),e.appendChild(r),e.appendChild(s),this.appendChild(e),this.appendChild(o),this.#t=a,this.#i=o,this.#o=e,this.listen(this,"drag-surface:transfer",d=>{let{item:p,fromSurface:u,toSurface:m}=d.detail,f=this.#d(u),g=this.#d(m);!f||!g||(p.setAttribute("data-quadrant",g),this.#b(`Moved ${this.#m(p)} to ${c.LABELS[g]}`),this.dispatchEvent(new CustomEvent("impact-effort:move",{bubbles:!0,detail:{itemId:p.dataset.id,from:f,to:g,item:p}})))});let l=this.getAttribute("src");l&&this.#c(l),this.#u()}teardown(){this.#o&&(this.#o.remove(),this.#o=null),this.#i&&(this.#i.remove(),this.#i=null),this.#t=null,this.#r={},this.#n.clear(),this.#a=[]}#a=[];#n=new Map;get items(){if(this.#a.length)return this.#a;let t=[];for(let[e,r]of Object.entries(this.#r))for(let s of r.querySelectorAll(':scope > [draggable="true"]'))t.push({id:s.getAttribute("data-id")||void 0,quadrant:e,text:s.textContent?.trim()||void 0});return t}set items(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];V({newItems:e,nodes:this.#n,keyOf:r=>r.id??`${r.quadrant}:${r.text}`,renderItem:r=>{let s=this;if(typeof s.renderItem=="function"){let i=s.renderItem(r);if(i instanceof Element)return i.hasAttribute("draggable")||i.setAttribute("draggable","true"),i.hasAttribute("data-id")||i.setAttribute("data-id",String(r.id??"")),i}let a=document.createElement("article");return a.className="ie-card",a.setAttribute("draggable","true"),r.id&&a.setAttribute("data-id",String(r.id)),a.textContent=r.text||r.id||"",a},containerFor:r=>this.#r[r.quadrant]||this.#r["quick-wins"]}),this.#a=e,this.dispatchEvent(new CustomEvent("impact-effort:items-changed",{detail:{items:e,source:"property"},bubbles:!0}))}attributeChangedCallback(t,e,r){this.hasAttribute("data-upgraded")&&t==="src"&&r&&r!==e&&this.#c(r)}async#c(t){try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();if(!Array.isArray(r))return;let s=()=>{for(let a of c.QUADRANTS){let i=this.#r[a];if(i)for(let o of[...i.querySelectorAll("[draggable]")])o.remove()}r.forEach((a,i)=>{let o=a.quadrant||"quick-wins",n=a.id||`ie-item-${i}`,l;a.persona||a.action||a.storyId?(l=document.createElement("user-story"),l.setAttribute("detail","minimal"),a.storyId&&l.setAttribute("story-id",a.storyId),a.persona&&l.setAttribute("persona",a.persona),a.action&&l.setAttribute("action",a.action),a.benefit&&l.setAttribute("benefit",a.benefit),a.priority&&l.setAttribute("priority",a.priority),a.status&&l.setAttribute("status",a.status),a.points&&l.setAttribute("points",String(a.points))):(l=document.createElement("article"),l.textContent=a.label||a.text||""),l.setAttribute("draggable","true"),l.dataset.id=n,l.dataset.quadrant=o,(this.#r[o]||this.#r["quick-wins"]).appendChild(l)})};this.hasAttribute("data-upgraded")&&this.#t?S(this,s,"ie-vt"):s(),this.#u()}catch(e){console.warn(`[impact-effort] Failed to load src="${t}":`,e)}}#d(t){for(let[e,r]of Object.entries(this.#r))if(r===t)return e;return null}#b(t){let e=this.#i;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#m(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#u(){let t={};for(let e of c.QUADRANTS){let r=this.#r[e];t[e]=r?r.querySelectorAll('[draggable="true"]').length:0}this.dispatchEvent(new CustomEvent("impact-effort:ready",{bubbles:!0,detail:{quadrantCounts:t}}))}};x("impact-effort",nt);var ct=class c extends C{static#e=0;setup(){this.#m=`qg-${++c.#e}`;let t=this.getAttribute("x-label")||"",e=this.getAttribute("y-label")||"",r=this.getAttribute("x-low")||"Low",s=this.getAttribute("x-high")||"High",a=this.getAttribute("y-low")||"Low",i=this.getAttribute("y-high")||"High",o=[this.getAttribute("q1-label")||"Q1",this.getAttribute("q2-label")||"Q2",this.getAttribute("q3-label")||"Q3",this.getAttribute("q4-label")||"Q4"],n=this.hasAttribute("draggable"),l=[...this.querySelectorAll(":scope > [data-quadrant], :scope > [data-x][data-y]")],d=document.createElement("section");d.className="qg-wrapper",d.setAttribute("role","region"),d.setAttribute("aria-label",`${e} \xD7 ${t} quadrant grid`);let p=document.createElement("header");p.className="qg-y-label",p.setAttribute("aria-hidden","true"),p.textContent=`\u2191 ${e}`;let u=document.createElement("aside");u.className="qg-y-scale",u.setAttribute("aria-hidden","true"),u.innerHTML=`<span>${i}</span><span>${a}</span>`;let m=document.createElement("div");m.className="qg-grid";let f=document.createElement("aside");f.className="qg-x-scale",f.setAttribute("aria-hidden","true"),f.innerHTML=`<span>${r}</span><span>${s}</span>`;let g=document.createElement("footer");g.className="qg-x-label",g.setAttribute("aria-hidden","true"),g.textContent=`${t} \u2192`;for(let y=0;y<4;y++){let _=document.createElement("section");_.className="qg-quadrant",_.dataset.quadrantZone=String(y),_.setAttribute("aria-label",o[y]);let b=document.createElement("header");if(b.className="qg-quadrant-label",b.textContent=o[y],_.appendChild(b),n){let w=document.createElement("drag-surface");w.setAttribute("group",this.#m),w.setAttribute("aria-label",o[y]),w.setAttribute("data-layout","stack"),w.setAttribute("data-layout-gap","xs"),_.appendChild(w),this.#u[y]=w}else{let w=document.createElement("ul");w.className="qg-items",_.appendChild(w),this.#f[y]=w}m.appendChild(_),this.#v[y]=_}l.forEach((y,_)=>{let b=y,w=this.#n(b),T=n?this.#u[w]:this.#f[w];if(n&&(b.hasAttribute("draggable")||b.setAttribute("draggable","true")),b.hasAttribute("data-id")||(b.dataset.id=`qg-item-${_}`),b.hasAttribute("data-x")&&b.hasAttribute("data-y")){let E=parseFloat(b.getAttribute("data-x")??""),M=parseFloat(b.getAttribute("data-y")??"");if(Number.isFinite(E)&&Number.isFinite(M)){let $=w===0||w===3?(E-.5)*2:E*2,F=w===0||w===1?(M-.5)*2:M*2;if(b.style.setProperty("--qg-local-x",$.toFixed(4)),b.style.setProperty("--qg-local-y",F.toFixed(4)),b.classList.add("qg-pinned"),!b.style.getPropertyValue("--qg-pin-hue")){let Ot=b.dataset.id||(b.textContent||"").trim();b.style.setProperty("--qg-pin-hue",`${c.#o(Ot)}deg`)}}}if(n)T.appendChild(b);else{let E=document.createElement("li");E.appendChild(b),T.appendChild(E)}});let v=document.createElement("div");v.className="qg-live-region visually-hidden",v.setAttribute("role","status"),v.setAttribute("aria-live","polite"),d.appendChild(p),d.appendChild(u),d.appendChild(m),d.appendChild(f),d.appendChild(g),this.appendChild(d),this.appendChild(v),this.#l=m,this.#h=v,this.#y=o,n&&this.listen(this,"drag-surface:transfer",this.#a),this.#t()}#t(){if(typeof ResizeObserver>"u")return;let t=e=>{let r=e.offsetWidth,s=e.offsetHeight;r>0&&e.style.setProperty("--qg-pin-half-w",`${r/2}px`),s>0&&e.style.setProperty("--qg-pin-half-h",`${s/2}px`)};this.#g=new ResizeObserver(e=>{for(let r of e)t(r.target);this.#r()});for(let e of this.querySelectorAll(".qg-pinned"))this.#g.observe(e);this.#r()}#r(){this.#p||(this.#p=requestAnimationFrame(()=>{this.#p=0,this.#i()}))}#i(){for(let e of this.querySelectorAll(".qg-pinned")){let r=e;r.classList.remove("qg-clustered"),r.style.removeProperty("--qg-cluster-i"),r.style.removeProperty("--qg-cluster-n"),delete r.dataset.cluster,r.dataset.qgTabbed!==void 0&&(r.removeAttribute("tabindex"),delete r.dataset.qgTabbed)}let t=0;for(let e=0;e<4;e++){let r=this.#v[e];if(!r)continue;let s=[...r.querySelectorAll(".qg-pinned")];if(s.length<2)continue;let a=s.map(d=>d.getBoundingClientRect()),i=Array.from({length:s.length},(d,p)=>p),o=d=>i[d]===d?d:i[d]=o(i[d]),n=(d,p)=>{let u=o(d),m=o(p);u!==m&&(i[u]=m)};for(let d=0;d<s.length;d++)for(let p=d+1;p<s.length;p++)c.#s(a[d],a[p])&&n(d,p);let l=new Map;for(let d=0;d<s.length;d++){let p=o(d);l.has(p)||l.set(p,[]),l.get(p)?.push(d)}for(let d of l.values()){if(d.length<2)continue;let p=`c${++t}`;d.forEach((u,m)=>{let f=s[u];f.classList.add("qg-clustered"),f.dataset.cluster=p,f.style.setProperty("--qg-cluster-i",String(m)),f.style.setProperty("--qg-cluster-n",String(d.length)),!f.hasAttribute("tabindex")&&!f.matches("a, button, [contenteditable]")&&(f.setAttribute("tabindex","0"),f.dataset.qgTabbed="")})}}}teardown(){this.#g?.disconnect(),this.#g=null,this.#p&&cancelAnimationFrame(this.#p),this.#p=0}static#s(t,e){return!(t.right<=e.left||e.right<=t.left||t.bottom<=e.top||e.bottom<=t.top)}static#o(t){let e=5381;for(let r=0;r<t.length;r++)e=(e<<5)+e+t.charCodeAt(r)|0;return(e%360+360)%360}#a=t=>{let{item:e,fromSurface:r,toSurface:s}=t.detail,a=this.#c(r),i=this.#c(s);a==null||i==null||(e.setAttribute("data-quadrant",String(i)),this.#b(`Moved ${this.#d(e)} to ${this.#y[i]}`),this.dispatchEvent(new CustomEvent("quadrant-grid:move",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,from:a,to:i}})))};#n(t){let e=parseInt(t.getAttribute("data-quadrant"),10);if(e>=0&&e<=3)return e;if(t.hasAttribute("data-x")&&t.hasAttribute("data-y")){let r=parseFloat(t.getAttribute("data-x")),s=parseFloat(t.getAttribute("data-y"));return c.quadrantFor(r,s)}return 0}static quadrantFor(t,e){let r=t>=.5,s=e>=.5;return s&&r?0:s&&!r?1:!s&&!r?2:3}#c(t){for(let e=0;e<4;e++)if(this.#u[e]===t)return e;return null}#d(t){return(t.textContent||"").trim().split(`
1755
+ `)[0]||"item"}#b(t){this.#h&&(this.#h.textContent=t)}#m="";#u={};#f={};#v={};#l=null;#h=null;#y=[];#g=null;#p=0};x("quadrant-grid",ct);var It=5,dt=class c extends C{setup(){let t=this.querySelector(":scope > template"),e=t?c.#t(t):[];if(this.hasAttribute("src")){this.#e(this.getAttribute("src"));return}this.#r(e)}async#e(t){try{let r=await(await fetch(t)).json();this.#r(Array.isArray(r)?r:[])}catch(e){console.warn("risk-register: failed to load src",t,e),this.#r([])}}static#t(t){let e=[],r=t.content.querySelectorAll("tr");for(let s of r){let a=[...s.children],i=a[0]?.textContent?.trim()||"",o=s.getAttribute("data-id")||i.toLowerCase().replace(/\s+/g,"-")||`risk-${e.length}`;e.push({id:o,title:i,likelihood:parseInt(a[1]?.textContent??"",10)||0,impact:parseInt(a[2]?.textContent??"",10)||0,owner:a[3]?.textContent?.trim()||"",mitigation:a[4]?.textContent?.trim()||""})}return e}#r(t){this.#a=t,[...this.children].forEach(s=>{s.tagName!=="TEMPLATE"&&s.remove()});let e=this.getAttribute("label");if(e){let s=document.createElement("header");s.className="rr-label",s.textContent=e,this.appendChild(s)}let r=document.createElement("div");r.className="rr-layout",r.appendChild(this.#i(t)),r.appendChild(this.#s(t)),this.appendChild(r),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("risk-register:ready",{bubbles:!0,detail:{count:t.length}}))})}#i(t){let e=document.createElement("data-table"),r=document.createElement("table");return r.innerHTML=`
1756
+ <thead>
1757
+ <tr>
1758
+ <th data-sort="string">Title</th>
1759
+ <th data-sort="number">Likelihood</th>
1760
+ <th data-sort="number">Impact</th>
1761
+ <th data-sort="number" data-rollup="product" data-heatmap="low-good">Severity</th>
1762
+ <th data-sort="string">Owner</th>
1763
+ <th data-sort="string">Mitigation</th>
1764
+ </tr>
1765
+ </thead>
1766
+ <tbody>
1767
+ ${t.map(s=>`
1768
+ <tr data-id="${c.#o(s.id)}">
1769
+ <td>${c.#o(s.title)}</td>
1770
+ <td>${s.likelihood||""}</td>
1771
+ <td>${s.impact||""}</td>
1772
+ <td></td>
1773
+ <td>${c.#o(s.owner)}</td>
1774
+ <td>${c.#o(s.mitigation)}</td>
1775
+ </tr>
1776
+ `).join("")}
1777
+ </tbody>
1778
+ `,e.appendChild(r),e}#s(t){let e=document.createElement("quadrant-grid");e.setAttribute("x-label","Likelihood"),e.setAttribute("y-label","Impact"),e.setAttribute("x-low","Rare"),e.setAttribute("x-high","Likely"),e.setAttribute("y-low","Minor"),e.setAttribute("y-high","Severe"),e.setAttribute("q1-label","Avoid"),e.setAttribute("q2-label","Plan"),e.setAttribute("q3-label","Accept"),e.setAttribute("q4-label","Mitigate");for(let r of t){if(!r.likelihood||!r.impact)continue;let s=document.createElement("span"),a=Math.min(1,Math.max(0,r.likelihood/It)),i=Math.min(1,Math.max(0,r.impact/It));s.setAttribute("data-x",a.toFixed(3)),s.setAttribute("data-y",i.toFixed(3)),s.setAttribute("data-id",r.id),s.setAttribute("title",`${r.title} \u2014 likelihood ${r.likelihood}, impact ${r.impact}`),s.textContent=r.title,e.appendChild(s)}return e}static#o(t){return String(t??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}#a=[];get rows(){return[...this.#a]}set rows(t){this.#r(Array.isArray(t)?t:[])}};x("risk-register",dt);var lt=class c extends C{setup(){let t=this.getAttribute("rows"),e=this.getAttribute("cols"),r=this.getAttribute("link-attr");return!t||!e||!r?(console.warn("traceability-matrix: requires rows, cols, and link-attr attributes"),!1):(queueMicrotask(()=>this.#e(t,e,r)),!0)}#e(t,e,r){let s=[...document.querySelectorAll(t)].filter(b=>b!==this&&!this.contains(b)),a=[...document.querySelectorAll(e)].filter(b=>b!==this&&!this.contains(b));if(!s.length||!a.length){this.#i();return}let i=this.getAttribute("row-label")||"",o=this.getAttribute("cell-mark")||"\u2713",n=this.hasAttribute("flag-orphans"),l=[],d=new WeakMap,p=new WeakMap;for(let b of s){let w=c.#s(b.getAttribute(r));for(let T of w){let E=a.find(M=>M.id===T);E&&(l.push({rowEl:b,colEl:E}),d.set(b,(d.get(b)||0)+1),p.set(E,(p.get(E)||0)+1))}}let u=document.createElement("data-table"),m=document.createElement("table"),f=document.createElement("thead"),g=document.createElement("tr"),v=document.createElement("th");v.setAttribute("data-sort","string"),v.textContent=i,g.appendChild(v);for(let b of a){let w=document.createElement("th");w.setAttribute("data-sort","number"),w.textContent=c.#o(b),w.dataset.colId=b.id||"",n&&!p.get(b)&&(w.dataset.orphan=""),g.appendChild(w)}f.appendChild(g),m.appendChild(f);let y=document.createElement("tbody");for(let b of s){let w=document.createElement("tr");w.dataset.rowId=b.id||"",n&&!d.get(b)&&(w.dataset.orphan="");let T=document.createElement("th");T.scope="row",T.textContent=c.#o(b),w.appendChild(T);let E=c.#s(b.getAttribute(r));for(let M of a){let $=document.createElement("td"),F=E.includes(M.id);$.setAttribute("data-sort-value",F?"1":"0"),F?($.dataset.linked="",$.textContent=o,$.setAttribute("aria-label","linked")):$.setAttribute("aria-label","not linked"),$.dataset.colId=M.id||"",w.appendChild($)}y.appendChild(w)}m.appendChild(y),u.appendChild(m),[...this.children].forEach(b=>{b.tagName!=="TEMPLATE"&&b.remove()});let _=this.getAttribute("label");if(_){let b=document.createElement("header");b.className="tm-label",b.textContent=_,this.appendChild(b)}this.appendChild(u),this.#a=u,this.#n=new Map(s.map(b=>[b.id,b])),this.#c=new Map(a.map(b=>[b.id,b])),this.listen(u,"click",this.#t),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("traceability-matrix:ready",{bubbles:!0,detail:{rowCount:s.length,colCount:a.length,linkCount:l.length}}))})}#t=t=>{let e=t.target.closest('td, th[scope="row"]');if(!e)return;let r=e.closest("tr");if(!r)return;let s=r.dataset.rowId,a=e.dataset.colId,i=s?this.#n.get(s):null,o=a?this.#c.get(a):null,n=e.hasAttribute("data-state-highlighted");if(this.#r(),n){this.dispatchEvent(new CustomEvent("traceability-matrix:highlight",{bubbles:!0,detail:{rowEl:i,colEl:o,on:!1}}));return}e.setAttribute("data-state-highlighted",""),i&&i.setAttribute("data-state-highlighted",""),o&&o!==i&&o.setAttribute("data-state-highlighted",""),r.setAttribute("data-state-highlighted",""),this.dispatchEvent(new CustomEvent("traceability-matrix:highlight",{bubbles:!0,detail:{rowEl:i,colEl:o,on:!0}}))};#r(){this.#a&&(this.#a.querySelectorAll("[data-state-highlighted]").forEach(t=>t.removeAttribute("data-state-highlighted")),document.querySelectorAll("[data-state-highlighted]").forEach(t=>{(this.#n.has(t.id)||this.#c.has(t.id))&&t.removeAttribute("data-state-highlighted")}))}#i(){[...this.children].forEach(e=>{e.tagName!=="TEMPLATE"&&e.remove()});let t=document.createElement("p");t.className="tm-empty",t.textContent="No matching elements found for this matrix.",this.appendChild(t)}static#s(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}static#o(t){return t.getAttribute("data-matrix-label")||t.id||(t.textContent||"").trim().split(`
1779
+ `)[0].slice(0,60)||"(unnamed)"}#a=null;#n=new Map;#c=new Map};x("traceability-matrix",lt);var te=864e5,pt=class c extends C{setup(){let t=this.getAttribute("start"),e=this.getAttribute("end"),r=parseFloat(this.getAttribute("total")||"");if(!t||!e||!Number.isFinite(r))return console.warn("burndown-chart: requires start, end, and total attributes"),!1;let s=c.#r(t),a=c.#r(e);if(!s||!a||a<s)return console.warn("burndown-chart: start/end dates invalid",t,e),!1;let i=(this.getAttribute("weekends")||"include")!=="exclude",o=this.getAttribute("unit")||"points",n=this.getAttribute("label")||"",l=this.querySelector(":scope > template"),d=l?c.#t(l):[],p=d.filter(g=>g.delta!==0),u=c.#s(s,a),m=c.#o(u,r,i),f=c.#a(u,d);return this.#e({label:n,unit:o,dayLabels:u,actual:f,ideal:m,scopeChanges:p}),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("burndown-chart:ready",{bubbles:!0,detail:{dayCount:u.length,total:r,scopeChanges:p.length}}))}),!0}#e({label:t,unit:e,dayLabels:r,actual:s,ideal:a,scopeChanges:i}){if([...this.children].forEach(p=>{p.tagName!=="TEMPLATE"&&p.remove()}),t){let p=document.createElement("header");p.className="bdc-label",p.textContent=t,this.appendChild(p)}let o=document.createElement("chart-wc");o.setAttribute("data-type","line"),o.setAttribute("data-legend",""),o.setAttribute("data-tooltip",""),o.setAttribute("data-label-x","Day"),o.setAttribute("data-label-y",e);let n={},l={};r.forEach((p,u)=>{n[p]=a[u],s[u]!==null&&(l[p]=s[u])});let d=[{name:"Actual",values:l},{name:"Ideal",values:n}];if(o.setAttribute("data-values",JSON.stringify(d)),this.appendChild(o),i.length){let p=document.createElement("aside");p.className="bdc-scope-changes";let u=document.createElement("h4");u.textContent="Scope changes",p.appendChild(u);let m=document.createElement("ul");for(let f of i){let g=document.createElement("li"),v=f.delta>0?"+":"";g.innerHTML=`<time datetime="${f.date}">${f.date}</time>: <strong>${v}${f.delta} ${e}</strong>`,m.appendChild(g)}p.appendChild(m),this.appendChild(p)}}static#t(t){let e=[],r=t.content.querySelectorAll("tr");for(let s of r){let a=[...s.children],i=a[0]?.textContent?.trim(),o=parseFloat(a[1]?.textContent??""),n=parseFloat(a[2]?.textContent??"0")||0;!i||!Number.isFinite(o)||e.push({date:i,remaining:o,delta:n})}return e}static#r(t){let e=String(t).match(/^(\d{4})-(\d{2})-(\d{2})/);return e?new Date(Number(e[1]),Number(e[2])-1,Number(e[3])):null}static#i(t){let e=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${r}`}static#s(t,e){let r=[];for(let s=t.getTime();s<=e.getTime();s+=te)r.push(c.#i(new Date(s)));return r}static#o(t,e,r){let s=d=>{let p=c.#r(d);if(!p)return!1;let u=p.getDay();return u===0||u===6},a=t.map((d,p)=>({d,i:p,weekend:s(d)})).filter(d=>r||!d.weekend),i=a.length>1?e/(a.length-1):0,o=new Array(t.length).fill(null),n=e,l=0;for(let d=0;d<t.length;d++){let p=s(t[d]);r||!p?(o[d]=Math.max(0,e-i*l),l++,n=o[d]):o[d]=n}return o}static#a(t,e){let r=new Map(e.map(s=>[s.date,s.remaining]));return t.map(s=>r.has(s)?r.get(s):null)}};x("burndown-chart",pt);var ut=class c extends C{setup(){let t=this.getAttribute("start"),e=this.getAttribute("end");if(!t||!e)return console.warn("product-roadmap: start and end attributes required"),!1;let r=c.#f(t,"start"),s=c.#f(e,"end");if(!r||!s||s<=r)return console.warn("product-roadmap: invalid start/end",t,e),!1;this.#l=r,this.#h=s,this.#y=s.getTime()-r.getTime(),this.#g=this.getAttribute("view")==="month"?"month":"quarter",this.#p=this.hasAttribute("editable");let a=[...this.querySelectorAll(":scope > section[data-lane]")];return a.length?(this.#x=a,this.#e(),!0):(console.warn("product-roadmap: no <section data-lane> children found"),!1)}attributeChangedCallback(){this.isConnected&&this.#x.length&&this.#e()}#e(){[...this.children].forEach(s=>{this.#x.includes(s)||s.remove()}),this.#x.forEach(s=>{s.hidden=!0});let t=document.createElement("div");t.className="rm-wrapper";let e=this.#t();t.appendChild(e);let r=document.createElement("div");r.className="rm-lanes";for(let s of this.#x){let a=s.getAttribute("data-lane")||"",i=document.createElement("section");i.className="rm-lane",i.dataset.lane=a;let o=document.createElement("header");o.className="rm-lane-label",o.textContent=a,i.appendChild(o);let n=document.createElement("div");n.className="rm-track",n.dataset.lane=a;let l=[...s.querySelectorAll(":scope > article[data-start][data-end]")];for(let d of l){let p=this.#r(d,a);p&&n.appendChild(p)}this.#p&&(n.addEventListener("dragover",this.#n),n.addEventListener("drop",this.#c)),i.appendChild(n),r.appendChild(i)}if(t.appendChild(r),this.hasAttribute("today-marker")&&this.#l&&this.#h){let s=new Date;if(s>=this.#l&&s<=this.#h){let a=document.createElement("div");a.className="rm-today",a.style.setProperty("--rm-x",this.#d(s).toFixed(4)),a.title=`Today: ${c.#v(s)}`,r.appendChild(a)}}this.appendChild(t),this.#k=t}#t(){let t=document.createElement("header");t.className="rm-axis";let e=this.#u();for(let r of e){let s=document.createElement("div");s.className="rm-tick",s.style.setProperty("--rm-x",r.startFraction.toFixed(4)),s.style.setProperty("--rm-w",(r.endFraction-r.startFraction).toFixed(4)),s.textContent=r.label,t.appendChild(s)}return t}#r(t,e){let r=c.#f(t.getAttribute("data-start"),"start"),s=c.#f(t.getAttribute("data-end"),"end");if(!r||!s||!this.#l||!this.#h)return null;let a=r<this.#l?this.#l:r,i=s>this.#h?this.#h:s;if(a>=i)return null;let o=this.#d(a),n=this.#d(i)-o,l=document.createElement("article");l.className="rm-bar",l.style.setProperty("--rm-x",o.toFixed(4)),l.style.setProperty("--rm-w",n.toFixed(4)),l.dataset.lane=e,l.dataset.start=c.#v(r),l.dataset.end=c.#v(s),t.dataset.status&&(l.dataset.status=t.dataset.status),t.id&&(l.dataset.sourceId=t.id),this.#p&&l.setAttribute("draggable","true");let d=t.querySelector("h1, h2, h3, h4, h5, h6"),p=document.createElement("span");if(p.className="rm-bar-title",p.textContent=d?d.textContent.trim():(t.textContent||"").trim().split(`
1780
+ `)[0],l.appendChild(p),l.setAttribute("aria-label",`${p.textContent} \u2014 ${l.dataset.start} to ${l.dataset.end} in ${e}`),l.addEventListener("click",u=>{this.#w||this.dispatchEvent(new CustomEvent("product-roadmap:select",{bubbles:!0,detail:{initiative:t,lane:e,start:l.dataset.start,end:l.dataset.end,status:l.dataset.status||null}}))}),this.#p){let u=document.createElement("span");u.className="rm-bar-handle",u.setAttribute("aria-label","Resize end date"),l.appendChild(u),u.addEventListener("pointerdown",m=>this.#s(m,l,t)),l.addEventListener("pointerdown",m=>{m.target!==u&&this.#i(m,l,t)}),l.addEventListener("dragstart",m=>{m.dataTransfer&&(m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",t.id||l.dataset.sourceId||"")),this.#A=t,this.#_=e}),l.addEventListener("dragend",()=>{this.#A=null,this.#_=null})}return l}#i(t,e,r){if(t.button!==0)return;t.preventDefault();let s=e.parentElement.getBoundingClientRect(),a=t.clientX,i=parseFloat(e.style.getPropertyValue("--rm-x"))||0,o=parseFloat(e.style.getPropertyValue("--rm-w"))||0;this.#w={kind:"move",bar:e,initiative:r,trackRect:s,startX:a,startFraction:i,widthFraction:o},e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.#o),e.addEventListener("pointerup",this.#a),e.addEventListener("pointercancel",this.#a)}#s(t,e,r){if(t.button!==0)return;t.preventDefault(),t.stopPropagation();let s=e.parentElement.getBoundingClientRect(),a=t.clientX,i=parseFloat(e.style.getPropertyValue("--rm-x"))||0,o=parseFloat(e.style.getPropertyValue("--rm-w"))||0;this.#w={kind:"resize",bar:e,initiative:r,trackRect:s,startX:a,startFraction:i,widthFraction:o},e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.#o),e.addEventListener("pointerup",this.#a),e.addEventListener("pointercancel",this.#a)}#o=t=>{if(!this.#w)return;let{kind:e,bar:r,trackRect:s,startX:a,startFraction:i,widthFraction:o}=this.#w,n=(t.clientX-a)/s.width;if(e==="move"){let l=Math.max(0,Math.min(1-o,i+n));r.style.setProperty("--rm-x",l.toFixed(4))}else if(e==="resize"){let l=Math.max(.02,Math.min(1-i,o+n));r.style.setProperty("--rm-w",l.toFixed(4))}};#a=t=>{if(!this.#w)return;let{kind:e,bar:r,initiative:s}=this.#w;r.releasePointerCapture(t.pointerId),r.removeEventListener("pointermove",this.#o),r.removeEventListener("pointerup",this.#a),r.removeEventListener("pointercancel",this.#a);let a=parseFloat(r.style.getPropertyValue("--rm-x"))||0,i=parseFloat(r.style.getPropertyValue("--rm-w"))||0,o=this.#m(this.#b(a)),n=this.#m(this.#b(a+i));r.dataset.start=c.#v(o),r.dataset.end=c.#v(n);let l=this.#d(o),d=this.#d(n)-l;r.style.setProperty("--rm-x",l.toFixed(4)),r.style.setProperty("--rm-w",d.toFixed(4)),s&&(s.setAttribute("data-start",r.dataset.start??""),s.setAttribute("data-end",r.dataset.end??"")),this.dispatchEvent(new CustomEvent(e==="move"?"product-roadmap:reschedule":"product-roadmap:resize",{bubbles:!0,detail:{initiative:s,lane:r.dataset.lane,start:r.dataset.start,end:r.dataset.end}})),setTimeout(()=>{this.#w=null},0)};#n=t=>{this.#A&&(t.preventDefault(),t.dataTransfer.dropEffect="move")};#c=t=>{if(!this.#A)return;t.preventDefault();let e=t.currentTarget.dataset.lane,r=this.#A,s=this.#_;if(e===s)return;let a=this.#x.find(i=>i.getAttribute("data-lane")===e);a&&a.appendChild(r),this.dispatchEvent(new CustomEvent("product-roadmap:move",{bubbles:!0,detail:{initiative:r,fromLane:s,toLane:e,start:r.getAttribute("data-start"),end:r.getAttribute("data-end")}})),this.#e()};#d(t){if(!this.#l)return 0;let e=t.getTime()-this.#l.getTime();return Math.max(0,Math.min(1,e/this.#y))}#b(t){let e=this.#l??new Date;return new Date(e.getTime()+t*this.#y)}#m(t){if(this.#g==="month")return new Date(t.getFullYear(),t.getMonth(),1);let e=t.getMonth(),r=Math.floor(e/3)*3;return new Date(t.getFullYear(),r,1)}#u(){let t=[],e=this.#l,r=this.#h;if(!e||!r)return t;if(this.#g==="quarter"){let s=this.#m(e);for(;s<r;){let a=new Date(s.getFullYear(),s.getMonth()+3,1),i=this.#d(s<e?e:s),o=this.#d(a>r?r:a),n=Math.floor(s.getMonth()/3)+1;t.push({startFraction:i,endFraction:o,label:`Q${n} ${s.getFullYear()}`}),s=a}}else{let s=new Date(e.getFullYear(),e.getMonth(),1);for(;s<r;){let a=new Date(s.getFullYear(),s.getMonth()+1,1),i=this.#d(s<e?e:s),o=this.#d(a>r?r:a),n=s.toLocaleString(void 0,{month:"short"});t.push({startFraction:i,endFraction:o,label:`${n} ${s.getFullYear()}`}),s=a}}return t}static#f(t,e){if(!t)return null;let r=String(t).match(/^(\d{4})-Q([1-4])$/i);if(r){let i=Number(r[1]),n=(Number(r[2])-1)*3;return e==="end"?new Date(i,n+3,0):new Date(i,n,1)}let s=String(t).match(/^(\d{4})-(\d{2})-(\d{2})/);if(s)return new Date(Number(s[1]),Number(s[2])-1,Number(s[3]));let a=new Date(t);return isNaN(a.getTime())?null:a}static#v(t){let e=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${r}`}#l=null;#h=null;#y=0;#g="quarter";#p=!1;#x=[];#k=null;#w=null;#A=null;#_=null};x("product-roadmap",ut);function Tt(c){let t=c;return class extends t{static keyOf(e){return e.id}#e=[];#t=new Map;get items(){return this.#e}set items(e){let r=e||[],s=V({newItems:r,nodes:this.#t,keyOf:this.constructor.keyOf,renderItem:a=>this._renderItem(a),containerFor:(a,i)=>this._containerFor(a,i)});this.#e=r,this._postRender({...s,items:r}),this._emit("items-changed",{items:r},"api")}_renderItem(e){throw new Error(`${this.constructor.name}: must implement _renderItem(item)`)}_containerFor(e,r){return this}_postRender(e){}_emit(e,r,s="api"){this.dispatchEvent(new CustomEvent(`${this.localName}:${e}`,{detail:{...r,source:s},bubbles:!0}))}_nodeFor(e){return this.#t.get(e)||null}_seedCollection(e,r){this.#e=e,this.#t.clear();for(let[s,a]of r)this.#t.set(s,a)}_setItemsSilently(e){this.#e=e}}}var ht=class c extends Tt(C){static get observedAttributes(){return["src","compact","title"]}static keyOf(t){return t.id??t.storyId}static#e=0;#t=null;#r={};#i={};#s=null;#o="";#a=[];#n=null;setup(){this.#o=`kb-${++c.#e}`;let t=[...this.querySelectorAll(":scope > section[data-column]")];this.#a=t.map(a=>{let i=a.getAttribute("data-column")||"",n=a.getAttribute("data-column-label")||""||this.#y(i),l=a.getAttribute("data-wip"),d=l?parseInt(l,10):null,p=a.getAttribute("data-column-color")||null,u=[...a.children];return{id:i,label:n,wip:d,color:p,children:u}});for(let a of t)a.remove();this.#t=document.createElement("div"),this.#t.className="kb-columns",this.#t.setAttribute("role","region"),this.#t.setAttribute("aria-label","Kanban board");let e=0;for(let a of this.#a){let i=document.createElement("section");i.className="kb-column",i.setAttribute("data-column-id",a.id),a.color&&i.setAttribute("data-column-tint",a.color);let o=document.createElement("header");o.className="kb-column-header";let n=document.createElement("h3");n.textContent=a.label;let l=document.createElement("output");if(l.className="kb-count",l.textContent=String(a.children.length),n.appendChild(l),a.wip!==null&&!isNaN(a.wip)){let p=document.createElement("span");p.className="kb-wip",p.textContent=`/ ${a.wip}`,p.setAttribute("aria-label",`WIP limit ${a.wip}`),n.appendChild(p)}o.appendChild(n),i.appendChild(o);let d=document.createElement("drag-surface");if(d.setAttribute("group",this.#o),d.setAttribute("aria-label",`${a.label} items`),d.setAttribute("data-layout","stack"),d.setAttribute("data-layout-gap","xs"),a.children.length>0){for(let p of a.children)p.hasAttribute("draggable")||p.setAttribute("draggable","true"),p.hasAttribute("data-id")||(p.dataset.id=`kb-item-${e}`),d.appendChild(p);e+=a.children.length}else{let p=document.createElement("p");p.className="kb-empty",p.textContent="No items",d.appendChild(p)}i.appendChild(d),this.#t.appendChild(i),this.#r[a.id]=d,this.#i[a.id]=i,a.wip!==null&&a.children.length>a.wip&&i.setAttribute("data-wip-exceeded","")}let r=this.getAttribute("title");if(r){let a=document.createElement("h2");a.className="kb-title",a.textContent=r,this.appendChild(a)}this.appendChild(this.#t),this.#s=document.createElement("div"),this.#s.className="kb-live-region",this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.listen(this,"drag-surface:reorder",a=>{let i=a.detail,o=a.target.closest("drag-surface"),n=this.#u(o);n&&(this.#f(n),this.#d("drag"),this.dispatchEvent(new CustomEvent("kanban-board:reorder",{bubbles:!0,detail:{itemId:i.itemId,column:n,oldIndex:i.oldIndex,newIndex:i.newIndex}})))}),this.listen(this,"drag-surface:transfer",a=>{let i=a.detail,o=i.fromSurface,n=i.toSurface,l=this.#u(o),d=this.#u(n);if(!l||!d)return;i.item&&i.item.setAttribute("data-column",d),this.#f(l),this.#f(d);let p=n.querySelector(".kb-empty");if(p&&p.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".kb-empty")){let _=document.createElement("p");_.className="kb-empty",_.textContent="No items",o.appendChild(_)}let m=this.#h(i.item),f=this.#v(l),g=this.#v(d);this.#l(`${m} moved from ${f} to ${g}`),this.#d("drag"),this.dispatchEvent(new CustomEvent("kanban-board:transfer",{bubbles:!0,detail:{itemId:i.itemId,fromColumn:l,toColumn:d,newIndex:i.newIndex,item:i.item}}));let v=n.querySelectorAll(':scope > [draggable="true"]').length,y=this.#a.find(_=>_.id===d);y?.wip!==null&&y?.wip!==void 0&&v>y.wip&&this.dispatchEvent(new CustomEvent("kanban-board:wip-exceeded",{bubbles:!0,detail:{column:d,limit:y.wip,count:v}}))}),this.#c();let s=this.getAttribute("src");if(s){this._loadSrc(s);return}this.dispatchEvent(new CustomEvent("kanban-board:ready",{bubbles:!0,detail:{columnCount:this.#a.length,itemCount:e}}))}#c(){let t=[],e=new Map;for(let[r,s]of Object.entries(this.#r)){let a=s.querySelectorAll(':scope > [draggable="true"]');for(let i of a){let o=i.getAttribute("data-id");o&&(t.push({id:o,column:r}),e.set(o,i))}}this._seedCollection(t,e)}#d(t){let e=[],r=new Map;for(let s of this.items){let a=String(s.id??s.storyId??"");a&&r.set(a,s)}for(let[s,a]of Object.entries(this.#r)){let i=a.querySelectorAll(':scope > [draggable="true"]');for(let o of i){let n=o.getAttribute("data-id");if(!n)continue;let l=r.get(n);e.push(l?{...l,column:s}:{id:n,column:s})}}this._setItemsSilently(e),this._emit("items-changed",{items:e},t)}teardown(){let t=this.querySelector(".kb-title");t&&t.remove(),this.#t&&(this.#t.remove(),this.#t=null),this.#s&&(this.#s.remove(),this.#s=null),this.#r={},this.#i={},this.#a=[]}get columns(){return this.#a.map(t=>({id:t.id,label:t.label,wip:t.wip??void 0,color:t.color??void 0}))}set columns(t){let e=(t||[]).map(i=>({id:i.id,label:i.label||this.#y(i.id),wip:i.wip??null,color:i.color??null,children:[]})),r=this.#t;this.#r={},this.#i={},this.#a=e;let s=this.#m();this.#t=s;let a=()=>{r&&r.remove(),this.appendChild(s)};this.hasAttribute("data-upgraded")&&r?S(this,a,"kb-vt"):a()}get renderItem(){return this.#n}set renderItem(t){this.#n=typeof t=="function"?t:null}_renderItem(t){let e;if(this.#n){let r=this.#n(t);if(!(r instanceof Element))throw new Error("kanban-board: renderItem must return an Element");e=r}else e=this.#b(t);return e.hasAttribute("draggable")||e.setAttribute("draggable","true"),e.hasAttribute("data-id")||e.setAttribute("data-id",String(c.keyOf(t))),e}_containerFor(t,e){let r=this.#r[t.column];if(!r)throw new Error(`kanban-board: no column "${t.column}" \u2014 set .columns first or include item.column matching an existing column id`);let s=r.querySelector(":scope > .kb-empty");return s&&s.remove(),r}_postRender(){for(let t of Object.keys(this.#r)){this.#f(t);let e=this.#r[t],r=e.querySelectorAll(':scope > [draggable="true"]'),s=e.querySelector(":scope > .kb-empty");if(r.length===0&&!s){let a=document.createElement("p");a.className="kb-empty",a.textContent="No items",e.appendChild(a)}else r.length>0&&s&&s.remove()}}#b(t){let e=customElements.get("work-item")?"work-item":"article",r=document.createElement(e);return e==="work-item"?r.data={itemId:t.id??t.storyId,type:t.type,priority:t.priority,status:t.status,estimate:t.estimate!=null?String(t.estimate):void 0,assignee:t.assignee,title:t.title,description:t.description,checklist:t.checklist,notes:t.notes,detail:t.detail}:(r.className="kb-card",r.textContent=t.title||t.label||t.id),r}#m(){let t=document.createElement("div");t.className="kb-columns",t.setAttribute("role","region"),t.setAttribute("aria-label","Kanban board");for(let e of this.#a){let r=document.createElement("section");r.className="kb-column",r.setAttribute("data-column-id",e.id),e.color&&r.setAttribute("data-column-tint",e.color);let s=document.createElement("header");s.className="kb-column-header";let a=document.createElement("h3");a.textContent=e.label;let i=document.createElement("output");if(i.className="kb-count",i.textContent="0",a.appendChild(i),e.wip!=null&&!isNaN(e.wip)){let l=document.createElement("span");l.className="kb-wip",l.textContent=`/ ${e.wip}`,l.setAttribute("aria-label",`WIP limit ${e.wip}`),a.appendChild(l)}s.appendChild(a),r.appendChild(s);let o=document.createElement("drag-surface");o.setAttribute("group",this.#o),o.setAttribute("aria-label",`${e.label} items`),o.setAttribute("data-layout","stack"),o.setAttribute("data-layout-gap","xs");let n=document.createElement("p");n.className="kb-empty",n.textContent="No items",o.appendChild(n),r.appendChild(o),t.appendChild(r),this.#r[e.id]=o,this.#i[e.id]=r}return t}attributeChangedCallback(t,e,r){e===r||!this.isConnected||t==="src"&&this._loadSrc(r)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let a of r.columns||[]){let i=document.createElement("section");i.setAttribute("data-column",a.id),a.label&&i.setAttribute("data-column-label",a.label),a.wip!=null&&i.setAttribute("data-wip",String(a.wip)),a.color&&i.setAttribute("data-column-color",a.color);for(let o of a.items||[]){let n;o.persona||o.action||o.storyId?(n=document.createElement("user-story"),n.setAttribute("detail",o.detail||"minimal"),o.storyId&&n.setAttribute("story-id",o.storyId),o.persona&&n.setAttribute("persona",o.persona),o.action&&n.setAttribute("action",o.action),o.benefit&&n.setAttribute("benefit",o.benefit),o.priority&&n.setAttribute("priority",o.priority),o.status&&n.setAttribute("status",o.status),o.points&&n.setAttribute("points",String(o.points))):(n=document.createElement("article"),n.className="kb-card",n.textContent=o.text||o.label||""),n.setAttribute("draggable","true"),n.dataset.id=o.id||o.storyId||"",i.appendChild(n)}this.appendChild(i)}let s=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#t?S(this,s,"kb-vt"):s()}catch(e){console.warn(`[kanban-board] Failed to load src="${t}":`,e)}}#u(t){if(!t)return null;for(let[e,r]of Object.entries(this.#r))if(r===t)return e;return null}#f(t){let e=this.#r[t],r=this.#i[t];if(!e||!r)return;let s=e.querySelectorAll(':scope > [draggable="true"]').length,a=r.querySelector(".kb-count");a&&(a.textContent=String(s));let i=this.#a.find(o=>o.id===t);i?.wip!==null&&i?.wip!==void 0&&(s>i.wip?r.setAttribute("data-wip-exceeded",""):r.removeAttribute("data-wip-exceeded"))}#v(t){return this.#a.find(r=>r.id===t)?.label||this.#y(t)}#l(t){this.#s&&(this.#s.textContent="",requestAnimationFrame(()=>{this.#s&&(this.#s.textContent=t)}))}#h(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#y(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("kanban-board",ht);var mt=class c extends C{static get observedAttributes(){return["src","compact","title"]}static#e=0;#t=null;#r=null;#i={};#s=null;#o="";#a=[];setup(){this.#o=`sm-${++c.#e}`;let t=[...this.querySelectorAll(":scope > section[data-activity]")];this.#a=t.map(a=>{let i=a.getAttribute("data-activity")||"",n=a.getAttribute("data-activity-label")||""||this.#m(i),l=a.getAttribute("data-journey-phase")||null,d=[...a.children];return{id:i,label:n,journeyPhase:l,children:d}});for(let a of t)a.remove();this.#t=document.createElement("div"),this.#t.className="sm-scroll",this.#t.setAttribute("role","region"),this.#t.setAttribute("aria-label","Story map"),this.#t.setAttribute("tabindex","0"),this.#r=document.createElement("div"),this.#r.className="sm-columns";let e=0;for(let a of this.#a){let i=document.createElement("section");i.className="sm-column",i.setAttribute("data-activity-column",a.id);let o=document.createElement("header");o.className="sm-activity-header";let n=document.createElement("h3");n.textContent=a.label;let l=document.createElement("span");l.className="sm-activity-count",l.textContent=String(a.children.length),n.appendChild(l),o.appendChild(n),i.appendChild(o);let d=document.createElement("drag-surface");if(d.setAttribute("group",this.#o),d.setAttribute("aria-label",`${a.label} stories`),d.setAttribute("data-layout","stack"),d.setAttribute("data-layout-gap","xs"),a.children.length>0){for(let p of a.children)d.appendChild(p);e+=a.children.length}else{let p=document.createElement("p");p.className="sm-empty",p.textContent="No stories yet",d.appendChild(p)}i.appendChild(d),this.#r.appendChild(i),this.#i[a.id]=d}let r=this.getAttribute("title");if(r){let a=document.createElement("h2");a.className="sm-title",a.textContent=r,this.appendChild(a)}this.#t.appendChild(this.#r),this.appendChild(this.#t),this.#s=document.createElement("div"),this.#s.className="sm-live-region",this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.listen(this,"drag-surface:reorder",a=>{let i=a.detail,o=a.target.closest("drag-surface"),n=this.#n(o);n&&(this.#c(n),this.dispatchEvent(new CustomEvent("story-map:reorder",{bubbles:!0,detail:{itemId:i.itemId,activity:n,oldIndex:i.oldIndex,newIndex:i.newIndex}})))}),this.listen(this,"drag-surface:transfer",a=>{let i=a.detail,o=i.fromSurface,n=i.toSurface,l=this.#n(o),d=this.#n(n);if(!l||!d)return;this.#c(l),this.#c(d);let p=n.querySelector(".sm-empty");if(p&&p.remove(),o.querySelectorAll(':scope > [draggable="true"]').length===0&&!o.querySelector(".sm-empty")){let f=document.createElement("p");f.className="sm-empty",f.textContent="No stories yet",o.appendChild(f)}let m=this.#b(i.item);this.#d(`${m} moved from ${l} to ${d}`),this.dispatchEvent(new CustomEvent("story-map:transfer",{bubbles:!0,detail:{itemId:i.itemId,fromActivity:l,toActivity:d,newIndex:i.newIndex}}))});let s=this.getAttribute("src");if(s){this._loadSrc(s);return}this.dispatchEvent(new CustomEvent("story-map:ready",{bubbles:!0,detail:{activityCount:this.#a.length,storyCount:e}}))}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#s&&(this.#s.remove(),this.#s=null),this.#r=null,this.#i={},this.#a=[]}get activities(){return this.#a.map(t=>({id:t.id,label:t.label,journeyPhase:t.journeyPhase||void 0,stories:[...this.#i[t.id]?.querySelectorAll(':scope > [draggable="true"]')||[]].map(e=>({id:e.getAttribute("data-id")||void 0,storyId:e.getAttribute("story-id")||void 0,title:e.querySelector('[slot="title"]')?.textContent?.trim()||void 0}))}))}set activities(t){let e=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();for(let s of e){let a=document.createElement("section");a.setAttribute("data-activity",s.id||""),s.label&&a.setAttribute("data-activity-label",s.label),s.journeyPhase&&a.setAttribute("data-journey-phase",s.journeyPhase);for(let i of s.stories||[]){let o,n=this;if(typeof n.renderStory=="function"){let l=n.renderStory(i);o=l instanceof Element?l:null}o||(customElements.get("user-story")?(o=document.createElement("user-story"),o.data=i):(o=document.createElement("article"),o.className="sm-card",o.textContent=i.title||i.id||"")),o.hasAttribute("draggable")||o.setAttribute("draggable","true"),i.id&&!o.hasAttribute("data-id")&&o.setAttribute("data-id",String(i.id)),a.appendChild(o)}this.appendChild(a)}let r=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#t?S(this,r,"sm-vt"):r(),this.dispatchEvent(new CustomEvent("story-map:activities-changed",{detail:{activities:e,source:"property"},bubbles:!0}))}attributeChangedCallback(t,e,r){e===r||!this.isConnected||t==="src"&&this._loadSrc(r)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();for(;this.firstChild;)this.firstChild.remove();for(let a of r.activities||[]){let i=document.createElement("section");i.setAttribute("data-activity",a.id),i.setAttribute("data-activity-label",a.label||a.id),a.journeyPhase&&i.setAttribute("data-journey-phase",a.journeyPhase);for(let o of a.stories||[]){let n=document.createElement("user-story");n.setAttribute("draggable","true"),n.dataset.id=o.id||o.storyId,(o.storyId||o.id)&&n.setAttribute("story-id",o.storyId||o.id),o.title&&n.setAttribute("title",o.title),o.persona&&n.setAttribute("persona",o.persona),o.action&&n.setAttribute("action",o.action),o.benefit&&n.setAttribute("benefit",o.benefit),o.priority&&n.setAttribute("priority",o.priority),o.status&&n.setAttribute("status",o.status),o.points&&n.setAttribute("points",String(o.points)),n.setAttribute("detail",o.detail||"compact"),i.appendChild(n)}this.appendChild(i)}let s=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};this.hasAttribute("data-upgraded")&&this.#t?S(this,s,"sm-vt"):s()}catch(e){console.warn(`[story-map] Failed to load src="${t}":`,e)}}#n(t){if(!t)return null;for(let[e,r]of Object.entries(this.#i))if(r===t)return e;return null}#c(t){let e=this.#i[t];if(!e)return;let r=e.querySelectorAll(':scope > [draggable="true"]').length,s=e.closest("[data-activity-column]");if(!s)return;let a=s.querySelector(".sm-activity-count");a&&(a.textContent=String(r))}#d(t){this.#s&&(this.#s.textContent="",requestAnimationFrame(()=>{this.#s&&(this.#s.textContent=t)}))}#b(t){return t.getAttribute("story-id")||t.getAttribute("data-id")||t.textContent?.trim().slice(0,40)||"item"}#m(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("story-map",mt);var Q=`
1701
1781
  :host {
1702
1782
  display: block;
1703
1783
  position: relative;
@@ -1881,12 +1961,12 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1881
1961
  }
1882
1962
 
1883
1963
  .rs-popover__btn--delete {
1884
- color: #dc2626;
1964
+ color: var(--color-error-text, var(--color-error, #dc2626));
1885
1965
  }
1886
1966
 
1887
1967
  .rs-popover__btn--delete:hover {
1888
- background: #fef2f2;
1889
- color: #dc2626;
1968
+ background: color-mix(in oklch, var(--color-error, #dc2626) 8%, var(--_card));
1969
+ color: var(--color-error-text, var(--color-error, #dc2626));
1890
1970
  }
1891
1971
 
1892
1972
  /* \u2500\u2500 Comment thread \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 */
@@ -1910,7 +1990,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1910
1990
  display: flex;
1911
1991
  align-items: center;
1912
1992
  justify-content: center;
1913
- color: #fff;
1993
+ color: var(--color-text-inverted, #fff);
1914
1994
  flex-shrink: 0;
1915
1995
  }
1916
1996
 
@@ -1992,7 +2072,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
1992
2072
  border: none;
1993
2073
  border-radius: 6px;
1994
2074
  background: var(--_accent);
1995
- color: #fff;
2075
+ color: var(--color-text-inverted, #fff);
1996
2076
  cursor: pointer;
1997
2077
  padding: 0;
1998
2078
  flex-shrink: 0;
@@ -2054,7 +2134,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2054
2134
 
2055
2135
  .rs-toolbar__btn[aria-pressed="true"] {
2056
2136
  background: var(--_accent);
2057
- color: #fff;
2137
+ color: var(--color-text-inverted, #fff);
2058
2138
  border-color: var(--_accent);
2059
2139
  }
2060
2140
 
@@ -2144,75 +2224,69 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2144
2224
 
2145
2225
  /* \u2500\u2500 Utility \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 */
2146
2226
  .state-msg { padding: var(--_space-l); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
2147
- .state-msg--error { color: #dc2626; }
2148
-
2149
- @media (prefers-color-scheme: dark) {
2150
- .rs-popover__btn--delete:hover {
2151
- background: #450a0a;
2152
- }
2153
- }
2154
- `;function Dt(){let d=globalThis.localStorage;if(!d)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return d.getItem(t)},async setRaw(t,e){d.setItem(t,e)},async removeRaw(t){d.removeItem(t)},async keys(t){let e=[];for(let s=0;s<d.length;s++){let r=d.key(s);r&&r.startsWith(t)&&e.push(r)}return e}}}var R=null;function k(){return R||(R=Dt()),R}function st(d,t){if(typeof d!="string"||!d)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${d}:${t}`}function yt(d){if(typeof d!="string"||!d)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${d}:`}function xt(d){try{let t=JSON.parse(d);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var D={configure(d={}){R=d.backend??null},async set(d,t,e){let s={data:e,timestamp:Date.now()};await k().setRaw(st(d,t),JSON.stringify(s))},async get(d,t,e){let s=await k().getRaw(st(d,t));if(s==null)return null;let r=xt(s);return!r||e?.maxAge!=null&&Date.now()-r.timestamp>e.maxAge?null:r.data},async remove(d,t){await k().removeRaw(st(d,t))},async list(d){let t=yt(d),e=await k().keys(t),s=[];for(let r of e){let a=await k().getRaw(r);if(a==null)continue;let i=xt(a);i&&s.push({key:r.slice(t.length),data:i.data,timestamp:i.timestamp})}return s},async clear(d){let t=yt(d),e=await k().keys(t);for(let s of e)await k().removeRaw(s)},async clearAll(){let d=await k().keys("vb:");for(let t of d)await k().removeRaw(t)},async setMany(d,t){for(let[e,s]of t)await D.set(d,e,s)}};var I=class{#t=new Map;async load(){return[...this.#t.values()]}async save(t){return t.id||(t.id=crypto.randomUUID()),this.#t.set(t.id,t),t}async update(t,e){let s=this.#t.get(t);if(!s)throw new Error(`Pin ${t} not found`);return Object.assign(s,e),s}async remove(t){this.#t.delete(t)}},P=class{#t;constructor(t="default"){this.#t=t}async#e(){let t=await D.get("reviews",this.#t);return Array.isArray(t)?t:[]}async#s(t){await D.set("reviews",this.#t,t)}async load(){return this.#e()}async save(t){t.id||(t.id=crypto.randomUUID());let e=await this.#e();return e.push(t),await this.#s(e),t}async update(t,e){let s=await this.#e(),r=s.findIndex(a=>a.id===t);if(r===-1)throw new Error(`Pin ${t} not found`);return Object.assign(s[r],e),await this.#s(s),s[r]}async remove(t){let e=(await this.#e()).filter(s=>s.id!==t);await this.#s(e)}},B=class{#t;constructor(t){if(!t)throw new Error("RestAdapter requires an endpoint URL");this.#t=t.replace(/\/$/,"")}async load(){let t=await fetch(this.#t);if(!t.ok)throw new Error(`HTTP ${t.status}`);let e=await t.json();return Array.isArray(e)?e:e.pins||[]}async save(t){let e=await fetch(this.#t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async update(t,e){let s=await fetch(`${this.#t}/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.json()}async remove(t){let e=await fetch(`${this.#t}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`)}},rt=class extends HTMLElement{static get observedAttributes(){return["src","editable","adapter","endpoint","storage-key","author","compact","show-resolved"]}#t=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__pins=[],this.__adapter=null,this._activePin=null,this._annotating=!1}get pins(){return this.__pins}set pins(t){this.__pins=Array.isArray(t)?t:[],this.isConnected&&this._render()}get adapter(){return this.__adapter}set adapter(t){this.__adapter=t,this.isConnected&&this._loadFromAdapter()}#e(){for(let t of this.children){let e=t.getAttribute("slot");e&&this.#t.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#t.get(t)||""}connectedCallback(){this.#e(),this.setAttribute("data-upgraded",""),this.#s(),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._loadFromAdapter()}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.removeAttribute("data-annotating")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):t==="adapter"||t==="endpoint"||t==="storage-key"?(this.#s(),this._loadFromAdapter()):this._render())}#s(){if(this.__adapter&&!(this.__adapter instanceof I)&&!(this.__adapter instanceof P)&&!(this.__adapter instanceof B))return;switch(this.getAttribute("adapter")||"memory"){case"local":this.__adapter=new P(this.getAttribute("storage-key")||"default");break;case"rest":try{this.__adapter=new B(this.getAttribute("endpoint"))}catch{this.__adapter=new I}break;default:this.__adapter=new I}}async _loadSrc(t){if(t){this.shadowRoot.innerHTML=`<style>${j}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();this.__pins=Array.isArray(s)?s:s.pins||[],this._render()}catch(e){this.shadowRoot.innerHTML=`<style>${j}</style><div class="state-msg state-msg--error">Could not load pins: ${m(e.message)}</div>`}}}async _loadFromAdapter(){if(this.__adapter){try{this.__pins=await this.__adapter.load()}catch{this.__pins=[]}this._render()}}async addPin(t){let e={id:crypto.randomUUID(),x:Math.max(0,Math.min(100,t.x)),y:Math.max(0,Math.min(100,t.y)),text:t.text||"",author:t.author||this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString(),resolved:!1,resolvedBy:null,resolvedAt:null,replies:[]};return this.__adapter&&await this.__adapter.save(e),this.__pins.push(e),this._render(),this.#n(`Pin ${this.#r().length} added`),this.dispatchEvent(new CustomEvent("review-surface:add",{bubbles:!0,composed:!0,detail:{pin:e}})),e}async removePin(t){let e=this.__pins.find(s=>s.id===t);e&&(this.__adapter&&await this.__adapter.remove(t),this.__pins=this.__pins.filter(s=>s.id!==t),this._activePin===t&&(this._activePin=null),this._render(),this.#n("Pin removed"),this.dispatchEvent(new CustomEvent("review-surface:remove",{bubbles:!0,composed:!0,detail:{pin:e}})))}async resolvePin(t){let e=this.__pins.find(r=>r.id===t);if(!e)return;let s={resolved:!0,resolvedBy:this.getAttribute("author")||"Anonymous",resolvedAt:new Date().toISOString()};this.__adapter&&await this.__adapter.update(t,s),Object.assign(e,s),this._render(),this.#n("Pin resolved"),this.dispatchEvent(new CustomEvent("review-surface:resolve",{bubbles:!0,composed:!0,detail:{pin:e}}))}async unresolvePin(t){let e=this.__pins.find(r=>r.id===t);if(!e)return;let s={resolved:!1,resolvedBy:null,resolvedAt:null};this.__adapter&&await this.__adapter.update(t,s),Object.assign(e,s),this._render(),this.#n("Pin re-opened"),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:e,changes:s}}))}exportPins(){return structuredClone(this.__pins)}importPins(t){this.__pins=Array.isArray(t)?structuredClone(t):[],this._activePin=null,this._render()}#r(){let t=this.hasAttribute("show-resolved");return this.__pins.filter(e=>t||!e.resolved).sort((e,s)=>new Date(e.createdAt)-new Date(s.createdAt))}_render(){let t=this.hasAttribute("editable"),e=this.#r(),s=this._activePin?this.__pins.find(r=>r.id===this._activePin):null;this.setAttribute("pin-count",String(e.length)),this.shadowRoot.innerHTML=`<style>${j}</style>
2227
+ .state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
2228
+ `;function ee(){let c=globalThis.localStorage;if(!c)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return c.getItem(t)},async setRaw(t,e){c.setItem(t,e)},async removeRaw(t){c.removeItem(t)},async keys(t){let e=[];for(let r=0;r<c.length;r++){let s=c.key(r);s&&s.startsWith(t)&&e.push(s)}return e}}}var X=null;function I(){return X||(X=ee()),X}function ft(c,t){if(typeof c!="string"||!c)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${c}:${t}`}function Mt(c){if(typeof c!="string"||!c)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${c}:`}function zt(c){try{let t=JSON.parse(c);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var Y={configure(c={}){X=c.backend??null},async set(c,t,e){let r={data:e,timestamp:Date.now()};await I().setRaw(ft(c,t),JSON.stringify(r))},async get(c,t,e){let r=await I().getRaw(ft(c,t));if(r==null)return null;let s=zt(r);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(c,t){await I().removeRaw(ft(c,t))},async list(c){let t=Mt(c),e=await I().keys(t),r=[];for(let s of e){let a=await I().getRaw(s);if(a==null)continue;let i=zt(a);i&&r.push({key:s.slice(t.length),data:i.data,timestamp:i.timestamp})}return r},async clear(c){let t=Mt(c),e=await I().keys(t);for(let r of e)await I().removeRaw(r)},async clearAll(){let c=await I().keys("vb:");for(let t of c)await I().removeRaw(t)},async setMany(c,t){for(let[e,r]of t)await Y.set(c,e,r)}};var bt="[data-copy], [data-copy-target], [data-paste-target]",re="Copied to clipboard",se="Pasted from clipboard",gt=new WeakMap;async function yt(c,t={}){if(c==null||c==="")return!1;let{button:e,announceMessage:r=re,duration:s=1500}=t;try{await navigator.clipboard.writeText(c)}catch{return!1}return Nt({button:e,duration:s,announceMessage:r,eventDetail:{text:c}}),!0}function Nt({button:c,duration:t,announceMessage:e,eventDetail:r,state:s="copied",eventName:a="copy"}){if(c){c.dataset.state=s;let i=gt.get(c);i&&clearTimeout(i),gt.set(c,setTimeout(()=>{delete c.dataset.state,gt.delete(c)},t)),c.dispatchEvent(new CustomEvent(a,{bubbles:!0,detail:r}))}oe(e,c??document.body)}async function ae(c,t={}){let{button:e,announceMessage:r=se,duration:s=1500}=t,a;try{a=await navigator.clipboard.readText()}catch{return null}return c&&("value"in c&&(c instanceof HTMLInputElement||c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement)?c.value=a:c.textContent=a,c.dispatchEvent(new Event("input",{bubbles:!0}))),Nt({button:e,duration:s,announceMessage:r,eventDetail:{text:a},state:"pasted",eventName:"paste"}),a}function Lt(c=document){c.querySelectorAll(bt).forEach(vt)}function vt(c){c.hasAttribute("data-copy-init")||(c.setAttribute("data-copy-init",""),c.addEventListener("click",()=>{if(c.dataset.pasteTarget){let e=document.querySelector(c.dataset.pasteTarget);if(!e)return;ae(e,{button:c});return}let t=ie(c);t&&yt(t,{button:c})}))}function ie(c){if(c.dataset.copy)return c.dataset.copy;if(c.dataset.copyTarget){let t=document.querySelector(c.dataset.copyTarget);if(!t)return"";let e=c.dataset.copyAttr;return e?t.getAttribute(e)??"":t.textContent??""}return""}function oe(c,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=c,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Lt()):Lt();var ne=new MutationObserver(c=>{for(let t of c)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let r=e;r.matches(bt)&&vt(r),r.querySelectorAll(bt).forEach(s=>vt(s))}});ne.observe(document.documentElement,{childList:!0,subtree:!0});var P=class{#e=new Map;async load(){return[...this.#e.values()]}async save(t){return t.id||(t.id=crypto.randomUUID()),this.#e.set(t.id,t),t}async update(t,e){let r=this.#e.get(t);if(!r)throw new Error(`Pin ${t} not found`);return Object.assign(r,e),r}async remove(t){this.#e.delete(t)}},K=class{#e;constructor(t="default"){this.#e=t}async#t(){let t=await Y.get("reviews",this.#e);return Array.isArray(t)?t:[]}async#r(t){await Y.set("reviews",this.#e,t)}async load(){return this.#t()}async save(t){t.id||(t.id=crypto.randomUUID());let e=await this.#t();return e.push(t),await this.#r(e),t}async update(t,e){let r=await this.#t(),s=r.findIndex(a=>a.id===t);if(s===-1)throw new Error(`Pin ${t} not found`);return Object.assign(r[s],e),await this.#r(r),r[s]}async remove(t){let e=(await this.#t()).filter(r=>r.id!==t);await this.#r(e)}},W=class{#e;constructor(t){if(!t)throw new Error("RestAdapter requires an endpoint URL");this.#e=t.replace(/\/$/,"")}async load(){let t=await fetch(this.#e);if(!t.ok)throw new Error(`HTTP ${t.status}`);let e=await t.json();return Array.isArray(e)?e:e.pins||[]}async save(t){let e=await fetch(this.#e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async update(t,e){let r=await fetch(`${this.#e}/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async remove(t){let e=await fetch(`${this.#e}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`)}},xt=class extends HTMLElement{static get observedAttributes(){return["src","editable","adapter","endpoint","storage-key","author","compact","show-resolved"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"}),this.__pins=[],this.__adapter=null,this._activePin=null,this._annotating=!1}get pins(){return this.__pins}set pins(t){let e=Array.isArray(t)?t:[];this.__pins!==e&&(this.__pins=e,this.isConnected&&this._render(),this.dispatchEvent(new CustomEvent("review-surface:pins-changed",{detail:{pins:e,source:"property"},bubbles:!0,composed:!0})))}get adapter(){return this.__adapter}set adapter(t){this.__adapter=t,this.isConnected&&this._loadFromAdapter()}#t(){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.#t(),this.setAttribute("data-upgraded",""),this.#r(),this.hasAttribute("src")?this._loadSrc(this.getAttribute("src")):this._loadFromAdapter()}disconnectedCallback(){this.removeAttribute("data-upgraded"),this.removeAttribute("data-annotating")}attributeChangedCallback(t){this.isConnected&&(t==="src"?this._loadSrc(this.getAttribute("src")):t==="adapter"||t==="endpoint"||t==="storage-key"?(this.#r(),this._loadFromAdapter()):this._render())}#r(){if(this.__adapter&&!(this.__adapter instanceof P)&&!(this.__adapter instanceof K)&&!(this.__adapter instanceof W))return;switch(this.getAttribute("adapter")||"memory"){case"local":this.__adapter=new K(this.getAttribute("storage-key")||"default");break;case"rest":try{this.__adapter=new W(this.getAttribute("endpoint")??"")}catch{this.__adapter=new P}break;default:this.__adapter=new P}}async _loadSrc(t){if(!(!t||!this.shadowRoot)){this.shadowRoot.innerHTML=`<style>${Q}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();this.__pins=Array.isArray(r)?r:r.pins||[],this._render()}catch(e){let r=e instanceof Error?e.message:String(e);this.shadowRoot.innerHTML=`<style>${Q}</style><div class="state-msg state-msg--error">Could not load pins: ${h(r)}</div>`}}}async _loadFromAdapter(){if(this.__adapter){try{this.__pins=await this.__adapter.load()}catch{this.__pins=[]}this._render()}}async addPin(t){let e={id:crypto.randomUUID(),x:Math.max(0,Math.min(100,t.x)),y:Math.max(0,Math.min(100,t.y)),text:t.text||"",author:t.author||this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString(),resolved:!1,resolvedBy:null,resolvedAt:null,replies:[]};return this.__adapter&&await this.__adapter.save(e),this.__pins.push(e),this._render(),this.#c(`Pin ${this.#i().length} added`),this.dispatchEvent(new CustomEvent("review-surface:add",{bubbles:!0,composed:!0,detail:{pin:e}})),e}async removePin(t){let e=this.__pins.find(r=>r.id===t);e&&(this.__adapter&&await this.__adapter.remove(t),this.__pins=this.__pins.filter(r=>r.id!==t),this._activePin===t&&(this._activePin=null),this._render(),this.#c("Pin removed"),this.dispatchEvent(new CustomEvent("review-surface:remove",{bubbles:!0,composed:!0,detail:{pin:e}})))}async resolvePin(t){let e=this.__pins.find(s=>s.id===t);if(!e)return;let r={resolved:!0,resolvedBy:this.getAttribute("author")||"Anonymous",resolvedAt:new Date().toISOString()};this.__adapter&&await this.__adapter.update(t,r),Object.assign(e,r),this._render(),this.#c("Pin resolved"),this.dispatchEvent(new CustomEvent("review-surface:resolve",{bubbles:!0,composed:!0,detail:{pin:e}}))}async unresolvePin(t){let e=this.__pins.find(s=>s.id===t);if(!e)return;let r={resolved:!1,resolvedBy:null,resolvedAt:null};this.__adapter&&await this.__adapter.update(t,r),Object.assign(e,r),this._render(),this.#c("Pin re-opened"),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:e,changes:r}}))}exportPins(){return structuredClone(this.__pins)}importPins(t){this.__pins=Array.isArray(t)?structuredClone(t):[],this._activePin=null,this._render()}#i(){let t=this.hasAttribute("show-resolved");return this.__pins.filter(e=>t||!e.resolved).sort((e,r)=>new Date(e.createdAt??0).getTime()-new Date(r.createdAt??0).getTime())}_render(){if(!this.shadowRoot)return;let t=this.hasAttribute("editable"),e=this.#i(),r=this._activePin?this.__pins.find(s=>s.id===this._activePin):null;this.setAttribute("pin-count",String(e.length)),this.shadowRoot.innerHTML=`<style>${Q}</style>
2155
2229
  <div class="rs-container">
2156
2230
  <slot></slot>
2157
2231
  <div class="rs-overlay" role="img" aria-label="Review annotation surface">
2158
- ${e.map((r,a)=>this._renderPin(r,a+1)).join("")}
2232
+ ${e.map((s,a)=>this._renderPin(s,a+1)).join("")}
2159
2233
  </div>
2160
- ${s?this._renderPopover(s,t):""}
2234
+ ${r?this._renderPopover(r,t):""}
2161
2235
  </div>
2162
2236
  ${t?this._renderToolbar(e.length):""}
2163
- <div class="rs-live" aria-live="polite" aria-atomic="true"></div>`,this._bindListeners(t),this.dispatchEvent(new CustomEvent("review-surface:ready",{bubbles:!0,composed:!0,detail:{pinCount:e.length}}))}_renderPin(t,e){let s=t.text?t.text.slice(0,50):"Empty pin";return`<button class="rs-pin"
2164
- data-pin-id="${m(t.id)}"
2237
+ <div class="rs-live" aria-live="polite" aria-atomic="true"></div>`,this._bindListeners(t),this.dispatchEvent(new CustomEvent("review-surface:ready",{bubbles:!0,composed:!0,detail:{pinCount:e.length}}))}_renderPin(t,e){let r=t.text?t.text.slice(0,50):"Empty pin";return`<button class="rs-pin"
2238
+ data-pin-id="${h(t.id)}"
2165
2239
  ${t.resolved?"data-resolved":""}
2166
2240
  ${this._activePin===t.id?"data-active":""}
2167
2241
  style="left:${t.x}%;top:${t.y}%"
2168
- aria-label="Pin ${e}: ${m(s)}"
2242
+ aria-label="Pin ${e}: ${h(r)}"
2169
2243
  aria-expanded="${this._activePin===t.id}"
2170
2244
  aria-haspopup="dialog">
2171
2245
  <span class="rs-pin__number">${e}</span>
2172
- </button>`}_renderPopover(t,e){let s=this.#r().findIndex(r=>r.id===t.id)+1;return`<div class="rs-popover" data-open
2246
+ </button>`}_renderPopover(t,e){let r=this.#i().findIndex(s=>s.id===t.id)+1;return`<div class="rs-popover" data-open
2173
2247
  style="left:${Math.min(t.x,70)}%;top:${t.y}%"
2174
2248
  role="dialog"
2175
- aria-labelledby="rs-popover-title-${m(t.id)}">
2249
+ aria-labelledby="rs-popover-title-${h(t.id)}">
2176
2250
 
2177
2251
  <div class="rs-popover__header">
2178
- <span class="rs-popover__title" id="rs-popover-title-${m(t.id)}">
2179
- Pin ${s}
2180
- ${t.resolved?`<span class="rs-resolved-badge">${y(_.checkCircle)} Resolved</span>`:""}
2252
+ <span class="rs-popover__title" id="rs-popover-title-${h(t.id)}">
2253
+ Pin ${r}
2254
+ ${t.resolved?`<span class="rs-resolved-badge">${A(k.checkCircle)} Resolved</span>`:""}
2181
2255
  </span>
2182
2256
  <div class="rs-popover__actions">
2183
2257
  ${e&&!t.resolved?`
2184
- <button class="rs-popover__btn rs-popover__btn--resolve" data-action="resolve" data-pin-id="${m(t.id)}"
2185
- aria-label="Resolve pin" title="Resolve">${y(_.checkCircle)}</button>`:""}
2258
+ <button class="rs-popover__btn rs-popover__btn--resolve" data-action="resolve" data-pin-id="${h(t.id)}"
2259
+ aria-label="Resolve pin" title="Resolve">${A(k.checkCircle)}</button>`:""}
2186
2260
  ${e&&t.resolved?`
2187
- <button class="rs-popover__btn" data-action="unresolve" data-pin-id="${m(t.id)}"
2188
- aria-label="Re-open pin" title="Re-open">${y(_.messageCircle)}</button>`:""}
2261
+ <button class="rs-popover__btn" data-action="unresolve" data-pin-id="${h(t.id)}"
2262
+ aria-label="Re-open pin" title="Re-open">${A(k.messageCircle)}</button>`:""}
2189
2263
  ${e?`
2190
- <button class="rs-popover__btn rs-popover__btn--delete" data-action="delete" data-pin-id="${m(t.id)}"
2191
- aria-label="Delete pin" title="Delete">${y(_.x)}</button>`:""}
2264
+ <button class="rs-popover__btn rs-popover__btn--delete" data-action="delete" data-pin-id="${h(t.id)}"
2265
+ aria-label="Delete pin" title="Delete">${A(k.x)}</button>`:""}
2192
2266
  <button class="rs-popover__btn" data-action="close"
2193
- aria-label="Close">${y(_.x)}</button>
2267
+ aria-label="Close">${A(k.x)}</button>
2194
2268
  </div>
2195
2269
  </div>
2196
2270
 
2197
2271
  <div class="rs-comment">
2198
2272
  <div class="rs-comment__meta">
2199
- <span class="rs-comment__avatar" style="background:${S(t.author||"Anonymous")}">${E(t.author||"Anonymous")}</span>
2200
- <span class="rs-comment__author">${m(t.author||"Anonymous")}</span>
2201
- <span class="rs-comment__time">${this.#l(t.createdAt)}</span>
2273
+ <span class="rs-comment__avatar" style="background:${L(t.author||"Anonymous")}">${z(t.author||"Anonymous")}</span>
2274
+ <span class="rs-comment__author">${h(t.author||"Anonymous")}</span>
2275
+ <span class="rs-comment__time">${this.#n(t.createdAt)}</span>
2202
2276
  </div>
2203
- <div class="rs-comment__text">${m(t.text)}</div>
2277
+ <div class="rs-comment__text">${h(t.text)}</div>
2204
2278
  </div>
2205
2279
 
2206
2280
  ${t.replies?.length?`
2207
2281
  <div class="rs-replies">
2208
- ${t.replies.map(r=>`
2282
+ ${t.replies.map(s=>`
2209
2283
  <div class="rs-reply">
2210
2284
  <div class="rs-comment__meta">
2211
- <span class="rs-comment__avatar" style="background:${S(r.author||"Anonymous")}">${E(r.author||"Anonymous")}</span>
2212
- <span class="rs-comment__author">${m(r.author||"Anonymous")}</span>
2213
- <span class="rs-comment__time">${this.#l(r.createdAt)}</span>
2285
+ <span class="rs-comment__avatar" style="background:${L(s.author||"Anonymous")}">${z(s.author||"Anonymous")}</span>
2286
+ <span class="rs-comment__author">${h(s.author||"Anonymous")}</span>
2287
+ <span class="rs-comment__time">${this.#n(s.createdAt)}</span>
2214
2288
  </div>
2215
- <div class="rs-comment__text">${m(r.text)}</div>
2289
+ <div class="rs-comment__text">${h(s.text)}</div>
2216
2290
  </div>
2217
2291
  `).join("")}
2218
2292
  </div>`:""}
@@ -2220,23 +2294,23 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2220
2294
  ${e?`
2221
2295
  <div class="rs-input">
2222
2296
  <textarea class="rs-input__field" placeholder="Reply\u2026" rows="1"
2223
- aria-label="Reply to pin ${s}"></textarea>
2224
- <button class="rs-input__submit" data-action="reply" data-pin-id="${m(t.id)}"
2225
- aria-label="Send reply">${y(_.send)}</button>
2297
+ aria-label="Reply to pin ${r}"></textarea>
2298
+ <button class="rs-input__submit" data-action="reply" data-pin-id="${h(t.id)}"
2299
+ aria-label="Send reply">${A(k.send)}</button>
2226
2300
  </div>`:""}
2227
2301
 
2228
2302
  </div>`}_renderToolbar(t){return`<div class="rs-toolbar" role="toolbar" aria-label="Review tools">
2229
2303
  <button class="rs-toolbar__btn" data-action="toggle-mode"
2230
2304
  aria-pressed="${this._annotating}"
2231
2305
  title="Toggle annotate mode">
2232
- ${y(_.mapPin)} Annotate
2306
+ ${A(k.mapPin)} Annotate
2233
2307
  </button>
2234
2308
  <button class="rs-toolbar__btn" data-action="export"
2235
2309
  title="Export pins as JSON">
2236
- ${y(_.download)} Export
2310
+ ${A(k.download)} Export
2237
2311
  </button>
2238
2312
  <output class="rs-toolbar__count">${t} pin${t!==1?"s":""}</output>
2239
- </div>`}_bindListeners(t){let e=this.shadowRoot;e.querySelectorAll(".rs-pin").forEach(a=>{a.addEventListener("click",i=>{i.stopPropagation();let o=a.dataset.pinId;this._activePin=this._activePin===o?null:o,this._render(),this._activePin&&this.dispatchEvent(new CustomEvent("review-surface:select",{bubbles:!0,composed:!0,detail:{pin:this.__pins.find(n=>n.id===o)}}))})});let s=e.querySelector(".rs-overlay");s&&t&&s.addEventListener("click",a=>{if(!this._annotating||a.target.closest(".rs-pin"))return;let i=s.getBoundingClientRect(),o=(a.clientX-i.left)/i.width*100,n=(a.clientY-i.top)/i.height*100;this.#a(o,n)}),e.querySelectorAll("[data-action]").forEach(a=>{a.addEventListener("click",i=>{i.stopPropagation();let o=a.dataset.action,n=a.dataset.pinId;switch(o){case"close":this._activePin=null,this._render();break;case"resolve":this.resolvePin(n);break;case"unresolve":this.unresolvePin(n);break;case"delete":this.removePin(n);break;case"toggle-mode":this._annotating=!this._annotating,this._annotating?this.setAttribute("data-annotating",""):this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:this._annotating?"annotate":"view"}}));break;case"export":this.#i();break;case"reply":this.#o(n);break}})});let r=e.querySelector(".rs-input__field");r&&r.addEventListener("keydown",a=>{if(a.key==="Enter"&&!a.shiftKey){a.preventDefault();let i=e.querySelector('[data-action="reply"]')?.dataset.pinId;i&&this.#o(i)}}),e.addEventListener("keydown",a=>{a.key==="Escape"&&(this._activePin?(this._activePin=null,this._render()):this._annotating&&(this._annotating=!1,this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:"view"}}))))})}async#a(t,e){let s=this.getAttribute("author")||"Anonymous",r=await this.addPin({x:t,y:e,text:"",author:s});this._activePin=r.id,this._render(),requestAnimationFrame(()=>{let a=this.shadowRoot.querySelector(".rs-input__field");a&&a.focus()})}async#o(t){let e=this.shadowRoot.querySelector(".rs-input__field");if(!e)return;let s=e.value.trim();if(!s)return;let r=this.__pins.find(i=>i.id===t);if(!r)return;let a={id:crypto.randomUUID(),text:s,author:this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString()};r.replies||(r.replies=[]),r.text?(r.replies.push(a),this.__adapter&&await this.__adapter.update(t,{replies:r.replies})):(r.text=s,this.__adapter&&await this.__adapter.update(t,{text:s})),this._render(),this.#n("Reply added"),requestAnimationFrame(()=>{let i=this.shadowRoot.querySelector(".rs-input__field");i&&i.focus()}),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:r,changes:{replies:r.replies}}}))}async#i(){let t=JSON.stringify(this.exportPins(),null,2);try{await navigator.clipboard.writeText(t),this.#n("Pins copied to clipboard")}catch{let e=new Blob([t],{type:"application/json"}),s=URL.createObjectURL(e),r=document.createElement("a");r.href=s,r.download="review-pins.json",r.click(),URL.revokeObjectURL(s),this.#n("Pins exported as file")}}#l(t){if(!t)return"";try{let e=new Date(t),r=new Date-e,a=Math.floor(r/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let i=Math.floor(a/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);return o<7?`${o}d ago`:e.toLocaleDateString()}catch{return""}}#n(t){let e=this.shadowRoot.querySelector(".rs-live");e&&(e.textContent=t)}};x("review-surface",rt);var $=864e5,it=$*7,O=$*30,Pt=$*91,At=$*365;function _t(d){return typeof d=="number"?d:new Date(d).getTime()}function Bt(d){return d<=it*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):d<=O*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):d<=At?t=>t.toLocaleDateString(void 0,{month:"short",year:"2-digit"}):t=>t.toLocaleDateString(void 0,{year:"numeric"})}function Ot(d){return d<=it*3?"day":d<=O*3?"week":d<=At?"month":"quarter"}function wt(d){return String(d).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var at=class extends A{static get observedAttributes(){return["src","title","view","show-today","show-progress","show-dependencies","compact"]}#t=null;#e=null;#s=null;#r=[];#a=0;#o=0;#i=0;setup(){let t=this.querySelector(":scope > table");if(!t||(this.#r=this.#l(t),this.#r.length===0))return!1;this.#a=Math.min(...this.#r.map(e=>e.start)),this.#o=Math.max(...this.#r.map(e=>e.end)),this.#i=this.#o-this.#a,this.#i<=0&&(this.#i=$),this.#n(t),this.dispatchEvent(new CustomEvent("gantt-chart:ready",{bubbles:!0,detail:{taskCount:this.#r.length,dateRange:{start:new Date(this.#a).toISOString(),end:new Date(this.#o).toISOString()}}}))}teardown(){this.#s&&(this.#s.remove(),this.#s=null),this.#t&&(this.#t.remove(),this.#t=null),this.#e&&(this.#e.remove(),this.#e=null);let t=this.querySelector("table.gc-sr-only");t&&t.classList.remove("gc-sr-only"),this.#r=[]}attributeChangedCallback(t,e,s){e===s||!this.isConnected||(t==="src"?this._loadSrc(s):this.hasAttribute("data-upgraded")&&(this.teardown(),this.removeAttribute("data-upgraded"),this.setup()))}#l(t){let e=t.querySelectorAll("tbody tr"),s=[];for(let r=0;r<e.length;r++){let a=e[r],i=a.querySelectorAll("time[datetime]");if(i.length<2&&!a.hasAttribute("data-milestone"))continue;let o=i[0]?.getAttribute("datetime"),n=i.length>1?i[1].getAttribute("datetime"):o;if(!o)continue;let c=a.querySelector("progress"),l=c?c.value/(c.max||100):0,h=a.cells[0]?.textContent?.trim()||`Task ${r+1}`;s.push({id:a.dataset.taskId||`gc-task-${r}`,name:h,start:_t(o),end:_t(n),progress:l,group:a.dataset.group||null,depends:a.dataset.depends?a.dataset.depends.split(",").map(u=>u.trim()):[],status:a.dataset.status||null,assignee:a.dataset.assignee||null,milestone:a.hasAttribute("data-milestone"),color:a.dataset.color||null,storyIds:a.dataset.storyIds?a.dataset.storyIds.split(",").map(u=>u.trim()):[],itemIds:a.dataset.itemIds?a.dataset.itemIds.split(",").map(u=>u.trim()):[]})}return s}#n(t){let e=this.getAttribute("title"),s=this.hasAttribute("show-today"),r=this.hasAttribute("show-progress"),a=this.hasAttribute("show-dependencies");e&&(this.#s=document.createElement("h2"),this.#s.className="gc-title",this.#s.textContent=e,this.insertBefore(this.#s,t)),this.#t=document.createElement("div"),this.#t.className="gc-container",this.#t.setAttribute("role","region"),this.#t.setAttribute("aria-label",`Gantt chart${e?": "+e:""}`);let i=this.#c();this.#t.appendChild(i);let o=document.createElement("div");o.className="gc-body";let n=document.createElement("div");n.className="gc-task-list";let c=document.createElement("div");c.className="gc-bars";let l=this.#b();c.appendChild(l);let h=this.#p();for(let[u,f]of h){if(h.size>1&&u){let g=document.createElement("div");g.className="gc-group-header";let p=document.createElement("span");p.className="gc-group-label",p.textContent=u,g.appendChild(p),n.appendChild(g);let b=document.createElement("div");b.className="gc-group-spacer",c.appendChild(b)}for(let g of f){let p=document.createElement("div");p.className="gc-task-row",p.setAttribute("data-task-id",g.id);let b=document.createElement("span");b.className="gc-task-name",b.textContent=g.name,p.appendChild(b);let v=document.createElement("span");v.className="gc-task-dates",v.textContent=`${new Date(g.start).toLocaleDateString()} to ${new Date(g.end).toLocaleDateString()}`,p.appendChild(v),n.appendChild(p);let w=document.createElement("div");w.className="gc-bar-row",g.milestone?w.appendChild(this.#y(g)):w.appendChild(this.#v(g,r)),c.appendChild(w)}}if(s){let u=this.#m();u&&c.appendChild(u)}a&&requestAnimationFrame(()=>{let u=this.#x(c);u&&c.appendChild(u)}),o.appendChild(n),o.appendChild(c),this.#t.appendChild(o),this.insertBefore(this.#t,t),t.classList.add("gc-sr-only"),this.#e=document.createElement("div"),this.#e.className="gc-sr-only",this.#e.setAttribute("role","status"),this.#e.setAttribute("aria-live","polite"),this.#e.setAttribute("aria-atomic","true"),this.appendChild(this.#e),this.listen(this.#t,"click",u=>{let f=u.target.closest(".gc-bar, .gc-milestone");if(!f)return;let g=f.dataset.taskId,p=this.#r.find(b=>b.id===g);p&&(this.#u(`Selected: ${p.name}`),this.dispatchEvent(new CustomEvent("gantt-chart:task-click",{bubbles:!0,detail:{task:p}})))}),this.listen(this.#t,"keydown",u=>{if(u.key==="Enter"||u.key===" "){let f=u.target.closest(".gc-bar, .gc-milestone");f&&(u.preventDefault(),f.click())}})}#c(){let t=document.createElement("div");t.className="gc-timeline-header";let e=document.createElement("div");e.className="gc-timeline-spacer",t.appendChild(e);let s=document.createElement("div");s.className="gc-timeline-dates";let r=this.#d();for(let{position:a,text:i}of r){let o=document.createElement("span");o.className="gc-date-label",o.style.left=`${a}%`,o.textContent=i,s.appendChild(o)}return t.appendChild(s),t}#d(){let t=this.getAttribute("view")||"auto",e=t==="auto"?Ot(this.#i):t,s=Bt(this.#i),r=[],a;switch(e){case"day":a=$;break;case"week":a=it;break;case"month":a=O;break;case"quarter":a=Pt;break;default:a=O}let i=new Date(this.#a);if(e==="week"){let c=i.getDay(),l=c===0?1:c===1?0:8-c;i.setDate(i.getDate()+l)}else if(e==="month")i.setDate(1),i.getTime()<this.#a&&i.setMonth(i.getMonth()+1);else if(e==="quarter"){let c=i.getMonth(),l=Math.ceil((c+1)/3)*3;i.setMonth(l),i.setDate(1)}let o=i.getTime();o>this.#a+a*.5&&r.push({position:0,text:s(new Date(this.#a))});let n=o;for(;n<=this.#o;){let c=(n-this.#a)/this.#i*100;if(c>=0&&c<=100&&r.push({position:c,text:s(new Date(n))}),e==="month"){let l=new Date(n);l.setMonth(l.getMonth()+1),n=l.getTime()}else if(e==="quarter"){let l=new Date(n);l.setMonth(l.getMonth()+3),n=l.getTime()}else n+=a}return r}#b(){let t=document.createElement("div");t.className="gc-grid-lines";let e=this.#d();for(let{position:s}of e){if(s<=0)continue;let r=document.createElement("div");r.className="gc-grid-line",r.style.left=`${s}%`,t.appendChild(r)}return t}#p(){let t=new Map;for(let e of this.#r){let s=e.group||"";t.has(s)||t.set(s,[]),t.get(s).push(e)}return t}#v(t,e){let s=(t.start-this.#a)/this.#i*100,r=(t.end-t.start)/this.#i*100,a=document.createElement("div");if(a.className="gc-bar",a.setAttribute("data-task-id",t.id),a.setAttribute("role","img"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`${wt(t.name)}: ${new Date(t.start).toLocaleDateString()} to ${new Date(t.end).toLocaleDateString()}`+(t.progress>0?`, ${Math.round(t.progress*100)}% complete`:"")),a.style.left=`${s}%`,a.style.width=`${Math.max(r,.5)}%`,t.status&&a.setAttribute("data-status",t.status),t.color&&a.style.setProperty("--gc-bar-color",t.color),e&&t.progress>0){let i=document.createElement("div");i.className="gc-bar-fill",i.style.width=`${Math.round(t.progress*100)}%`,a.appendChild(i)}if(r>8){let i=document.createElement("span");i.className="gc-bar-label",i.textContent=t.name,a.appendChild(i)}return a}#y(t){let e=(t.start-this.#a)/this.#i*100,s=document.createElement("div");return s.className="gc-milestone",s.setAttribute("data-task-id",t.id),s.setAttribute("role","img"),s.setAttribute("tabindex","0"),s.setAttribute("aria-label",`Milestone: ${wt(t.name)}, ${new Date(t.start).toLocaleDateString()}`),s.style.left=`${e}%`,t.status&&s.setAttribute("data-status",t.status),t.color&&s.style.setProperty("--gc-bar-color",t.color),s}#m(){let t=Date.now();if(t<this.#a||t>this.#o)return null;let e=(t-this.#a)/this.#i*100,s=document.createElement("div");s.className="gc-today-line",s.style.left=`${e}%`;let r=document.createElement("span");return r.className="gc-today-label",r.textContent="Today",s.appendChild(r),s}#x(t){if(!this.#r.some(n=>n.depends.length>0))return null;let s="http://www.w3.org/2000/svg",r=document.createElementNS(s,"svg");r.setAttribute("class","gc-deps"),r.style.width="100%",r.style.height="100%";let a=document.createElementNS(s,"defs"),i=document.createElementNS(s,"marker");i.setAttribute("id","gc-arrowhead"),i.setAttribute("markerWidth","8"),i.setAttribute("markerHeight","6"),i.setAttribute("refX","8"),i.setAttribute("refY","3"),i.setAttribute("orient","auto");let o=document.createElementNS(s,"polygon");o.setAttribute("points","0 0, 8 3, 0 6"),o.setAttribute("fill","var(--color-text-muted, #666666)"),i.appendChild(o),a.appendChild(i),r.appendChild(a);for(let n of this.#r)for(let c of n.depends){let l=this.#r.find(Et=>Et.id===c);if(!l)continue;let h=(l.end-this.#a)/this.#i*100,u=(n.start-this.#a)/this.#i*100,f=this.#g(l.id,t),g=this.#g(n.id,t);if(f===-1||g===-1)continue;let p=36,b=f*p+p/2,v=g*p+p/2,w=document.createElementNS(s,"path"),pt=h+(u-h)/2;w.setAttribute("d",`M ${h}% ${b} C ${pt}% ${b}, ${pt}% ${v}, ${u}% ${v}`),w.setAttribute("class","gc-dep-line"),r.appendChild(w)}return r}#g(t,e){let s=e.querySelectorAll(".gc-bar-row");for(let r=0;r<s.length;r++){let a=s[r].querySelector("[data-task-id]");if(a&&a.dataset.taskId===t)return r}return-1}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();let r=document.createElement("table"),a=document.createElement("thead"),i=document.createElement("tr");for(let n of["Task","Start","End","Progress"]){let c=document.createElement("th");c.textContent=n,i.appendChild(c)}a.appendChild(i),r.appendChild(a);let o=document.createElement("tbody");for(let n of s.tasks||[]){let c=document.createElement("tr");n.id&&(c.dataset.taskId=n.id),n.group&&(c.dataset.group=n.group),n.depends&&(c.dataset.depends=Array.isArray(n.depends)?n.depends.join(","):n.depends),n.status&&(c.dataset.status=n.status),n.assignee&&(c.dataset.assignee=n.assignee),n.milestone&&c.setAttribute("data-milestone",""),n.color&&(c.dataset.color=n.color),n.storyIds&&(c.dataset.storyIds=Array.isArray(n.storyIds)?n.storyIds.join(","):n.storyIds),n.itemIds&&(c.dataset.itemIds=Array.isArray(n.itemIds)?n.itemIds.join(","):n.itemIds);let l=document.createElement("td");l.textContent=n.name||"",c.appendChild(l);let h=document.createElement("td"),u=document.createElement("time");u.setAttribute("datetime",n.start),u.textContent=new Date(n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),h.appendChild(u),c.appendChild(h);let f=document.createElement("td"),g=document.createElement("time");g.setAttribute("datetime",n.end||n.start),g.textContent=new Date(n.end||n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),f.appendChild(g),c.appendChild(f);let p=document.createElement("td"),b=document.createElement("progress");b.value=n.progress||0,b.max=100,b.textContent=`${n.progress||0}%`,p.appendChild(b),c.appendChild(p),o.appendChild(c)}r.appendChild(o),this.appendChild(r),s.title&&this.setAttribute("title",s.title),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[gantt-chart] Failed to load src="${t}":`,e)}}#u(t){this.#e&&(this.#e.textContent="",requestAnimationFrame(()=>{this.#e&&(this.#e.textContent=t)}))}};x("gantt-chart",at);var ot=class d extends A{static get observedAttributes(){return["src","compact","title","searchable"]}static#t=0;#e=null;#s=null;#r=null;#a=null;#o=null;#i="";#l=null;#n=[];#c=[];#d=new Map;#b=new Map;setup(){this.#i=`gloss-${++d.#t}`;let t=this.querySelector(":scope > dl");if(!t)return!1;let e=[...t.querySelectorAll(":scope > div[data-term-id]")];if(e.length===0)return!1;this.#n=e.map(a=>{let i=a.getAttribute("data-term-id")||"",o=a.getAttribute("data-category")||"Uncategorized",n=a.querySelector("dt"),c=a.querySelector("dd"),l=n?n.textContent.trim():"",h=c?c.textContent.trim():"";return a.id=i,{id:i,term:l,definition:h,category:o,el:a}});let s=new Set;this.#c=[];for(let a of this.#n)s.has(a.category)||(s.add(a.category),this.#c.push(a.category));t.remove(),this.#p();let r=this.getAttribute("src");if(r){this._loadSrc(r);return}this.dispatchEvent(new CustomEvent("glossary-wc:ready",{bubbles:!0,detail:{termCount:this.#n.length,categories:[...this.#c]}}))}teardown(){this.#l&&clearTimeout(this.#l);let t=this.querySelector(".gloss-title");t&&t.remove(),this.#e?.parentElement&&this.#e.parentElement.remove(),this.#s&&this.#s.remove(),this.#o&&this.#o.remove(),this.#a&&this.#a.remove(),this.#e=null,this.#s=null,this.#r=null,this.#a=null,this.#o=null,this.#n=[],this.#c=[],this.#d=new Map,this.#b=new Map}#p(){let t=this.getAttribute("title");if(t){let e=document.createElement("h2");e.className="gloss-title",e.textContent=t,this.#r=document.createElement("output"),this.#r.className="gloss-count",this.#r.textContent=String(this.#n.length),e.appendChild(this.#r),this.appendChild(e)}if(this.hasAttribute("searchable")){let e=document.createElement("div");e.className="gloss-search";let s=document.createElement("input");s.type="search",s.className="gloss-search-input",s.setAttribute("placeholder","Search terms\u2026"),s.setAttribute("aria-label","Search glossary terms"),e.appendChild(s),this.appendChild(e),this.#e=s,this.listen(s,"input",this.#m)}this.#v(),this.#o=document.createElement("div"),this.#o.className="gloss-categories",this.#o.setAttribute("role","region"),this.#o.setAttribute("aria-label","Glossary terms"),this.appendChild(this.#o);for(let e of this.#c){let s=this.#n.filter(r=>r.category===e);this.#y(e,s)}this.#a=document.createElement("div"),this.#a.className="gloss-live-region",this.#a.setAttribute("role","status"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.appendChild(this.#a)}#v(){this.#s=document.createElement("nav"),this.#s.className="gloss-jump-bar",this.#s.setAttribute("aria-label","Alphabet navigation");let t=new Set;for(let e of this.#n){let s=e.term.charAt(0).toUpperCase();/[A-Z]/.test(s)&&t.add(s)}for(let e=65;e<=90;e++){let s=String.fromCharCode(e),r=document.createElement("a");r.textContent=s,r.className="gloss-jump-letter",t.has(s)?(r.href=`#${this.#i}-letter-${s}`,r.setAttribute("data-active","")):(r.setAttribute("aria-disabled","true"),r.setAttribute("tabindex","-1")),this.#s.appendChild(r)}this.appendChild(this.#s)}#y(t,e){let s=document.createElement("section");s.className="gloss-category",s.setAttribute("data-category",t);let r=document.createElement("header");r.className="gloss-category-header";let a=document.createElement("button");a.type="button",a.className="gloss-category-toggle",a.setAttribute("aria-expanded","true"),a.innerHTML=`<span class="gloss-category-label">${m(t)}</span><output class="gloss-category-count">${e.length}</output><span class="gloss-chevron" aria-hidden="true"></span>`,r.appendChild(a),s.appendChild(r),this.#d.set(t,a);let i=document.createElement("dl");i.className="gloss-term-list";let o=[...e].sort((l,h)=>l.term.localeCompare(h.term)),n=[],c="";for(let l of o){let h=l.term.charAt(0).toUpperCase();if(/[A-Z]/.test(h)&&h!==c){c=h;let u=document.createElement("span");u.id=`${this.#i}-letter-${h}`,u.className="gloss-letter-anchor",i.appendChild(u)}l.el.className="gloss-term",l.el.id=l.id,i.appendChild(l.el),n.push(l.el)}this.#b.set(t,n),s.appendChild(i),this.#o.appendChild(s),this.listen(a,"click",()=>{let l=a.getAttribute("aria-expanded")==="true";a.setAttribute("aria-expanded",String(!l)),i.hidden=l})}#m=t=>{this.#l&&clearTimeout(this.#l),this.#l=setTimeout(()=>{let e=t.target.value.toLowerCase().trim();this.#x(e)},150)};#x(t){let e=0;for(let s of this.#n)t===""||s.term.toLowerCase().includes(t)||s.definition.toLowerCase().includes(t)?(s.el.removeAttribute("hidden"),e++):s.el.setAttribute("hidden","");for(let s of this.#c){let r=this.#b.get(s)||[],a=r[0]?.closest(".gloss-category");if(!a)continue;if(r.some(o=>!o.hasAttribute("hidden"))){a.removeAttribute("hidden");let o=r.filter(c=>!c.hasAttribute("hidden")).length,n=a.querySelector(".gloss-category-count");n&&(n.textContent=String(o))}else a.setAttribute("hidden","")}this.#r&&(this.#r.textContent=t===""?String(this.#n.length):`${e} / ${this.#n.length}`),t!==""&&this.#a&&(this.#a.textContent="",requestAnimationFrame(()=>{this.#a&&(this.#a.textContent=`${e} term${e!==1?"s":""} found`)})),this.dispatchEvent(new CustomEvent("glossary-wc:search",{bubbles:!0,detail:{query:t,matchCount:e}}))}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();let r=document.createElement("dl");for(let a of s.terms||[]){let i=document.createElement("div");i.setAttribute("data-term-id",a.id||""),i.setAttribute("data-category",a.category||"Uncategorized");let o=document.createElement("dt");o.textContent=a.term||"";let n=document.createElement("dd"),c=a.definition||"";if(a.seeAlso&&a.seeAlso.length>0){let l=a.seeAlso.map(h=>`<a href="#${m(h)}">${m(this.#g(h))}</a>`).join(", ");c+=` See also: ${l}.`}n.innerHTML=c,i.appendChild(o),i.appendChild(n),r.appendChild(i)}this.appendChild(r),s.title&&!this.getAttribute("title")&&this.setAttribute("title",s.title),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[glossary-wc] Failed to load src="${t}":`,e)}}#g(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};x("glossary-wc",ot);var z=`
2313
+ </div>`}_bindListeners(t){let e=this.shadowRoot;if(!e)return;e.querySelectorAll(".rs-pin").forEach(a=>{a.addEventListener("click",i=>{i.stopPropagation();let o=a.dataset.pinId??null;this._activePin=this._activePin===o?null:o,this._render(),this._activePin&&this.dispatchEvent(new CustomEvent("review-surface:select",{bubbles:!0,composed:!0,detail:{pin:this.__pins.find(n=>n.id===o)}}))})});let r=e.querySelector(".rs-overlay");r&&t&&r.addEventListener("click",a=>{if(!this._annotating)return;let i=a;if(i.target?.closest(".rs-pin"))return;let n=r.getBoundingClientRect(),l=(i.clientX-n.left)/n.width*100,d=(i.clientY-n.top)/n.height*100;this.#s(l,d)}),e.querySelectorAll("[data-action]").forEach(a=>{a.addEventListener("click",i=>{i.stopPropagation();let o=a.dataset.action,n=a.dataset.pinId;switch(o){case"close":this._activePin=null,this._render();break;case"resolve":n&&this.resolvePin(n);break;case"unresolve":n&&this.unresolvePin(n);break;case"delete":n&&this.removePin(n);break;case"toggle-mode":this._annotating=!this._annotating,this._annotating?this.setAttribute("data-annotating",""):this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:this._annotating?"annotate":"view"}}));break;case"export":this.#a();break;case"reply":this.#o(n);break}})});let s=e.querySelector(".rs-input__field");s&&s.addEventListener("keydown",a=>{let i=a;if(i.key==="Enter"&&!i.shiftKey){i.preventDefault();let n=e.querySelector('[data-action="reply"]')?.dataset.pinId;n&&this.#o(n)}}),e.addEventListener("keydown",a=>{a.key==="Escape"&&(this._activePin?(this._activePin=null,this._render()):this._annotating&&(this._annotating=!1,this.removeAttribute("data-annotating"),this._render(),this.dispatchEvent(new CustomEvent("review-surface:mode",{bubbles:!0,composed:!0,detail:{mode:"view"}}))))})}async#s(t,e){let r=this.getAttribute("author")||"Anonymous",s=await this.addPin({x:t,y:e,text:"",author:r});this._activePin=s.id,this._render(),requestAnimationFrame(()=>{(this.shadowRoot?.querySelector(".rs-input__field")??null)?.focus()})}async#o(t){let e=this.shadowRoot?.querySelector(".rs-input__field")??null;if(!e)return;let r=e.value.trim();if(!r)return;let s=this.__pins.find(i=>i.id===t);if(!s)return;let a={id:crypto.randomUUID(),text:r,author:this.getAttribute("author")||"Anonymous",createdAt:new Date().toISOString()};s.replies||(s.replies=[]),s.text?(s.replies.push(a),this.__adapter&&await this.__adapter.update(t,{replies:s.replies})):(s.text=r,this.__adapter&&await this.__adapter.update(t,{text:r})),this._render(),this.#c("Reply added"),requestAnimationFrame(()=>{(this.shadowRoot?.querySelector(".rs-input__field")??null)?.focus()}),this.dispatchEvent(new CustomEvent("review-surface:update",{bubbles:!0,composed:!0,detail:{pin:s,changes:{replies:s.replies}}}))}async#a(){let t=JSON.stringify(this.exportPins(),null,2);if(await yt(t,{announceMessage:"Pins copied to clipboard"}))return;let r=new Blob([t],{type:"application/json"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download="review-pins.json",a.click(),URL.revokeObjectURL(s),this.#c("Pins exported as file")}#n(t){if(!t)return"";try{let e=new Date(t),s=new Date().getTime()-e.getTime(),a=Math.floor(s/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;let i=Math.floor(a/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);return o<7?`${o}d ago`:e.toLocaleDateString()}catch{return""}}#c(t){let e=this.shadowRoot?.querySelector(".rs-live");e&&(e.textContent=t)}};x("review-surface",xt);var N=864e5,wt=N*7,G=N*30,ce=N*91,Pt=N*365;function j(c){return typeof c=="number"?c:new Date(c).getTime()}function de(c){return c<=wt*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):c<=G*3?t=>t.toLocaleDateString(void 0,{month:"short",day:"numeric"}):c<=Pt?t=>t.toLocaleDateString(void 0,{month:"short",year:"2-digit"}):t=>t.toLocaleDateString(void 0,{year:"numeric"})}function le(c){return c<=wt*3?"day":c<=G*3?"week":c<=Pt?"month":"quarter"}function Dt(c){return String(c).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var _t=class c extends C{static get observedAttributes(){return["src","title","view","show-today","show-progress","show-dependencies","compact"]}#e=null;#t=null;#r=null;#i=[];#s=0;#o=0;#a=0;setup(){let t=this.querySelector(":scope > table");return!t||(this.#i=this.#d(t),this.#i.length===0)?!1:(this.#s=Math.min(...this.#i.map(e=>e.start)),this.#o=Math.max(...this.#i.map(e=>e.end)),this.#a=this.#o-this.#s,this.#a<=0&&(this.#a=N),this.#b(t),this.dispatchEvent(new CustomEvent("gantt-chart:ready",{bubbles:!0,detail:{taskCount:this.#i.length,dateRange:{start:new Date(this.#s).toISOString(),end:new Date(this.#o).toISOString()}}})),!0)}teardown(){this.#r&&(this.#r.remove(),this.#r=null),this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null);let t=this.querySelector("table.gc-sr-only");t&&t.classList.remove("gc-sr-only"),this.#i=[]}static#n=0;attributeChangedCallback(t,e,r){e===r||!this.isConnected||(t==="src"?this._loadSrc(r):this.hasAttribute("data-upgraded")&&this.#c())}#c(){let t=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};if(this.hasAttribute("data-upgraded")&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let e=`gc-vt-${++c.#n}`;this.style.viewTransitionName=e,document.startViewTransition(t).finished.finally(()=>{this.style.viewTransitionName=""})}else t()}get tasks(){return this.#i}set tasks(t){let e=(t||[]).map((r,s)=>({id:r.id??`gc-task-${s}`,name:r.name??`Task ${s+1}`,start:typeof r.start=="number"?r.start:j(r.start),end:typeof r.end=="number"?r.end:r.end!=null?j(r.end):typeof r.start=="number"?r.start:j(r.start),progress:r.progress??0,group:r.group??null,depends:Array.isArray(r.depends)?r.depends:r.depends?String(r.depends).split(",").map(a=>a.trim()):[],status:r.status??null,assignee:r.assignee??null,milestone:!!r.milestone,color:r.color??null,storyIds:r.storyIds??[],itemIds:r.itemIds??[]}));if((this.#e||this.#r||this.#t)&&(this.#r&&(this.#r.remove(),this.#r=null),this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null)),this.#i=e,e.length>0){this.#s=Math.min(...e.map(s=>s.start)),this.#o=Math.max(...e.map(s=>s.end)),this.#a=this.#o-this.#s,this.#a<=0&&(this.#a=N);let r=this.querySelector(":scope > table");r||(r=document.createElement("table"),r.classList.add("gc-sr-only"),this.appendChild(r)),this.#b(r)}this.dispatchEvent(new CustomEvent("gantt-chart:tasks-changed",{detail:{tasks:e,source:"property"},bubbles:!0}))}#d(t){let e=t.querySelectorAll("tbody tr"),r=[];for(let s=0;s<e.length;s++){let a=e[s],i=a.querySelectorAll("time[datetime]");if(i.length<2&&!a.hasAttribute("data-milestone"))continue;let o=i[0]?.getAttribute("datetime"),n=i.length>1?i[1].getAttribute("datetime"):o;if(!o)continue;let l=a.querySelector("progress"),d=l?l.value/(l.max||100):0,p=a.cells[0]?.textContent?.trim()||`Task ${s+1}`;r.push({id:a.dataset.taskId||`gc-task-${s}`,name:p,start:j(o),end:j(n),progress:d,group:a.dataset.group||null,depends:a.dataset.depends?a.dataset.depends.split(",").map(u=>u.trim()):[],status:a.dataset.status||null,assignee:a.dataset.assignee||null,milestone:a.hasAttribute("data-milestone"),color:a.dataset.color||null,storyIds:a.dataset.storyIds?a.dataset.storyIds.split(",").map(u=>u.trim()):[],itemIds:a.dataset.itemIds?a.dataset.itemIds.split(",").map(u=>u.trim()):[]})}return r}#b(t){let e=this.getAttribute("title"),r=this.hasAttribute("show-today"),s=this.hasAttribute("show-progress"),a=this.hasAttribute("show-dependencies");e&&(this.#r=document.createElement("h2"),this.#r.className="gc-title",this.#r.textContent=e,this.insertBefore(this.#r,t)),this.#e=document.createElement("div"),this.#e.className="gc-container",this.#e.setAttribute("role","region"),this.#e.setAttribute("aria-label",`Gantt chart${e?": "+e:""}`);let i=this.#m();this.#e.appendChild(i);let o=document.createElement("div");o.className="gc-body";let n=document.createElement("div");n.className="gc-task-list";let l=document.createElement("div");l.className="gc-bars";let d=this.#f();l.appendChild(d);let p=this.#v();for(let[u,m]of p){if(p.size>1&&u){let f=document.createElement("div");f.className="gc-group-header";let g=document.createElement("span");g.className="gc-group-label",g.textContent=u,f.appendChild(g),n.appendChild(f);let v=document.createElement("div");v.className="gc-group-spacer",l.appendChild(v)}for(let f of m){let g=document.createElement("div");g.className="gc-task-row",g.setAttribute("data-task-id",f.id);let v=document.createElement("span");v.className="gc-task-name",v.textContent=f.name,g.appendChild(v);let y=document.createElement("span");y.className="gc-task-dates",y.textContent=`${new Date(f.start).toLocaleDateString()} to ${new Date(f.end).toLocaleDateString()}`,g.appendChild(y),n.appendChild(g);let _=document.createElement("div");_.className="gc-bar-row",f.milestone?_.appendChild(this.#h(f)):_.appendChild(this.#l(f,s)),l.appendChild(_)}}if(r){let u=this.#y();u&&l.appendChild(u)}a&&requestAnimationFrame(()=>{let u=this.#g(l);u&&l.appendChild(u)}),o.appendChild(n),o.appendChild(l),this.#e.appendChild(o),this.insertBefore(this.#e,t),t.classList.add("gc-sr-only"),this.#t=document.createElement("div"),this.#t.className="gc-sr-only",this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.appendChild(this.#t),this.listen(this.#e,"click",u=>{let m=u.target.closest(".gc-bar, .gc-milestone");if(!m)return;let f=m.dataset.taskId,g=this.#i.find(v=>v.id===f);g&&(this.#x(`Selected: ${g.name}`),this.dispatchEvent(new CustomEvent("gantt-chart:task-click",{bubbles:!0,detail:{task:g}})))}),this.listen(this.#e,"keydown",u=>{let m=u;if(m.key==="Enter"||m.key===" "){let f=m.target.closest(".gc-bar, .gc-milestone");f&&(m.preventDefault(),f.click())}})}#m(){let t=document.createElement("div");t.className="gc-timeline-header";let e=document.createElement("div");e.className="gc-timeline-spacer",t.appendChild(e);let r=document.createElement("div");r.className="gc-timeline-dates";let s=this.#u();for(let{position:a,text:i}of s){let o=document.createElement("span");o.className="gc-date-label",o.style.left=`${a}%`,o.textContent=i,r.appendChild(o)}return t.appendChild(r),t}#u(){let t=this.getAttribute("view")||"auto",e=t==="auto"?le(this.#a):t,r=de(this.#a),s=[],a;switch(e){case"day":a=N;break;case"week":a=wt;break;case"month":a=G;break;case"quarter":a=ce;break;default:a=G}let i=new Date(this.#s);if(e==="week"){let l=i.getDay(),d=l===0?1:l===1?0:8-l;i.setDate(i.getDate()+d)}else if(e==="month")i.setDate(1),i.getTime()<this.#s&&i.setMonth(i.getMonth()+1);else if(e==="quarter"){let l=i.getMonth(),d=Math.ceil((l+1)/3)*3;i.setMonth(d),i.setDate(1)}let o=i.getTime();o>this.#s+a*.5&&s.push({position:0,text:r(new Date(this.#s))});let n=o;for(;n<=this.#o;){let l=(n-this.#s)/this.#a*100;if(l>=0&&l<=100&&s.push({position:l,text:r(new Date(n))}),e==="month"){let d=new Date(n);d.setMonth(d.getMonth()+1),n=d.getTime()}else if(e==="quarter"){let d=new Date(n);d.setMonth(d.getMonth()+3),n=d.getTime()}else n+=a}return s}#f(){let t=document.createElement("div");t.className="gc-grid-lines";let e=this.#u();for(let{position:r}of e){if(r<=0)continue;let s=document.createElement("div");s.className="gc-grid-line",s.style.left=`${r}%`,t.appendChild(s)}return t}#v(){let t=new Map;for(let e of this.#i){let r=e.group||"";t.has(r)||t.set(r,[]),t.get(r)?.push(e)}return t}#l(t,e){let r=(t.start-this.#s)/this.#a*100,s=(t.end-t.start)/this.#a*100,a=document.createElement("div");if(a.className="gc-bar",a.setAttribute("data-task-id",t.id),a.setAttribute("role","img"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`${Dt(t.name)}: ${new Date(t.start).toLocaleDateString()} to ${new Date(t.end).toLocaleDateString()}`+(t.progress>0?`, ${Math.round(t.progress*100)}% complete`:"")),a.style.left=`${r}%`,a.style.width=`${Math.max(s,.5)}%`,t.status&&a.setAttribute("data-status",t.status),t.color&&a.style.setProperty("--gc-bar-color",t.color),e&&t.progress>0){let i=document.createElement("div");i.className="gc-bar-fill",i.style.width=`${Math.round(t.progress*100)}%`,a.appendChild(i)}if(s>8){let i=document.createElement("span");i.className="gc-bar-label",i.textContent=t.name,a.appendChild(i)}return a}#h(t){let e=(t.start-this.#s)/this.#a*100,r=document.createElement("div");return r.className="gc-milestone",r.setAttribute("data-task-id",t.id),r.setAttribute("role","img"),r.setAttribute("tabindex","0"),r.setAttribute("aria-label",`Milestone: ${Dt(t.name)}, ${new Date(t.start).toLocaleDateString()}`),r.style.left=`${e}%`,t.status&&r.setAttribute("data-status",t.status),t.color&&r.style.setProperty("--gc-bar-color",t.color),r}#y(){let t=Date.now();if(t<this.#s||t>this.#o)return null;let e=(t-this.#s)/this.#a*100,r=document.createElement("div");r.className="gc-today-line",r.style.left=`${e}%`;let s=document.createElement("span");return s.className="gc-today-label",s.textContent="Today",r.appendChild(s),r}#g(t){if(!this.#i.some(n=>n.depends.length>0))return null;let r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg");s.setAttribute("class","gc-deps"),s.style.width="100%",s.style.height="100%";let a=document.createElementNS(r,"defs"),i=document.createElementNS(r,"marker");i.setAttribute("id","gc-arrowhead"),i.setAttribute("markerWidth","8"),i.setAttribute("markerHeight","6"),i.setAttribute("refX","8"),i.setAttribute("refY","3"),i.setAttribute("orient","auto");let o=document.createElementNS(r,"polygon");o.setAttribute("points","0 0, 8 3, 0 6"),o.setAttribute("fill","var(--color-text-muted, #666666)"),i.appendChild(o),a.appendChild(i),s.appendChild(a);for(let n of this.#i)for(let l of n.depends){let d=this.#i.find(w=>w.id===l);if(!d)continue;let p=(d.end-this.#s)/this.#a*100,u=(n.start-this.#s)/this.#a*100,m=this.#p(d.id,t),f=this.#p(n.id,t);if(m===-1||f===-1)continue;let g=36,v=m*g+g/2,y=f*g+g/2,_=document.createElementNS(r,"path"),b=p+(u-p)/2;_.setAttribute("d",`M ${p}% ${v} C ${b}% ${v}, ${b}% ${y}, ${u}% ${y}`),_.setAttribute("class","gc-dep-line"),s.appendChild(_)}return s}#p(t,e){let r=e.querySelectorAll(".gc-bar-row");for(let s=0;s<r.length;s++){let a=r[s].querySelector("[data-task-id]");if(a&&a.dataset.taskId===t)return s}return-1}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let r=await e.json();for(;this.firstChild;)this.firstChild.remove();let s=document.createElement("table"),a=document.createElement("thead"),i=document.createElement("tr");for(let n of["Task","Start","End","Progress"]){let l=document.createElement("th");l.textContent=n,i.appendChild(l)}a.appendChild(i),s.appendChild(a);let o=document.createElement("tbody");for(let n of r.tasks||[]){let l=document.createElement("tr");n.id&&(l.dataset.taskId=n.id),n.group&&(l.dataset.group=n.group),n.depends&&(l.dataset.depends=Array.isArray(n.depends)?n.depends.join(","):n.depends),n.status&&(l.dataset.status=n.status),n.assignee&&(l.dataset.assignee=n.assignee),n.milestone&&l.setAttribute("data-milestone",""),n.color&&(l.dataset.color=n.color),n.storyIds&&(l.dataset.storyIds=Array.isArray(n.storyIds)?n.storyIds.join(","):n.storyIds),n.itemIds&&(l.dataset.itemIds=Array.isArray(n.itemIds)?n.itemIds.join(","):n.itemIds);let d=document.createElement("td");d.textContent=n.name||"",l.appendChild(d);let p=document.createElement("td"),u=document.createElement("time");u.setAttribute("datetime",n.start),u.textContent=new Date(n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),p.appendChild(u),l.appendChild(p);let m=document.createElement("td"),f=document.createElement("time");f.setAttribute("datetime",n.end||n.start),f.textContent=new Date(n.end||n.start).toLocaleDateString(void 0,{month:"short",day:"numeric"}),m.appendChild(f),l.appendChild(m);let g=document.createElement("td"),v=document.createElement("progress");v.value=n.progress||0,v.max=100,v.textContent=`${n.progress||0}%`,g.appendChild(v),l.appendChild(g),o.appendChild(l)}s.appendChild(o),this.appendChild(s),r.title&&this.setAttribute("title",r.title),this.#c()}catch(e){console.warn(`[gantt-chart] Failed to load src="${t}":`,e)}}#x(t){this.#t&&(this.#t.textContent="",requestAnimationFrame(()=>{this.#t&&(this.#t.textContent=t)}))}};x("gantt-chart",_t);var R=`
2240
2314
  :host {
2241
2315
  --_bg: var(--work-item-bg, var(--color-surface, #ffffff));
2242
2316
  --_text: var(--work-item-text, var(--color-text, #1a1a1a));
@@ -2326,12 +2400,13 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2326
2400
  height: 12px;
2327
2401
  }
2328
2402
 
2329
- /* Type colors */
2330
- .wi-type[data-type="task"] { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
2331
- .wi-type[data-type="bug"] { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
2332
- .wi-type[data-type="chore"] { color: #6b7280; background: rgba(107, 114, 128, 0.1); }
2333
- .wi-type[data-type="spike"] { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
2334
- .wi-type[data-type="feature"] { color: #059669; background: rgba(5, 150, 105, 0.1); }
2403
+ /* Type colors \u2014 driven by VB theme tokens, with color-mix surfaces so the
2404
+ pill background shifts with the active theme. */
2405
+ .wi-type[data-type="task"] { color: var(--color-info, #3b82f6); background: color-mix(in oklch, var(--color-info, #3b82f6) 12%, transparent); }
2406
+ .wi-type[data-type="bug"] { color: var(--color-error, #dc2626); background: color-mix(in oklch, var(--color-error, #dc2626) 12%, transparent); }
2407
+ .wi-type[data-type="chore"] { color: var(--color-text-muted, #6b7280); background: color-mix(in oklch, var(--color-text-muted, #6b7280) 12%, transparent); }
2408
+ .wi-type[data-type="spike"] { color: var(--color-accent, #8b5cf6); background: color-mix(in oklch, var(--color-accent, #8b5cf6) 12%, transparent); }
2409
+ .wi-type[data-type="feature"] { color: var(--color-success, #059669); background: color-mix(in oklch, var(--color-success, #059669) 12%, transparent); }
2335
2410
 
2336
2411
  /* \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 */
2337
2412
  .wi-badges {
@@ -2414,7 +2489,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2414
2489
  display: flex;
2415
2490
  align-items: center;
2416
2491
  justify-content: center;
2417
- color: #fff;
2492
+ color: var(--color-text-inverted, #fff);
2418
2493
  flex-shrink: 0;
2419
2494
  }
2420
2495
 
@@ -2481,12 +2556,12 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2481
2556
  .wi-section-icon svg {
2482
2557
  width: 13px;
2483
2558
  height: 13px;
2484
- fill: white;
2559
+ fill: var(--color-text-inverted, #fff);
2485
2560
  }
2486
2561
 
2487
- .wi-section-icon.description { background: #3b82f6; }
2488
- .wi-section-icon.checklist { background: #22c55e; }
2489
- .wi-section-icon.notes { background: #f59e0b; }
2562
+ .wi-section-icon.description { background: var(--color-info, #3b82f6); }
2563
+ .wi-section-icon.checklist { background: var(--color-success, #22c55e); }
2564
+ .wi-section-icon.notes { background: var(--color-warning, #f59e0b); }
2490
2565
 
2491
2566
  .wi-section-title {
2492
2567
  font-size: var(--_font-xs);
@@ -2597,31 +2672,31 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2597
2672
  }
2598
2673
 
2599
2674
  .state-msg { padding: var(--_space-m); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
2600
- .state-msg--error { color: #dc2626; }
2601
- `;var Ct={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"/>'},nt={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)"}},lt={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)"}},ct=class extends HTMLElement{static get observedAttributes(){return["item-id","type","priority","status","estimate","assignee","story-ids","detail","compact","src"]}#t=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#e(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#t.set(e,t.textContent.trim())}}_resolve(t){return this.getAttribute(t)||this.#t.get(t)||""}connectedCallback(){this.#e(),this.itemId&&!this.id&&(this.id=this.itemId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#s(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,s){e!==s&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(s):this.#s())}get itemId(){return this.getAttribute("item-id")||""}get itemTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#t.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){lt[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("work-item:status",{detail:{status:t,itemId:this.itemId},bubbles:!0,composed:!0})))}updatePriority(t){nt[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.#s(),this.dispatchEvent(new CustomEvent("work-item:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,s]of[["itemId","item-id"],["type","type"],["priority","priority"],["status","status"],["estimate","estimate"],["assignee","assignee"],["detail","detail"]])t[e]!=null&&this.setAttribute(s,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 s=document.createElement("p");s.slot=e,s.textContent=t[e],this.appendChild(s)}if(t.checklist&&!this.querySelector('[slot="checklist"]')){let e=document.createElement("ul");e.slot="checklist";let s=Array.isArray(t.checklist)?t.checklist:[t.checklist];for(let r of s){let a=document.createElement("li");a.textContent=r,e.appendChild(a)}this.appendChild(e)}}async _loadSrc(t){if(t){this.shadowRoot.innerHTML=`<style>${z}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();this._applyData(s),this.#s()}catch(e){this.shadowRoot.innerHTML=`<style>${z}</style><div class="state-msg state-msg--error">Could not load: ${m(e.message)}</div>`}}}#s(){let t=nt[this.priority]||nt.medium,e=lt[this.status]||lt.backlog,s=this.itemType,r=Ct[s]||Ct.task,a=this._detailLevel,i=this.itemId?`Work item: ${m(this.itemId)}`:"Work item";if(a==="minimal"){this.shadowRoot.innerHTML=`<style>${z}</style>
2602
- <article class="wi-card wi-card--minimal" role="article" aria-label="${i}"
2675
+ .state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
2676
+ `;var jt={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"/>'},At={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)"}},kt={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)"}},Ct=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"})}#t(){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.#t(),this.itemId&&!this.id&&(this.id=this.itemId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#r(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,r){e!==r&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(r):this.#r())}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){kt[t]&&(this.setAttribute("status",t),this.dispatchEvent(new CustomEvent("work-item:status",{detail:{status:t,itemId:this.itemId},bubbles:!0,composed:!0})))}updatePriority(t){At[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.#r(),this.dispatchEvent(new CustomEvent("work-item:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){for(let[e,r]of[["itemId","item-id"],["type","type"],["priority","priority"],["status","status"],["estimate","estimate"],["assignee","assignee"],["detail","detail"]])t[e]!=null&&this.setAttribute(r,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 r=document.createElement("p");r.slot=e,r.textContent=String(t[e]),this.appendChild(r)}if(t.checklist&&!this.querySelector('[slot="checklist"]')){let e=document.createElement("ul");e.slot="checklist";let r=Array.isArray(t.checklist)?t.checklist:[t.checklist];for(let s of r){let a=document.createElement("li");a.textContent=String(s),e.appendChild(a)}this.appendChild(e)}}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${R}</style><div class="state-msg">Loading\u2026</div>`;try{let r=await fetch(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);let s=await r.json();this._applyData(s),this.#r()}catch(r){e.innerHTML=`<style>${R}</style><div class="state-msg state-msg--error">Could not load: ${h(r.message)}</div>`}}#r(){let t=this.shadowRoot,e=At[this.priority]||At.medium,r=kt[this.status]||kt.backlog,s=this.itemType,a=jt[s]||jt.task,i=this._detailLevel,o=this.itemId?`Work item: ${h(this.itemId)}`:"Work item";if(i==="minimal"){t.innerHTML=`<style>${R}</style>
2677
+ <article class="wi-card wi-card--minimal" role="article" aria-label="${o}"
2603
2678
  tabindex="0">
2604
2679
  <div class="wi-body">
2605
2680
  <div class="wi-meta">
2606
- ${this.itemId?`<span class="wi-id">${m(this.itemId)}</span>`:""}
2607
- <span class="wi-type" data-type="${m(s)}">${y(r)} ${m(s)}</span>
2681
+ ${this.itemId?`<span class="wi-id">${h(this.itemId)}</span>`:""}
2682
+ <span class="wi-type" data-type="${h(s)}">${A(a)} ${h(s)}</span>
2608
2683
  </div>
2609
2684
  <div class="wi-title-wrap">
2610
- <slot name="title"><span class="wi-title-fallback">${m(this._minimalLabel)}</span></slot>
2685
+ <slot name="title"><span class="wi-title-fallback">${h(this._minimalLabel)}</span></slot>
2611
2686
  </div>
2612
2687
  </div>
2613
- </article>`;return}if(this.shadowRoot.innerHTML=`<style>${z}</style>
2614
- <article class="wi-card wi-card--${a}" role="article" aria-label="${i}">
2688
+ </article>`;return}if(t.innerHTML=`<style>${R}</style>
2689
+ <article class="wi-card wi-card--${i}" role="article" aria-label="${o}">
2615
2690
 
2616
2691
  <header class="wi-header">
2617
2692
  <div class="wi-meta">
2618
- ${this.itemId?`<span class="wi-id">${m(this.itemId)}</span>`:""}
2619
- <span class="wi-type" data-type="${m(s)}">${y(r)} ${m(s)}</span>
2693
+ ${this.itemId?`<span class="wi-id">${h(this.itemId)}</span>`:""}
2694
+ <span class="wi-type" data-type="${h(s)}">${A(a)} ${h(s)}</span>
2620
2695
  </div>
2621
2696
  <div class="wi-badges">
2622
- <span class="wi-priority" style="color:${t.color};background:${t.bg}">${m(t.label)}</span>
2623
- <span class="wi-status" style="color:${e.color};background:${e.bg}">${m(e.label)}</span>
2624
- ${this.estimate?`<span class="wi-estimate" title="Estimate">${m(this.estimate)}</span>`:""}
2697
+ <span class="wi-priority" style="color:${e.color};background:${e.bg}">${h(e.label)}</span>
2698
+ <span class="wi-status" style="color:${r.color};background:${r.bg}">${h(r.label)}</span>
2699
+ ${this.estimate?`<span class="wi-estimate" title="Estimate">${h(this.estimate)}</span>`:""}
2625
2700
  </div>
2626
2701
  </header>
2627
2702
 
@@ -2632,13 +2707,13 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2632
2707
 
2633
2708
  ${this.assignee?`
2634
2709
  <div class="wi-assignee">
2635
- <span class="wi-assignee__avatar" style="background:${S(this.assignee)}">${E(this.assignee)}</span>
2636
- ${m(this.assignee)}
2710
+ <span class="wi-assignee__avatar" style="background:${L(this.assignee)}">${z(this.assignee)}</span>
2711
+ ${h(this.assignee)}
2637
2712
  </div>`:""}
2638
2713
 
2639
2714
  ${this.storyIds.length?`
2640
2715
  <div class="wi-links">
2641
- ${this.storyIds.map(o=>`<a class="wi-link" href="#${m(o)}">${y('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h10"/>')} ${m(o)}</a>`).join("")}
2716
+ ${this.storyIds.map(n=>`<a class="wi-link" href="#${h(n)}">${A('<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 7h10"/><path d="M7 12h10"/><path d="M7 17h10"/>')} ${h(n)}</a>`).join("")}
2642
2717
  </div>`:""}
2643
2718
  </div>
2644
2719
 
@@ -2680,7 +2755,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2680
2755
  </div>
2681
2756
  </div>
2682
2757
 
2683
- </article>`,a==="compact")for(let o of this.shadowRoot.querySelectorAll(".wi-section")){let n=o.querySelector("slot");n&&n.assignedNodes().length===0&&o.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("work-item:ready",{detail:{itemId:this.itemId,title:this.itemTitle,type:s,priority:this.priority,status:this.status},bubbles:!0,composed:!0}))}};x("work-item",ct);var H={layout:{label:"Layout",cssClass:"sm-badge--layout"},section:{label:"Section",cssClass:"sm-badge--section"},dashboard:{label:"Dashboard",cssClass:"sm-badge--dashboard"},page:{label:"Page",cssClass:"sm-badge--page"},modal:{label:"Modal",cssClass:"sm-badge--modal"},redirect:{label:"Redirect",cssClass:"sm-badge--redirect"}},U={draft:{label:"Draft",cssClass:"sm-status--draft"},ready:{label:"Ready",cssClass:"sm-status--ready"},live:{label:"Live",cssClass:"sm-status--live"},deprecated:{label:"Deprecated",cssClass:"sm-status--deprecated"}},dt=class d extends A{static get observedAttributes(){return["src","collapsed","compact","title","data-view","data-orientation","data-detail"]}static#t=0;#e=null;#s=null;#r=null;#a=null;#o=0;#i=0;setup(){d.#t++;let t=this.getAttribute("src");if(t&&!this.querySelector("nav")){this._loadSrc(t);return}let e=this.querySelector(":scope > nav");if(e){if(this.#o=0,this.#i=0,this.#l(e.querySelector("ul"),0),this.dataset.view==="visual"){this.#c(),this.#G(e),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#o,depth:this.#i}}));return}this.#n(e.querySelector("ul"),0),this.#c(),e.classList.add("sm-tree"),e.setAttribute("role","tree"),e.setAttribute("aria-label",this.getAttribute("title")||"Site map"),this.#e=e,this.hasAttribute("collapsed")&&this.#d(),this.listen(e,"keydown",s=>this.#y(s)),this.listen(e,"click",s=>this.#v(s)),this.dispatchEvent(new CustomEvent("site-map-wc:ready",{bubbles:!0,detail:{nodeCount:this.#o,depth:this.#i}}))}}teardown(){if(this.#r){this.#r.remove(),this.#r=null;let t=this.querySelector("nav");t&&(t.style.display="",t.removeAttribute("aria-hidden"))}this.#s&&(this.#s.remove(),this.#s=null),this.#e&&(this.#e.classList.remove("sm-tree"),this.#e.removeAttribute("role"),this.#e.removeAttribute("aria-label")),this.querySelectorAll(".sm-node-content, .sm-toggle").forEach(t=>t.remove()),this.querySelectorAll('li[role="treeitem"]').forEach(t=>{t.removeAttribute("role"),t.removeAttribute("aria-expanded"),t.removeAttribute("tabindex")}),this.querySelectorAll('ul[role="group"]').forEach(t=>{t.removeAttribute("role"),t.classList.remove("sm-subtree","sm-collapsed")}),this.#e=null,this.#a=null,this.#o=0,this.#i=0}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}#l(t,e){if(!t)return;let s=t.querySelectorAll(":scope > li");for(let r of s){this.#o++;let a=e+1;a>this.#i&&(this.#i=a);let i=r.querySelector(":scope > ul");i&&this.#l(i,a)}}#n(t,e){if(!t)return;e>0&&(t.setAttribute("role","group"),t.classList.add("sm-subtree"));let s=[...t.querySelectorAll(":scope > li")];for(let r of s){let a=!!r.querySelector(":scope > ul"),i=r.querySelector(":scope > a"),o=r.getAttribute("data-page-type")||"page",n=r.getAttribute("data-template")||"",c=r.getAttribute("data-status")||"";r.setAttribute("role","treeitem"),r.setAttribute("tabindex","-1");let l=document.createElement("span");if(l.className="sm-node-content",a){r.setAttribute("aria-expanded","true");let u=document.createElement("button");u.className="sm-toggle",u.setAttribute("type","button"),u.setAttribute("aria-hidden","true"),u.setAttribute("tabindex","-1"),u.textContent="\u25BE",l.appendChild(u)}else{let u=document.createElement("span");u.className="sm-leaf-marker",u.setAttribute("aria-hidden","true"),l.appendChild(u)}if(c&&U[c]){let u=document.createElement("span");u.className=`sm-status-dot ${U[c].cssClass}`,u.setAttribute("title",U[c].label),u.setAttribute("aria-label",U[c].label),l.appendChild(u)}if(i&&l.appendChild(i),H[o]){let u=document.createElement("span");u.className=`sm-badge ${H[o].cssClass}`,u.textContent=H[o].label,l.appendChild(u)}if(n){let u=document.createElement("span");u.className="sm-badge sm-badge--template",u.textContent=n,l.appendChild(u)}r.insertBefore(l,r.firstChild);let h=r.querySelector(":scope > ul");h&&this.#n(h,e+1)}}#c(){let t=this.getAttribute("title");if(!t&&this.#o===0)return;if(this.#s=document.createElement("div"),this.#s.className="sm-header",t){let r=document.createElement("h2");r.className="sm-title",r.textContent=t,this.#s.appendChild(r)}let e=document.createElement("span");e.className="sm-summary",e.textContent=`${this.#o} pages \xB7 ${this.#i} levels deep`,this.#s.appendChild(e);let s=document.createElement("button");s.className="sm-toggle-all",s.setAttribute("type","button"),s.textContent="Collapse all",s.addEventListener("click",()=>{this.querySelectorAll('li[aria-expanded="true"]').length>0?(this.#d(),s.textContent="Expand all"):(this.#b(),s.textContent="Collapse all")}),this.#s.appendChild(s),this.insertBefore(this.#s,this.firstChild)}#d(){let t=this.querySelectorAll("li[aria-expanded]");for(let e of t){e.setAttribute("aria-expanded","false");let s=e.querySelector(":scope > ul");s&&s.classList.add("sm-collapsed");let r=e.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent="\u25B8")}}#b(){let t=this.querySelectorAll("li[aria-expanded]");for(let e of t){e.setAttribute("aria-expanded","true");let s=e.querySelector(":scope > ul");s&&s.classList.remove("sm-collapsed");let r=e.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent="\u25BE")}}#p(t){let e=t.getAttribute("aria-expanded")==="true";t.setAttribute("aria-expanded",e?"false":"true");let s=t.querySelector(":scope > ul");s&&s.classList.toggle("sm-collapsed",e);let r=t.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent=e?"\u25B8":"\u25BE")}#v(t){let e=t.target;if(e.closest(".sm-toggle")){t.preventDefault();let a=e.closest('li[role="treeitem"]');a&&this.#p(a);return}let s=e.closest('li[role="treeitem"]');if(!s)return;this.#u(s);let r=e.closest("a");r&&this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:r.getAttribute("href")||"",pageType:s.getAttribute("data-page-type")||"page",template:s.getAttribute("data-template")||""}}))}#y(t){let e=t.target.closest('li[role="treeitem"]');if(!e)return;let s=t.key,r=!1;switch(s){case"ArrowDown":r=!0,this.#x(e);break;case"ArrowUp":r=!0,this.#g(e);break;case"ArrowRight":if(r=!0,e.getAttribute("aria-expanded")==="false")this.#p(e);else if(e.getAttribute("aria-expanded")==="true"){let a=e.querySelector(':scope > ul > li[role="treeitem"]');a&&this.#u(a)}break;case"ArrowLeft":if(r=!0,e.getAttribute("aria-expanded")==="true")this.#p(e);else{let a=e.parentElement?.closest('li[role="treeitem"]');a&&this.#u(a)}break;case"Enter":r=!0,e.hasAttribute("aria-expanded")&&this.#p(e);break;case" ":r=!0;{let a=e.querySelector(":scope > .sm-node-content > a");a&&a.click()}break;case"Home":r=!0;{let a=this.querySelector('li[role="treeitem"]');a&&this.#u(a)}break;case"End":r=!0;{let a=this.#m();a.length&&this.#u(a[a.length-1])}break}r&&(t.preventDefault(),t.stopPropagation())}#m(){let t=[],e=r=>{if(!r)return;let a=[...r.querySelectorAll(':scope > li[role="treeitem"]')];for(let i of a)if(t.push(i),i.getAttribute("aria-expanded")==="true"){let o=i.querySelector(":scope > ul");o&&e(o)}},s=this.querySelector("nav > ul");return e(s),t}#x(t){let e=this.#m(),s=e.indexOf(t);s>=0&&s<e.length-1&&this.#u(e[s+1])}#g(t){let e=this.#m(),s=e.indexOf(t);s>0&&this.#u(e[s-1])}#u(t){this.#a&&this.#a.setAttribute("tabindex","-1"),t.setAttribute("tabindex","0"),t.focus(),this.#a=t}static#_="http://www.w3.org/2000/svg";static#f=150;static#w=70;static#q=30;static#k=50;static#A=20;static#j={layout:{stroke:"#8b5cf6",fill:"#f5f3ff",text:"#6d28d9"},section:{stroke:"#3b82f6",fill:"#eff6ff",text:"#1d4ed8"},dashboard:{stroke:"#22c55e",fill:"#f0fdf4",text:"#15803d"},page:{stroke:"#94a3b8",fill:"#f8fafc",text:"#475569"},modal:{stroke:"#f59e0b",fill:"#fffbeb",text:"#b45309"},redirect:{stroke:"#ef4444",fill:"#fef2f2",text:"#b91c1c"}};static#R={draft:"#94a3b8",ready:"#f59e0b",live:"#22c55e",deprecated:"#ef4444"};#D(t){let e=[];for(let s of t.querySelectorAll(":scope > li")){let r=s.querySelector(":scope > a"),a=s.querySelector(":scope > ul");e.push({label:r?.textContent?.trim()||s.firstChild?.textContent?.trim()||"",href:r?.getAttribute("href")||"",pageType:s.getAttribute("data-page-type")||"page",template:s.getAttribute("data-template")||"",status:s.getAttribute("data-status")||"",children:a?this.#D(a):[],x:0,y:0,subtreeWidth:0,collapsed:!1,childCount:0})}return e}#P(t,e=0){let s=d.#f,r=d.#w,a=d.#q,i=d.#k;for(let o of t)o.childCount=this.#B(o),o.children.length>0&&!o.collapsed?(this.#P(o.children,e+1),o.subtreeWidth=o.children.reduce((n,c)=>n+c.subtreeWidth,0)+a*(o.children.length-1)):o.subtreeWidth=s,o.subtreeWidth=Math.max(o.subtreeWidth,s)}#B(t){let e=0;for(let s of t.children)e+=1+this.#B(s);return e}#O(t,e,s){let r=d.#f,a=d.#w,i=d.#q,o=d.#k,n=e;for(let c of t)c.x=n+(c.subtreeWidth-r)/2,c.y=s,c.children.length>0&&!c.collapsed&&this.#O(c.children,n,s+a+o),n+=c.subtreeWidth+i}#G(t){t.style.display="none",t.setAttribute("aria-hidden","true");let e=t.querySelector("ul");e&&(this.#h=this.#D(e),this.#S())}#h=null;#C=1;get#N(){return this.dataset.orientation==="horizontal"?"horizontal":"vertical"}get#H(){return Math.min(4,Math.max(0,parseInt(this.dataset.detail||"2",10)))}static#I={zoomIn:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',zoomOut:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/>',reset:'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',flip:'<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"/><path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/>'};static#U=["Shape","Shape + Title","Full","Full + Status","Wireframe"];#S(){if(!this.#h)return;this.#r&&this.#r.remove();let t=d.#_,e=d.#f,s=d.#w,r=d.#A,a=this.#N==="horizontal";this.#P(this.#h),this.#O(this.#h,r,r);let i=this.#K(this.#h),o=i.maxX+e+r,n=i.maxY+s+r;a&&([o,n]=[n,o]),this.#r=document.createElement("div"),this.#r.className="sm-visual",this.#r.setAttribute("tabindex","-1"),this.#r.appendChild(this.#J());let c=document.createElementNS(t,"svg");c.setAttribute("viewBox",`0 0 ${o} ${n}`),c.setAttribute("width",String(o)),c.setAttribute("height",String(n)),c.setAttribute("role","img"),c.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""}`);let l=document.createElement("div");if(l.className="sm-visual-zoom",l.style.width=`${Math.round(o*this.#C)}px`,l.style.height=`${Math.round(n*this.#C)}px`,c.style.transform=`scale(${this.#C})`,c.style.transformOrigin="0 0",a){let f=document.createElementNS(t,"g");f.setAttribute("transform",`rotate(90 0 0) translate(0 -${n})`),this.#M(f,this.#h),this.#L(f,this.#h),c.appendChild(f)}else this.#M(c,this.#h),this.#L(c,this.#h);l.appendChild(c),this.#r.appendChild(l);let h=document.createElement("div");h.className="sm-visual-summary";let u=Math.round(this.#C*100);h.textContent=`${this.#o} pages \xB7 ${this.#i} levels \xB7 ${u}%`,this.#r.appendChild(h),this.appendChild(this.#r),this.#st(this.#r,c),this.listen(c,"click",f=>{let g=f.target,p=g.closest("[data-toggle]");if(p){let v=p.getAttribute("data-toggle");this.#Y(v);return}let b=g.closest("[data-node-id]");b&&(this.#E(b.getAttribute("data-node-id")),this.dispatchEvent(new CustomEvent("site-map-wc:select",{bubbles:!0,detail:{href:b.getAttribute("data-href")||"",pageType:b.getAttribute("data-page-type")||"page",template:b.getAttribute("data-template")||""}})))}),c.setAttribute("tabindex","0"),c.setAttribute("role","tree"),c.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""} \u2014 use arrow keys to navigate`),c.addEventListener("keydown",f=>this.#tt(f)),requestAnimationFrame(()=>{let f=c.querySelector("[data-node-id]");f&&this.#V(f)})}#J(){let t=document.createElement("div");t.className="sm-vtoolbar",t.setAttribute("role","toolbar"),t.setAttribute("aria-label","Site map controls");let e=f=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${f}</svg>`,s=this.#z(e(d.#I.zoomIn),"Zoom in",()=>{this.#C=Math.min(3,this.#C+.25),this.#S()});t.appendChild(s);let r=this.#z(e(d.#I.zoomOut),"Zoom out",()=>{this.#C=Math.max(.25,this.#C-.25),this.#S()});t.appendChild(r);let a=this.#z(e(d.#I.reset),"Reset zoom",()=>{this.#C=1,this.#S()});t.appendChild(a);let i=document.createElement("span");i.className="sm-vtoolbar-sep",t.appendChild(i);let o=this.#N==="horizontal"?"Vertical":"Horizontal",n=this.#z(e(d.#I.flip),o,()=>{this.dataset.orientation=this.#N==="horizontal"?"vertical":"horizontal",this.#S()});t.appendChild(n),t.appendChild(i.cloneNode());let c=this.#H,l=document.createElement("label");l.className="sm-vtoolbar-detail",l.textContent="Detail ";let h=document.createElement("input");h.type="range",h.min="0",h.max="4",h.value=String(c),h.setAttribute("aria-label","Detail level"),h.className="sm-vtoolbar-slider",l.appendChild(h);let u=document.createElement("span");return u.className="sm-vtoolbar-detail-label",u.textContent=d.#U[c],l.appendChild(u),h.addEventListener("input",()=>{this.dataset.detail=h.value,u.textContent=d.#U[parseInt(h.value,10)],this.#S()}),t.appendChild(l),t}#z(t,e,s){let r=document.createElement("button");return r.type="button",r.className="sm-vtoolbar-btn",r.innerHTML=t,r.setAttribute("aria-label",e),r.setAttribute("title",e),r.addEventListener("click",s),r}#T=null;#F(t,e=""){let s=[];for(let r=0;r<t.length;r++){let a=t[r],i=e?`${e}-${r}`:String(r);s.push(i),a.children.length>0&&!a.collapsed&&s.push(...this.#F(a.children,i))}return s}#Z(t){let e=t.lastIndexOf("-");return e>0?t.slice(0,e):null}#rt(t){let e=this.#$(t,this.#h);return!e||e.collapsed||e.children.length===0?null:`${t}-0`}#E(t){if(!t||!this.#r)return;let e=this.#r.querySelector('svg[role="tree"]');if(!e)return;let s=e.querySelector(`[data-node-id="${t}"]`);if(!s)return;this.#V(s),this.#T=t;let r=s.querySelector("rect");if(r&&this.#r){let a=r.getBoundingClientRect(),i=this.#r.getBoundingClientRect();(a.left<i.left||a.right>i.right||a.top<i.top||a.bottom>i.bottom)&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}#V(t){let e=t.closest("svg");if(!e)return;e.querySelectorAll(".sm-vfocus-ring").forEach(a=>a.remove()),e.querySelectorAll("[data-node-id]").forEach(a=>a.removeAttribute("aria-current"));let s=d.#_,r=t.querySelector("rect");if(r){let a=document.createElementNS(s,"rect");a.setAttribute("x",String(parseFloat(r.getAttribute("x"))-3)),a.setAttribute("y",String(parseFloat(r.getAttribute("y"))-3)),a.setAttribute("width",String(parseFloat(r.getAttribute("width"))+6)),a.setAttribute("height",String(parseFloat(r.getAttribute("height"))+6)),a.setAttribute("rx","11"),a.setAttribute("fill","none"),a.setAttribute("stroke","#3b82f6"),a.setAttribute("stroke-width","2"),a.setAttribute("class","sm-vfocus-ring"),t.parentNode.insertBefore(a,t)}t.setAttribute("aria-current","true"),this.#T=t.getAttribute("data-node-id")}#tt(t){if(!this.#h)return;let e=this.#T||"0",s=!1;switch(t.key){case"ArrowDown":{s=!0;let r=this.#$(e,this.#h);r&&r.children.length>0&&!r.collapsed&&this.#E(`${e}-0`);break}case"ArrowUp":{s=!0;let r=this.#Z(e);r&&this.#E(r);break}case"ArrowRight":{s=!0;let r=this.#W(e,1);r&&this.#E(r);break}case"ArrowLeft":{s=!0;let r=this.#W(e,-1);r&&this.#E(r);break}case"Enter":case" ":{s=!0;let r=this.#$(e,this.#h);r&&r.children.length>0&&this.#Y(e);break}case"Home":{s=!0,this.#E("0");break}case"End":{s=!0;let r=this.#F(this.#h);r.length&&this.#E(r[r.length-1]);break}}s&&(t.preventDefault(),t.stopPropagation())}#W(t,e){let s=t.split("-").map(Number),r=s[s.length-1]+e;if(r<0)return null;let a=s.length>1?s.slice(0,-1).join("-"):null,i=a?this.#$(a,this.#h):null,o=i?i.children:this.#h;if(!o||r>=o.length)return null;let n=[...s];return n[n.length-1]=r,n.join("-")}#X=!1;#et={dragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,moved:!1};#st(t,e){if(e.style.cursor="grab",this.#X)return;this.#X=!0;let s=this.#et;this.listen(this,"pointerdown",r=>{if(r.target.closest("button, [data-toggle], .sm-vtoolbar, input"))return;let a=this.querySelector(".sm-visual");if(!a)return;s.dragging=!0,s.moved=!1,s.startX=r.clientX,s.startY=r.clientY,s.scrollLeft=a.scrollLeft,s.scrollTop=a.scrollTop;let i=this.querySelector('svg[role="tree"]');i&&(i.style.cursor="grabbing")}),this.listen(window,"pointermove",r=>{if(!s.dragging)return;let a=r.clientX-s.startX,i=r.clientY-s.startY;(Math.abs(a)>3||Math.abs(i)>3)&&(s.moved=!0);let o=this.querySelector(".sm-visual");o&&(o.scrollLeft=s.scrollLeft-a,o.scrollTop=s.scrollTop-i)}),this.listen(window,"pointerup",()=>{if(!s.dragging)return;s.dragging=!1;let r=this.querySelector('svg[role="tree"]');r&&(r.style.cursor="grab")}),this.listen(this,"click",r=>{s.moved&&(r.stopPropagation(),s.moved=!1)},{capture:!0})}#K(t){let e=0,s=0;for(let r of t)if(r.x+d.#f>e&&(e=r.x+d.#f),r.y+d.#w>s&&(s=r.y+d.#w),r.children.length>0&&!r.collapsed){let a=this.#K(r.children);a.maxX>e&&(e=a.maxX),a.maxY>s&&(s=a.maxY)}return{maxX:e,maxY:s}}#M(t,e){let s=d.#_,r=d.#f,a=d.#w,i=d.#k;for(let o of e){if(o.children.length===0||o.collapsed)continue;let n=o.x+r/2,c=o.y+a,l=c+i/2;for(let h of o.children){let u=h.x+r/2,f=h.y,g=document.createElementNS(s,"path");g.setAttribute("d",`M ${n} ${c} L ${n} ${l} L ${u} ${l} L ${u} ${f}`),g.setAttribute("fill","none"),g.setAttribute("stroke","#cbd5e1"),g.setAttribute("stroke-width","1.5"),t.appendChild(g)}this.#M(t,o.children)}}#L(t,e,s=""){let r=d.#_,a=d.#f,i=d.#w,o=this.#H,n=o>=4;for(let c=0;c<e.length;c++){let l=e[c],h=s?`${s}-${c}`:String(c),u=n?{stroke:"#94a3b8",fill:"#ffffff",text:"#475569"}:d.#j[l.pageType]||d.#j.page,f=document.createElementNS(r,"g");f.setAttribute("data-node-id",h),f.setAttribute("data-href",l.href),f.setAttribute("data-page-type",l.pageType),f.setAttribute("data-template",l.template),f.style.cursor="pointer";let g=document.createElementNS(r,"rect");if(g.setAttribute("x",String(l.x)),g.setAttribute("y",String(l.y)),g.setAttribute("width",String(a)),g.setAttribute("height",String(i)),g.setAttribute("rx","8"),g.setAttribute("fill",u.fill),g.setAttribute("stroke",u.stroke),g.setAttribute("stroke-width",n?"1":"2"),(n||l.pageType==="modal")&&g.setAttribute("stroke-dasharray","6 3"),f.appendChild(g),o>=1){let p=document.createElementNS(r,"text");p.setAttribute("x",String(l.x+a/2)),p.setAttribute("y",String(o===1?l.y+i/2+5:l.y+24)),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","13"),p.setAttribute("font-weight","600"),p.setAttribute("fill",u.text),p.setAttribute("font-family","system-ui, sans-serif"),p.textContent=l.label.length>18?l.label.slice(0,17)+"\u2026":l.label,f.appendChild(p)}if(o>=2){let p=document.createElementNS(r,"text");if(p.setAttribute("x",String(l.x+a/2)),p.setAttribute("y",String(l.y+40)),p.setAttribute("text-anchor","middle"),p.setAttribute("font-size","9"),p.setAttribute("font-weight","700"),p.setAttribute("fill",u.stroke),p.setAttribute("font-family","system-ui, sans-serif"),p.textContent=(H[l.pageType]?.label||l.pageType).toUpperCase(),f.appendChild(p),l.template){let b=document.createElementNS(r,"text");b.setAttribute("x",String(l.x+a/2)),b.setAttribute("y",String(l.y+54)),b.setAttribute("text-anchor","middle"),b.setAttribute("font-size","9"),b.setAttribute("fill","#94a3b8"),b.setAttribute("font-family","system-ui, sans-serif"),b.textContent=l.template,f.appendChild(b)}}if(o>=3&&l.status&&d.#R[l.status]){let p=document.createElementNS(r,"circle");p.setAttribute("cx",String(l.x+a/2)),p.setAttribute("cy",String(l.y+i-8)),p.setAttribute("r","4"),p.setAttribute("fill",n?"#94a3b8":d.#R[l.status]),f.appendChild(p)}if(n)for(let p=0;p<2;p++){let b=document.createElementNS(r,"line");b.setAttribute("x1",String(l.x+12)),b.setAttribute("x2",String(l.x+a-12)),b.setAttribute("y1",String(l.y+i-22+p*8)),b.setAttribute("y2",String(l.y+i-22+p*8)),b.setAttribute("stroke","#cbd5e1"),b.setAttribute("stroke-width","1"),b.setAttribute("stroke-dasharray","3 2"),f.appendChild(b)}if(l.children.length>0){let p=document.createElementNS(r,"g");p.setAttribute("data-toggle",h),p.style.cursor="pointer";let b=document.createElementNS(r,"circle");b.setAttribute("cx",String(l.x+a/2)),b.setAttribute("cy",String(l.y+i+10)),b.setAttribute("r","10"),b.setAttribute("fill",n?"#fff":"#f1f5f9"),b.setAttribute("stroke","#cbd5e1"),b.setAttribute("stroke-width","1"),p.appendChild(b);let v=document.createElementNS(r,"text");v.setAttribute("x",String(l.x+a/2)),v.setAttribute("y",String(l.y+i+14)),v.setAttribute("text-anchor","middle"),v.setAttribute("font-size","11"),v.setAttribute("font-weight","700"),v.setAttribute("fill","#64748b"),v.setAttribute("font-family","system-ui, sans-serif"),v.textContent=l.collapsed?`+${l.childCount}`:"\u2212",p.appendChild(v),f.appendChild(p)}t.appendChild(f),l.children.length>0&&!l.collapsed&&this.#L(t,l.children,h)}}#Y(t){let e=this.#$(t,this.#h);if(!e)return;e.collapsed=!e.collapsed;let s=this.#T||t;this.#S(),requestAnimationFrame(()=>{this.#E(s);let r=this.#r?.querySelector('svg[role="tree"]');r&&r.focus({preventScroll:!0})})}#$(t,e){if(!e)return null;let s=t.split("-").map(Number),r=e,a=null;for(let i of s){if(!r||i>=r.length)return null;a=r[i],r=a.children}return a}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();s.title&&!this.getAttribute("title")&&this.setAttribute("title",s.title);let r=document.createElement("nav"),a=document.createElement("ul");this.#Q(a,s.pages||[]),r.appendChild(a),this.appendChild(r),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[site-map-wc] Failed to load src="${t}":`,e)}}#Q(t,e){for(let s of e){let r=document.createElement("li");s.pageType&&r.setAttribute("data-page-type",s.pageType),s.template&&r.setAttribute("data-template",s.template),s.status&&r.setAttribute("data-status",s.status);let a=document.createElement("a");if(a.href=s.href||"#",a.textContent=s.label||"",r.appendChild(a),s.children&&s.children.length>0){let i=document.createElement("ul");this.#Q(i,s.children),r.appendChild(i)}t.appendChild(r)}}};x("site-map-wc",dt);var T=`
2758
+ </article>`,i==="compact")for(let n of t.querySelectorAll(".wi-section")){let l=n.querySelector("slot");l&&l.assignedNodes().length===0&&n.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("work-item:ready",{detail:{itemId:this.itemId,title:this.itemTitle,type:s,priority:this.priority,status:this.status},bubbles:!0,composed:!0}))}};x("work-item",Ct);var O=`
2684
2759
  :host {
2685
2760
  --_bg: var(--adr-wc-bg, var(--color-surface, #ffffff));
2686
2761
  --_text: var(--adr-wc-text, var(--color-text, #1a1a1a));
@@ -2889,12 +2964,12 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
2889
2964
  .adr-section-icon svg {
2890
2965
  width: 13px;
2891
2966
  height: 13px;
2892
- fill: white;
2967
+ fill: var(--color-text-inverted, #fff);
2893
2968
  }
2894
2969
 
2895
- .adr-section-icon.context { background: #8b5cf6; }
2896
- .adr-section-icon.decision { background: #22c55e; }
2897
- .adr-section-icon.consequences { background: #f59e0b; }
2970
+ .adr-section-icon.context { background: var(--color-accent, #8b5cf6); }
2971
+ .adr-section-icon.decision { background: var(--color-success, #22c55e); }
2972
+ .adr-section-icon.consequences { background: var(--color-warning, #f59e0b); }
2898
2973
 
2899
2974
  .adr-section-title {
2900
2975
  font-size: var(--_font-xs);
@@ -3005,29 +3080,29 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
3005
3080
  }
3006
3081
 
3007
3082
  .state-msg { padding: var(--_space-m); font-size: var(--_font-sm); color: var(--_muted); font-style: italic; }
3008
- .state-msg--error { color: #dc2626; }
3009
- `;var kt={proposed:{label:"Proposed",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},accepted:{label:"Accepted",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},deprecated:{label:"Deprecated",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},superseded:{label:"Superseded",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"}},q={calendar:'<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/>',context:'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/><line x1="10" x2="8" y1="9" y2="9"/>',decision:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',consequences:'<path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"/><path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"/><path d="M7 21h10"/><path d="M12 3v18"/><path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"/>',arrowRight:'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>'},ht=class extends HTMLElement{static get observedAttributes(){return["adr-id","status","supersedes","superseded-by","detail","compact","src"]}#t=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#e(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#t.set(e,t.textContent.trim())}}connectedCallback(){this.#e(),this.adrId&&!this.id&&(this.id=this.adrId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#s(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,s){e!==s&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(s):this.#s())}get adrId(){return this.getAttribute("adr-id")||""}get status(){return this.getAttribute("status")||"proposed"}get adrTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#t.get("title")||""}get adrDate(){let t=this.querySelector('[slot="date"]');return t?.getAttribute("datetime")||t?.textContent?.trim()||this.#t.get("date")||""}get supersedes(){let t=this.getAttribute("supersedes")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get supersededBy(){let t=this.getAttribute("superseded-by")||"";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.adrTitle||this.adrId||"ADR"}async _loadSrc(t){if(t){this.shadowRoot.innerHTML=`<style>${T}</style><div class="state-msg">Loading\u2026</div>`;try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();if(s.adrId!=null&&this.setAttribute("adr-id",String(s.adrId)),s.status!=null&&this.setAttribute("status",String(s.status)),s.detail!=null&&this.setAttribute("detail",String(s.detail)),s.supersedes&&this.setAttribute("supersedes",Array.isArray(s.supersedes)?s.supersedes.join(","):s.supersedes),s.supersededBy&&this.setAttribute("superseded-by",Array.isArray(s.supersededBy)?s.supersededBy.join(","):s.supersededBy),s.title&&!this.querySelector('[slot="title"]')){let r=document.createElement("h3");r.slot="title",r.textContent=s.title,this.appendChild(r)}if(s.date&&!this.querySelector('[slot="date"]')){let r=document.createElement("time");r.slot="date",r.setAttribute("datetime",s.date),r.textContent=new Date(s.date).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),this.appendChild(r)}for(let r of["context","decision"])if(s[r]&&!this.querySelector(`[slot="${r}"]`)){let a=document.createElement("p");a.slot=r,a.textContent=s[r],this.appendChild(a)}if(s.consequences&&!this.querySelector('[slot="consequences"]')){let r=document.createElement("ul");r.slot="consequences";let a=Array.isArray(s.consequences)?s.consequences:[s.consequences];for(let i of a){let o=document.createElement("li");o.textContent=i,r.appendChild(o)}this.appendChild(r)}this.#e(),this.#s()}catch(e){this.shadowRoot.innerHTML=`<style>${T}</style><div class="state-msg state-msg--error">Could not load: ${m(e.message)}</div>`}}}#s(){let t=kt[this.status]||kt.proposed,e=this._detailLevel,s=this.adrId?`ADR: ${m(this.adrId)}`:"Architectural Decision Record",r=!!this.querySelector('[slot="date"]')||this.#t.has("date");if(e==="minimal"){this.shadowRoot.innerHTML=`<style>${T}</style>
3083
+ .state-msg--error { color: var(--color-error-text, var(--color-error, #dc2626)); }
3084
+ `;var Rt={proposed:{label:"Proposed",color:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},accepted:{label:"Accepted",color:"#22c55e",bg:"rgba(34, 197, 94, 0.1)"},deprecated:{label:"Deprecated",color:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},superseded:{label:"Superseded",color:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"}},D={calendar:'<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/>',context:'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/><line x1="10" x2="8" y1="9" y2="9"/>',decision:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',consequences:'<path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"/><path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"/><path d="M7 21h10"/><path d="M12 3v18"/><path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"/>',arrowRight:'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>'},Et=class extends HTMLElement{static get observedAttributes(){return["adr-id","status","supersedes","superseded-by","detail","compact","src"]}#e=new Map;constructor(){super(),this.attachShadow({mode:"open"})}#t(){for(let t of[...this.children]){let e=t.getAttribute("slot");e&&this.#e.set(e,t.textContent.trim())}}connectedCallback(){this.#t(),this.adrId&&!this.id&&(this.id=this.adrId),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),this.#r(),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}attributeChangedCallback(t,e,r){e!==r&&this.shadowRoot&&(t==="src"&&this.isConnected?this._loadSrc(r):this.#r())}get adrId(){return this.getAttribute("adr-id")||""}get status(){return this.getAttribute("status")||"proposed"}get adrTitle(){return this.querySelector('[slot="title"]')?.textContent?.trim()||this.#e.get("title")||""}get adrDate(){let t=this.querySelector('[slot="date"]');return t?.getAttribute("datetime")||t?.textContent?.trim()||this.#e.get("date")||""}get supersedes(){let t=this.getAttribute("supersedes")||"";return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}get supersededBy(){let t=this.getAttribute("superseded-by")||"";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.adrTitle||this.adrId||"ADR"}get data(){return{adrId:this.adrId||void 0,status:this.status,detail:this.getAttribute("detail")||void 0,supersedes:this.supersedes.length?this.supersedes:void 0,supersededBy:this.supersededBy.length?this.supersededBy:void 0,title:this.adrTitle||void 0,date:this.adrDate||void 0}}set data(t){!t||typeof t!="object"||(this._applyData(t),this.#t(),this.shadowRoot&&this.#r(),this.dispatchEvent(new CustomEvent("adr-wc:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}_applyData(t){if(t.adrId!=null&&this.setAttribute("adr-id",String(t.adrId)),t.status!=null&&this.setAttribute("status",String(t.status)),t.detail!=null&&this.setAttribute("detail",String(t.detail)),t.supersedes&&this.setAttribute("supersedes",Array.isArray(t.supersedes)?t.supersedes.join(","):String(t.supersedes)),t.supersededBy&&this.setAttribute("superseded-by",Array.isArray(t.supersededBy)?t.supersededBy.join(","):String(t.supersededBy)),t.title&&!this.querySelector('[slot="title"]')){let e=document.createElement("h3");e.slot="title",e.textContent=String(t.title),this.appendChild(e)}if(t.date&&!this.querySelector('[slot="date"]')){let e=document.createElement("time");e.slot="date",e.setAttribute("datetime",String(t.date)),e.textContent=new Date(String(t.date)).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),this.appendChild(e)}for(let e of["context","decision"])if(t[e]&&!this.querySelector(`[slot="${e}"]`)){let r=document.createElement("p");r.slot=e,r.textContent=String(t[e]),this.appendChild(r)}if(t.consequences&&!this.querySelector('[slot="consequences"]')){let e=document.createElement("ul");e.slot="consequences";let r=Array.isArray(t.consequences)?t.consequences:[t.consequences];for(let s of r){let a=document.createElement("li");a.textContent=String(s),e.appendChild(a)}this.appendChild(e)}}async _loadSrc(t){if(!t)return;let e=this.shadowRoot;e.innerHTML=`<style>${O}</style><div class="state-msg">Loading\u2026</div>`;try{let r=await fetch(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);let s=await r.json();this._applyData(s),this.#t(),this.#r()}catch(r){e.innerHTML=`<style>${O}</style><div class="state-msg state-msg--error">Could not load: ${h(r.message)}</div>`}}#r(){let t=this.shadowRoot,e=Rt[this.status]||Rt.proposed,r=this._detailLevel,s=this.adrId?`ADR: ${h(this.adrId)}`:"Architectural Decision Record",a=!!this.querySelector('[slot="date"]')||this.#e.has("date");if(r==="minimal"){t.innerHTML=`<style>${O}</style>
3010
3085
  <article class="adr-card adr-card--minimal" role="article" aria-label="${s}"
3011
3086
  tabindex="0">
3012
3087
  <div class="adr-body">
3013
3088
  <div class="adr-meta">
3014
- ${this.adrId?`<span class="adr-id">${m(this.adrId)}</span>`:""}
3015
- <span class="adr-status" style="color:${t.color};background:${t.bg}">${m(t.label)}</span>
3089
+ ${this.adrId?`<span class="adr-id">${h(this.adrId)}</span>`:""}
3090
+ <span class="adr-status" style="color:${e.color};background:${e.bg}">${h(e.label)}</span>
3016
3091
  </div>
3017
3092
  <div class="adr-title-wrap">
3018
- <slot name="title"><span class="adr-title-fallback">${m(this._minimalLabel)}</span></slot>
3093
+ <slot name="title"><span class="adr-title-fallback">${h(this._minimalLabel)}</span></slot>
3019
3094
  </div>
3020
3095
  </div>
3021
- </article>`;return}if(this.shadowRoot.innerHTML=`<style>${T}</style>
3022
- <article class="adr-card adr-card--${e}" role="article" aria-label="${s}">
3096
+ </article>`;return}if(t.innerHTML=`<style>${O}</style>
3097
+ <article class="adr-card adr-card--${r}" role="article" aria-label="${s}">
3023
3098
 
3024
3099
  <header class="adr-header">
3025
3100
  <div class="adr-meta">
3026
- ${this.adrId?`<span class="adr-id">${m(this.adrId)}</span>`:""}
3027
- ${r?`<span class="adr-date-wrap">${y(q.calendar)} <slot name="date"></slot></span>`:""}
3101
+ ${this.adrId?`<span class="adr-id">${h(this.adrId)}</span>`:""}
3102
+ ${a?`<span class="adr-date-wrap">${A(D.calendar)} <slot name="date"></slot></span>`:""}
3028
3103
  </div>
3029
3104
  <div class="adr-badges">
3030
- <span class="adr-status" style="color:${t.color};background:${t.bg}">${m(t.label)}</span>
3105
+ <span class="adr-status" style="color:${e.color};background:${e.bg}">${h(e.label)}</span>
3031
3106
  </div>
3032
3107
  </header>
3033
3108
 
@@ -3039,20 +3114,20 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
3039
3114
  ${this.supersedes.length?`
3040
3115
  <div class="adr-links">
3041
3116
  <span class="adr-links-label">Supersedes</span>
3042
- ${this.supersedes.map(a=>`<a class="adr-link" href="#${m(a)}">${y(q.arrowRight)} ${m(a)}</a>`).join("")}
3117
+ ${this.supersedes.map(i=>`<a class="adr-link" href="#${h(i)}">${A(D.arrowRight)} ${h(i)}</a>`).join("")}
3043
3118
  </div>`:""}
3044
3119
 
3045
3120
  ${this.supersededBy.length?`
3046
3121
  <div class="adr-links">
3047
3122
  <span class="adr-links-label">Superseded by</span>
3048
- ${this.supersededBy.map(a=>`<a class="adr-link" href="#${m(a)}">${y(q.arrowRight)} ${m(a)}</a>`).join("")}
3123
+ ${this.supersededBy.map(i=>`<a class="adr-link" href="#${h(i)}">${A(D.arrowRight)} ${h(i)}</a>`).join("")}
3049
3124
  </div>`:""}
3050
3125
  </div>
3051
3126
 
3052
3127
  <div class="adr-sections">
3053
3128
  <div class="adr-section">
3054
3129
  <div class="adr-section-header">
3055
- <div class="adr-section-icon context">${y(q.context)}</div>
3130
+ <div class="adr-section-icon context">${A(D.context)}</div>
3056
3131
  <span class="adr-section-title">Context</span>
3057
3132
  </div>
3058
3133
  <div class="adr-section-content">
@@ -3062,7 +3137,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
3062
3137
 
3063
3138
  <div class="adr-section">
3064
3139
  <div class="adr-section-header">
3065
- <div class="adr-section-icon decision">${y(q.decision)}</div>
3140
+ <div class="adr-section-icon decision">${A(D.decision)}</div>
3066
3141
  <span class="adr-section-title">Decision</span>
3067
3142
  </div>
3068
3143
  <div class="adr-section-content">
@@ -3072,7 +3147,7 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
3072
3147
 
3073
3148
  <div class="adr-section">
3074
3149
  <div class="adr-section-header">
3075
- <div class="adr-section-icon consequences">${y(q.consequences)}</div>
3150
+ <div class="adr-section-icon consequences">${A(D.consequences)}</div>
3076
3151
  <span class="adr-section-title">Consequences</span>
3077
3152
  </div>
3078
3153
  <div class="adr-section-content">
@@ -3081,5 +3156,5 @@ var Ht=window.matchMedia("(prefers-reduced-motion: reduce)");var mt=new Map;func
3081
3156
  </div>
3082
3157
  </div>
3083
3158
 
3084
- </article>`,e==="compact")for(let a of this.shadowRoot.querySelectorAll(".adr-section")){let i=a.querySelector("slot");i&&i.assignedNodes().length===0&&a.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("adr-wc:ready",{detail:{adrId:this.adrId,title:this.adrTitle,status:this.status},bubbles:!0,composed:!0}))}};x("adr-wc",ht);var ut=class extends A{static get observedAttributes(){return["src","title","compact"]}#t=null;#e=null;#s=null;#r=0;setup(){let t=this.querySelector(":scope > ol");if(!t)return!1;let e=this.#a(t);if(e.length===0)return!1;t.style.display="none",t.setAttribute("aria-hidden","true");let s=this.getAttribute("title");s&&(this.#e=document.createElement("h2"),this.#e.className="fd-title",this.#e.textContent=s,this.insertBefore(this.#e,t)),this.#t=document.createElement("div"),this.#t.className="fd-container",this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`Flow diagram${s?": "+s:""}`),this.#r=0,this.#i(e,this.#t);let r=document.createElement("div");r.className="fd-summary",r.textContent=`${this.#r} step${this.#r!==1?"s":""}`,this.#t.appendChild(r),this.insertBefore(this.#t,t),this.#s=document.createElement("div"),this.#s.className="fd-live",this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.listen(this.#t,"click",a=>{let i=a.target.closest(".fd-node-shape");if(!i)return;let n=i.closest(".fd-node")?.dataset.type||"action",c=i.textContent?.trim()||"";this.#d(`Selected: ${c}`),this.dispatchEvent(new CustomEvent("flow-diagram:select",{bubbles:!0,detail:{type:n,text:c}}))}),this.dispatchEvent(new CustomEvent("flow-diagram:ready",{bubbles:!0,detail:{nodeCount:this.#r}}))}teardown(){this.#e&&(this.#e.remove(),this.#e=null),this.#t&&(this.#t.remove(),this.#t=null),this.#s&&(this.#s.remove(),this.#s=null);let t=this.querySelector("ol");t&&(t.style.display="",t.removeAttribute("aria-hidden")),this.#r=0}attributeChangedCallback(t,e,s){e===s||!this.isConnected||(t==="src"?this._loadSrc(s):this.hasAttribute("data-upgraded")&&(this.teardown(),this.removeAttribute("data-upgraded"),this.setup()))}#a(t){let e=[];for(let s of t.querySelectorAll(":scope > li")){let r=this.#o(s);r&&e.push(r)}return e}#o(t){let e=t.dataset.type||"action",s=t.dataset.annotation||"",r=[],a=t.querySelectorAll(":scope > ol > li[data-branch]");if(a.length>0)for(let o of a){let n=o.dataset.branch||"",c=o.querySelector(":scope > ol"),l=c?this.#a(c):[];r.push({label:n,steps:l})}let i="";for(let o of t.childNodes)(o.nodeType===Node.TEXT_NODE||o.nodeType===Node.ELEMENT_NODE&&o.tagName!=="OL")&&(i+=o.textContent);return i=i.trim(),{type:e,text:i,annotation:s,branches:r}}#i(t,e){for(let s=0;s<t.length;s++){let r=t[s];s>0&&e.appendChild(this.#n());let a=this.#l(r);if(e.appendChild(a),r.branches.length>0){let i=document.createElement("div");i.className="fd-branches",i.setAttribute("data-branch-count",String(r.branches.length));let o=document.createElement("div");o.className="fd-split-line",o.setAttribute("aria-hidden","true"),i.appendChild(o);let n=document.createElement("div");n.className="fd-branch-columns";let c=(50/r.branches.length).toFixed(2);n.style.setProperty("--fd-inset",`${c}%`);for(let l of r.branches){let h=document.createElement("div");h.className="fd-branch",h.appendChild(this.#n());let u=document.createElement("span");u.className="fd-branch-label",u.textContent=l.label,u.setAttribute("data-branch",l.label.toLowerCase()),h.appendChild(u),this.#i(l.steps,h),n.appendChild(h)}i.appendChild(n),e.appendChild(i)}}}#l(t){this.#r++;let e=document.createElement("div");e.className="fd-node",e.dataset.type=t.type;let s=document.createElement("div");if(s.className="fd-node-shape",s.setAttribute("tabindex","0"),s.setAttribute("role","img"),s.setAttribute("aria-label",`${t.type}: ${t.text}`),s.textContent=t.text,e.appendChild(s),t.annotation){let r=document.createElement("div");r.className="fd-annotation",r.textContent=t.annotation,e.appendChild(r)}return e}#n(t){let e=document.createElement("div");e.className="fd-connector",e.setAttribute("aria-hidden","true");let s=document.createElement("div");if(s.className="fd-connector-line",e.appendChild(s),t){let a=document.createElement("span");a.className="fd-connector-label",a.textContent=t,e.appendChild(a)}let r=document.createElement("div");return r.className="fd-connector-arrow",e.appendChild(r),e}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();s.title&&this.setAttribute("title",s.title);let r=document.createElement("ol");this.#c(s.steps||[],r),this.appendChild(r),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[flow-diagram] Failed to load src="${t}":`,e)}}#c(t,e){for(let s of t){let r=document.createElement("li");if(s.type&&(r.dataset.type=s.type),s.annotation&&(r.dataset.annotation=s.annotation),r.textContent=s.text||"",s.branches&&s.branches.length>0){let a=document.createElement("ol");for(let i of s.branches){let o=document.createElement("li");o.dataset.branch=i.label||"";let n=document.createElement("ol");this.#c(i.steps||[],n),o.appendChild(n),a.appendChild(o)}r.appendChild(a)}e.appendChild(r)}}#d(t){this.#s&&(this.#s.textContent="",requestAnimationFrame(()=>{this.#s&&(this.#s.textContent=t)}))}};x("flow-diagram",ut);
3159
+ </article>`,r==="compact")for(let i of t.querySelectorAll(".adr-section")){let o=i.querySelector("slot");o&&o.assignedNodes().length===0&&i.setAttribute("data-empty","")}this.dispatchEvent(new CustomEvent("adr-wc:ready",{detail:{adrId:this.adrId,title:this.adrTitle,status:this.status},bubbles:!0,composed:!0}))}};x("adr-wc",Et);
3085
3160
  //# sourceMappingURL=ux-planning.full.js.map