@adia-ai/web-components 0.8.34 → 0.8.35

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 (89) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/components/agent-questions/agent-questions.class.js +0 -1
  3. package/components/badge/badge.css +27 -3
  4. package/components/badge/badge.examples.md +4 -4
  5. package/components/card/card.css +44 -1
  6. package/components/check/check.a2ui.json +25 -11
  7. package/components/check/check.class.js +5 -0
  8. package/components/check/check.css +21 -0
  9. package/components/check/check.d.ts +2 -0
  10. package/components/check/check.examples.md +4 -4
  11. package/components/check/check.yaml +26 -7
  12. package/components/demo-toggle/demo-toggle.css +4 -0
  13. package/components/demo-toggle/demo-toggle.examples.md +4 -4
  14. package/components/feed/feed-item.a2ui.json +3 -2
  15. package/components/feed/feed-item.yaml +7 -1
  16. package/components/feed/feed.css +28 -5
  17. package/components/field/field.examples.md +4 -4
  18. package/components/image/image.class.js +8 -0
  19. package/components/nav-group/nav-group.css +12 -1
  20. package/components/option-card/option-card.a2ui.json +10 -10
  21. package/components/option-card/option-card.css +32 -16
  22. package/components/option-card/option-card.yaml +19 -15
  23. package/components/radio/radio.examples.md +4 -4
  24. package/components/range/range.css +8 -4
  25. package/components/slider/slider.a2ui.json +6 -3
  26. package/components/slider/slider.css +28 -12
  27. package/components/slider/slider.yaml +11 -3
  28. package/components/stat/stat.examples.md +4 -4
  29. package/components/swatch/swatch.css +14 -6
  30. package/components/switch/switch.examples.md +4 -4
  31. package/components/table-toolbar/table-toolbar.css +10 -1
  32. package/components/tabs/tabs.css +10 -4
  33. package/components/tag/tag.class.js +14 -1
  34. package/components/tag/tag.css +63 -5
  35. package/components/text/text.examples.md +4 -4
  36. package/components/timeline/timeline-item.a2ui.json +2 -2
  37. package/components/timeline/timeline-item.yaml +2 -2
  38. package/components/timeline/timeline.css +33 -5
  39. package/components/timeline/timeline.d.ts +2 -2
  40. package/components/toast/toast.css +28 -5
  41. package/custom-elements.json +469 -46
  42. package/dist/theme-provider.min.js +1 -1
  43. package/dist/web-components.min.css +1 -1
  44. package/dist/web-components.min.js +4 -4
  45. package/dist/web-components.sheet.js +1 -1
  46. package/package.json +1 -1
  47. package/patterns/access-requests/access-requests.examples.html +3 -3
  48. package/patterns/admin-keys-and-export/admin-keys-and-export.examples.html +3 -3
  49. package/patterns/admin-shell/admin-shell.examples.html +3 -4
  50. package/patterns/agent-cost/agent-cost.examples.html +3 -3
  51. package/patterns/agent-memory/agent-memory.examples.html +3 -3
  52. package/patterns/agent-prompt-library/agent-prompt-library.examples.html +3 -3
  53. package/patterns/agent-tool-call/agent-tool-call.examples.html +3 -3
  54. package/patterns/alert-dialog/alert-dialog.examples.html +3 -3
  55. package/patterns/app-nav/app-nav.examples.html +4 -4
  56. package/patterns/approvals/approvals.examples.html +3 -3
  57. package/patterns/audit-log/audit-log.examples.html +3 -3
  58. package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.html +19 -9
  59. package/patterns/bulk-action-toolbar/bulk-action-toolbar.examples.js +2 -2
  60. package/patterns/changelog-feed/changelog-feed.examples.html +3 -3
  61. package/patterns/chart-in-card/chart-in-card.examples.html +37 -3
  62. package/patterns/chart-in-card/chart-in-card.examples.js +12 -0
  63. package/patterns/chart-in-card/chart-in-card.html +6 -0
  64. package/patterns/chat-shell/chat-shell.examples.html +3 -4
  65. package/patterns/comments-and-collaboration/comments-and-collaboration.examples.html +3 -3
  66. package/patterns/conversion-funnel/conversion-funnel.examples.html +3 -3
  67. package/patterns/data-tables-inline-edit-and-tree/data-tables-inline-edit-and-tree.examples.html +3 -3
  68. package/patterns/diff-review/diff-review.examples.html +3 -3
  69. package/patterns/editor-shell/editor-shell.examples.html +3 -4
  70. package/patterns/export-flow/export-flow.examples.html +3 -3
  71. package/patterns/filter-bar/filter-bar.examples.html +3 -3
  72. package/patterns/form-drawer/form-drawer.examples.html +3 -3
  73. package/patterns/forms-conditional-and-autocomplete/forms-conditional-and-autocomplete.examples.html +3 -3
  74. package/patterns/inline-dialog/inline-dialog.examples.html +3 -3
  75. package/patterns/kanban-board/kanban-board.examples.html +3 -3
  76. package/patterns/layout/layout.examples.html +4 -7
  77. package/patterns/marketing-engagement/marketing-engagement.examples.html +3 -3
  78. package/patterns/notifications-bell-and-digest/notifications-bell-and-digest.examples.html +3 -3
  79. package/patterns/permissions-matrix/permissions-matrix.examples.html +3 -3
  80. package/patterns/permissions-role-picker/permissions-role-picker.examples.html +3 -3
  81. package/patterns/permissions-sharing/permissions-sharing.examples.html +3 -3
  82. package/patterns/profile-public-and-verification/profile-public-and-verification.examples.html +3 -3
  83. package/patterns/record-detail-drawer/record-detail-drawer.examples.html +3 -3
  84. package/patterns/responsive-shell-sidebar/responsive-shell-sidebar.examples.html +3 -3
  85. package/patterns/retention-cohort/retention-cohort.examples.html +3 -3
  86. package/patterns/search-discovery/search-discovery.examples.html +3 -3
  87. package/patterns/system-banners/system-banners.examples.html +3 -3
  88. package/patterns/timezone-selector/timezone-selector.examples.html +3 -3
  89. package/patterns/wizard-drawer/wizard-drawer.examples.html +3 -3
@@ -108,7 +108,7 @@ See the JSDoc header of icons-phosphor.js for the full recipe (gh#786).`)},0)}el
108
108
  <div slot="text" contenteditable="plaintext-only" tabindex="0"
109
109
  ${this.value?"":'data-empty=""'}
110
110
  data-placeholder="${this.placeholder}"></div>
111
- `),this.#t=this.querySelector('[slot="text"]'),this.value&&(this.#t.textContent=this.value),this.#t&&(this.#t.addEventListener("input",this.#e),this.#t.addEventListener("keydown",this.#i),this.#t.addEventListener("blur",this.#s),this.#t.addEventListener("paste",this.#r))}render(){if(!this.#t)return;this.#t.setAttribute("data-placeholder",this.placeholder),this.disabled||this.readonly?this.#t.contentEditable="false":this.#t.contentEditable="plaintext-only";let t=this.value||"";this.#t.textContent!==t&&(this.#t.textContent=t,this.#t.toggleAttribute("data-empty",!t));let e=this.querySelector('[slot="label"]');e&&this.label&&e.setAttribute("label",this.label),this.setAttribute("aria-label",this.label||this.placeholder||"")}#e=()=>{let t=this.#t.textContent||"";this.value=t,this.#t.toggleAttribute("data-empty",!t),this.syncValue(t),this.scheduleThrottledInput()};#i=t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.flushPendingInput(),this.dispatchEvent(new Event("submit",{bubbles:!0})))};#s=()=>{this.flushPendingInput(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}}))};#r=t=>{t.preventDefault();let e=t.clipboardData?.getData("text/plain")||"";document.execCommand("insertText",!1,e)};focus(){this.#t?.focus()}clear(){this.value="",this.#t&&(this.#t.textContent="",this.#t.setAttribute("data-empty","")),this.syncValue("")}disconnected(){super.disconnected(),this.#t&&(this.#t.removeEventListener("input",this.#e),this.#t.removeEventListener("keydown",this.#i),this.#t.removeEventListener("blur",this.#s),this.#t.removeEventListener("paste",this.#r)),this.#t=null}};E();v("textarea-ui",ar);Q();var lr=class extends Z{static labelDeprecated=!1;static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},indeterminate:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"",reflect:!0}};static template=()=>vt`<span slot="box"></span>`;connected(){super.connected(),this.setAttribute("role","checkbox"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}render(){this.indeterminate?this.setAttribute("aria-checked","mixed"):this.setAttribute("aria-checked",String(this.checked)),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"),this.label&&this.setAttribute("aria-label",this.label),this.syncValue(this.checked?this.value||"on":"")}#t=()=>{this.disabled||(this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,checked:this.checked}})))};#e=t=>{(t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.#t())};disconnected(){super.disconnected(),this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}};E();v("check-ui",lr);Q();var hr=class extends Z{static labelDeprecated=!1;static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"",reflect:!0}};static template=()=>vt`<span slot="dot"></span>`;connected(){super.connected(),this.setAttribute("role","radio"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}render(){this.setAttribute("aria-checked",String(this.checked)),this.label&&this.setAttribute("aria-label",this.label),this.checked&&this.syncValue(this.value||"on")}#t=()=>{if(this.disabled||this.checked)return;let t=this.closest('fieldset, [role="radiogroup"]')||this.parentElement;if(t)for(let e of t.querySelectorAll(`radio-ui[name="${this.name}"]`))e!==this&&e.checked&&(e.checked=!1);this.checked=!0,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,checked:this.checked}}))};#e=t=>{if((t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.#t()),t.key==="ArrowDown"||t.key==="ArrowRight"){t.preventDefault();let e=this.#i(1);e&&(e.focus(),e.click())}if(t.key==="ArrowUp"||t.key==="ArrowLeft"){t.preventDefault();let e=this.#i(-1);e&&(e.focus(),e.click())}};#i(t){let i=[...(this.closest('fieldset, [role="radiogroup"]')||this.parentElement)?.querySelectorAll(`radio-ui[name="${this.name}"]`)||[]],r=i.indexOf(this);return i[(r+t+i.length)%i.length]||null}disconnected(){super.disconnected(),this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}};E();v("radio-ui",hr);Q();var cr=class s extends w{static properties={label:{type:String,default:"",reflect:!0},required:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;connected(){this.setAttribute("role","radiogroup"),this.#e(),this.#t?.id&&this.setAttribute("aria-labelledby",this.#t.id)}disconnected(){this.#t=null}render(){this.#t&&(this.#t.textContent=this.label||""),this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")}#e(){if(this.#t=this.querySelector(":scope > [data-radio-group-label]"),!this.#t){let t=document.createElement("div");t.setAttribute("slot","label"),t.setAttribute("data-radio-group-label",""),t.id=s.#s(),t.textContent=this.label||"",this.prepend(t),this.#t=t}}static#i=0;static#s(){return`radio-group-label-${++s.#i}`}};E();v("radio-group-ui",cr);var ur=class extends Z{static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},heading:{type:String,default:"",reflect:!0},description:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},layout:{type:String,default:"default",reflect:!0}};static template=()=>null;connected(){super.connected(),this.setAttribute("role","radio"),this.setAttribute("tabindex","0"),this.#t(),this.addEventListener("click",this.#e),this.addEventListener("keydown",this.#i)}disconnected(){super.disconnected(),this.removeEventListener("click",this.#e),this.removeEventListener("keydown",this.#i)}render(){this.setAttribute("aria-checked",String(this.checked)),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled");let t=this.querySelector(':scope > [slot="heading"]');t&&t.dataset.fromAttr==="true"&&(t.textContent=this.heading||"");let e=this.querySelector(':scope > [slot="description"]');e&&e.dataset.fromAttr==="true"&&(e.textContent=this.description||"");let i=this.querySelector(':scope > [slot="icon"]');i&&i.dataset.fromAttr==="true"&&i.setAttribute("name",this.icon||""),this.checked?this.syncValue(this.value||"on"):this.syncValue("")}#t(){if(this.heading&&!st(this,"heading").length){let t=document.createElement("span");t.setAttribute("slot","heading"),t.dataset.fromAttr="true",t.textContent=this.heading,this.appendChild(t)}if(this.description&&!st(this,"description").length){let t=document.createElement("span");t.setAttribute("slot","description"),t.dataset.fromAttr="true",t.textContent=this.description,this.appendChild(t)}if(this.icon&&!st(this,"icon").length){let t=document.createElement("icon-ui");t.setAttribute("slot","icon"),t.dataset.fromAttr="true",t.setAttribute("name",this.icon),this.appendChild(t)}}#e=()=>{if(this.disabled||this.readonly||this.checked)return;let t=this.#s();if(t)for(let e of t.querySelectorAll(`option-card-ui[name="${this.name}"]`))e!==this&&e.checked&&(e.checked=!1);this.checked=!0,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,checked:this.checked}}))};#i=t=>{if(t.target===this){if(t.key===" "||t.key==="Enter"){t.preventDefault(),this.#e();return}if(t.key==="ArrowDown"||t.key==="ArrowRight"){t.preventDefault();let e=this.#r(1);e&&(e.focus(),e.click())}if(t.key==="ArrowUp"||t.key==="ArrowLeft"){t.preventDefault();let e=this.#r(-1);e&&(e.focus(),e.click())}}};#s(){return this.closest('fieldset, [role="radiogroup"]')||this.parentElement}#r(t){let i=[...this.#s()?.querySelectorAll(`option-card-ui[name="${this.name}"]`)||[]],r=i.indexOf(this);return r<0?null:i[(r+t+i.length)%i.length]||null}};E();v("option-card-ui",ur);Q();var We=Object.freeze({AVAILABLE:"available",CONNECTED:"connected",ERROR:"error",PENDING:"pending",COMING_SOON:"coming-soon"}),bb=Object.freeze({available:{event:"press",emits:"connect",label:"Connect",variant:"primary",icon:""},connected:{event:"press",emits:"configure",label:"Configure",variant:"outline",icon:""},error:{event:"press",emits:"retry",label:"Retry",variant:"outline",icon:"arrow-clockwise"},pending:{event:"press",emits:"",label:"Connecting\u2026",variant:"outline",icon:""}}),zA=Object.freeze({connected:{variant:"success",text:"Connected",icon:"check"},error:{variant:"danger",text:"Error",icon:"warning-circle"},pending:{variant:"info",text:"Connecting\u2026",icon:""},"coming-soon":{text:"Coming soon",icon:""}}),VA=Object.freeze({slack:"chat-circle",github:"git-branch",gitlab:"git-branch",linear:"kanban",stripe:"credit-card",zapier:"lightning",figma:"figma-logo",notion:"notion-logo",webhook:"lightning",discord:"discord-logo",google:"google-logo"}),jA="plug",dr=class extends w{static requiredIcons=["check","warning-circle","arrow-clockwise"];static properties={provider:{type:String,default:"",reflect:!0},name:{type:String,default:"",reflect:!1},logo:{type:String,default:"",reflect:!1},description:{type:String,default:"",reflect:!1},status:{type:String,default:"available",reflect:!0},"error-message":{type:String,default:"",attribute:"error-message"},disabled:{type:Boolean,default:!1,reflect:!0}};static parts={body:'<div slot="body" data-integration-card-body></div>',logo:'<div slot="logo" data-integration-card-logo></div>',heading:'<div slot="heading" data-integration-card-heading></div>',desc:'<p slot="description" data-integration-card-description></p>',error:'<p slot="error" data-integration-card-error></p>',status:'<badge-ui slot="status" data-integration-card-status></badge-ui>',footer:'<footer slot="footer" data-integration-card-footer></footer>',button:'<button-ui slot="action" data-integration-card-action></button-ui>'};static template=()=>null;#t="";#e=null;#i=null;#s=null;#r=null;#n=null;#a=null;#o=null;#l=null;connected(){this.setAttribute("role","group"),this.#e=this.ensure("body"),this.#i=this.ensure("logo"),this.#s=this.ensure("heading"),this.#r=this.ensure("desc"),this.#a=this.ensure("status"),this.#o=this.ensure("footer"),this.#i.parentElement!==this.#e&&this.#e.appendChild(this.#i),this.#s.parentElement!==this.#e&&this.#e.appendChild(this.#s),this.#a.parentElement!==this.#e&&this.#e.appendChild(this.#a),this.#s.id?this.#t=this.#s.id:(this.#t=`integration-card-heading-${Math.random().toString(36).slice(2,9)}`,this.#s.id=this.#t),this.setAttribute("aria-labelledby",this.#t),this.addEventListener("press",this.#m),this.addEventListener("action",this.#g)}disconnected(){this.removeEventListener("press",this.#m),this.removeEventListener("action",this.#g),this.#e=null,this.#i=null,this.#s=null,this.#r=null,this.#n=null,this.#a=null,this.#o=null,this.#l=null}render(){if(!this.#s)return;let t=this.#c();this.name&&this.#s.textContent!==this.name&&(this.#s.textContent=this.name),this.#h()?this.#r.parentElement===this&&this.#r.remove():(this.#r.parentElement||this.appendChild(this.#r),this.description?(this.#r.textContent!==this.description&&(this.#r.textContent=this.description),this.#r.hidden=!1):(this.#r.textContent="",this.#r.hidden=!0)),this.#u(),this.#d(t),this.#f(t),this.#p(t)}#c(){let t=(this.status||"").trim()||We.AVAILABLE;return Object.values(We).includes(t)?t:We.AVAILABLE}#h(){for(let t of this.children)if(t!==this.#e&&t!==this.#r&&t!==this.#n&&t!==this.#o&&!(t.getAttribute&&t.getAttribute("slot")==="actions")&&!(t.dataset&&(t.dataset.integrationCardBody!==void 0||t.dataset.integrationCardDescription!==void 0||t.dataset.integrationCardError!==void 0||t.dataset.integrationCardFooter!==void 0)))return!0;return!1}#u(){if(!this.#i)return;let t=(this.logo||"").trim();if(t.startsWith("{{p:"))return;let e=(this.provider||"").trim().toLowerCase(),i=t||VA[e]||(e?jA:"");if(!i){this.#i.replaceChildren(),this.#i.hidden=!0;return}if(this.#i.hidden=!1,i.includes("/")){let o=this.#i.querySelector(":scope > img");if(o&&o.getAttribute("src")===i){o.setAttribute("alt",`${this.name||this.provider||"Integration"} logo`);return}this.#i.replaceChildren(),o=document.createElement("img"),o.setAttribute("src",i),o.setAttribute("alt",`${this.name||this.provider||"Integration"} logo`),o.setAttribute("data-integration-logo",""),o.setAttribute("loading","lazy"),o.setAttribute("decoding","async"),this.#i.appendChild(o);return}let n=this.#i.querySelector(":scope > icon-ui");n&&n.getAttribute("name")===i||(this.#i.replaceChildren(),n=document.createElement("icon-ui"),n.setAttribute("name",i),n.setAttribute("aria-hidden","true"),this.#i.appendChild(n))}#d(t){if(!this.#a)return;let e=zA[t];if(!e){this.#a.hidden=!0,this.#a.removeAttribute("aria-label");return}this.#a.hidden=!1,e.variant?(this.#a.setAttribute("variant",e.variant),this.#a.removeAttribute("tone")):(this.#a.removeAttribute("variant"),this.#a.setAttribute("tone","muted")),this.#a.setAttribute("text",e.text),this.#a.setAttribute("size","sm"),e.icon?this.#a.setAttribute("icon",e.icon):this.#a.removeAttribute("icon"),this.#a.setAttribute("aria-label",e.text)}#f(t){let e=(this["error-message"]||this.getAttribute("error-message")||"").trim();t===We.ERROR&&e?(this.#n||(this.#n=this.ensure("error")),this.#n.parentElement||(this.#r?.parentElement===this?this.#r.after(this.#n):this.#o?.parentElement===this?this.insertBefore(this.#n,this.#o):this.appendChild(this.#n)),this.#n.textContent!==e&&(this.#n.textContent=e),this.#n.hidden=!1,this.#n.setAttribute("role","status")):this.#n&&(this.#n.hidden=!0,this.#n.textContent="")}#p(t){if(t===We.COMING_SOON){this.drop("button"),this.#l=null;return}let e=bb[t];if(!e){this.drop("button"),this.#l=null;return}this.#l||(this.#l=this.ensure("button")),this.#l.parentElement!==this.#o&&this.#o.insertBefore(this.#l,this.#o.firstChild),this.#l.setAttribute("text",e.label),this.#l.setAttribute("variant",e.variant),this.#l.setAttribute("size","sm"),e.icon?this.#l.setAttribute("icon",e.icon):this.#l.removeAttribute("icon"),t===We.CONNECTED?this.#l.setAttribute("aria-pressed","true"):t===We.AVAILABLE?this.#l.setAttribute("aria-pressed","false"):this.#l.removeAttribute("aria-pressed");let i={available:"Connect to",connected:"Configure",error:"Retry connecting",pending:"Connecting to"}[t]||e.label,r=this.name||this.provider||"integration";this.#l.setAttribute("aria-label",`${i} ${r}`),t===We.PENDING||this.disabled?this.#l.setAttribute("disabled",""):this.#l.removeAttribute("disabled")}#m=t=>{if(!this.#l||t.target!==this.#l&&!t.composedPath?.().includes(this.#l))return;if(this.disabled){t.stopPropagation();return}let e=this.#c();if(e===We.PENDING||e===We.COMING_SOON){t.stopPropagation();return}let i=bb[e];!i||!i.emits||this.dispatchEvent(new CustomEvent(i.emits,{bubbles:!0,detail:{provider:this.provider}}))};#g=t=>{let e=t.detail?.action||t.target?.getAttribute?.("action");if(e&&(e==="disconnect"||e==="reauth"||e==="re-authenticate")){let i=e==="disconnect"?"disconnect":"reauth";this.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:{provider:this.provider}}))}}};E();v("integration-card-ui",dr);Q();var fr=class s extends Z{static labelDeprecated=!1;static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},hint:{type:String,default:"",reflect:!0}};static#t=0;static template=t=>{let e=t.hint?`switch-hint-${++s.#t}`:"";return e?t.setAttribute("aria-describedby",e):t.removeAttribute("aria-describedby"),vt`
111
+ `),this.#t=this.querySelector('[slot="text"]'),this.value&&(this.#t.textContent=this.value),this.#t&&(this.#t.addEventListener("input",this.#e),this.#t.addEventListener("keydown",this.#i),this.#t.addEventListener("blur",this.#s),this.#t.addEventListener("paste",this.#r))}render(){if(!this.#t)return;this.#t.setAttribute("data-placeholder",this.placeholder),this.disabled||this.readonly?this.#t.contentEditable="false":this.#t.contentEditable="plaintext-only";let t=this.value||"";this.#t.textContent!==t&&(this.#t.textContent=t,this.#t.toggleAttribute("data-empty",!t));let e=this.querySelector('[slot="label"]');e&&this.label&&e.setAttribute("label",this.label),this.setAttribute("aria-label",this.label||this.placeholder||"")}#e=()=>{let t=this.#t.textContent||"";this.value=t,this.#t.toggleAttribute("data-empty",!t),this.syncValue(t),this.scheduleThrottledInput()};#i=t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.flushPendingInput(),this.dispatchEvent(new Event("submit",{bubbles:!0})))};#s=()=>{this.flushPendingInput(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}}))};#r=t=>{t.preventDefault();let e=t.clipboardData?.getData("text/plain")||"";document.execCommand("insertText",!1,e)};focus(){this.#t?.focus()}clear(){this.value="",this.#t&&(this.#t.textContent="",this.#t.setAttribute("data-empty","")),this.syncValue("")}disconnected(){super.disconnected(),this.#t&&(this.#t.removeEventListener("input",this.#e),this.#t.removeEventListener("keydown",this.#i),this.#t.removeEventListener("blur",this.#s),this.#t.removeEventListener("paste",this.#r)),this.#t=null}};E();v("textarea-ui",ar);Q();var lr=class extends Z{static labelDeprecated=!1;static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},indeterminate:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"",reflect:!0},labelHidden:{type:Boolean,default:!1,reflect:!0,attribute:"label-hidden"}};static template=()=>vt`<span slot="box"></span>`;connected(){super.connected(),this.setAttribute("role","checkbox"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}render(){this.indeterminate?this.setAttribute("aria-checked","mixed"):this.setAttribute("aria-checked",String(this.checked)),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"),this.label&&this.setAttribute("aria-label",this.label),this.syncValue(this.checked?this.value||"on":"")}#t=()=>{this.disabled||(this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,checked:this.checked}})))};#e=t=>{(t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.#t())};disconnected(){super.disconnected(),this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}};E();v("check-ui",lr);Q();var hr=class extends Z{static labelDeprecated=!1;static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"",reflect:!0}};static template=()=>vt`<span slot="dot"></span>`;connected(){super.connected(),this.setAttribute("role","radio"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}render(){this.setAttribute("aria-checked",String(this.checked)),this.label&&this.setAttribute("aria-label",this.label),this.checked&&this.syncValue(this.value||"on")}#t=()=>{if(this.disabled||this.checked)return;let t=this.closest('fieldset, [role="radiogroup"]')||this.parentElement;if(t)for(let e of t.querySelectorAll(`radio-ui[name="${this.name}"]`))e!==this&&e.checked&&(e.checked=!1);this.checked=!0,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,checked:this.checked}}))};#e=t=>{if((t.key===" "||t.key==="Enter")&&(t.preventDefault(),this.#t()),t.key==="ArrowDown"||t.key==="ArrowRight"){t.preventDefault();let e=this.#i(1);e&&(e.focus(),e.click())}if(t.key==="ArrowUp"||t.key==="ArrowLeft"){t.preventDefault();let e=this.#i(-1);e&&(e.focus(),e.click())}};#i(t){let i=[...(this.closest('fieldset, [role="radiogroup"]')||this.parentElement)?.querySelectorAll(`radio-ui[name="${this.name}"]`)||[]],r=i.indexOf(this);return i[(r+t+i.length)%i.length]||null}disconnected(){super.disconnected(),this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}};E();v("radio-ui",hr);Q();var cr=class s extends w{static properties={label:{type:String,default:"",reflect:!0},required:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;connected(){this.setAttribute("role","radiogroup"),this.#e(),this.#t?.id&&this.setAttribute("aria-labelledby",this.#t.id)}disconnected(){this.#t=null}render(){this.#t&&(this.#t.textContent=this.label||""),this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")}#e(){if(this.#t=this.querySelector(":scope > [data-radio-group-label]"),!this.#t){let t=document.createElement("div");t.setAttribute("slot","label"),t.setAttribute("data-radio-group-label",""),t.id=s.#s(),t.textContent=this.label||"",this.prepend(t),this.#t=t}}static#i=0;static#s(){return`radio-group-label-${++s.#i}`}};E();v("radio-group-ui",cr);var ur=class extends Z{static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},heading:{type:String,default:"",reflect:!0},description:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},layout:{type:String,default:"default",reflect:!0}};static template=()=>null;connected(){super.connected(),this.setAttribute("role","radio"),this.setAttribute("tabindex","0"),this.#t(),this.addEventListener("click",this.#e),this.addEventListener("keydown",this.#i)}disconnected(){super.disconnected(),this.removeEventListener("click",this.#e),this.removeEventListener("keydown",this.#i)}render(){this.setAttribute("aria-checked",String(this.checked)),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled");let t=this.querySelector(':scope > [slot="heading"]');t&&t.dataset.fromAttr==="true"&&(t.textContent=this.heading||"");let e=this.querySelector(':scope > [slot="description"]');e&&e.dataset.fromAttr==="true"&&(e.textContent=this.description||"");let i=this.querySelector(':scope > [slot="icon"]');i&&i.dataset.fromAttr==="true"&&i.setAttribute("name",this.icon||""),this.checked?this.syncValue(this.value||"on"):this.syncValue("")}#t(){if(this.heading&&!st(this,"heading").length){let t=document.createElement("span");t.setAttribute("slot","heading"),t.dataset.fromAttr="true",t.textContent=this.heading,this.appendChild(t)}if(this.description&&!st(this,"description").length){let t=document.createElement("span");t.setAttribute("slot","description"),t.dataset.fromAttr="true",t.textContent=this.description,this.appendChild(t)}if(this.icon&&!st(this,"icon").length){let t=document.createElement("icon-ui");t.setAttribute("slot","icon"),t.dataset.fromAttr="true",t.setAttribute("name",this.icon),this.appendChild(t)}}#e=()=>{if(this.disabled||this.readonly||this.checked)return;let t=this.#s();if(t)for(let e of t.querySelectorAll(`option-card-ui[name="${this.name}"]`))e!==this&&e.checked&&(e.checked=!1);this.checked=!0,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value,checked:this.checked}}))};#i=t=>{if(t.target===this){if(t.key===" "||t.key==="Enter"){t.preventDefault(),this.#e();return}if(t.key==="ArrowDown"||t.key==="ArrowRight"){t.preventDefault();let e=this.#r(1);e&&(e.focus(),e.click())}if(t.key==="ArrowUp"||t.key==="ArrowLeft"){t.preventDefault();let e=this.#r(-1);e&&(e.focus(),e.click())}}};#s(){return this.closest('fieldset, [role="radiogroup"]')||this.parentElement}#r(t){let i=[...this.#s()?.querySelectorAll(`option-card-ui[name="${this.name}"]`)||[]],r=i.indexOf(this);return r<0?null:i[(r+t+i.length)%i.length]||null}};E();v("option-card-ui",ur);Q();var We=Object.freeze({AVAILABLE:"available",CONNECTED:"connected",ERROR:"error",PENDING:"pending",COMING_SOON:"coming-soon"}),bb=Object.freeze({available:{event:"press",emits:"connect",label:"Connect",variant:"primary",icon:""},connected:{event:"press",emits:"configure",label:"Configure",variant:"outline",icon:""},error:{event:"press",emits:"retry",label:"Retry",variant:"outline",icon:"arrow-clockwise"},pending:{event:"press",emits:"",label:"Connecting\u2026",variant:"outline",icon:""}}),zA=Object.freeze({connected:{variant:"success",text:"Connected",icon:"check"},error:{variant:"danger",text:"Error",icon:"warning-circle"},pending:{variant:"info",text:"Connecting\u2026",icon:""},"coming-soon":{text:"Coming soon",icon:""}}),VA=Object.freeze({slack:"chat-circle",github:"git-branch",gitlab:"git-branch",linear:"kanban",stripe:"credit-card",zapier:"lightning",figma:"figma-logo",notion:"notion-logo",webhook:"lightning",discord:"discord-logo",google:"google-logo"}),jA="plug",dr=class extends w{static requiredIcons=["check","warning-circle","arrow-clockwise"];static properties={provider:{type:String,default:"",reflect:!0},name:{type:String,default:"",reflect:!1},logo:{type:String,default:"",reflect:!1},description:{type:String,default:"",reflect:!1},status:{type:String,default:"available",reflect:!0},"error-message":{type:String,default:"",attribute:"error-message"},disabled:{type:Boolean,default:!1,reflect:!0}};static parts={body:'<div slot="body" data-integration-card-body></div>',logo:'<div slot="logo" data-integration-card-logo></div>',heading:'<div slot="heading" data-integration-card-heading></div>',desc:'<p slot="description" data-integration-card-description></p>',error:'<p slot="error" data-integration-card-error></p>',status:'<badge-ui slot="status" data-integration-card-status></badge-ui>',footer:'<footer slot="footer" data-integration-card-footer></footer>',button:'<button-ui slot="action" data-integration-card-action></button-ui>'};static template=()=>null;#t="";#e=null;#i=null;#s=null;#r=null;#n=null;#a=null;#o=null;#l=null;connected(){this.setAttribute("role","group"),this.#e=this.ensure("body"),this.#i=this.ensure("logo"),this.#s=this.ensure("heading"),this.#r=this.ensure("desc"),this.#a=this.ensure("status"),this.#o=this.ensure("footer"),this.#i.parentElement!==this.#e&&this.#e.appendChild(this.#i),this.#s.parentElement!==this.#e&&this.#e.appendChild(this.#s),this.#a.parentElement!==this.#e&&this.#e.appendChild(this.#a),this.#s.id?this.#t=this.#s.id:(this.#t=`integration-card-heading-${Math.random().toString(36).slice(2,9)}`,this.#s.id=this.#t),this.setAttribute("aria-labelledby",this.#t),this.addEventListener("press",this.#m),this.addEventListener("action",this.#g)}disconnected(){this.removeEventListener("press",this.#m),this.removeEventListener("action",this.#g),this.#e=null,this.#i=null,this.#s=null,this.#r=null,this.#n=null,this.#a=null,this.#o=null,this.#l=null}render(){if(!this.#s)return;let t=this.#c();this.name&&this.#s.textContent!==this.name&&(this.#s.textContent=this.name),this.#h()?this.#r.parentElement===this&&this.#r.remove():(this.#r.parentElement||this.appendChild(this.#r),this.description?(this.#r.textContent!==this.description&&(this.#r.textContent=this.description),this.#r.hidden=!1):(this.#r.textContent="",this.#r.hidden=!0)),this.#u(),this.#d(t),this.#f(t),this.#p(t)}#c(){let t=(this.status||"").trim()||We.AVAILABLE;return Object.values(We).includes(t)?t:We.AVAILABLE}#h(){for(let t of this.children)if(t!==this.#e&&t!==this.#r&&t!==this.#n&&t!==this.#o&&!(t.getAttribute&&t.getAttribute("slot")==="actions")&&!(t.dataset&&(t.dataset.integrationCardBody!==void 0||t.dataset.integrationCardDescription!==void 0||t.dataset.integrationCardError!==void 0||t.dataset.integrationCardFooter!==void 0)))return!0;return!1}#u(){if(!this.#i)return;let t=(this.logo||"").trim();if(t.startsWith("{{p:"))return;let e=(this.provider||"").trim().toLowerCase(),i=t||VA[e]||(e?jA:"");if(!i){this.#i.replaceChildren(),this.#i.hidden=!0;return}if(this.#i.hidden=!1,i.includes("/")){let o=this.#i.querySelector(":scope > img");if(o&&o.getAttribute("src")===i){o.setAttribute("alt",`${this.name||this.provider||"Integration"} logo`);return}this.#i.replaceChildren(),o=document.createElement("img"),o.setAttribute("src",i),o.setAttribute("alt",`${this.name||this.provider||"Integration"} logo`),o.setAttribute("data-integration-logo",""),o.setAttribute("loading","lazy"),o.setAttribute("decoding","async"),this.#i.appendChild(o);return}let n=this.#i.querySelector(":scope > icon-ui");n&&n.getAttribute("name")===i||(this.#i.replaceChildren(),n=document.createElement("icon-ui"),n.setAttribute("name",i),n.setAttribute("aria-hidden","true"),this.#i.appendChild(n))}#d(t){if(!this.#a)return;let e=zA[t];if(!e){this.#a.hidden=!0,this.#a.removeAttribute("aria-label");return}this.#a.hidden=!1,e.variant?(this.#a.setAttribute("variant",e.variant),this.#a.removeAttribute("tone")):(this.#a.removeAttribute("variant"),this.#a.setAttribute("tone","muted")),this.#a.setAttribute("text",e.text),this.#a.setAttribute("size","sm"),e.icon?this.#a.setAttribute("icon",e.icon):this.#a.removeAttribute("icon"),this.#a.setAttribute("aria-label",e.text)}#f(t){let e=(this["error-message"]||this.getAttribute("error-message")||"").trim();t===We.ERROR&&e?(this.#n||(this.#n=this.ensure("error")),this.#n.parentElement||(this.#r?.parentElement===this?this.#r.after(this.#n):this.#o?.parentElement===this?this.insertBefore(this.#n,this.#o):this.appendChild(this.#n)),this.#n.textContent!==e&&(this.#n.textContent=e),this.#n.hidden=!1,this.#n.setAttribute("role","status")):this.#n&&(this.#n.hidden=!0,this.#n.textContent="")}#p(t){if(t===We.COMING_SOON){this.drop("button"),this.#l=null;return}let e=bb[t];if(!e){this.drop("button"),this.#l=null;return}this.#l||(this.#l=this.ensure("button")),this.#l.parentElement!==this.#o&&this.#o.insertBefore(this.#l,this.#o.firstChild),this.#l.setAttribute("text",e.label),this.#l.setAttribute("variant",e.variant),this.#l.setAttribute("size","sm"),e.icon?this.#l.setAttribute("icon",e.icon):this.#l.removeAttribute("icon"),t===We.CONNECTED?this.#l.setAttribute("aria-pressed","true"):t===We.AVAILABLE?this.#l.setAttribute("aria-pressed","false"):this.#l.removeAttribute("aria-pressed");let i={available:"Connect to",connected:"Configure",error:"Retry connecting",pending:"Connecting to"}[t]||e.label,r=this.name||this.provider||"integration";this.#l.setAttribute("aria-label",`${i} ${r}`),t===We.PENDING||this.disabled?this.#l.setAttribute("disabled",""):this.#l.removeAttribute("disabled")}#m=t=>{if(!this.#l||t.target!==this.#l&&!t.composedPath?.().includes(this.#l))return;if(this.disabled){t.stopPropagation();return}let e=this.#c();if(e===We.PENDING||e===We.COMING_SOON){t.stopPropagation();return}let i=bb[e];!i||!i.emits||this.dispatchEvent(new CustomEvent(i.emits,{bubbles:!0,detail:{provider:this.provider}}))};#g=t=>{let e=t.detail?.action||t.target?.getAttribute?.("action");if(e&&(e==="disconnect"||e==="reauth"||e==="re-authenticate")){let i=e==="disconnect"?"disconnect":"reauth";this.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:{provider:this.provider}}))}}};E();v("integration-card-ui",dr);Q();var fr=class s extends Z{static labelDeprecated=!1;static properties={...Z.properties,checked:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},hint:{type:String,default:"",reflect:!0}};static#t=0;static template=t=>{let e=t.hint?`switch-hint-${++s.#t}`:"";return e?t.setAttribute("aria-describedby",e):t.removeAttribute("aria-describedby"),vt`
112
112
  <span slot="track"><span slot="thumb"></span></span>
113
113
  ${t.label?vt`<span slot="label">${t.label}</span>`:null}
114
114
  ${t.hint?vt`<span slot="hint" id=${e}>${t.hint}</span>`:null}
@@ -213,7 +213,7 @@ parent-template-re-read pattern that works across frameworks.`);return}if(this.d
213
213
  <path data-wordmark-glyph fill-rule="evenodd" clip-rule="evenodd" d="M267.953 4.72882H299.978V178.524H267.953V163.876C258.519 175.959 245.113 182 227.735 182C211.019 182 196.703 175.71 184.786 163.131C173.035 150.386 167.16 134.827 167.16 116.454C167.16 98.0817 173.035 82.6057 184.786 70.0262C196.703 57.2812 211.019 50.9087 227.735 50.9087C245.113 50.9087 258.519 56.9502 267.953 69.0331V4.72882ZM208.867 141.779C215.488 148.234 223.763 151.462 233.693 151.462C243.623 151.462 251.816 148.234 258.271 141.779C264.725 135.158 267.953 126.717 267.953 116.454C267.953 106.192 264.725 97.8334 258.271 91.3782C251.816 84.7574 243.623 81.447 233.693 81.447C223.763 81.447 215.488 84.7574 208.867 91.3782C202.413 97.8334 199.185 106.192 199.185 116.454C199.185 126.717 202.413 135.158 208.867 141.779Z"></path>
214
214
  <path data-wordmark-glyph fill-rule="evenodd" clip-rule="evenodd" d="M116.681 147.241L127.108 178.524H164.347L103.275 4.72882H60.8231L0 178.524H36.9904L47.4172 147.241H116.681ZM82.1733 44.2052L106.006 115.213H58.3406L82.1733 44.2052Z"></path>
215
215
  </svg>
216
- `;connected(){this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Adia")}};E();v("adia-wordmark-ui",en);Q();var sn=class extends w{static properties={value:{type:Number,default:null,reflect:!0},variant:{type:String,default:"bar",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.variant==="bar"&&(this.#t=document.createElement("div"),this.#t.setAttribute("slot","track"),this.#e=document.createElement("div"),this.#e.setAttribute("slot","fill"),this.#t.appendChild(this.#e),this.appendChild(this.#t))}render(){let t=this.value==null||this.value<0,e=Math.max(0,Math.min(100,this.value));this.setAttribute("aria-busy",String(t)),t?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",String(e)),this.#e&&(this.#e.style.width=t?"100%":`${e}%`)}disconnected(){this.#t?.remove(),this.#t=null,this.#e=null}};E();v("progress-ui",sn);Q();var rn=class extends w{static properties={value:{type:Number,default:0,reflect:!0},total:{type:Number,default:0,reflect:!0},caption:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),!st(this,"caption").length&&!st(this,"track").length?(this.#t=document.createElement("span"),this.#t.setAttribute("slot","caption"),this.appendChild(this.#t),this.#e=document.createElement("div"),this.#e.setAttribute("slot","track"),this.appendChild(this.#e)):(this.#t=st(this,"caption")[0],this.#e=st(this,"track")[0])}render(){let t=Math.max(0,this.total|0),e=Math.max(0,Math.min(t,this.value|0));if(this.setAttribute("aria-valuemax",String(t)),this.setAttribute("aria-valuenow",String(e)),this.#t&&!this.#t.dataset.custom&&(this.#t.textContent=this.caption||"",this.#t.toggleAttribute("hidden",!this.caption)),this.#e){let i=this.#e.children.length;for(;this.#e.children.length<t;)this.#e.appendChild(document.createElement("span"));for(;this.#e.children.length>t;)this.#e.lastElementChild.remove();for(let r=0;r<this.#e.children.length;r++)this.#e.children[r].toggleAttribute("data-active",r<e)}}disconnected(){this.#t=null,this.#e=null}};E();v("step-progress-ui",rn);Q();var nn=class extends w{static properties={width:{type:String,default:"100%",reflect:!0},height:{type:String,default:"1.2em",reflect:!0},radius:{type:String,default:"sm",reflect:!0},static:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("aria-hidden","true"),this.#t()}render(){this.#t()}#t(){this.style.width=this.width,this.style.height=this.height}};E();v("skeleton-ui",nn);Q();var on=class extends w{static properties={size:{type:String,default:"md",reflect:!0},variant:{type:String,default:"arc",reflect:!0},tone:{type:String,default:"current",reflect:!0},paused:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"Loading",reflect:!1}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","progressbar"),this.hasAttribute("aria-busy")||this.setAttribute("aria-busy","true"),this.setAttribute("aria-valuetext",this.label||"Loading"),this.#t()}render(){this.setAttribute("aria-valuetext",this.label||"Loading"),this.#t()}#t(){let t=this.variant==="dots",e=this.querySelectorAll(":scope > [data-spinner-dot]");if(t){if(e.length===3)return;e.forEach(r=>r.remove());let i=document.createDocumentFragment();for(let r=1;r<=3;r++){let n=document.createElement("span");n.setAttribute("data-spinner-dot",String(r)),n.setAttribute("aria-hidden","true"),i.appendChild(n)}this.appendChild(i)}else e.length&&e.forEach(i=>i.remove())}};E();v("spinner-ui",on);Q();var an=class extends w{static properties={active:{type:Boolean,default:!1,reflect:!0},delay:{type:Number,default:200,reflect:!0},label:{type:String,default:"Loading\u2026",reflect:!0},variant:{type:String,default:"default",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=!1;constructor(){super();let t=Object.getOwnPropertyDescriptor(this,"active");if(t?.set){let e=t.set;Object.defineProperty(this,"active",{get:t.get,set:i=>{let r=!!t.get.call(this);e.call(this,i),!!i!==r&&this.#s(!!i)},configurable:!0})}}connected(){this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.setAttribute("aria-label",this.label||"Loading"),this.#t=this.parentElement,this.active&&this.#s(!0)}disconnected(){this.#a(),this.#i&&this.#n(),this.#t=null}render(){let t=this.label||"Loading";this.setAttribute("aria-label",t);let e=this.querySelector(":scope > spinner-ui[data-loading-overlay-auto]");e&&e.getAttribute("label")!==t&&e.setAttribute("label",t),this.children.length===0&&this.#o()}#s(t){if(this.#a(),t){let e=Math.max(0,Number(this.delay)||0);e===0?this.#r():this.#e=setTimeout(()=>{this.#e=null,this.active&&this.#r()},e)}else this.#i&&this.#n()}#r(){let t=this.#t||this.parentElement;t&&!t.hasAttribute("aria-busy")&&t.setAttribute("aria-busy","true"),this.#i=!0}#n(){let t=this.#t||this.parentElement;t&&t.getAttribute("aria-busy")==="true"&&t.removeAttribute("aria-busy"),this.#i=!1}#a(){this.#e!==null&&(clearTimeout(this.#e),this.#e=null)}#o(){let t=document.createElement("spinner-ui");t.setAttribute("size","lg"),t.setAttribute("tone","subtle"),t.setAttribute("label",this.label||"Loading"),t.setAttribute("data-loading-overlay-auto",""),this.appendChild(t)}};E();v("loading-overlay-ui",an);Q();var $b=new Set;function Cb(s,t){$b.has(s)||($b.add(s),console.warn(`[alert-ui] ${t}`))}var ln=class s extends w{static requiredIcons=["x"];static properties={text:{type:String,default:"",reflect:!0},title:{type:String,default:"",reflect:!0},description:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},closable:{type:Boolean,default:!1,reflect:!0},dismissible:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},pattern:{type:String,default:"",reflect:!0},amount:{type:Number,default:0,reflect:!0},currency:{type:String,default:"USD",reflect:!0},dueAt:{type:String,default:"",reflect:!0,attribute:"due-at"},cardLast4:{type:String,default:"",reflect:!0,attribute:"card-last4"},reason:{type:String,default:"",reflect:!0}};static parts={leading:'<icon-ui slot="leading"></icon-ui>',content:'<span slot="content"></span>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>'};static#t={declined:"x-circle",expired:"clock",insufficient:"wallet",network:"wifi-slash"};static template=()=>null;#e(){this.getAttribute("variant")==="error"&&(Cb("variant-error",'variant="error" is not in the canonical enum [default, info, success, warning, danger]. Mapping to "danger". Fix the source (LLM prompt / corpus pattern) to emit "danger" directly.'),this.setAttribute("variant","danger")),this.hasAttribute("closeable")&&!this.hasAttribute("closable")&&!this.hasAttribute("dismissible")&&(Cb("alias-closeable","attribute [closeable] is a misspelled alias of canonical [closable]. Mapping. Fix the source to use [closable] or [dismissible]."),this.setAttribute("closable",""),this.removeAttribute("closeable")),this.hasAttribute("dismissible")&&!this.hasAttribute("closable")&&this.setAttribute("closable","")}#i=t=>{if(t.target.closest('[slot="close"]')){this.#h();return}if(this.pattern==="dunning"){let e=t.target.closest("[data-dunning-action]");if(e&&this.contains(e)){let i=e.getAttribute("data-dunning-action")||"";this.dispatchEvent(new CustomEvent("dunning-action",{bubbles:!0,composed:!0,detail:{action:i,amount:this.amount,currency:this.currency,dueAt:this.dueAt}}))}}};connected(){this.#e(),this.#c(),(this.icon||this.pattern==="dunning"&&this.reason)&&this.ensure("leading"),this.ensure("content"),this.closable&&this.ensure("close"),this.addEventListener("press",this.#i)}disconnected(){this.removeEventListener("press",this.#i)}render(){if(this.pattern==="dunning"){this.#s(),this.#c();return}if(this.icon){let e=this.ensure("leading");e&&e.setAttribute("name",this.icon)}else this.drop("leading");let t=this.ensure("content");if(t){let e=t.hasAttribute("data-alert-auto"),i=t.childNodes.length>0;if(!e&&i){if(this.title||this.description){let r=[this.title,this.description].filter(Boolean).join(". ");this.setAttribute("aria-label",r)}}else if(this.title||this.description){if(t.setAttribute("data-alert-auto","title-desc"),t.replaceChildren(),this.title){let n=document.createElement("strong");n.textContent=this.title,t.appendChild(n),this.description&&t.appendChild(document.createTextNode(" "))}this.description&&t.appendChild(document.createTextNode(this.description));let r=[this.title,this.description].filter(Boolean).join(". ");this.setAttribute("aria-label",r)}else this.text&&(t.setAttribute("data-alert-auto","text"),t.textContent=this.text)}this.closable||this.dismissible?this.ensure("close"):this.drop("close"),this.#c()}#s(){let t=this.icon||s.#t[this.reason]||"x-circle",e=this.ensure("leading");e&&e.setAttribute("name",t);let i=this.ensure("content");if(!i)return;i.setAttribute("data-alert-auto","dunning"),i.replaceChildren();let r=this.title||this.#r();if(r){let l=document.createElement("strong");l.setAttribute("data-dunning-title",""),l.textContent=r,i.appendChild(l)}let n=this.#n(),o=this.#o();if(n||o){if(i.appendChild(document.createTextNode(" ")),n){let l=document.createElement("span");l.setAttribute("data-dunning-amount",""),l.textContent=n,i.appendChild(l)}if(n&&o&&i.appendChild(document.createTextNode(" ")),o){let l=document.createElement("span");l.setAttribute("data-dunning-meta",""),l.textContent=o,i.appendChild(l)}}let a=[r,n,o].filter(Boolean).join(". ");a&&this.setAttribute("aria-label",a),this.closable||this.dismissible?this.ensure("close"):this.drop("close")}#r(){switch(this.reason){case"expired":return"Card expired";case"insufficient":return"Insufficient funds";case"network":return"Network error";case"declined":return"Payment failed";default:return this.variant==="warning"?"Payment due soon":"Payment failed"}}#n(){if(!this.amount&&this.amount!==0||this.amount===0)return"";try{let t=this.getAttribute("lang")||this.lang||void 0;return new Intl.NumberFormat(t,{style:"currency",currency:this.currency||"USD"}).format(this.amount)}catch{return`${this.currency||""} ${this.amount}`.trim()}}#a(){if(!this.dueAt)return"";let t=/^\d{4}-\d{2}-\d{2}$/.test(this.dueAt)?new Date(`${this.dueAt}T00:00:00`):new Date(this.dueAt);if(Number.isNaN(t.getTime()))return"";try{let e=this.getAttribute("lang")||this.lang||void 0;return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}catch{return t.toDateString()}}#o(){let t=[];this.cardLast4&&t.push(`Card ending ${this.cardLast4}`),this.reason&&this.reason!=="declined"&&t.push(this.#l());let e=this.#a();if(e){let i=this.variant==="warning"?"due":"failed";t.push(`${i} ${e}`)}return t.join(" \xB7 ")}#l(){switch(this.reason){case"expired":return"expired";case"insufficient":return"insufficient funds";case"network":return"network error";case"declined":return"declined";default:return""}}#c(){let t=this.variant==="danger"||this.variant==="warning"?"alert":"status";this.setAttribute("role",t)}#h(){this.dispatchEvent(new Event("close",{bubbles:!0})),this.remove()}};E();v("alert-ui",ln);Q();var d$={info:"info",success:"check-circle",warning:"warning",danger:"x-circle"},hn=class extends w{static properties={text:{type:String,default:"",reflect:!1},variant:{type:String,default:"default",reflect:!0},icon:{type:String,default:"",reflect:!0},live:{type:String,default:"",reflect:!0}};static parts={leading:'<icon-ui slot="leading"></icon-ui>'};static requiredIcons=["info","check-circle","warning","x-circle"];static template=()=>null;#t(t){return!!(t&&(t._uiPart||t.hasAttribute("data-im-auto")))}connected(){}render(){this.live?this.setAttribute("aria-live",this.live):this.hasAttribute("aria-live")&&this.removeAttribute("aria-live"),this.#e();let t=this.icon||d$[this.variant]||"",e=this.querySelector(':scope > [slot="leading"]');if(!(e&&!this.#t(e)))if(t){let i=this.ensure("leading");i&&(i.setAttribute("data-im-auto",""),i.getAttribute("name")!==t&&i.setAttribute("name",t))}else this.drop("leading")}#e(){let t=this.querySelector(":scope > [data-im-text]");if(Array.from(this.childNodes).some(i=>i===t?!1:i.nodeType===Node.ELEMENT_NODE?!(i.getAttribute&&i.getAttribute("slot")==="leading"):!!(i.nodeType===Node.TEXT_NODE&&i.textContent.trim()))){t&&t.remove();return}this.text?(t||(t=document.createElement("span"),t.setAttribute("data-im-text",""),this.appendChild(t)),t.textContent!==this.text&&(t.textContent=this.text)):t&&t.remove()}};E();v("inline-message-ui",hn);Q();var cn=class extends w{static properties={size:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","presentation")}};E();v("kbd-ui",cn);Q();var un=class extends w{static requiredIcons=["x"];static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},size:{type:String,default:"md",reflect:!0},removable:{type:Boolean,default:!1,reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static parts={dismiss:'<button-ui slot="dismiss" variant="ghost" size="sm" aria-label="Remove"><icon-ui slot="icon" name="x" weight="bold"></icon-ui></button-ui>'};static template=()=>null;#t=t=>{this.disabled||t.target.closest('[slot="dismiss"]')&&(this.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{text:this.text,value:this.text}})),this.remove())};#e=t=>{this.disabled||t.target.closest('[slot="dismiss"]')&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{text:this.text,value:this.text}})),this.remove())};connected(){this.setAttribute("role","status"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}disconnected(){this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.disabled?(this.setAttribute("aria-disabled","true"),this.setAttribute("tabindex","-1")):(this.removeAttribute("aria-disabled"),this.setAttribute("tabindex","0")),this.removable&&!this.disabled){let t=this.ensure("dismiss");t&&t.parentElement!==this&&this.appendChild(t)}else this.drop("dismiss")}};E();v("tag-ui",un);Q();var f$=new Set(["block","dot","square","line","dashed"]),p$=new Set(["sm","md","lg"]),m$=new Set(["out-of-gamut","p3-only","apca-pass","apca-fail"]),g$={"out-of-gamut":"\u25B3","p3-only":"\u2726","apca-pass":"\u2713","apca-fail":"\u2717"},O$={"out-of-gamut":"Outside sRGB gamut","p3-only":"Display-P3 only","apca-pass":"Contrast passes APCA","apca-fail":"Contrast fails APCA"};function b$(s){return s?s.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t&&m$.has(t)):[]}var ds=null;function v$(s){if(!s||typeof s!="string"||typeof document>"u")return null;try{if(!ds){let u=document.createElement("canvas");u.width=1,u.height=1,ds=u.getContext("2d")}ds.fillStyle="#000",ds.clearRect(0,0,1,1),ds.fillStyle=s,ds.fillRect(0,0,1,1);let[t,e,i]=ds.getImageData(0,0,1,1).data;if(t===0&&e===0&&i===0&&s!=="#000"&&s!=="black"&&s!=="#000000")return null;let r=u=>{let d=u/255;return d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)},n=r(t),o=r(e),a=r(i),l=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),h=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a);return .2104542553*l+.793617785*h-.0040720468*c}catch{return null}}var dn=class extends w{static properties={shape:{type:String,default:"square",reflect:!0},size:{type:String,default:"md",reflect:!0},color:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},detail:{type:String,default:"",reflect:!0},badge:{type:String,default:"",reflect:!0},copyable:{type:Boolean,default:!1,reflect:!0},copyValue:{type:String,default:""},selectable:{type:Boolean,default:!1,reflect:!0},selected:{type:Boolean,default:!1,reflect:!0},autoContrast:{type:Boolean,default:!1,reflect:!0,attribute:"auto-contrast"},labelPosition:{type:String,default:"below",reflect:!0,attribute:"label-position"}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=!1;#a=null;#o=null;#l=null;#c=null;#h=null;#u=null;connected(){this.#d(),this.#S(),typeof MutationObserver<"u"&&(this.#u=new MutationObserver(t=>{let e=!1;for(let i of t){for(let r of i.addedNodes)if(r.nodeType===1){if(r.getAttribute?.("slot")==="chrome"){e=!0;break}if(r.tagName==="SPAN"&&r.style?.display==="contents"&&r.querySelector?.('[slot="chrome"]')){e=!0;break}}if(e)break}e&&(this.#f(),this.#u.takeRecords())}),this.#u.observe(this,{childList:!0}))}render(){this.#d(),this.#p(),this.#m(),this.#b(),this.#v(),this.#O(),this.#g()}#d(){if(this.#n)return;let t=Array.from(this.children).filter(n=>n.getAttribute&&n.getAttribute("slot")==="chrome");for(let n of t)n.remove();let e=Array.from(this.children).filter(n=>n.tagName==="SPAN"&&n.style?.display==="contents"&&n.querySelector?.('[slot="chrome"]'));for(let n of e)n.remove();let i=[];for(let n of Array.from(this.childNodes))(n.nodeType===3&&!n.data||n.nodeType===8)&&i.push(n);for(let n of i)n.remove();let r=Array.from(this.childNodes).filter(n=>!(n.nodeType===1&&n.dataset&&(n.dataset.tile!==void 0||n.dataset.label!==void 0||n.dataset.detail!==void 0||n.dataset.badge!==void 0||n.dataset.copy!==void 0))&&!(n.nodeType===3&&!n.textContent.trim()));this.innerHTML="",this.#t=document.createElement("span"),this.#t.setAttribute("data-tile",""),this.#t.setAttribute("aria-hidden","true"),this.appendChild(this.#t);for(let n of t)this.appendChild(n);for(let n of e)this.appendChild(n);for(let n of i)this.appendChild(n);if(this.#s=document.createElement("span"),this.#s.setAttribute("data-badge",""),this.#s.setAttribute("hidden",""),this.appendChild(this.#s),this.#e=document.createElement("span"),this.#e.setAttribute("data-label",""),r.length)for(let n of r)this.#e.appendChild(n);this.appendChild(this.#e),this.#i=document.createElement("span"),this.#i.setAttribute("data-detail",""),this.#i.setAttribute("hidden",""),this.appendChild(this.#i),this.#r=document.createElement("button-ui"),this.#r.setAttribute("data-copy",""),this.#r.setAttribute("variant","ghost"),this.#r.setAttribute("size","xs"),this.#r.setAttribute("aria-label","Copy value"),this.#r.setAttribute("hidden",""),this.#r.setAttribute("text","\u29C9"),this.appendChild(this.#r),this.#n=!0}#f(){if(!this.#t||!this.#s)return;let t=[];for(let e of this.children)if(e!==this.#t){if(e===this.#s)break;e.getAttribute?.("slot")==="chrome"&&t.push(e)}for(let e of Array.from(this.children))e!==this.#t&&e!==this.#s&&e!==this.#e&&e!==this.#i&&e!==this.#r&&e.getAttribute?.("slot")==="chrome"&&this.insertBefore(e,this.#s);for(let e of Array.from(this.children))e===this.#t||e===this.#s||e===this.#e||e===this.#i||e===this.#r||!(e.tagName==="SPAN"&&e.style?.display==="contents")||!e.querySelector?.('[slot="chrome"]')||this.insertBefore(e,this.#s)}#p(){if(!this.#t||!this.#e)return;this.#f();let t=f$.has(this.shape)?this.shape:"square",e=p$.has(this.size)?this.size:"md";t!==this.shape&&this.setAttribute("shape",t),e!==this.size&&this.setAttribute("size",e),this.color&&this.style.setProperty("--swatch-color",this.color),!this.#e.firstChild&&this.label?this.#e.textContent=this.label:this.#e.firstChild?.nodeType===3&&this.label&&(this.#e.textContent=this.label);let i=this.#e.textContent.trim().length>0||this.#e.firstElementChild!=null;this.#e.toggleAttribute("hidden",!i)}#m(){if(!this.#s)return;let t=b$(this.badge);if(t.length===0){this.#s.setAttribute("hidden",""),this.#s.replaceChildren();return}this.#s.removeAttribute("hidden");let e=Array.from(this.#s.children).map(n=>n.dataset.badgeVariant);if(e.length===t.length&&e.every((n,o)=>n===t[o]))return;let r=document.createDocumentFragment();for(let n of t){let o=document.createElement("span");o.setAttribute("data-badge-variant",n),o.setAttribute("role","img"),o.setAttribute("aria-label",O$[n]),o.textContent=g$[n],r.appendChild(o)}this.#s.replaceChildren(r)}#g(){if(!this.#e)return;if(!this.autoContrast){this.#e.removeAttribute("data-on-light"),this.#e.removeAttribute("data-on-dark"),this.#a=null;return}let t=this.color||getComputedStyle(this).getPropertyValue("--swatch-color").trim();if(t===this.#a)return;this.#a=t;let e=v$(t);if(e==null){this.#e.removeAttribute("data-on-light"),this.#e.removeAttribute("data-on-dark");return}let i=e<.62;this.#e.toggleAttribute("data-on-dark",i),this.#e.toggleAttribute("data-on-light",!i)}#b(){if(!this.#i)return;let t=(this.detail||"").trim();if(!t){this.#i.setAttribute("hidden",""),this.#i.textContent="";return}this.#i.removeAttribute("hidden"),this.#i.textContent!==t&&(this.#i.textContent=t)}#v(){if(!this.#r)return;if(!this.copyable){this.#r.setAttribute("hidden","");return}this.#r.removeAttribute("hidden");let t=this.#y();t?this.#r.setAttribute("aria-label",`Copy ${t}`):this.#r.setAttribute("aria-label","Copy value")}#O(){this.selectable?(this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.setAttribute("aria-pressed",this.selected?"true":"false")):(this.getAttribute("role")==="button"&&this.removeAttribute("role"),this.getAttribute("tabindex")==="0"&&this.removeAttribute("tabindex"),this.removeAttribute("aria-pressed"))}#S(){this.#o=t=>{!this.selectable||(t.composedPath?t.composedPath():[]).includes(this.#r)||this.#x()},this.#l=t=>{!this.selectable||t.key!=="Enter"&&t.key!==" "||(t.composedPath?t.composedPath():[t.target]).includes(this.#r)||(t.preventDefault(),this.#x())},this.addEventListener("click",this.#o),this.addEventListener("keydown",this.#l),this.#c=t=>{if(t.stopPropagation(),!this.copyable)return;let e=this.#y();e&&this.#w(e)},this.#r.addEventListener("click",this.#c)}#x(){this.dispatchEvent(new CustomEvent("select",{bubbles:!0,detail:{value:this.color||this.label,color:this.color,label:this.label}}))}#y(){return this.copyValue?this.copyValue:this.color?this.color:""}async#w(t){let e=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),e=!0)}catch{}this.#k(e)}#k(t){this.#r&&(this.#h!=null&&clearTimeout(this.#h),this.#r.setAttribute("data-copy-state",t?"ok":"fail"),this.#r.setAttribute("text",t?"\u2713":"\u26A0"),this.#h=setTimeout(()=>{this.#r&&(this.#r.removeAttribute("data-copy-state"),this.#r.setAttribute("text","\u29C9"),this.#h=null)},1200))}disconnected(){this.#h!=null&&(clearTimeout(this.#h),this.#h=null),this.#u&&(this.#u.disconnect(),this.#u=null),this.#o&&this.removeEventListener("click",this.#o),this.#l&&this.removeEventListener("keydown",this.#l),this.#r&&this.#c&&this.#r.removeEventListener("click",this.#c),this.#t=null,this.#e=null,this.#i=null,this.#s=null,this.#r=null,this.#n=!1}};E();v("swatch-ui",dn);_e();var Eb={xs:0,sm:480,md:768,lg:1024,xl:1280},fs=Object.keys(Eb),vd=Object.values(Eb);function Pb(){if(typeof window>"u")return"lg";let s=window.innerWidth;for(let t=fs.length-1;t>=0;t--)if(s>=vd[t])return fs[t];return"xs"}var Ce=Zi(Pb());if(typeof window<"u")for(let s=1;s<vd.length;s++)window.matchMedia(`(min-width: ${vd[s]}px)`).addEventListener("change",()=>{Ce.value=Pb()});function qt(s,t=Ce.value){if(!s)return null;if(!s.includes("@"))return s;let e=null,i=new Map;for(let a of s.trim().split(/\s+/)){let l=a.lastIndexOf("@");l===-1?e=a:i.set(a.slice(l+1),a.slice(0,l))}let r=fs.indexOf(t),n=null,o=-1;for(let[a,l]of i){let h=fs.indexOf(a);h!==-1&&h<=r&&h>o&&(n=l,o=h)}return n??e}Q();var fn=class extends w{static properties={justify:{type:String,default:"start",reflect:!0},align:{type:String,default:"stretch",reflect:!0},gap:{type:String,default:"md",reflect:!0},grow:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;render(){let t=this.gap,e=this.align,i=this.justify,n=t?.includes("@")||e?.includes("@")||i?.includes("@")?Ce.value:"";if(t?.includes("@")?this.style.setProperty("--col-gap",S$(qt(t,n))):this.style.removeProperty("--col-gap"),e?.includes("@")){let o=qt(e,n);this.style.setProperty("--col-align",w$(o)),this.style.textAlign=k$(o)}else this.style.removeProperty("--col-align"),this.style.textAlign="";i?.includes("@")?this.style.setProperty("--col-justify",A$(qt(i,n))):this.style.removeProperty("--col-justify")}},y$={start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},x$={start:"flex-start",end:"flex-end",center:"center",between:"space-between","space-between":"space-between","space-around":"space-around"};function S$(s){return!s||s==="0"?"0":/^\d+$/.test(s)?`var(--a-space-${s})`:`var(--a-gap-${s})`}function w$(s){return y$[s]??s}function k$(s){return{start:"start",center:"center",end:"end"}[s]??""}function A$(s){return x$[s]??s}E();v("col-ui",fn);Q();var pn=class s extends w{static properties={label:{type:String,default:"",reflect:!0},hint:{type:String,default:"",reflect:!0},required:{type:Boolean,default:!1,reflect:!0},inline:{type:Boolean,default:!1,reflect:!0},align:{type:String,default:"start",reflect:!0}};get error(){return this.#g()?.error??""}static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=t=>{let e=this.#g();if(!e)return;let i=this.#v(e);i&&(t.preventDefault(),i.focus())};connected(){this.#u(),this.#d(),this.#f(),this.#p(),this.#c(),this.#t?.addEventListener("click",this.#n),typeof MutationObserver<"u"&&(this.#r=new MutationObserver(()=>{this.#p(),this.#c(),this.#m(),this.#a()}),this.#r.observe(this,{childList:!0})),this.#a()}disconnected(){this.#r?.disconnect(),this.#r=null,this.#h(),this.#t?.removeEventListener("click",this.#n),this.#t=null,this.#e=null,this.#i=null,this.#s=null}render(){this.#t&&this.#t.childNodes[0]&&(this.#t.childNodes[0].nodeValue=this.label||""),this.#e&&(this.#e.hidden=!this.required),this.#i&&(this.#i.textContent=this.hint||"",this.#i.hidden=!this.hint||!!this.error),this.#a(),this.#m()}#a(){if(!this.#s)return;let t=this.error;this.#s.textContent=t||"",this.#s.hidden=!t}#o=()=>{this.#a(),this.#m()};#l=null;#c(){let t=this.#g();t!==this.#l&&(this.#h(),t&&(this.#l=t,t.addEventListener("invalid",this.#o,!0),t.addEventListener("change",this.#o),t.addEventListener("input",this.#o)))}#h(){let t=this.#l;t&&(t.removeEventListener("invalid",this.#o,!0),t.removeEventListener("change",this.#o),t.removeEventListener("input",this.#o),this.#l=null)}#u(){if(this.#t=this.querySelector(":scope > [data-field-label]"),!this.#t){let t=document.createElement("label");t.setAttribute("slot","label"),t.setAttribute("data-field-label",""),t.appendChild(document.createTextNode(this.label||"")),this.prepend(t),this.#t=t}if(this.#e=this.#t.querySelector("[data-field-required]"),!this.#e){let t=document.createElement("span");t.setAttribute("data-field-required",""),t.setAttribute("aria-hidden","true"),t.textContent="*",t.hidden=!0,this.#t.appendChild(t),this.#e=t}}#d(){if(this.#i=this.querySelector(":scope > [data-field-hint]"),this.#i)return;let t=document.createElement("div");t.setAttribute("slot","hint"),t.setAttribute("data-field-hint",""),t.setAttribute("id",s.#y("hint")),t.hidden=!0,this.appendChild(t),this.#i=t}#f(){if(this.#s=this.querySelector(":scope > [data-field-error]"),this.#s)return;let t=document.createElement("div");t.setAttribute("slot","error"),t.setAttribute("data-field-error",""),t.setAttribute("id",s.#y("err")),t.setAttribute("role","alert"),t.hidden=!0,this.appendChild(t),this.#s=t}#p(){if(!this.#t)return;let t=this.#g();if(!t){this.#t.removeAttribute("for");return}t.id||(t.id=s.#S()),this.#t.setAttribute("for",t.id)}#m(){let t=this.#g();if(!t)return;let e=new Set;this.#i&&!this.#i.hidden&&e.add(this.#i.id),this.#s&&!this.#s.hidden&&e.add(this.#s.id);let r=[...(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(n=>n&&!n.startsWith("field-hint-")&&!n.startsWith("field-err-")),...e].join(" ").trim();r?t.setAttribute("aria-describedby",r):t.removeAttribute("aria-describedby")}#g(){let t=null,e=null;for(let i of this.children)if(!i.hasAttribute("slot")){if(t===null&&(t=i),s.#b.has(i.localName))return i;e===null&&this.#v(i)&&(e=i)}return e??t}static#b=new Set(["input-ui","textarea-ui","select-ui","combobox-ui","search-ui","check-ui","radio-ui","switch-ui","slider-ui","range-ui","otp-input-ui","tags-input-ui","chat-input-ui","autocomplete-input-ui","datetime-picker-ui","date-range-picker-ui","calendar-picker-ui","color-picker-ui","upload-ui","rating-ui","segmented-ui","input","textarea","select"]);#v(t){let e='input, textarea, select, button, [contenteditable], [tabindex]:not([tabindex="-1"])';return t.matches?.(e)?t:t.querySelector?.(e)??null}static#O=0;static#S(){return`field-ctl-${++s.#O}`}static#x=0;static#y(t){return`field-${t}-${++s.#x}`}};E();v("field-ui",pn);Q();var mn=class extends w{static properties={inline:{type:Boolean,default:!1,reflect:!0},columns:{type:Number,default:6,reflect:!0}};static template=()=>null;#t=null;connected(){this.#e(),typeof MutationObserver<"u"&&(this.#t=new MutationObserver(t=>{for(let e of t)if(e.type==="childList"&&(this.#i(e.addedNodes)||this.#i(e.removedNodes))){this.#e();return}}),this.#t.observe(this,{childList:!0}))}disconnected(){this.#t?.disconnect(),this.#t=null}render(){this.#e()}#e(){let t=this.hasAttribute("inline");for(let e of this.children)e.localName==="field-ui"&&(t?e.hasAttribute("inline")||e.setAttribute("inline",""):e.hasAttribute("inline")&&e.removeAttribute("inline"))}#i(t){for(let e of t)if(e.nodeType===1&&e.localName==="field-ui")return!0;return!1}};E();v("fields-ui",mn);Q();E();var Qb=0,Qa=class extends w{static properties={label:{type:String,default:"",reflect:!0},value:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},hint:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;connected(){this.setAttribute("role","group"),this.#t=this.querySelector(':scope > [slot="label"]'),this.#t||(this.#t=document.createElement("span"),this.#t.setAttribute("slot","label"),this.insertBefore(this.#t,this.firstChild)),this.#t.id||(this.#t.id=`display-field-label-${++Qb}`),this.#e=this.querySelector(':scope > [slot="value"]'),this.#i=this.querySelector(':scope > [slot="hint"]'),this.#s=this.querySelector(':scope > icon-ui[slot="icon"]')}render(){if(!this.#t)return;this.label?(this.#t.textContent=this.label,this.#t.hidden=!1,this.setAttribute("aria-labelledby",this.#t.id)):(this.#t.hidden=!0,this.removeAttribute("aria-labelledby")),this.querySelector(":scope > :not([slot])")?this.#e&&(this.#e.remove(),this.#e=null):(this.#e||(this.#e=document.createElement("span"),this.#e.setAttribute("slot","value"),this.appendChild(this.#e)),this.#e.textContent=this.value),this.hint?(this.#i||(this.#i=document.createElement("span"),this.#i.setAttribute("slot","hint"),this.#i.id=`display-field-hint-${++Qb}`,this.appendChild(this.#i)),this.#i.textContent=this.hint,this.setAttribute("aria-describedby",this.#i.id)):this.#i&&(this.#i.remove(),this.#i=null,this.removeAttribute("aria-describedby")),this.icon?(this.#s||(this.#s=document.createElement("icon-ui"),this.#s.setAttribute("slot","icon"),this.#s.setAttribute("aria-hidden","true"),this.appendChild(this.#s)),this.#s.setAttribute("name",this.icon)):this.#s&&(this.#s.remove(),this.#s=null)}disconnected(){this.#t=null,this.#e=null,this.#i=null,this.#s=null}};v("display-field-ui",Qa);Q();var gn=class extends w{static properties={justify:{type:String,default:"start",reflect:!0},align:{type:String,default:"center",reflect:!0},gap:{type:String,default:"md",reflect:!0},grow:{type:Boolean,default:!1,reflect:!0},wrap:{type:Boolean,default:!1,reflect:!0},wrapAt:{type:String,default:"",reflect:!0,attribute:"wrap-at"},draggable:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;connected(){this.draggable&&!this.#t&&(this.addTrait(Gr),this.#t=!0)}updated(t){t.has("draggable")&&this.draggable&&!this.#t&&(this.addTrait(Gr),this.#t=!0)}render(){let t=this.gap,e=this.align,i=this.justify,r=this.wrapAt,o=t?.includes("@")||e?.includes("@")||i?.includes("@")||!!r?Ce.value:"";if(t?.includes("@")?this.style.setProperty("--row-gap",E$(qt(t,o))):this.style.removeProperty("--row-gap"),e?.includes("@")?this.style.setProperty("--row-align",P$(qt(e,o))):this.style.removeProperty("--row-align"),i?.includes("@")?this.style.setProperty("--row-justify",Q$(qt(i,o))):this.style.removeProperty("--row-justify"),r){let a=fs.indexOf(o),l=fs.indexOf(r);this.style.flexWrap=l!==-1&&a>=l?"wrap":""}else this.style.flexWrap=""}},$$={start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},C$={start:"flex-start",end:"flex-end",center:"center",between:"space-between","space-between":"space-between","space-around":"space-around"};function E$(s){return!s||s==="0"?"0":/^\d+$/.test(s)?`var(--a-space-${s})`:`var(--a-gap-${s})`}function P$(s){return $$[s]??s}function Q$(s){return C$[s]??s}E();v("row-ui",gn);Q();var On=class extends w{static properties={columns:{type:String,default:"3",reflect:!0},gap:{type:String,default:"md",reflect:!0},columnGap:{type:String,default:"",reflect:!0,attribute:"column-gap"},rowGap:{type:String,default:"",reflect:!0,attribute:"row-gap"},minColumnWidth:{type:String,default:"",reflect:!0,attribute:"min-column-width"}};static template=()=>null;render(){let t=Ce.value,e=this.columns;if(e?.includes("@")){let r=qt(e,t);this.style.gridTemplateColumns=this.#t(r),this.style.gridAutoFlow=r?"row":"",this.style.gridAutoColumns=r?"auto":""}else this.style.gridTemplateColumns="",this.style.gridAutoFlow="",this.style.gridAutoColumns="";this.minColumnWidth?this.style.setProperty("--grid-min-col",this.minColumnWidth):this.style.removeProperty("--grid-min-col");let i=this.gap;if(i?.includes("@")){let r=qt(i,t),n=this.#e(r);this.style.columnGap=n,this.style.rowGap=n}else this.style.columnGap="",this.style.rowGap=""}#t(t){return t?/^\d+$/.test(t)?`repeat(${t}, 1fr)`:t==="auto-fill"?"repeat(auto-fill, minmax(var(--grid-min-col, 12rem), 1fr))":t==="auto-fit"?"repeat(auto-fit, minmax(var(--grid-min-col, 12rem), 1fr))":t:""}#e(t){return!t||t==="0"?"0":/^\d+$/.test(t)?`var(--a-space-${t})`:`var(--a-gap-${t})`}};E();v("grid-ui",On);Q();var bn=class extends w{static properties={align:{type:String,default:"center",reflect:!0}};static template=()=>null};E();v("stack-ui",bn);Q();var vn=class extends w{static properties={};static template=()=>null};E();v("frame-ui",vn);Q();function Bi(s,t,e=5){let r=(t-s||1)/e,n=Math.pow(10,Math.floor(Math.log10(r))),o=r/n,l=(o<=1.5?1:o<=3?2:o<=7?5:10)*n,h=Math.floor(s/l)*l,c=Math.ceil(t/l)*l,u=[];for(let d=h;d<=c+l*.5;d+=l)u.push(+d.toFixed(10));return u}function Tb(s){if(s==null)return"";let t=+s;return Number.isNaN(t)?String(s):Math.abs(t)>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.abs(t)>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":Number.isInteger(t)?String(t):t.toFixed(1)}function ne(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function yt({label:s,value:t,pct:e,series:i}){let r="";return s!=null&&(r+=` data-tip-label="${ne(String(s))}"`),t!=null&&(r+=` data-tip-value="${t}"`),e!=null&&(r+=` data-tip-pct="${e}"`),i!=null&&(r+=` data-tip-series="${ne(String(i))}"`),r}function oe(s,t,e){return s+t*Math.cos(e)}function ae(s,t,e){return s+t*Math.sin(e)}function T$(s,t,e,i,r){let n=oe(s,e,i),o=ae(t,e,i),a=oe(s,e,r),l=ae(t,e,r),h=r-i>Math.PI?1:0;return`M ${s} ${t} L ${n} ${o} A ${e} ${e} 0 ${h} 1 ${a} ${l} Z`}function yd(s,t,e,i,r,n,o=0){let a=(e-i)/2,l=n-r,h=Math.max(0,Math.min(o,a)),c=()=>{let bt=oe(s,e,r),mt=ae(t,e,r),kt=oe(s,e,n),Pt=ae(t,e,n),At=oe(s,i,n),Ft=ae(t,i,n),Yt=oe(s,i,r),Xi=ae(t,i,r),ls=l>Math.PI?1:0;return`M ${bt} ${mt} A ${e} ${e} 0 ${ls} 1 ${kt} ${Pt} L ${At} ${Ft} A ${i} ${i} 0 ${ls} 0 ${Yt} ${Xi} Z`};if(h<=0)return c();let u=h/e,d=h/i;if(l<=(u+d)*1.05)return c();let f=r+u,p=n-u,m=r+d,O=n-d,g=p-f>Math.PI?1:0,y=oe(s,e,f),S=ae(t,e,f),x=oe(s,e,p),k=ae(t,e,p),A=oe(s,i,O),$=ae(t,i,O),C=oe(s,i,m),M=ae(t,i,m),T=oe(s,e-h,r),q=ae(t,e-h,r),I=oe(s,i+h,r),_=ae(t,i+h,r),F=oe(s,e-h,n),Y=ae(t,e-h,n),tt=oe(s,i+h,n),nt=ae(t,i+h,n);return`M ${y} ${S} A ${e} ${e} 0 ${g} 1 ${x} ${k} A ${h} ${h} 0 0 1 ${F} ${Y} L ${tt} ${nt} A ${h} ${h} 0 0 1 ${A} ${$} A ${i} ${i} 0 ${g} 0 ${C} ${M} A ${h} ${h} 0 0 1 ${I} ${_} L ${T} ${q} A ${h} ${h} 0 0 1 ${y} ${S} Z`}function Ta(s,t=.4){if(s.length<2)return"";if(t<=0)return"M"+s.map(r=>`${r.x},${r.y}`).join(" L");let e=s.length,i=`M${s[0].x},${s[0].y}`;for(let r=0;r<e-1;r++){let n=s[Math.max(r-1,0)],o=s[r],a=s[r+1],l=s[Math.min(r+2,e-1)],h=o.x+(a.x-n.x)*t/3,c=o.y+(a.y-n.y)*t/3,u=a.x-(l.x-o.x)*t/3,d=a.y-(l.y-o.y)*t/3;i+=` C${h},${c} ${u},${d} ${a.x},${a.y}`}return i}function xd(s,t,e=.4){let i=Ta(s,e),r=s[s.length-1],n=s[0];return`${i} L${r.x},${t} L${n.x},${t} Z`}function lh(s,t,e,i,r=0){if(i<=0||e<=0)return"";let n=Math.max(0,Math.min(r,e/2,i));return n===0?`M${s},${t} H${s+e} V${t+i} H${s} Z`:`M${s},${t+i} V${t+n} Q${s},${t} ${s+n},${t} H${s+e-n} Q${s+e},${t} ${s+e},${t+n} V${t+i} Z`}var L$={std:{ratio:4/3}},yn=class extends w{static properties={type:{type:String,default:"bar",reflect:!0},x:{type:String,default:"",reflect:!0},y:{type:String,default:"",reflect:!0},hideAverage:{type:Boolean,default:!1,reflect:!0,attribute:"hide-average"},color:{type:String,default:"",reflect:!0},hideGrid:{type:Boolean,default:!1,reflect:!0,attribute:"hide-grid"},hideValues:{type:Boolean,default:!1,reflect:!0,attribute:"hide-values"},radius:{type:Number,default:null,reflect:!0},smooth:{type:Number,default:.4,reflect:!0},size:{type:String,default:"",reflect:!0},format:{type:String,default:"abbr",reflect:!0},loading:{type:Boolean,default:!1,reflect:!0},dots:{type:String,default:"all",reflect:!0},seriesEmphasis:{type:String,default:"",reflect:!0,attribute:"series-emphasis"}};static template=()=>null;#t=[];#e=!1;#i=null;#s=null;#r=0;#n=0;#a=new Set;#o=null;#l(){if(this.radius!=null)return this.radius;let t=getComputedStyle(this).getPropertyValue("--a-radius").trim(),e=parseFloat(t);return Number.isFinite(e)&&e>0?e:6}set data(t){!Array.isArray(t)&&!this.#e&&(this.#e=!0,console.warn(`[chart-ui] .data must be an array of plain objects \u2014 received ${t===null?"null":typeof t}. The {labels, datasets} envelope is the Chart.js API, not the chart-ui API.
216
+ `;connected(){this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Adia")}};E();v("adia-wordmark-ui",en);Q();var sn=class extends w{static properties={value:{type:Number,default:null,reflect:!0},variant:{type:String,default:"bar",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","100"),this.variant==="bar"&&(this.#t=document.createElement("div"),this.#t.setAttribute("slot","track"),this.#e=document.createElement("div"),this.#e.setAttribute("slot","fill"),this.#t.appendChild(this.#e),this.appendChild(this.#t))}render(){let t=this.value==null||this.value<0,e=Math.max(0,Math.min(100,this.value));this.setAttribute("aria-busy",String(t)),t?this.removeAttribute("aria-valuenow"):this.setAttribute("aria-valuenow",String(e)),this.#e&&(this.#e.style.width=t?"100%":`${e}%`)}disconnected(){this.#t?.remove(),this.#t=null,this.#e=null}};E();v("progress-ui",sn);Q();var rn=class extends w{static properties={value:{type:Number,default:0,reflect:!0},total:{type:Number,default:0,reflect:!0},caption:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),!st(this,"caption").length&&!st(this,"track").length?(this.#t=document.createElement("span"),this.#t.setAttribute("slot","caption"),this.appendChild(this.#t),this.#e=document.createElement("div"),this.#e.setAttribute("slot","track"),this.appendChild(this.#e)):(this.#t=st(this,"caption")[0],this.#e=st(this,"track")[0])}render(){let t=Math.max(0,this.total|0),e=Math.max(0,Math.min(t,this.value|0));if(this.setAttribute("aria-valuemax",String(t)),this.setAttribute("aria-valuenow",String(e)),this.#t&&!this.#t.dataset.custom&&(this.#t.textContent=this.caption||"",this.#t.toggleAttribute("hidden",!this.caption)),this.#e){let i=this.#e.children.length;for(;this.#e.children.length<t;)this.#e.appendChild(document.createElement("span"));for(;this.#e.children.length>t;)this.#e.lastElementChild.remove();for(let r=0;r<this.#e.children.length;r++)this.#e.children[r].toggleAttribute("data-active",r<e)}}disconnected(){this.#t=null,this.#e=null}};E();v("step-progress-ui",rn);Q();var nn=class extends w{static properties={width:{type:String,default:"100%",reflect:!0},height:{type:String,default:"1.2em",reflect:!0},radius:{type:String,default:"sm",reflect:!0},static:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("aria-hidden","true"),this.#t()}render(){this.#t()}#t(){this.style.width=this.width,this.style.height=this.height}};E();v("skeleton-ui",nn);Q();var on=class extends w{static properties={size:{type:String,default:"md",reflect:!0},variant:{type:String,default:"arc",reflect:!0},tone:{type:String,default:"current",reflect:!0},paused:{type:Boolean,default:!1,reflect:!0},label:{type:String,default:"Loading",reflect:!1}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","progressbar"),this.hasAttribute("aria-busy")||this.setAttribute("aria-busy","true"),this.setAttribute("aria-valuetext",this.label||"Loading"),this.#t()}render(){this.setAttribute("aria-valuetext",this.label||"Loading"),this.#t()}#t(){let t=this.variant==="dots",e=this.querySelectorAll(":scope > [data-spinner-dot]");if(t){if(e.length===3)return;e.forEach(r=>r.remove());let i=document.createDocumentFragment();for(let r=1;r<=3;r++){let n=document.createElement("span");n.setAttribute("data-spinner-dot",String(r)),n.setAttribute("aria-hidden","true"),i.appendChild(n)}this.appendChild(i)}else e.length&&e.forEach(i=>i.remove())}};E();v("spinner-ui",on);Q();var an=class extends w{static properties={active:{type:Boolean,default:!1,reflect:!0},delay:{type:Number,default:200,reflect:!0},label:{type:String,default:"Loading\u2026",reflect:!0},variant:{type:String,default:"default",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=!1;constructor(){super();let t=Object.getOwnPropertyDescriptor(this,"active");if(t?.set){let e=t.set;Object.defineProperty(this,"active",{get:t.get,set:i=>{let r=!!t.get.call(this);e.call(this,i),!!i!==r&&this.#s(!!i)},configurable:!0})}}connected(){this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.setAttribute("aria-label",this.label||"Loading"),this.#t=this.parentElement,this.active&&this.#s(!0)}disconnected(){this.#a(),this.#i&&this.#n(),this.#t=null}render(){let t=this.label||"Loading";this.setAttribute("aria-label",t);let e=this.querySelector(":scope > spinner-ui[data-loading-overlay-auto]");e&&e.getAttribute("label")!==t&&e.setAttribute("label",t),this.children.length===0&&this.#o()}#s(t){if(this.#a(),t){let e=Math.max(0,Number(this.delay)||0);e===0?this.#r():this.#e=setTimeout(()=>{this.#e=null,this.active&&this.#r()},e)}else this.#i&&this.#n()}#r(){let t=this.#t||this.parentElement;t&&!t.hasAttribute("aria-busy")&&t.setAttribute("aria-busy","true"),this.#i=!0}#n(){let t=this.#t||this.parentElement;t&&t.getAttribute("aria-busy")==="true"&&t.removeAttribute("aria-busy"),this.#i=!1}#a(){this.#e!==null&&(clearTimeout(this.#e),this.#e=null)}#o(){let t=document.createElement("spinner-ui");t.setAttribute("size","lg"),t.setAttribute("tone","subtle"),t.setAttribute("label",this.label||"Loading"),t.setAttribute("data-loading-overlay-auto",""),this.appendChild(t)}};E();v("loading-overlay-ui",an);Q();var $b=new Set;function Cb(s,t){$b.has(s)||($b.add(s),console.warn(`[alert-ui] ${t}`))}var ln=class s extends w{static requiredIcons=["x"];static properties={text:{type:String,default:"",reflect:!0},title:{type:String,default:"",reflect:!0},description:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},closable:{type:Boolean,default:!1,reflect:!0},dismissible:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},pattern:{type:String,default:"",reflect:!0},amount:{type:Number,default:0,reflect:!0},currency:{type:String,default:"USD",reflect:!0},dueAt:{type:String,default:"",reflect:!0,attribute:"due-at"},cardLast4:{type:String,default:"",reflect:!0,attribute:"card-last4"},reason:{type:String,default:"",reflect:!0}};static parts={leading:'<icon-ui slot="leading"></icon-ui>',content:'<span slot="content"></span>',close:'<button-ui slot="close" icon="x" variant="ghost" size="sm" aria-label="Close"></button-ui>'};static#t={declined:"x-circle",expired:"clock",insufficient:"wallet",network:"wifi-slash"};static template=()=>null;#e(){this.getAttribute("variant")==="error"&&(Cb("variant-error",'variant="error" is not in the canonical enum [default, info, success, warning, danger]. Mapping to "danger". Fix the source (LLM prompt / corpus pattern) to emit "danger" directly.'),this.setAttribute("variant","danger")),this.hasAttribute("closeable")&&!this.hasAttribute("closable")&&!this.hasAttribute("dismissible")&&(Cb("alias-closeable","attribute [closeable] is a misspelled alias of canonical [closable]. Mapping. Fix the source to use [closable] or [dismissible]."),this.setAttribute("closable",""),this.removeAttribute("closeable")),this.hasAttribute("dismissible")&&!this.hasAttribute("closable")&&this.setAttribute("closable","")}#i=t=>{if(t.target.closest('[slot="close"]')){this.#h();return}if(this.pattern==="dunning"){let e=t.target.closest("[data-dunning-action]");if(e&&this.contains(e)){let i=e.getAttribute("data-dunning-action")||"";this.dispatchEvent(new CustomEvent("dunning-action",{bubbles:!0,composed:!0,detail:{action:i,amount:this.amount,currency:this.currency,dueAt:this.dueAt}}))}}};connected(){this.#e(),this.#c(),(this.icon||this.pattern==="dunning"&&this.reason)&&this.ensure("leading"),this.ensure("content"),this.closable&&this.ensure("close"),this.addEventListener("press",this.#i)}disconnected(){this.removeEventListener("press",this.#i)}render(){if(this.pattern==="dunning"){this.#s(),this.#c();return}if(this.icon){let e=this.ensure("leading");e&&e.setAttribute("name",this.icon)}else this.drop("leading");let t=this.ensure("content");if(t){let e=t.hasAttribute("data-alert-auto"),i=t.childNodes.length>0;if(!e&&i){if(this.title||this.description){let r=[this.title,this.description].filter(Boolean).join(". ");this.setAttribute("aria-label",r)}}else if(this.title||this.description){if(t.setAttribute("data-alert-auto","title-desc"),t.replaceChildren(),this.title){let n=document.createElement("strong");n.textContent=this.title,t.appendChild(n),this.description&&t.appendChild(document.createTextNode(" "))}this.description&&t.appendChild(document.createTextNode(this.description));let r=[this.title,this.description].filter(Boolean).join(". ");this.setAttribute("aria-label",r)}else this.text&&(t.setAttribute("data-alert-auto","text"),t.textContent=this.text)}this.closable||this.dismissible?this.ensure("close"):this.drop("close"),this.#c()}#s(){let t=this.icon||s.#t[this.reason]||"x-circle",e=this.ensure("leading");e&&e.setAttribute("name",t);let i=this.ensure("content");if(!i)return;i.setAttribute("data-alert-auto","dunning"),i.replaceChildren();let r=this.title||this.#r();if(r){let l=document.createElement("strong");l.setAttribute("data-dunning-title",""),l.textContent=r,i.appendChild(l)}let n=this.#n(),o=this.#o();if(n||o){if(i.appendChild(document.createTextNode(" ")),n){let l=document.createElement("span");l.setAttribute("data-dunning-amount",""),l.textContent=n,i.appendChild(l)}if(n&&o&&i.appendChild(document.createTextNode(" ")),o){let l=document.createElement("span");l.setAttribute("data-dunning-meta",""),l.textContent=o,i.appendChild(l)}}let a=[r,n,o].filter(Boolean).join(". ");a&&this.setAttribute("aria-label",a),this.closable||this.dismissible?this.ensure("close"):this.drop("close")}#r(){switch(this.reason){case"expired":return"Card expired";case"insufficient":return"Insufficient funds";case"network":return"Network error";case"declined":return"Payment failed";default:return this.variant==="warning"?"Payment due soon":"Payment failed"}}#n(){if(!this.amount&&this.amount!==0||this.amount===0)return"";try{let t=this.getAttribute("lang")||this.lang||void 0;return new Intl.NumberFormat(t,{style:"currency",currency:this.currency||"USD"}).format(this.amount)}catch{return`${this.currency||""} ${this.amount}`.trim()}}#a(){if(!this.dueAt)return"";let t=/^\d{4}-\d{2}-\d{2}$/.test(this.dueAt)?new Date(`${this.dueAt}T00:00:00`):new Date(this.dueAt);if(Number.isNaN(t.getTime()))return"";try{let e=this.getAttribute("lang")||this.lang||void 0;return new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"numeric"}).format(t)}catch{return t.toDateString()}}#o(){let t=[];this.cardLast4&&t.push(`Card ending ${this.cardLast4}`),this.reason&&this.reason!=="declined"&&t.push(this.#l());let e=this.#a();if(e){let i=this.variant==="warning"?"due":"failed";t.push(`${i} ${e}`)}return t.join(" \xB7 ")}#l(){switch(this.reason){case"expired":return"expired";case"insufficient":return"insufficient funds";case"network":return"network error";case"declined":return"declined";default:return""}}#c(){let t=this.variant==="danger"||this.variant==="warning"?"alert":"status";this.setAttribute("role",t)}#h(){this.dispatchEvent(new Event("close",{bubbles:!0})),this.remove()}};E();v("alert-ui",ln);Q();var d$={info:"info",success:"check-circle",warning:"warning",danger:"x-circle"},hn=class extends w{static properties={text:{type:String,default:"",reflect:!1},variant:{type:String,default:"default",reflect:!0},icon:{type:String,default:"",reflect:!0},live:{type:String,default:"",reflect:!0}};static parts={leading:'<icon-ui slot="leading"></icon-ui>'};static requiredIcons=["info","check-circle","warning","x-circle"];static template=()=>null;#t(t){return!!(t&&(t._uiPart||t.hasAttribute("data-im-auto")))}connected(){}render(){this.live?this.setAttribute("aria-live",this.live):this.hasAttribute("aria-live")&&this.removeAttribute("aria-live"),this.#e();let t=this.icon||d$[this.variant]||"",e=this.querySelector(':scope > [slot="leading"]');if(!(e&&!this.#t(e)))if(t){let i=this.ensure("leading");i&&(i.setAttribute("data-im-auto",""),i.getAttribute("name")!==t&&i.setAttribute("name",t))}else this.drop("leading")}#e(){let t=this.querySelector(":scope > [data-im-text]");if(Array.from(this.childNodes).some(i=>i===t?!1:i.nodeType===Node.ELEMENT_NODE?!(i.getAttribute&&i.getAttribute("slot")==="leading"):!!(i.nodeType===Node.TEXT_NODE&&i.textContent.trim()))){t&&t.remove();return}this.text?(t||(t=document.createElement("span"),t.setAttribute("data-im-text",""),this.appendChild(t)),t.textContent!==this.text&&(t.textContent=this.text)):t&&t.remove()}};E();v("inline-message-ui",hn);Q();var cn=class extends w{static properties={size:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","presentation")}};E();v("kbd-ui",cn);Q();var un=class extends w{static requiredIcons=["x"];static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},size:{type:String,default:"md",reflect:!0},removable:{type:Boolean,default:!1,reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static parts={dismiss:'<button-ui slot="dismiss" variant="ghost" size="sm" aria-label="Remove"><icon-ui slot="icon" name="x" weight="bold" size="0.75rem"></icon-ui></button-ui>'};static template=()=>null;#t=t=>{this.disabled||t.target.closest('[slot="dismiss"]')&&(this.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{text:this.text,value:this.text}})),this.remove())};#e=t=>{this.disabled||t.target.closest('[slot="dismiss"]')&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{text:this.text,value:this.text}})),this.remove())};connected(){this.setAttribute("role","status"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}disconnected(){this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.disabled?(this.setAttribute("aria-disabled","true"),this.setAttribute("tabindex","-1")):(this.removeAttribute("aria-disabled"),this.setAttribute("tabindex","0")),this.removable&&!this.disabled){let t=this.ensure("dismiss");t&&t.parentElement!==this&&this.appendChild(t)}else this.drop("dismiss")}};E();v("tag-ui",un);Q();var f$=new Set(["block","dot","square","line","dashed"]),p$=new Set(["sm","md","lg"]),m$=new Set(["out-of-gamut","p3-only","apca-pass","apca-fail"]),g$={"out-of-gamut":"\u25B3","p3-only":"\u2726","apca-pass":"\u2713","apca-fail":"\u2717"},O$={"out-of-gamut":"Outside sRGB gamut","p3-only":"Display-P3 only","apca-pass":"Contrast passes APCA","apca-fail":"Contrast fails APCA"};function b$(s){return s?s.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t&&m$.has(t)):[]}var ds=null;function v$(s){if(!s||typeof s!="string"||typeof document>"u")return null;try{if(!ds){let u=document.createElement("canvas");u.width=1,u.height=1,ds=u.getContext("2d")}ds.fillStyle="#000",ds.clearRect(0,0,1,1),ds.fillStyle=s,ds.fillRect(0,0,1,1);let[t,e,i]=ds.getImageData(0,0,1,1).data;if(t===0&&e===0&&i===0&&s!=="#000"&&s!=="black"&&s!=="#000000")return null;let r=u=>{let d=u/255;return d<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)},n=r(t),o=r(e),a=r(i),l=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),h=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a);return .2104542553*l+.793617785*h-.0040720468*c}catch{return null}}var dn=class extends w{static properties={shape:{type:String,default:"square",reflect:!0},size:{type:String,default:"md",reflect:!0},color:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},detail:{type:String,default:"",reflect:!0},badge:{type:String,default:"",reflect:!0},copyable:{type:Boolean,default:!1,reflect:!0},copyValue:{type:String,default:""},selectable:{type:Boolean,default:!1,reflect:!0},selected:{type:Boolean,default:!1,reflect:!0},autoContrast:{type:Boolean,default:!1,reflect:!0,attribute:"auto-contrast"},labelPosition:{type:String,default:"below",reflect:!0,attribute:"label-position"}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=!1;#a=null;#o=null;#l=null;#c=null;#h=null;#u=null;connected(){this.#d(),this.#S(),typeof MutationObserver<"u"&&(this.#u=new MutationObserver(t=>{let e=!1;for(let i of t){for(let r of i.addedNodes)if(r.nodeType===1){if(r.getAttribute?.("slot")==="chrome"){e=!0;break}if(r.tagName==="SPAN"&&r.style?.display==="contents"&&r.querySelector?.('[slot="chrome"]')){e=!0;break}}if(e)break}e&&(this.#f(),this.#u.takeRecords())}),this.#u.observe(this,{childList:!0}))}render(){this.#d(),this.#p(),this.#m(),this.#b(),this.#v(),this.#O(),this.#g()}#d(){if(this.#n)return;let t=Array.from(this.children).filter(n=>n.getAttribute&&n.getAttribute("slot")==="chrome");for(let n of t)n.remove();let e=Array.from(this.children).filter(n=>n.tagName==="SPAN"&&n.style?.display==="contents"&&n.querySelector?.('[slot="chrome"]'));for(let n of e)n.remove();let i=[];for(let n of Array.from(this.childNodes))(n.nodeType===3&&!n.data||n.nodeType===8)&&i.push(n);for(let n of i)n.remove();let r=Array.from(this.childNodes).filter(n=>!(n.nodeType===1&&n.dataset&&(n.dataset.tile!==void 0||n.dataset.label!==void 0||n.dataset.detail!==void 0||n.dataset.badge!==void 0||n.dataset.copy!==void 0))&&!(n.nodeType===3&&!n.textContent.trim()));this.innerHTML="",this.#t=document.createElement("span"),this.#t.setAttribute("data-tile",""),this.#t.setAttribute("aria-hidden","true"),this.appendChild(this.#t);for(let n of t)this.appendChild(n);for(let n of e)this.appendChild(n);for(let n of i)this.appendChild(n);if(this.#s=document.createElement("span"),this.#s.setAttribute("data-badge",""),this.#s.setAttribute("hidden",""),this.appendChild(this.#s),this.#e=document.createElement("span"),this.#e.setAttribute("data-label",""),r.length)for(let n of r)this.#e.appendChild(n);this.appendChild(this.#e),this.#i=document.createElement("span"),this.#i.setAttribute("data-detail",""),this.#i.setAttribute("hidden",""),this.appendChild(this.#i),this.#r=document.createElement("button-ui"),this.#r.setAttribute("data-copy",""),this.#r.setAttribute("variant","ghost"),this.#r.setAttribute("size","xs"),this.#r.setAttribute("aria-label","Copy value"),this.#r.setAttribute("hidden",""),this.#r.setAttribute("text","\u29C9"),this.appendChild(this.#r),this.#n=!0}#f(){if(!this.#t||!this.#s)return;let t=[];for(let e of this.children)if(e!==this.#t){if(e===this.#s)break;e.getAttribute?.("slot")==="chrome"&&t.push(e)}for(let e of Array.from(this.children))e!==this.#t&&e!==this.#s&&e!==this.#e&&e!==this.#i&&e!==this.#r&&e.getAttribute?.("slot")==="chrome"&&this.insertBefore(e,this.#s);for(let e of Array.from(this.children))e===this.#t||e===this.#s||e===this.#e||e===this.#i||e===this.#r||!(e.tagName==="SPAN"&&e.style?.display==="contents")||!e.querySelector?.('[slot="chrome"]')||this.insertBefore(e,this.#s)}#p(){if(!this.#t||!this.#e)return;this.#f();let t=f$.has(this.shape)?this.shape:"square",e=p$.has(this.size)?this.size:"md";t!==this.shape&&this.setAttribute("shape",t),e!==this.size&&this.setAttribute("size",e),this.color&&this.style.setProperty("--swatch-color",this.color),!this.#e.firstChild&&this.label?this.#e.textContent=this.label:this.#e.firstChild?.nodeType===3&&this.label&&(this.#e.textContent=this.label);let i=this.#e.textContent.trim().length>0||this.#e.firstElementChild!=null;this.#e.toggleAttribute("hidden",!i)}#m(){if(!this.#s)return;let t=b$(this.badge);if(t.length===0){this.#s.setAttribute("hidden",""),this.#s.replaceChildren();return}this.#s.removeAttribute("hidden");let e=Array.from(this.#s.children).map(n=>n.dataset.badgeVariant);if(e.length===t.length&&e.every((n,o)=>n===t[o]))return;let r=document.createDocumentFragment();for(let n of t){let o=document.createElement("span");o.setAttribute("data-badge-variant",n),o.setAttribute("role","img"),o.setAttribute("aria-label",O$[n]),o.textContent=g$[n],r.appendChild(o)}this.#s.replaceChildren(r)}#g(){if(!this.#e)return;if(!this.autoContrast){this.#e.removeAttribute("data-on-light"),this.#e.removeAttribute("data-on-dark"),this.#a=null;return}let t=this.color||getComputedStyle(this).getPropertyValue("--swatch-color").trim();if(t===this.#a)return;this.#a=t;let e=v$(t);if(e==null){this.#e.removeAttribute("data-on-light"),this.#e.removeAttribute("data-on-dark");return}let i=e<.62;this.#e.toggleAttribute("data-on-dark",i),this.#e.toggleAttribute("data-on-light",!i)}#b(){if(!this.#i)return;let t=(this.detail||"").trim();if(!t){this.#i.setAttribute("hidden",""),this.#i.textContent="";return}this.#i.removeAttribute("hidden"),this.#i.textContent!==t&&(this.#i.textContent=t)}#v(){if(!this.#r)return;if(!this.copyable){this.#r.setAttribute("hidden","");return}this.#r.removeAttribute("hidden");let t=this.#y();t?this.#r.setAttribute("aria-label",`Copy ${t}`):this.#r.setAttribute("aria-label","Copy value")}#O(){this.selectable?(this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.setAttribute("aria-pressed",this.selected?"true":"false")):(this.getAttribute("role")==="button"&&this.removeAttribute("role"),this.getAttribute("tabindex")==="0"&&this.removeAttribute("tabindex"),this.removeAttribute("aria-pressed"))}#S(){this.#o=t=>{!this.selectable||(t.composedPath?t.composedPath():[]).includes(this.#r)||this.#x()},this.#l=t=>{!this.selectable||t.key!=="Enter"&&t.key!==" "||(t.composedPath?t.composedPath():[t.target]).includes(this.#r)||(t.preventDefault(),this.#x())},this.addEventListener("click",this.#o),this.addEventListener("keydown",this.#l),this.#c=t=>{if(t.stopPropagation(),!this.copyable)return;let e=this.#y();e&&this.#w(e)},this.#r.addEventListener("click",this.#c)}#x(){this.dispatchEvent(new CustomEvent("select",{bubbles:!0,detail:{value:this.color||this.label,color:this.color,label:this.label}}))}#y(){return this.copyValue?this.copyValue:this.color?this.color:""}async#w(t){let e=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),e=!0)}catch{}this.#k(e)}#k(t){this.#r&&(this.#h!=null&&clearTimeout(this.#h),this.#r.setAttribute("data-copy-state",t?"ok":"fail"),this.#r.setAttribute("text",t?"\u2713":"\u26A0"),this.#h=setTimeout(()=>{this.#r&&(this.#r.removeAttribute("data-copy-state"),this.#r.setAttribute("text","\u29C9"),this.#h=null)},1200))}disconnected(){this.#h!=null&&(clearTimeout(this.#h),this.#h=null),this.#u&&(this.#u.disconnect(),this.#u=null),this.#o&&this.removeEventListener("click",this.#o),this.#l&&this.removeEventListener("keydown",this.#l),this.#r&&this.#c&&this.#r.removeEventListener("click",this.#c),this.#t=null,this.#e=null,this.#i=null,this.#s=null,this.#r=null,this.#n=!1}};E();v("swatch-ui",dn);_e();var Eb={xs:0,sm:480,md:768,lg:1024,xl:1280},fs=Object.keys(Eb),vd=Object.values(Eb);function Pb(){if(typeof window>"u")return"lg";let s=window.innerWidth;for(let t=fs.length-1;t>=0;t--)if(s>=vd[t])return fs[t];return"xs"}var Ce=Zi(Pb());if(typeof window<"u")for(let s=1;s<vd.length;s++)window.matchMedia(`(min-width: ${vd[s]}px)`).addEventListener("change",()=>{Ce.value=Pb()});function qt(s,t=Ce.value){if(!s)return null;if(!s.includes("@"))return s;let e=null,i=new Map;for(let a of s.trim().split(/\s+/)){let l=a.lastIndexOf("@");l===-1?e=a:i.set(a.slice(l+1),a.slice(0,l))}let r=fs.indexOf(t),n=null,o=-1;for(let[a,l]of i){let h=fs.indexOf(a);h!==-1&&h<=r&&h>o&&(n=l,o=h)}return n??e}Q();var fn=class extends w{static properties={justify:{type:String,default:"start",reflect:!0},align:{type:String,default:"stretch",reflect:!0},gap:{type:String,default:"md",reflect:!0},grow:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;render(){let t=this.gap,e=this.align,i=this.justify,n=t?.includes("@")||e?.includes("@")||i?.includes("@")?Ce.value:"";if(t?.includes("@")?this.style.setProperty("--col-gap",S$(qt(t,n))):this.style.removeProperty("--col-gap"),e?.includes("@")){let o=qt(e,n);this.style.setProperty("--col-align",w$(o)),this.style.textAlign=k$(o)}else this.style.removeProperty("--col-align"),this.style.textAlign="";i?.includes("@")?this.style.setProperty("--col-justify",A$(qt(i,n))):this.style.removeProperty("--col-justify")}},y$={start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},x$={start:"flex-start",end:"flex-end",center:"center",between:"space-between","space-between":"space-between","space-around":"space-around"};function S$(s){return!s||s==="0"?"0":/^\d+$/.test(s)?`var(--a-space-${s})`:`var(--a-gap-${s})`}function w$(s){return y$[s]??s}function k$(s){return{start:"start",center:"center",end:"end"}[s]??""}function A$(s){return x$[s]??s}E();v("col-ui",fn);Q();var pn=class s extends w{static properties={label:{type:String,default:"",reflect:!0},hint:{type:String,default:"",reflect:!0},required:{type:Boolean,default:!1,reflect:!0},inline:{type:Boolean,default:!1,reflect:!0},align:{type:String,default:"start",reflect:!0}};get error(){return this.#g()?.error??""}static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=t=>{let e=this.#g();if(!e)return;let i=this.#v(e);i&&(t.preventDefault(),i.focus())};connected(){this.#u(),this.#d(),this.#f(),this.#p(),this.#c(),this.#t?.addEventListener("click",this.#n),typeof MutationObserver<"u"&&(this.#r=new MutationObserver(()=>{this.#p(),this.#c(),this.#m(),this.#a()}),this.#r.observe(this,{childList:!0})),this.#a()}disconnected(){this.#r?.disconnect(),this.#r=null,this.#h(),this.#t?.removeEventListener("click",this.#n),this.#t=null,this.#e=null,this.#i=null,this.#s=null}render(){this.#t&&this.#t.childNodes[0]&&(this.#t.childNodes[0].nodeValue=this.label||""),this.#e&&(this.#e.hidden=!this.required),this.#i&&(this.#i.textContent=this.hint||"",this.#i.hidden=!this.hint||!!this.error),this.#a(),this.#m()}#a(){if(!this.#s)return;let t=this.error;this.#s.textContent=t||"",this.#s.hidden=!t}#o=()=>{this.#a(),this.#m()};#l=null;#c(){let t=this.#g();t!==this.#l&&(this.#h(),t&&(this.#l=t,t.addEventListener("invalid",this.#o,!0),t.addEventListener("change",this.#o),t.addEventListener("input",this.#o)))}#h(){let t=this.#l;t&&(t.removeEventListener("invalid",this.#o,!0),t.removeEventListener("change",this.#o),t.removeEventListener("input",this.#o),this.#l=null)}#u(){if(this.#t=this.querySelector(":scope > [data-field-label]"),!this.#t){let t=document.createElement("label");t.setAttribute("slot","label"),t.setAttribute("data-field-label",""),t.appendChild(document.createTextNode(this.label||"")),this.prepend(t),this.#t=t}if(this.#e=this.#t.querySelector("[data-field-required]"),!this.#e){let t=document.createElement("span");t.setAttribute("data-field-required",""),t.setAttribute("aria-hidden","true"),t.textContent="*",t.hidden=!0,this.#t.appendChild(t),this.#e=t}}#d(){if(this.#i=this.querySelector(":scope > [data-field-hint]"),this.#i)return;let t=document.createElement("div");t.setAttribute("slot","hint"),t.setAttribute("data-field-hint",""),t.setAttribute("id",s.#y("hint")),t.hidden=!0,this.appendChild(t),this.#i=t}#f(){if(this.#s=this.querySelector(":scope > [data-field-error]"),this.#s)return;let t=document.createElement("div");t.setAttribute("slot","error"),t.setAttribute("data-field-error",""),t.setAttribute("id",s.#y("err")),t.setAttribute("role","alert"),t.hidden=!0,this.appendChild(t),this.#s=t}#p(){if(!this.#t)return;let t=this.#g();if(!t){this.#t.removeAttribute("for");return}t.id||(t.id=s.#S()),this.#t.setAttribute("for",t.id)}#m(){let t=this.#g();if(!t)return;let e=new Set;this.#i&&!this.#i.hidden&&e.add(this.#i.id),this.#s&&!this.#s.hidden&&e.add(this.#s.id);let r=[...(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(n=>n&&!n.startsWith("field-hint-")&&!n.startsWith("field-err-")),...e].join(" ").trim();r?t.setAttribute("aria-describedby",r):t.removeAttribute("aria-describedby")}#g(){let t=null,e=null;for(let i of this.children)if(!i.hasAttribute("slot")){if(t===null&&(t=i),s.#b.has(i.localName))return i;e===null&&this.#v(i)&&(e=i)}return e??t}static#b=new Set(["input-ui","textarea-ui","select-ui","combobox-ui","search-ui","check-ui","radio-ui","switch-ui","slider-ui","range-ui","otp-input-ui","tags-input-ui","chat-input-ui","autocomplete-input-ui","datetime-picker-ui","date-range-picker-ui","calendar-picker-ui","color-picker-ui","upload-ui","rating-ui","segmented-ui","input","textarea","select"]);#v(t){let e='input, textarea, select, button, [contenteditable], [tabindex]:not([tabindex="-1"])';return t.matches?.(e)?t:t.querySelector?.(e)??null}static#O=0;static#S(){return`field-ctl-${++s.#O}`}static#x=0;static#y(t){return`field-${t}-${++s.#x}`}};E();v("field-ui",pn);Q();var mn=class extends w{static properties={inline:{type:Boolean,default:!1,reflect:!0},columns:{type:Number,default:6,reflect:!0}};static template=()=>null;#t=null;connected(){this.#e(),typeof MutationObserver<"u"&&(this.#t=new MutationObserver(t=>{for(let e of t)if(e.type==="childList"&&(this.#i(e.addedNodes)||this.#i(e.removedNodes))){this.#e();return}}),this.#t.observe(this,{childList:!0}))}disconnected(){this.#t?.disconnect(),this.#t=null}render(){this.#e()}#e(){let t=this.hasAttribute("inline");for(let e of this.children)e.localName==="field-ui"&&(t?e.hasAttribute("inline")||e.setAttribute("inline",""):e.hasAttribute("inline")&&e.removeAttribute("inline"))}#i(t){for(let e of t)if(e.nodeType===1&&e.localName==="field-ui")return!0;return!1}};E();v("fields-ui",mn);Q();E();var Qb=0,Qa=class extends w{static properties={label:{type:String,default:"",reflect:!0},value:{type:String,default:"",reflect:!0},variant:{type:String,default:"default",reflect:!0},hint:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;connected(){this.setAttribute("role","group"),this.#t=this.querySelector(':scope > [slot="label"]'),this.#t||(this.#t=document.createElement("span"),this.#t.setAttribute("slot","label"),this.insertBefore(this.#t,this.firstChild)),this.#t.id||(this.#t.id=`display-field-label-${++Qb}`),this.#e=this.querySelector(':scope > [slot="value"]'),this.#i=this.querySelector(':scope > [slot="hint"]'),this.#s=this.querySelector(':scope > icon-ui[slot="icon"]')}render(){if(!this.#t)return;this.label?(this.#t.textContent=this.label,this.#t.hidden=!1,this.setAttribute("aria-labelledby",this.#t.id)):(this.#t.hidden=!0,this.removeAttribute("aria-labelledby")),this.querySelector(":scope > :not([slot])")?this.#e&&(this.#e.remove(),this.#e=null):(this.#e||(this.#e=document.createElement("span"),this.#e.setAttribute("slot","value"),this.appendChild(this.#e)),this.#e.textContent=this.value),this.hint?(this.#i||(this.#i=document.createElement("span"),this.#i.setAttribute("slot","hint"),this.#i.id=`display-field-hint-${++Qb}`,this.appendChild(this.#i)),this.#i.textContent=this.hint,this.setAttribute("aria-describedby",this.#i.id)):this.#i&&(this.#i.remove(),this.#i=null,this.removeAttribute("aria-describedby")),this.icon?(this.#s||(this.#s=document.createElement("icon-ui"),this.#s.setAttribute("slot","icon"),this.#s.setAttribute("aria-hidden","true"),this.appendChild(this.#s)),this.#s.setAttribute("name",this.icon)):this.#s&&(this.#s.remove(),this.#s=null)}disconnected(){this.#t=null,this.#e=null,this.#i=null,this.#s=null}};v("display-field-ui",Qa);Q();var gn=class extends w{static properties={justify:{type:String,default:"start",reflect:!0},align:{type:String,default:"center",reflect:!0},gap:{type:String,default:"md",reflect:!0},grow:{type:Boolean,default:!1,reflect:!0},wrap:{type:Boolean,default:!1,reflect:!0},wrapAt:{type:String,default:"",reflect:!0,attribute:"wrap-at"},draggable:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=!1;connected(){this.draggable&&!this.#t&&(this.addTrait(Gr),this.#t=!0)}updated(t){t.has("draggable")&&this.draggable&&!this.#t&&(this.addTrait(Gr),this.#t=!0)}render(){let t=this.gap,e=this.align,i=this.justify,r=this.wrapAt,o=t?.includes("@")||e?.includes("@")||i?.includes("@")||!!r?Ce.value:"";if(t?.includes("@")?this.style.setProperty("--row-gap",E$(qt(t,o))):this.style.removeProperty("--row-gap"),e?.includes("@")?this.style.setProperty("--row-align",P$(qt(e,o))):this.style.removeProperty("--row-align"),i?.includes("@")?this.style.setProperty("--row-justify",Q$(qt(i,o))):this.style.removeProperty("--row-justify"),r){let a=fs.indexOf(o),l=fs.indexOf(r);this.style.flexWrap=l!==-1&&a>=l?"wrap":""}else this.style.flexWrap=""}},$$={start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},C$={start:"flex-start",end:"flex-end",center:"center",between:"space-between","space-between":"space-between","space-around":"space-around"};function E$(s){return!s||s==="0"?"0":/^\d+$/.test(s)?`var(--a-space-${s})`:`var(--a-gap-${s})`}function P$(s){return $$[s]??s}function Q$(s){return C$[s]??s}E();v("row-ui",gn);Q();var On=class extends w{static properties={columns:{type:String,default:"3",reflect:!0},gap:{type:String,default:"md",reflect:!0},columnGap:{type:String,default:"",reflect:!0,attribute:"column-gap"},rowGap:{type:String,default:"",reflect:!0,attribute:"row-gap"},minColumnWidth:{type:String,default:"",reflect:!0,attribute:"min-column-width"}};static template=()=>null;render(){let t=Ce.value,e=this.columns;if(e?.includes("@")){let r=qt(e,t);this.style.gridTemplateColumns=this.#t(r),this.style.gridAutoFlow=r?"row":"",this.style.gridAutoColumns=r?"auto":""}else this.style.gridTemplateColumns="",this.style.gridAutoFlow="",this.style.gridAutoColumns="";this.minColumnWidth?this.style.setProperty("--grid-min-col",this.minColumnWidth):this.style.removeProperty("--grid-min-col");let i=this.gap;if(i?.includes("@")){let r=qt(i,t),n=this.#e(r);this.style.columnGap=n,this.style.rowGap=n}else this.style.columnGap="",this.style.rowGap=""}#t(t){return t?/^\d+$/.test(t)?`repeat(${t}, 1fr)`:t==="auto-fill"?"repeat(auto-fill, minmax(var(--grid-min-col, 12rem), 1fr))":t==="auto-fit"?"repeat(auto-fit, minmax(var(--grid-min-col, 12rem), 1fr))":t:""}#e(t){return!t||t==="0"?"0":/^\d+$/.test(t)?`var(--a-space-${t})`:`var(--a-gap-${t})`}};E();v("grid-ui",On);Q();var bn=class extends w{static properties={align:{type:String,default:"center",reflect:!0}};static template=()=>null};E();v("stack-ui",bn);Q();var vn=class extends w{static properties={};static template=()=>null};E();v("frame-ui",vn);Q();function Bi(s,t,e=5){let r=(t-s||1)/e,n=Math.pow(10,Math.floor(Math.log10(r))),o=r/n,l=(o<=1.5?1:o<=3?2:o<=7?5:10)*n,h=Math.floor(s/l)*l,c=Math.ceil(t/l)*l,u=[];for(let d=h;d<=c+l*.5;d+=l)u.push(+d.toFixed(10));return u}function Tb(s){if(s==null)return"";let t=+s;return Number.isNaN(t)?String(s):Math.abs(t)>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.abs(t)>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":Number.isInteger(t)?String(t):t.toFixed(1)}function ne(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function yt({label:s,value:t,pct:e,series:i}){let r="";return s!=null&&(r+=` data-tip-label="${ne(String(s))}"`),t!=null&&(r+=` data-tip-value="${t}"`),e!=null&&(r+=` data-tip-pct="${e}"`),i!=null&&(r+=` data-tip-series="${ne(String(i))}"`),r}function oe(s,t,e){return s+t*Math.cos(e)}function ae(s,t,e){return s+t*Math.sin(e)}function T$(s,t,e,i,r){let n=oe(s,e,i),o=ae(t,e,i),a=oe(s,e,r),l=ae(t,e,r),h=r-i>Math.PI?1:0;return`M ${s} ${t} L ${n} ${o} A ${e} ${e} 0 ${h} 1 ${a} ${l} Z`}function yd(s,t,e,i,r,n,o=0){let a=(e-i)/2,l=n-r,h=Math.max(0,Math.min(o,a)),c=()=>{let bt=oe(s,e,r),mt=ae(t,e,r),kt=oe(s,e,n),Pt=ae(t,e,n),At=oe(s,i,n),Ft=ae(t,i,n),Yt=oe(s,i,r),Xi=ae(t,i,r),ls=l>Math.PI?1:0;return`M ${bt} ${mt} A ${e} ${e} 0 ${ls} 1 ${kt} ${Pt} L ${At} ${Ft} A ${i} ${i} 0 ${ls} 0 ${Yt} ${Xi} Z`};if(h<=0)return c();let u=h/e,d=h/i;if(l<=(u+d)*1.05)return c();let f=r+u,p=n-u,m=r+d,O=n-d,g=p-f>Math.PI?1:0,y=oe(s,e,f),S=ae(t,e,f),x=oe(s,e,p),k=ae(t,e,p),A=oe(s,i,O),$=ae(t,i,O),C=oe(s,i,m),M=ae(t,i,m),T=oe(s,e-h,r),q=ae(t,e-h,r),I=oe(s,i+h,r),_=ae(t,i+h,r),F=oe(s,e-h,n),Y=ae(t,e-h,n),tt=oe(s,i+h,n),nt=ae(t,i+h,n);return`M ${y} ${S} A ${e} ${e} 0 ${g} 1 ${x} ${k} A ${h} ${h} 0 0 1 ${F} ${Y} L ${tt} ${nt} A ${h} ${h} 0 0 1 ${A} ${$} A ${i} ${i} 0 ${g} 0 ${C} ${M} A ${h} ${h} 0 0 1 ${I} ${_} L ${T} ${q} A ${h} ${h} 0 0 1 ${y} ${S} Z`}function Ta(s,t=.4){if(s.length<2)return"";if(t<=0)return"M"+s.map(r=>`${r.x},${r.y}`).join(" L");let e=s.length,i=`M${s[0].x},${s[0].y}`;for(let r=0;r<e-1;r++){let n=s[Math.max(r-1,0)],o=s[r],a=s[r+1],l=s[Math.min(r+2,e-1)],h=o.x+(a.x-n.x)*t/3,c=o.y+(a.y-n.y)*t/3,u=a.x-(l.x-o.x)*t/3,d=a.y-(l.y-o.y)*t/3;i+=` C${h},${c} ${u},${d} ${a.x},${a.y}`}return i}function xd(s,t,e=.4){let i=Ta(s,e),r=s[s.length-1],n=s[0];return`${i} L${r.x},${t} L${n.x},${t} Z`}function lh(s,t,e,i,r=0){if(i<=0||e<=0)return"";let n=Math.max(0,Math.min(r,e/2,i));return n===0?`M${s},${t} H${s+e} V${t+i} H${s} Z`:`M${s},${t+i} V${t+n} Q${s},${t} ${s+n},${t} H${s+e-n} Q${s+e},${t} ${s+e},${t+n} V${t+i} Z`}var L$={std:{ratio:4/3}},yn=class extends w{static properties={type:{type:String,default:"bar",reflect:!0},x:{type:String,default:"",reflect:!0},y:{type:String,default:"",reflect:!0},hideAverage:{type:Boolean,default:!1,reflect:!0,attribute:"hide-average"},color:{type:String,default:"",reflect:!0},hideGrid:{type:Boolean,default:!1,reflect:!0,attribute:"hide-grid"},hideValues:{type:Boolean,default:!1,reflect:!0,attribute:"hide-values"},radius:{type:Number,default:null,reflect:!0},smooth:{type:Number,default:.4,reflect:!0},size:{type:String,default:"",reflect:!0},format:{type:String,default:"abbr",reflect:!0},loading:{type:Boolean,default:!1,reflect:!0},dots:{type:String,default:"all",reflect:!0},seriesEmphasis:{type:String,default:"",reflect:!0,attribute:"series-emphasis"}};static template=()=>null;#t=[];#e=!1;#i=null;#s=null;#r=0;#n=0;#a=new Set;#o=null;#l(){if(this.radius!=null)return this.radius;let t=getComputedStyle(this).getPropertyValue("--a-radius").trim(),e=parseFloat(t);return Number.isFinite(e)&&e>0?e:6}set data(t){!Array.isArray(t)&&!this.#e&&(this.#e=!0,console.warn(`[chart-ui] .data must be an array of plain objects \u2014 received ${t===null?"null":typeof t}. The {labels, datasets} envelope is the Chart.js API, not the chart-ui API.
217
217
  Correct shape for <chart-ui x="label" y="value">:
218
218
  [{ label: "Jan", value: 100 }, { label: "Feb", value: 200 }]`)),this.#t=Array.isArray(t)?t:[],this.#h(),this.#p()}get data(){return this.#t}#c=!1;#h(){if(this.#c)return;let t=this.#u();this.#t.length>t&&(console.warn(`[chart-ui] .data has ${this.#t.length} rows which exceeds the recommended perf budget of ${t}. Consider downsampling at the data layer (e.g., LTTB, bucket aggregation). Override the budget via CSS: chart-ui { --chart-perf-budget: 10000 }.`),this.#c=!0)}#u(){let t=getComputedStyle(this).getPropertyValue("--chart-perf-budget").trim(),e=parseInt(t,10);return Number.isFinite(e)&&e>0?e:5e3}connected(){if(this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",`${this.type} chart`),this.#t.length===0&&this.hasAttribute("data"))try{let t=JSON.parse(this.getAttribute("data"));Array.isArray(t)&&(this.data=t)}catch{}document.addEventListener("toggle",this.#S),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("keydown",this.#T),this.addEventListener("focus",this.#C),this.addEventListener("blur",this.#I),this.addEventListener("pointerover",this.#Q),this.addEventListener("pointermove",this.#P),this.addEventListener("pointerleave",this.#Z),this.addEventListener("pointerdown",this.#N),this.addEventListener("click",this.#j),typeof ResizeObserver<"u"&&(this.#i=new ResizeObserver(t=>{let{inlineSize:e,blockSize:i}=t[0].contentBoxSize[0];if(!this.#t.length)return;let r=Math.round(e),n=Math.round(i);r===this.#r&&(!this.hasAttribute("resize")||n===this.#n)||(this.#r=r,this.#n=n,!this.#s&&(this.#s=requestAnimationFrame(()=>{this.#s=null,this.#p()})))}),this.#i.observe(this))}render(){if(this.loading){let e=this.querySelector("skeleton-ui[data-chart-skel]");e||(e=document.createElement("skeleton-ui"),e.setAttribute("data-chart-skel",""),e.style.cssText="display:block;width:100%;height:100%;min-height:4rem;border-radius:var(--a-radius-md)"),this.innerHTML="",this.appendChild(e);return}let t=this.querySelector("skeleton-ui[data-chart-skel]");t&&t.remove(),this.#p()}#d(){let t=this.clientWidth||300,e=this.clientHeight||0,i=L$.std,r=this.#t.length||1,n=Math.max(t,120),a=(this.hasAttribute("resize")||this.style.height)&&e>40?e:Math.round(n/i.ratio),l=parseFloat(getComputedStyle(this).maxHeight);isFinite(l)&&l>0&&a>l&&(a=Math.round(l));let h=Math.min(n,a),c=this.size||(h<150?"sm":h<300?"md":"lg"),u=c==="sm"?9:c==="md"?10:11,d=u,f=c==="sm"?8:c==="md"?9:10,p=this.hideGrid,m=p?0:u*3.2,O=!!this.x,g={top:p?2:u*1.6,right:p?2:u*1.2,bottom:!O||p?2:u*2.2,left:m},y=n-g.left-g.right,S=Math.max(4,y/r*.6);return{width:n,height:a,pad:g,fontSize:u,labelSize:d,valueSize:f,barMinW:S,plotW:y,n:r,sizeClass:c}}#f=null;#p(){if(!this.isConnected)return;let t=this.querySelector(':scope > [slot="empty"]');if(t&&!this.#f&&(this.#f=t.cloneNode(!0)),this.innerHTML="",this.#f&&this.appendChild(this.#f.cloneNode(!0)),!this.#t.length){this.removeAttribute("data-has-data");return}this.setAttribute("data-has-data",""),this.#o=null;let e=document.createElement("div");this.type==="sparkline"&&e.setAttribute("data-sparkline",""),this.appendChild(e);let i=document.createElementNS("http://www.w3.org/2000/svg","svg");e.appendChild(i);let r="",n="";switch(this.type){case"bar":({svg:r,viewBox:n}=this.#tt());break;case"line":({svg:r,viewBox:n}=this.#et());break;case"pie":({svg:r,viewBox:n}=this.#it());break;case"donut":({svg:r,viewBox:n}=this.#st());break;case"radar":({svg:r,viewBox:n}=this.#rt());break;case"sparkline":({svg:r,viewBox:n}=this.#K());break;case"segments":({svg:r,viewBox:n}=this.#dt());break;case"area":({svg:r,viewBox:n}=this.#W());break;case"scatter":({svg:r,viewBox:n}=this.#nt());break;case"radial-bar":({svg:r,viewBox:n}=this.#ot());break;case"gauge":({svg:r,viewBox:n}=this.#at());break;case"funnel":({svg:r,viewBox:n}=this.#lt());break;case"treemap":({svg:r,viewBox:n}=this.#ht());break;case"sankey":({svg:r,viewBox:n}=this.#ct());break;case"composed":({svg:r,viewBox:n}=this.#ut());break;case"stacked-bar":({svg:r,viewBox:n}=this.#ft());break;case"grouped-bar":({svg:r,viewBox:n}=this.#pt());break;case"multi-line":({svg:r,viewBox:n}=this.#mt());break;default:({svg:r,viewBox:n}=this.#tt());break}if(i.setAttribute("viewBox",n),i.setAttribute("preserveAspectRatio","xMidYMid meet"),i.innerHTML=r,["pie","donut","stacked-bar","grouped-bar","multi-line","radial-bar"].includes(this.type)&&!this.#v()){let o=this.#gt();o&&this.appendChild(o)}this.dispatchEvent(new CustomEvent("legend-update",{bubbles:!0}))}#m(t,e){return e?` data-slice="${t}" data-series-key="${ne(e)}" style="fill: var(--color-${e}, var(--chart-${t}))"`:` data-slice="${t}"`}#g(t,e){return e?` data-slice="${t}" data-series-key="${ne(e)}" style="stroke: var(--color-${e}, var(--chart-${t}))"`:` data-slice="${t}"`}#b=null;disconnected(){this.#i?.disconnect(),this.#i=null,this.#s&&(cancelAnimationFrame(this.#s),this.#s=null),document.removeEventListener("toggle",this.#S),document.removeEventListener("pointerdown",this.#B),this.removeEventListener("keydown",this.#T),this.removeEventListener("focus",this.#C),this.removeEventListener("blur",this.#I),this.removeEventListener("pointerover",this.#Q),this.removeEventListener("pointermove",this.#P),this.removeEventListener("pointerleave",this.#Z),this.removeEventListener("pointerdown",this.#N),this.removeEventListener("click",this.#j),this.#H()}#v(){return this.id?!!document.querySelector(`chart-legend-ui[for="${CSS.escape(this.id)}"]`):!1}#O(){return this.id?!!document.querySelector(`tooltip-ui[follows="pointer"][for="${CSS.escape(this.id)}"]`):!1}#S=t=>{let e=t.target?.closest?.("chart-legend-ui[for]");if(!e||e.getAttribute("for")!==this.id)return;let{key:i,active:r}=t.detail||{};i&&(r?this.#a.delete(i):this.#a.add(i),this.#p())};#x(t){return!!t&&this.#a.has(t)}#y(t){if(t==null||t==="")return"";let e=+t;if(!Number.isFinite(e))return String(t);switch(this.format||"abbr"){case"decimal":return e.toFixed(2);case"percent":return`${(e*100).toFixed(1)}%`;case"currency":{let r=getComputedStyle(this).getPropertyValue("--chart-currency-prefix").trim();return(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),`${r||"$"}${Tb(e)}`}default:return Tb(e)}}#w=-1;#k(){return Array.from(this.querySelectorAll("[data-tip-label], [data-tip-value]"))}#A(t){let e=this.#k();if(!e.length){this.#E();return}this.#w=Math.max(0,Math.min(t,e.length-1)),this.#$(),this.#M()}#$(){let t=this.#k();for(let i of t)i.removeAttribute("data-a11y-focus");let e=t[this.#w];if(!e)return this.removeAttribute("data-a11y-focused");e.setAttribute("data-a11y-focus",""),this.setAttribute("data-a11y-focused","")}#E(){this.#w=-1;for(let t of this.#k())t.removeAttribute("data-a11y-focus");this.removeAttribute("data-a11y-focused")}#M(){let t=this.#k()[this.#w];if(!t)return;let e=t.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.#X(t,i)}#R(){let t=this.#k()[this.#w];if(!t)return;let e=t.getBoundingClientRect(),i={clientX:e.left+e.width/2,clientY:e.top+e.height/2};this.dispatchEvent(new CustomEvent("chart-select",{bubbles:!0,detail:this.#Y(t,i)}))}#C=()=>{this.#w===-1&&this.#A(0)};#I=()=>{this.#E(),this.#L&&this.#D()};#T=t=>{let e=this.#k();if(e.length)switch(t.key){case"ArrowRight":case"ArrowDown":t.preventDefault(),this.#A(this.#w+1);break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.#A(Math.max(0,this.#w-1));break;case"Home":t.preventDefault(),this.#A(0);break;case"End":t.preventDefault(),this.#A(e.length-1);break;case"Enter":case" ":t.preventDefault(),this.#R();break;case"Escape":t.preventDefault(),this.#E(),this.#L&&this.#D();break}};#L=null;#Q=t=>{if(t.pointerType==="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");e&&(this.#U(e,t),this.#X(e,t))};#P=t=>{if(t.pointerType==="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");if(!e)return this.#L&&this.#D(),this.#H();this.#U(e,t),e!==this.#L&&this.#X(e,t)};#Z=t=>{t&&t.pointerType==="touch"||(this.#H(),this.#L&&this.#D())};#N=t=>{if(t.pointerType!=="touch")return;let e=t.target.closest("[data-tip-label], [data-tip-value]");if(!e)return this.#L&&this.#D(),this.#H();this.#U(e,t),e!==this.#L&&this.#X(e,t),document.addEventListener("pointerdown",this.#B)};#B=t=>{t.pointerType==="touch"&&(this.contains(t.target)||(this.#H(),this.#L&&this.#D(),document.removeEventListener("pointerdown",this.#B)))};#j=t=>{let e=t.target.closest("[data-tip-label], [data-tip-value]");e&&this.dispatchEvent(new CustomEvent("chart-select",{bubbles:!0,detail:this.#Y(e,t)}))};#X(t,e){this.#L=t,this.dots==="hover"&&this.#F(t),this.dispatchEvent(new CustomEvent("chart-hover",{bubbles:!0,detail:this.#Y(t,e)}))}#D(){this.#L=null,this.dots==="hover"&&this.#z(),this.dispatchEvent(new CustomEvent("chart-leave",{bubbles:!0}))}#F(t){let e=t?.previousElementSibling;this.#o&&this.#o!==e&&this.#o.removeAttribute("data-dot-active"),e&&e.hasAttribute("data-dot")?(e.setAttribute("data-dot-active",""),this.#o=e):this.#o=null}#z(){this.#o&&this.#o.removeAttribute("data-dot-active"),this.#o=null}#Y(t,e){let{tipLabel:i,tipValue:r,tipPct:n,tipSeries:o}=t.dataset,a=t.dataset.slice!=null?Number(t.dataset.slice):null,l=r!=null?Number(r):null,h=n!=null?Number(n):null,c=i??null,u=o??null,d=this.#_(c,u)??[{series:u,label:c,value:Number.isFinite(l)?l:r??null,pct:Number.isFinite(h)?h:null,slot:a}];return{label:c,value:Number.isFinite(l)?l:r??null,pct:Number.isFinite(h)?h:null,series:u,slot:a,payload:d,pointerX:e?.clientX??null,pointerY:e?.clientY??null}}#_(t,e){if(t==null)return null;let i=this.x,r=this.#q();if(!i||r.length===0)return null;let n=this.#t.find(l=>String(l[i]??"")===String(t));if(!n)return null;let o=r.filter(l=>!this.#x(l)),a=e||(o.length===1?o[0]:null);return o.map((l,h)=>{let c=+(n[l]??0);return{series:l,label:t,value:Number.isFinite(c)?c:null,pct:null,slot:h%10,hovered:l===a}})}#U(t,e){if(this.#O())return;let{tipLabel:i,tipValue:r,tipPct:n,tipSeries:o}=t.dataset;if(!this.#b){let O=document.createElement("div");O.setAttribute("popover","manual"),O.setAttribute("role","tooltip"),O.classList.add("chart-tooltip-popup"),document.body.appendChild(O),this.#b=O}let a=[];if(o&&a.push(`<span data-tip-role="series">${ne(o)}</span>`),i&&a.push(`<span data-tip-role="label">${ne(i)}</span>`),r!==void 0){let O=n!==void 0?` <span data-tip-role="pct">(${n}%)</span>`:"";a.push(`<span data-tip-role="value">${this.#y(r)}${O}</span>`)}this.#b.innerHTML=a.join("");try{this.#b.showPopover()}catch{}let l=12,h=8,{clientX:c,clientY:u}=e,d=this.#b.offsetWidth||0,f=this.#b.offsetHeight||0,p=c-d/2,m=u-f-l;p<h&&(p=h),p+d>window.innerWidth-h&&(p=window.innerWidth-d-h),m<h&&(m=u+l),this.#b.style.left=`${p}px`,this.#b.style.top=`${m}px`}#H(){if(this.#b){try{this.#b.hidePopover()}catch{}this.#b.remove(),this.#b=null}}#q(){return this.y?this.y.split(",").map(t=>t.trim()).filter(Boolean):[]}#J(t,e){switch(this.dots){case"none":return!1;case"last":return t===e-1;default:return!0}}#G(t,e,i,r,n,o){let a=n,l=o?.fontSize||10,h=o?.labelSize||l,c="",u=i;if(o?.sizeClass==="sm"&&i.length>4&&(u=i.filter((d,f)=>f%2===0||f===i.length-1)),!this.hideGrid){let f=i[i.length-1]-i[0]||1;for(let p of u){let m=a.top+(e-a.top-a.bottom)*(1-(p-i[0])/f);c+=`<line data-grid x1="${a.left}" y1="${m}" x2="${t-a.right}" y2="${m}"/>`}for(let p of u){let m=a.top+(e-a.top-a.bottom)*(1-(p-i[0])/f);c+=`<text data-y-label x="${a.left-4}" y="${m+l*.35}" text-anchor="end" font-size="${l}">${this.#y(p)}</text>`}if(r){let m=(t-a.left-a.right)/r.length,g=r.reduce((x,k)=>Math.max(x,String(k).length),1)*h*.6+h*.75,y=Math.max(1,Math.ceil(g/m)),S=r.length-1;for(let x=0;x<r.length;x++){if(x%y!==0&&x!==S||x!==S&&S-x<y)continue;let k=a.left+m*x+m/2;c+=`<text data-x-label x="${k}" y="${e-l*.5}" text-anchor="middle" font-size="${h}">${ne(r[x])}</text>`}}}return c}#tt(){let t=this.#d(),e=this.#t,i=this.#q()[0]||this.y,r=e.map(S=>+(S[i]??0)),n=e.map(S=>S[this.x]??""),o=Bi(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/e.length,p=f*.6,m=(f-p)/2,O=this.#G(l,h,o,n,c,t),g=!this.hideValues&&t.sizeClass!=="sm",y=!this.hideAverage&&r.length>1&&t.sizeClass!=="sm"&&!this.hideGrid;for(let S=0;S<e.length;S++){let x=r[S],k=a?x/a*u:0,A=c.left+f*S+m,$=c.top+u-k;O+=`<path data-bar${yt({label:n[S],value:x})} d="${lh(A,$,p,k,this.#l())}"/>`,g&&(O+=`<text data-value x="${A+p/2}" y="${$-4}" text-anchor="middle" font-size="${t.valueSize}">${this.#y(x)}</text>`)}if(y){let S=r.reduce((k,A)=>k+A,0)/r.length,x=c.top+u-(a?S/a*u:0);O+=`<line data-avg x1="${c.left}" y1="${x}" x2="${l-c.right}" y2="${x}"/>`,O+=`<text data-avg-label x="${l-c.right+2}" y="${x+3}" text-anchor="start" font-size="${t.valueSize}">${this.#y(S)}</text>`,O+=`<line data-hit${yt({label:"Average",value:S})} x1="${c.left}" y1="${x}" x2="${l-c.right}" y2="${x}" stroke="transparent" stroke-width="12"/>`}return{svg:O,viewBox:`0 0 ${l} ${h}`}}#et(){let t=this.#d(),e=this.#t,i=this.#q()[0]||this.y,r=e.map($=>+($[i]??0)),n=e.map($=>$[this.x]??""),o=Bi(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(e.length-1,1),p=this.#G(l,h,o,n,c,t),m=r.map(($,C)=>{let M=c.left+f*C,T=c.top+u-(a?$/a*u:0);return{x:M,y:T,v:$,label:n[C]}}),O=c.top+u,g=Math.max(0,Math.min(1,this.smooth));p+=`<path data-area d="${xd(m,O,g)}"/>`,p+=`<path data-line d="${Ta(m,g)}"/>`;let y=t.sizeClass==="sm",S=y?1.5:3,x=Math.max(S,10),k=!this.hideValues&&!y,A=!this.hideAverage&&r.length>1&&!y&&!this.hideGrid;if(m.forEach(($,C)=>{this.#J(C,m.length)&&(p+=`<circle data-dot cx="${$.x}" cy="${$.y}" r="${S}"/>`),p+=`<circle data-hit${yt({label:$.label,value:$.v})} cx="${$.x}" cy="${$.y}" r="${x}" fill="transparent"/>`,k&&(p+=`<text data-value x="${$.x}" y="${$.y-8}" text-anchor="middle" font-size="${t.valueSize}">${this.#y($.v)}</text>`)}),A){let $=r.reduce((M,T)=>M+T,0)/r.length,C=c.top+u-(a?$/a*u:0);p+=`<line data-avg x1="${c.left}" y1="${C}" x2="${l-c.right}" y2="${C}"/>`,p+=`<text data-avg-label x="${l-c.right+2}" y="${C+3}" text-anchor="start" font-size="${t.valueSize}">${this.#y($)}</text>`,p+=`<line data-hit${yt({label:"Average",value:$})} x1="${c.left}" y1="${C}" x2="${l-c.right}" y2="${C}" stroke="transparent" stroke-width="12"/>`}return{svg:p,viewBox:`0 0 ${l} ${h}`}}#it(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(p=>+(p[e]??0)),r=i.reduce((p,m)=>p+m,0)||1,n=t.map(p=>p[this.x]??""),o=this.#d(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.42),d="",f=-Math.PI/2;for(let p=0;p<i.length;p++){let m=i[p]/r*Math.PI*2;if(m===0)continue;let O=f+m,g=(i[p]/r*100).toFixed(1),y=` data-slice="${p%10}"${yt({label:n[p],value:i[p],pct:g})}`;Math.abs(m-Math.PI*2)<.001?d+=`<circle${y} cx="${h}" cy="${c}" r="${u}"/>`:d+=`<path${y} d="${T$(h,c,u,f,O)}"/>`,f=O}return this.#V=t.map((p,m)=>({label:n[m],value:i[m],pct:(i[m]/r*100).toFixed(1),slot:m%10})),{svg:d,viewBox:`0 0 ${a} ${l}`}}#st(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=i.reduce((g,y)=>g+y,0)||1,n=t.map(g=>g[this.x]??""),o=this.#d(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.42),d=u*.72,f="",p=-Math.PI/2;for(let g=0;g<i.length;g++){let y=i[g]/r*Math.PI*2;if(y===0)continue;let S=p+y,x=(i[g]/r*100).toFixed(1),k=` data-slice="${g%10}"${yt({label:n[g],value:i[g],pct:x})}`;Math.abs(y-Math.PI*2)<.001?(f+=`<circle${k} cx="${h}" cy="${c}" r="${(u+d)/2}" fill="none" stroke-width="${u-d}" style="fill:none"/>`,f+=`<path${k} d="M ${h-u} ${c} A ${u} ${u} 0 1 1 ${h+u} ${c} A ${u} ${u} 0 1 1 ${h-u} ${c} Z M ${h-d} ${c} A ${d} ${d} 0 1 0 ${h+d} ${c} A ${d} ${d} 0 1 0 ${h-d} ${c} Z" fill-rule="evenodd"/>`):f+=`<path${k} d="${yd(h,c,u,d,p,S,this.#l())}"/>`,p=S}let m=Math.max(14,Math.round(u*.32)),O=Math.max(9,Math.round(u*.16));return f+=`<text data-donut-total x="${h}" y="${c}" text-anchor="middle" dominant-baseline="central" font-size="${m}">${this.#y(r)}</text>`,f+=`<text data-donut-label x="${h}" y="${c+m}" text-anchor="middle" dominant-baseline="central" font-size="${O}">Total</text>`,this.#V=t.map((g,y)=>({label:n[y],value:i[y],pct:(i[y]/r*100).toFixed(1),slot:y%10})),{svg:f,viewBox:`0 0 ${a} ${l}`}}#rt(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(k=>+(k[e]??0)),r=t.map(k=>k[this.x]??""),n=Math.max(...i)||1,o=t.length,a=this.#d(),{width:l,height:h,fontSize:c}=a,u=l/2,d=h/2,f=c*3.5,p=Math.max(40,Math.min(l,h)/2-f),m="",O=Math.PI*2/o;for(let k=1;k<=3;k++){let A=p*k/3,$="";for(let C=0;C<o;C++){let M=-Math.PI/2+O*C,T=u+A*Math.cos(M),q=d+A*Math.sin(M);$+=(C===0?"M":"L")+` ${T} ${q}`}$+=" Z",m+=`<path data-grid d="${$}"/>`}for(let k=0;k<o;k++){let A=-Math.PI/2+O*k,$=u+p*Math.cos(A),C=d+p*Math.sin(A);m+=`<line data-grid x1="${u}" y1="${d}" x2="${$}" y2="${C}"/>`}let g="",y=[];for(let k=0;k<o;k++){let A=-Math.PI/2+O*k,$=i[k]/n*p,C=u+$*Math.cos(A),M=d+$*Math.sin(A);g+=(k===0?"M":"L")+` ${C} ${M}`,y.push({px:C,py:M})}g+=" Z",m+=`<path data-radar-fill d="${g}"/>`,m+=`<path data-radar-line d="${g}"/>`;let S=Math.max(c,10);for(let k=0;k<o;k++){let{px:A,py:$}=y[k];m+=`<circle data-hit${yt({label:r[k],value:i[k]})} cx="${A}" cy="${$}" r="${S}" fill="transparent"/>`}let x=c*1.3;for(let k=0;k<o;k++){let A=-Math.PI/2+O*k,$=u+(p+x)*Math.cos(A),C=d+(p+x)*Math.sin(A),M=Math.abs(Math.cos(A))<.1?"middle":Math.cos(A)>0?"start":"end";m+=`<text data-x-label x="${$}" y="${C}" text-anchor="${M}" dominant-baseline="central" font-size="${c}">${ne(r[k])}</text>`}return{svg:m,viewBox:`0 0 ${l} ${h}`}}#K(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=Bi(0,Math.max(...i),5),n=r[r.length-1],o=this.clientWidth||120,a=this.clientHeight||32,l=Math.max(40,o),h=Math.max(16,a),c=l/Math.max(i.length-1,1),u=Math.max(2,Math.min(6,h*.1)),d=t.map(g=>g[this.x]??""),f=i.map((g,y)=>({x:c*y,y:h-(n?g/n*(h-u*2):0)-u,v:g,label:d[y]})),p=Math.max(0,Math.min(1,this.smooth)),m="";m+=`<path data-area d="${xd(f,h,p)}"/>`,m+=`<path data-line d="${Ta(f,p)}"/>`;let O=Math.max(c/2,6);for(let g of f)m+=`<circle data-hit${yt({label:g.label,value:g.v})} cx="${g.x}" cy="${g.y}" r="${O}" fill="transparent"/>`;return{svg:m,viewBox:`0 0 ${l} ${h}`}}#W(){return this.#et()}#nt(){let t=this.#d(),e=this.#t,i=this.#q()[0]||this.y,r=e.map(g=>+(g[i]??0)),n=e.map(g=>g[this.x]??""),o=Bi(0,Math.max(...r),5),a=o[o.length-1],{width:l,height:h,pad:c}=t,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(e.length-1,1),p=this.#G(l,h,o,n,c,t),m=t.sizeClass==="sm"?2.5:4,O=Math.max(m*2,10);for(let g=0;g<r.length;g++){let y=c.left+f*g,S=c.top+u-(a?r[g]/a*u:0);p+=`<circle data-dot data-scatter cx="${y}" cy="${S}" r="${m}"/>`,p+=`<circle data-hit${yt({label:n[g],value:r[g]})} cx="${y}" cy="${S}" r="${O}" fill="transparent"/>`}return{svg:p,viewBox:`0 0 ${l} ${h}`}}#ot(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(g=>+(g[e]??0)),r=t.map(g=>g[this.x]??""),n=Math.max(...i)||1,o=this.#d(),{width:a,height:l}=o,h=a/2,c=l/2,u=Math.max(30,Math.min(a,l)*.45),d=u*.3,f=i.length||1,p=(u-d)/f,m=Math.min(2,p*.15),O="";for(let g=0;g<i.length;g++){let y=d+p*g+m/2,S=d+p*(g+1)-m/2,x=(y+S)/2,k=S-y,A=2*Math.PI*x,$=Math.max(0,Math.min(1,i[g]/n))*A;if(O+=`<circle data-radial-track cx="${h}" cy="${c}" r="${x}" fill="none" stroke-width="${k}"/>`,$<=0)continue;let C=(i[g]/n*100).toFixed(1),M=yt({label:r[g],value:i[g],pct:C}),T=Math.abs($-A)<.5,q=T?"butt":"round",I=T?`${A} 0`:`${$} ${A-$}`;O+=`<circle data-slice="${g%10}"${M} data-radial-bar cx="${h}" cy="${c}" r="${x}" fill="none" stroke-width="${k}" stroke-linecap="${q}" stroke-dasharray="${I}" transform="rotate(-90 ${h} ${c})"/>`}return this.#V=t.map((g,y)=>({label:r[y],key:r[y],value:i[y],pct:(i[y]/n*100).toFixed(1),slot:y%10})),{svg:O,viewBox:`0 0 ${a} ${l}`}}#at(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(x=>+(x[e]??0)),r=i.reduce((x,k)=>x+k,0)||1,n=i[0]??0,o=t[0]?.max!=null?+t[0].max:i.length===1?Math.max(n,1):r,a=Math.max(0,Math.min(1,n/o)),l=this.#d(),{width:h,height:c}=l,u=h/2,d=c*.68,f=Math.max(40,Math.min(h*.45,c*.6)),p=f*.72,m=(f-p)/2,O="";if(O+=`<path data-radial-track d="${yd(u,d,f,p,Math.PI,2*Math.PI,m)}"/>`,a>0){let x=Math.PI+Math.PI*a,k=yt({label:t[0]?.[this.x]??"Value",value:n,pct:(a*100).toFixed(1)});O+=`<path data-slice="0"${k} data-gauge-fill d="${yd(u,d,f,p,Math.PI,x,m)}"/>`}let g=Math.max(18,Math.round(f*.42)),y=Math.max(10,Math.round(f*.2)),S=d-f*.15;return O+=`<text data-gauge-value x="${u}" y="${S}" text-anchor="middle" dominant-baseline="central" font-size="${g}">${this.#y(n)}</text>`,o!==n&&(O+=`<text data-gauge-max x="${u}" y="${S+g*.8}" text-anchor="middle" dominant-baseline="central" font-size="${y}">of ${this.#y(o)}</text>`),{svg:O,viewBox:`0 0 ${h} ${c}`}}#lt(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(S=>+(S[e]??0)),r=t.map(S=>S[this.x]??""),n=i.length;if(n===0)return{svg:"",viewBox:"0 0 100 100"};let o=Math.max(...i)||1,a=this.#d(),{width:l,height:h}=a,c=a.fontSize,u=Math.max(l*.18,80),d=c*.8,f=l-u*2,m=(h-d*2)/n,O=Math.max(2,m*.08),g=l/2,y="";for(let S=0;S<n;S++){let x=i[S],k=S<n-1?i[S+1]:i[S],A=x/o*(f/2),$=k/o*(f/2),C=d+m*S+O/2,M=d+m*(S+1)-O/2,T=(x/o*100).toFixed(1),q=yt({label:r[S],value:x,pct:T}),I=`M ${g-A} ${C} L ${g+A} ${C} L ${g+$} ${M} L ${g-$} ${M} Z`;if(y+=`<path data-slice="${S%10}" data-funnel-stage${q} d="${I}"/>`,y+=`<text data-funnel-label x="${u-8}" y="${C+m/2}" text-anchor="end" dominant-baseline="central" font-size="${c}">${ne(r[S])}</text>`,y+=`<text data-funnel-value x="${l-u+8}" y="${C+m/2}" text-anchor="start" dominant-baseline="central" font-size="${c}">${this.#y(x)}</text>`,S>0){let _=(i[S]/i[0]*100).toFixed(0);y+=`<text data-funnel-drop x="${l-u+8}" y="${C+m/2+c*1.1}" text-anchor="start" dominant-baseline="central" font-size="${c*.85}">${_}%</text>`}}return this.#V=t.map((S,x)=>({label:r[x],value:i[x],pct:(i[x]/o*100).toFixed(1),slot:x%10})),{svg:y,viewBox:`0 0 ${l} ${h}`}}#ht(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(T=>+(T[e]??0)),r=t.map(T=>T[this.x]??""),n=i.length;if(n===0)return{svg:"",viewBox:"0 0 100 100"};let o=this.#d(),{width:a,height:l,fontSize:h}=o,c=i.reduce((T,q)=>T+q,0)||1,u=Array.from({length:n},(T,q)=>q).sort((T,q)=>i[q]-i[T]),d=[],f=a*l,p=u.map(T=>i[T]/c*f),m=0,O=0,g=a,y=l,S=[],x=0,k=(T,q)=>{if(T.length===0)return 1/0;let I=T.reduce((nt,bt)=>nt+bt,0),_=Math.max(...T),F=Math.min(...T),Y=q*q,tt=I*I;return Math.max(Y*_/tt,tt/(Y*F))},A=(T,q,I,_,F,Y)=>{let tt=T.reduce((Pt,At)=>Pt+At,0),nt=F>=Y,bt=nt?tt/F:Y,mt=nt?F:tt/Y,kt=0;for(let Pt=0;Pt<T.length;Pt++){let At=T[Pt]/tt,Ft=u[q+Pt];if(nt){let Yt=At*F;d.push({i:Ft,x:I+kt,y:_,w:Yt,h:bt}),kt+=Yt}else{let Yt=At*Y;d.push({i:Ft,x:I,y:_+kt,w:mt,h:Yt}),kt+=Yt}}return nt?{x:I,y:_+bt,w:F,h:Y-bt}:{x:I+mt,y:_,w:F-mt,h:Y}},$=p.slice();for(;$.length>0;){S=[$[0]],x=p.length-$.length;let T=Math.min(g,y),q=1;for(;q<$.length;){let _=S.concat($[q]);if(k(_,T)>k(S,T))break;S=_,q++}let I=A(S,x,m,O,g,y);m=I.x,O=I.y,g=I.w,y=I.h,$=$.slice(S.length)}let C="",M=2;for(let T of d){let q=(i[T.i]/c*100).toFixed(1),I=yt({label:r[T.i],value:i[T.i],pct:q});C+=`<rect data-slice="${T.i%10}" data-treemap-tile${I} x="${T.x+M}" y="${T.y+M}" width="${Math.max(0,T.w-M*2)}" height="${Math.max(0,T.h-M*2)}" rx="${this.#l()}"/>`;let _=T.x+8,F=T.w>h*4,Y=F&&T.h>h*2.5,tt=F&&!Y&&T.h>h*1.2;if(Y)C+=`<text data-treemap-label x="${_}" y="${T.y+h+4}" font-size="${h}" dominant-baseline="hanging">${ne(r[T.i])}</text>`,C+=`<text data-treemap-value x="${_}" y="${T.y+h*2+6}" font-size="${h*.9}" dominant-baseline="hanging">${this.#y(i[T.i])}</text>`;else if(tt){let nt=T.y+T.h/2;C+=`<text data-treemap-label x="${_}" y="${nt}" font-size="${h}" dominant-baseline="central">${ne(r[T.i])}</text>`}}return this.#V=t.map((T,q)=>({label:r[q],value:i[q],pct:(i[q]/c*100).toFixed(1),slot:q%10})),{svg:C,viewBox:`0 0 ${a} ${l}`}}#ct(){let t=this.#t;if(!t.length)return{svg:"",viewBox:"0 0 100 100"};let e=new Map,i=new Map;for(let x of t){let k=x.source??x.from??"",A=x.target??x.to??"",$=+(x.value??x.v??0);e.has(k)||e.set(k,{name:k,flow:0}),i.has(A)||i.set(A,{name:A,flow:0}),e.get(k).flow+=$,i.get(A).flow+=$}let r=this.#d(),{width:n,height:o,fontSize:a}=r,l=Math.max(8,n*.03),h=l+a*5,c=[...e.values()].reduce((x,k)=>x+k.flow,0)||1,u=[...i.values()].reduce((x,k)=>x+k.flow,0)||1,d=a*.6,f=[...e.values()],p=[...i.values()],m=o-d*(f.length-1),O=o-d*(p.length-1),g=0;for(let x of f){let k=x.flow/c*m;x.y0=g,x.y1=g+k,x.cursor=g,g+=k+d}g=0;for(let x of p){let k=x.flow/u*O;x.y0=g,x.y1=g+k,x.cursor=g,g+=k+d}let y="",S=Math.min(this.#l(),l/2);f.forEach((x,k)=>{y+=`<rect data-sankey-node data-slice="${k%10}" x="${h-l}" y="${x.y0}" width="${l}" height="${x.y1-x.y0}" rx="${S}"/>`,y+=`<text data-sankey-label x="${h-l-6}" y="${(x.y0+x.y1)/2}" text-anchor="end" dominant-baseline="central" font-size="${a}">${ne(x.name)}</text>`}),p.forEach((x,k)=>{y+=`<rect data-sankey-node data-slice="${(f.length+k)%10}" x="${n-h}" y="${x.y0}" width="${l}" height="${x.y1-x.y0}" rx="${S}"/>`,y+=`<text data-sankey-label x="${n-h+l+6}" y="${(x.y0+x.y1)/2}" text-anchor="start" dominant-baseline="central" font-size="${a}">${ne(x.name)}</text>`});for(let x of t){let k=e.get(x.source??x.from??""),A=i.get(x.target??x.to??"");if(!k||!A)continue;let $=+(x.value??x.v??0);if($<=0)continue;let C=$/c*m,M=$/u*O,T=k.cursor,q=T+C,I=A.cursor,_=I+M;k.cursor+=C,A.cursor+=M;let F=h,Y=n-h,tt=(F+Y)/2,nt=yt({label:`${k.name} \u2192 ${A.name}`,value:$}),bt=`M ${F} ${T} C ${tt} ${T}, ${tt} ${I}, ${Y} ${I} L ${Y} ${_} C ${tt} ${_}, ${tt} ${q}, ${F} ${q} Z`;y+=`<path data-sankey-link${nt} d="${bt}"/>`}return{svg:y,viewBox:`0 0 ${n} ${o}`}}#ut(){let t=this.#d(),e=this.#t,i=this.#q(),r=i[0]||"bar",n=i[1]||"line",o=e.map(A=>A[this.x]??""),a=e.map(A=>+(A[r]??0)),l=e.map(A=>+(A[n]??0)),h=[...a,...l],c=Bi(0,Math.max(...h),5),u=c[c.length-1],{width:d,height:f,pad:p}=t,m=f-p.top-p.bottom,O=d-p.left-p.right,g=O/e.length,y=g*.6,S=(g-y)/2,x=O/Math.max(e.length-1,1),k=this.#G(d,f,c,o,p,t);if(!this.#x(r))for(let A=0;A<e.length;A++){let $=a[A],C=u?$/u*m:0,M=p.left+g*A+S,T=p.top+m-C;k+=`<path${this.#m(0,r)}${yt({label:o[A],value:$,series:r})} d="${lh(M,T,y,C,this.#l())}"/>`}if(!this.#x(n)){let A=l.map((C,M)=>({x:p.left+g*M+g/2,y:p.top+m-(u?C/u*m:0),v:C,label:o[M]})),$=Math.max(0,Math.min(1,this.smooth));k+=`<path data-line${this.#g(1,n)} d="${Ta(A,$)}"/>`;for(let C of A)k+=`<circle data-dot${this.#m(1,n)} cx="${C.x}" cy="${C.y}" r="3"/>`,k+=`<circle data-hit${yt({label:C.label,value:C.v,series:n})} cx="${C.x}" cy="${C.y}" r="10" fill="transparent"/>`}return this.#V=[{label:r,key:r,slot:0},{label:n,key:n,slot:1}],{svg:k,viewBox:`0 0 ${d} ${f}`}}#dt(){let t=this.#t,e=this.#q()[0]||this.y,i=t.map(p=>+(p[e]??0)),r=i.reduce((p,m)=>p+m,0)||1,n=t.map(p=>p[this.x]??""),o=getComputedStyle(this),a=Math.max(40,this.clientWidth||200),l=24,h=Math.min(this.#l(),l/2),c=Math.max(0,parseFloat(o.getPropertyValue("--chart-segments-gap"))||2),u=[],d=0;for(let p=0;p<i.length;p++){let m=p===i.length-1?a:Math.round((d*r+i[p]*a)/r),O=p===i.length-1?a:i.slice(0,p+1).reduce((y,S)=>y+S,0)/r*a,g=p===0?0:i.slice(0,p).reduce((y,S)=>y+S,0)/r*a;u.push({x:g,w:Math.max(0,O-g)}),d=m}let f="";for(let p=0;p<u.length;p++){let{x:m,w:O}=u[p];if(O<=0)continue;let g=p===0,y=p===u.length-1,S=Math.max(0,O-(y?0:c)),x=(i[p]/r*100).toFixed(1),k=yt({label:n[p],value:i[p],pct:x}),A=`<title>${ne(n[p])}: ${i[p]} (${x}%)</title>`;if(g&&y||!g&&!y||h===0)f+=`<rect data-slice="${p%10}"${k} x="${m}" y="0" width="${S}" height="${l}"${(g||y)&&h?` rx="${h}"`:""}>${A}</rect>`;else{let $=h,C=m+S,M;g?M=`M ${m+$} 0 H ${C} V ${l} H ${m+$} A ${$} ${$} 0 0 1 ${m} ${l-$} V ${$} A ${$} ${$} 0 0 1 ${m+$} 0 Z`:M=`M ${m} 0 H ${C-$} A ${$} ${$} 0 0 1 ${C} ${$} V ${l-$} A ${$} ${$} 0 0 1 ${C-$} ${l} H ${m} Z`,f+=`<path data-slice="${p%10}"${k} d="${M}">${A}</path>`}}return this.#V=t.map((p,m)=>({label:n[m],value:i[m],pct:(i[m]/r*100).toFixed(1),slot:m%10})),{svg:f,viewBox:`0 0 ${a} ${l}`}}#ft(){let t=this.#t,e=this.#q(),i=t.map(g=>g[this.x]??""),r=t.map(g=>e.reduce((y,S)=>y+ +(g[S]??0),0)),n=Bi(0,Math.max(...r),5),o=n[n.length-1],a=this.#d(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/t.length,p=f*.6,m=(f-p)/2,O=this.#G(l,h,n,i,c,a);for(let g=0;g<t.length;g++){let y=c.top+u,S=e.length;for(let x=0;x<S;x++){if(this.#x(e[x]))continue;let k=+(t[g][e[x]]??0),A=o?k/o*u:0;if(A<=0){y-=A;continue}y-=A;let $=c.left+f*g+m,C=y,M=A,T=x===S-1,q=this.#l(),I=`${this.#m(x%10,e[x])}${yt({label:i[g],value:k,series:e[x]})}`;T?O+=`<path${I} d="${lh($,C,p,M,q)}"/>`:O+=`<rect${I} x="${$}" y="${C}" width="${p}" height="${M}"/>`}}return this.#V=e.map((g,y)=>({label:g,key:g,slot:y%10})),{svg:O,viewBox:`0 0 ${l} ${h}`}}#pt(){let t=this.#t,e=this.#q(),i=t.map(S=>S[this.x]??""),r=t.flatMap(S=>e.map(x=>+(S[x]??0))),n=Bi(0,Math.max(...r),5),o=n[n.length-1],a=this.#d(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/t.length,p=3,m=f*.7,O=(m-p*(e.length-1))/e.length,g=(f-m)/2,y=this.#G(l,h,n,i,c,a);for(let S=0;S<t.length;S++)for(let x=0;x<e.length;x++){if(this.#x(e[x]))continue;let k=+(t[S][e[x]]??0),A=o?k/o*u:0,$=c.left+f*S+g+(O+p)*x,C=c.top+u-A;y+=`<path${this.#m(x%10,e[x])}${yt({label:i[S],value:k,series:e[x]})} d="${lh($,C,O,A,this.#l())}"/>`,this.hideValues||(y+=`<text data-value x="${$+O/2}" y="${C-4}" text-anchor="middle" font-size="${a.valueSize}">${this.#y(k)}</text>`)}return this.#V=e.map((S,x)=>({label:S,key:S,slot:x%10})),{svg:y,viewBox:`0 0 ${l} ${h}`}}#mt(){let t=this.#t,e=this.#q(),i=t.map(m=>m[this.x]??""),r=t.flatMap(m=>e.map(O=>+(m[O]??0))),n=Bi(0,Math.max(...r),5),o=n[n.length-1],a=this.#d(),{width:l,height:h,pad:c}=a,u=h-c.top-c.bottom,f=(l-c.left-c.right)/Math.max(t.length-1,1),p=this.#G(l,h,n,i,c,a);for(let m=0;m<e.length;m++){if(this.#x(e[m]))continue;let g=t.map($=>+($[e[m]]??0)).map(($,C)=>{let M=c.left+f*C,T=c.top+u-(o?$/o*u:0);return{x:M,y:T,v:$,label:i[C]}}),y=c.top+u,S=Math.max(0,Math.min(1,this.smooth)),x=this.seriesEmphasis,k=!x||e[m]===x,A=k?"":" data-deemphasized";k&&(p+=`<path data-area${this.#m(m%10,e[m])} d="${xd(g,y,S)}"/>`),p+=`<path data-line${this.#g(m%10,e[m])}${A} d="${Ta(g,S)}"/>`,g.forEach(($,C)=>{this.#J(C,g.length)&&(p+=`<circle data-dot${this.#m(m%10,e[m])}${A} cx="${$.x}" cy="${$.y}" r="3"/>`),p+=`<circle data-hit${yt({label:$.label,value:$.v,series:e[m]})} cx="${$.x}" cy="${$.y}" r="10" fill="transparent"/>`})}return this.#V=e.map((m,O)=>({label:m,key:m,slot:O%10})),{svg:p,viewBox:`0 0 ${l} ${h}`}}#V=null;get legendData(){return this.#V?this.#V.map(t=>({...t})):null}#gt(){if(!this.#V||!this.#V.length)return null;let t=document.createElement("div");t.setAttribute("data-legend","");for(let e of this.#V){let i=document.createElement("span");i.setAttribute("data-legend-item",""),e.key&&i.setAttribute("data-series-key",e.key);let r=document.createElement("span");r.setAttribute("data-legend-dot",""),r.setAttribute("data-slice",String(e.slot)),e.key&&(r.style.background=`var(--color-${e.key}, var(--chart-${e.slot}))`),i.appendChild(r);let n=document.createElement("span");n.textContent=e.pct?`${e.label} (${e.pct}%)`:e.label,i.appendChild(n),t.appendChild(i)}return t}};E();v("chart-ui",yn);Q();var xn=class s extends w{static properties={for:{type:String,default:"",reflect:!0},items:{type:String,default:"",reflect:!1},shape:{type:String,default:"dot",reflect:!0},position:{type:String,default:"bottom",reflect:!0},static:{type:Boolean,default:!1,reflect:!0},onToggle:{type:String,default:"hide",reflect:!0,attribute:"on-toggle"}};static template=()=>null;#t=null;#e=null;#i=new Set;connected(){this.setAttribute("role","list"),this.#s(),this.#a()}disconnected(){this.#r()}render(){this.#s(),this.#a()}#s(){if(this.#r(),!this.for)return;let t=this.getRootNode()?.getElementById?.(this.for)||document.getElementById(this.for);if(!t){s._warned||(s._warned=new WeakSet);let e={el:this,id:this.for};s._warned.has(this)||(console.warn(`[chart-legend-ui] [for="${this.for}"] did not resolve to an element.`),s._warned.add(this));return}this.#t=t,this.#e=()=>this.#a(),t.addEventListener("legend-update",this.#e)}#r(){this.#t&&this.#e&&this.#t.removeEventListener("legend-update",this.#e),this.#t=null,this.#e=null}#n(){if(this.items)try{let t=JSON.parse(this.items);if(Array.isArray(t))return t}catch{}return this.#t&&Array.isArray(this.#t.legendData)?this.#t.legendData:[]}#a(){let t=this.#n();if(this.innerHTML="",!!t.length)for(let e of t){let i=e.key??e.label??"",r=e.label??i,n=e.slot!=null?e.slot:0,o=!this.#i.has(i),a=document.createElement("badge-ui");a.setAttribute("data-row",""),a.setAttribute("role",this.static?"listitem":"button"),a.setAttribute("text",r),i&&a.setAttribute("data-key",i),o&&a.setAttribute("data-active",""),this.static||(a.setAttribute("tabindex","0"),a.setAttribute("aria-pressed",o?"true":"false"));let l=this.shape||"dot",h=document.createElement("swatch-ui");h.setAttribute("shape",l),h.setAttribute("size","sm");let c=i?`var(--color-${i}, var(--a-data-${n}))`:`var(--a-data-${n})`;h.style.setProperty("--swatch-color",c),a.appendChild(h),this.static||(a.addEventListener("click",u=>this.#o(u,i)),a.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),this.#o(u,i))})),this.appendChild(a)}}#o(t,e){if(!e)return;let r=!!this.#i.has(e);r?this.#i.delete(e):this.#i.add(e);let n=t.currentTarget;r?n.setAttribute("data-active",""):n.removeAttribute("data-active"),n.setAttribute("aria-pressed",r?"true":"false"),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{key:e,active:r,mode:this.onToggle||"hide"}}))}};E();v("chart-legend-ui",xn);Q();var M$=120,Sn=class extends w{static properties={placement:{type:String,default:"bottom",reflect:!0},gap:{type:Number,default:4,reflect:!0},open:{type:Boolean,default:!1,reflect:!0},trigger:{type:String,default:"click",reflect:!0},matchWidth:{type:Boolean,default:!1,reflect:!0,attribute:"match-width"}};static template=()=>null;#t=null;#e=!1;#i=null;#s=null;#r=null;connected(){let t=this.querySelector('[slot="content"]');t&&(t.hasAttribute("popover")||t.setAttribute("popover","manual"),t.addEventListener("toggle",this.#d),this.#s=t),this.#e||(this.#e=!0,this.trigger==="click"&&this.addEventListener("click",this.#o),this.trigger==="hover"&&(this.addEventListener("pointerenter",this.#h),this.addEventListener("pointerleave",this.#u),t&&(t.addEventListener("pointerenter",this.#h),t.addEventListener("pointerleave",this.#u))))}render(){this.open?this.#n():this.#a()}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}#n(){let t=this.querySelector('[slot="trigger"]'),e=this.#s??this.querySelector('[slot="content"]');if(!(!t||!e)){if(!e.matches(":popover-open"))try{e.showPopover()}catch{}this.#t?.(),this.#t=ht(t,e,{placement:this.placement,gap:this.gap,matchWidth:this.matchWidth}),(this.trigger==="click"||this.trigger==="manual")&&(this.#r=requestAnimationFrame(()=>{this.#r=null,document.addEventListener("pointerdown",this.#l),document.addEventListener("keydown",this.#c)}))}}#a(){this.#t?.(),this.#t=null;let t=this.#s??this.querySelector('[slot="content"]');if(t?.matches(":popover-open"))try{t.hidePopover()}catch{}this.#r!=null&&(cancelAnimationFrame(this.#r),this.#r=null),document.removeEventListener("pointerdown",this.#l),document.removeEventListener("keydown",this.#c)}#o=t=>{let e=this.querySelector('[slot="trigger"]');e&&(t.target===e||e.contains(t.target))&&(this.open=!this.open)};#l=t=>{if(!this.open)return;let e=this.#s;this.contains(t.target)||e?.contains(t.target)||(this.open=!1)};#c=t=>{t.key==="Escape"&&this.open&&(t.stopPropagation(),this.open=!1)};#h=()=>{clearTimeout(this.#i),this.open=!0};#u=()=>{clearTimeout(this.#i),this.#i=setTimeout(()=>{this.open=!1},M$)};#d=t=>{let e=t.newState==="open";e!==this.open&&(this.open=e)};disconnected(){clearTimeout(this.#i),this.#a(),this.trigger==="click"&&this.removeEventListener("click",this.#o),this.trigger==="hover"&&(this.removeEventListener("pointerenter",this.#h),this.removeEventListener("pointerleave",this.#u),this.#s&&(this.#s.removeEventListener("pointerenter",this.#h),this.#s.removeEventListener("pointerleave",this.#u))),this.#s?.removeEventListener("toggle",this.#d),this.#s=null,this.#e=!1}};E();v("popover-ui",Sn);Q();var wn=class extends w{static requiredIcons=["caret-down"];static properties={multiple:{type:Boolean,default:!1,reflect:!0},variant:{type:String,default:"flat",reflect:!0}};static template=()=>null;connected(){this.addEventListener("toggle",this.#t)}disconnected(){this.removeEventListener("toggle",this.#t)}#t=t=>{if(this.multiple)return;let e=t.target;if(!e.open)return;let i=this.querySelectorAll("accordion-item-ui");for(let r of i)r!==e&&r.open&&(r.open=!1)}},kn=class extends w{static properties={text:{type:String,default:"",reflect:!0},open:{type:Boolean,default:!1,reflect:!0},variant:{type:String,default:"flat",reflect:!0}};static template=()=>null;#t=!1;connected(){let t=this.querySelector('[slot="header"]');if(t){if(!t.querySelector('[slot="caret"]')){let e=document.createElement("icon-ui");e.setAttribute("name","caret-down"),e.setAttribute("slot","caret"),t.appendChild(e)}}else{let e=document.createElement("div");e.setAttribute("slot","header"),e.setAttribute("tabindex","0"),e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),e.dataset.autofocusable="";let i=document.createElement("span");i.setAttribute("slot","header-text"),i.dataset.autolabel="",e.appendChild(i);let r=document.createElement("icon-ui");r.setAttribute("name","caret-down"),r.setAttribute("slot","caret"),e.appendChild(r),this.prepend(e)}if(!this.querySelector('[slot="body"]')){let e=document.createElement("div");e.setAttribute("slot","body");let i=[...this.childNodes].filter(r=>r.nodeType===1?!r.hasAttribute("slot"):r.nodeType===3&&r.textContent.trim());for(let r of i)e.appendChild(r);this.appendChild(e)}this.#t||(this.#t=!0,this.addEventListener("click",this.#e),this.addEventListener("keydown",this.#i))}disconnected(){this.removeEventListener("click",this.#e),this.removeEventListener("keydown",this.#i),this.#t=!1}render(){let t=this.querySelector('[slot="header-text"][data-autolabel]');t&&(t.textContent=this.text);let e=this.querySelector('[slot="header"][data-autofocusable]');e&&e.setAttribute("aria-expanded",String(this.open))}#e=t=>{let e=this.querySelector('[slot="header"]');!e||!e.contains(t.target)||t.target.closest('[slot="action"], [slot="actions"], [data-no-toggle]')||(this.open=!this.open,this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{open:this.open}})))};#i=t=>{let e=this.querySelector('[slot="header"][data-autofocusable]');!e||t.target!==e||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e.click())}};E();v("accordion-ui",wn),v("accordion-item-ui",kn);Q();var An=class extends w{static properties={label:{type:String,default:"",reflect:!0},vertical:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","separator")}render(){if(this.vertical?this.setAttribute("aria-orientation","vertical"):this.removeAttribute("aria-orientation"),this.label){let t=this.querySelector('[slot="label"]');t||(t=document.createElement("span"),t.setAttribute("slot","label"),this.appendChild(t)),t.textContent=this.label}else{let t=this.querySelector('[slot="label"]');t&&t.remove()}}};E();v("divider-ui",An);Q();var $n=class extends w{static properties={cite:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("role")||this.setAttribute("role","blockquote")}render(){let t=this.querySelector('[slot="cite"]:not([data-cite-stamped])'),e=this.querySelector('[slot="cite"][data-cite-stamped]');if(t){e?.remove();return}if(this.cite)if(e)e.textContent=this.cite;else{let i=document.createElement("span");i.setAttribute("slot","cite"),i.setAttribute("data-cite-stamped",""),i.textContent=this.cite,this.appendChild(i)}else e&&e.remove()}};E();v("blockquote-ui",$n);Q();var Sd=[{limit:60,unit:"second",divisor:1},{limit:3600,unit:"minute",divisor:60},{limit:3600*24,unit:"hour",divisor:3600},{limit:3600*24*7,unit:"day",divisor:3600*24},{limit:3600*24*30,unit:"week",divisor:3600*24*7},{limit:3600*24*365,unit:"month",divisor:3600*24*30},{limit:1/0,unit:"year",divisor:3600*24*365}],Cn=class extends w{static properties={datetime:{type:String,default:"",reflect:!0},timeStyle:{type:String,default:"long",reflect:!0,attribute:"time-style"},numeric:{type:String,default:"auto",reflect:!0},locale:{type:String,default:"",reflect:!0},updateInterval:{type:Number,default:60,reflect:!0,attribute:"update-interval"}};static template=()=>null;#t=null;#e(){return this.locale?this.locale:this.ownerDocument?.documentElement?.lang||void 0}#i(){if(!this.datetime)return"";let t=new Date(this.datetime);if(Number.isNaN(t.getTime()))return"";let e=(t.getTime()-Date.now())/1e3,i=Math.abs(e),r=Sd.find(o=>i<=o.limit)||Sd[Sd.length-1],n=Math.round(e/r.divisor);try{return new Intl.RelativeTimeFormat(this.#e(),{style:this.timeStyle,numeric:this.numeric}).format(n,r.unit)}catch{let o=e<0,a=Math.abs(n);return o?`${a} ${r.unit}${a===1?"":"s"} ago`:`in ${a} ${r.unit}${a===1?"":"s"}`}}#s(){if(!this.datetime)return"";let t=new Date(this.datetime);if(Number.isNaN(t.getTime()))return"";try{return new Intl.DateTimeFormat(this.#e(),{dateStyle:"full",timeStyle:"long"}).format(t)}catch{return t.toString()}}connected(){super.connected(),this.hasAttribute("role")||this.setAttribute("role","time"),this.#r()}render(){let t=this.#i();this.textContent=t,t&&!this.hasAttribute("data-suppress-title")&&this.setAttribute("title",this.#s()),this.datetime&&this.setAttribute("datetime",this.datetime),this.#r()}#r(){this.#n();let t=Number(this.updateInterval);!Number.isFinite(t)||t<=0||(this.#t=setInterval(()=>{this.textContent=this.#i()},t*1e3))}#n(){this.#t!=null&&(clearInterval(this.#t),this.#t=null)}disconnected(){super.disconnected(),this.#n()}};E();v("relative-time-ui",Cn);Q();var En=class extends w{static properties={value:{type:Number,default:0,reflect:!0},numberStyle:{type:String,default:"decimal",reflect:!0,attribute:"number-style"},currency:{type:String,default:"",reflect:!0},unit:{type:String,default:"",reflect:!0},notation:{type:String,default:"standard",reflect:!0},compactDisplay:{type:String,default:"short",reflect:!0,attribute:"compact-display"},minimumFractionDigits:{type:Number,default:0,reflect:!0,attribute:"minimum-fraction-digits"},maximumFractionDigits:{type:Number,default:2,reflect:!0,attribute:"maximum-fraction-digits"},locale:{type:String,default:"",reflect:!0},signDisplay:{type:String,default:"auto",reflect:!0,attribute:"sign-display"}};static template=()=>null;#t(){return this.locale?this.locale:this.ownerDocument?.documentElement?.lang||void 0}#e(){let t=Number(this.value);if(!Number.isFinite(t)||this.numberStyle==="currency"&&!this.currency||this.numberStyle==="unit"&&!this.unit)return"";let e={style:this.numberStyle,notation:this.notation,signDisplay:this.signDisplay};this.numberStyle==="currency"&&(e.currency=this.currency),this.numberStyle==="unit"&&(e.unit=this.unit),this.notation==="compact"&&(e.compactDisplay=this.compactDisplay),Number.isFinite(this.minimumFractionDigits)&&(e.minimumFractionDigits=this.minimumFractionDigits),Number.isFinite(this.maximumFractionDigits)&&(e.maximumFractionDigits=this.maximumFractionDigits);try{return new Intl.NumberFormat(this.#t(),e).format(t)}catch{return String(t)}}connected(){super.connected()}render(){let t=this.#e();this.textContent=t,t&&Number.isFinite(Number(this.value))?this.setAttribute("aria-label",`${t} (raw: ${this.value})`):this.removeAttribute("aria-label")}};E();v("number-format-ui",En);Q();var wd=["Weak","Fair","Good","Strong"];function R$(s){if(!s)return-1;let t=0;s.length>=8&&t++,s.length>=12&&t++,s.length>=16&&t++;let e=[/[a-z]/.test(s),/[A-Z]/.test(s),/[0-9]/.test(s),/[^a-zA-Z0-9]/.test(s)].filter(Boolean).length;return e>=2&&t++,e>=3&&t++,e===4&&t++,/(.)\1{2,}/.test(s)&&t--,s.length<8&&(t=Math.min(t,0)),Math.max(0,Math.min(3,t))}var Pn=class extends w{static properties={value:{type:String,default:""},minScore:{type:Number,default:2,reflect:!0,attribute:"min-score"},showLabel:{type:Boolean,default:!0,reflect:!0,attribute:"show-label"}};static template=()=>null;#t=-2;connected(){super.connected(),this.querySelector('[slot="bar"]')||(this.innerHTML=`
219
219
  <div slot="bar" aria-hidden="true">
@@ -254,7 +254,7 @@ Correct shape for <chart-ui x="label" y="value">:
254
254
  <span slot="icon">${this.icon?`<icon-ui name="${this.icon}"></icon-ui>`:""}</span>
255
255
  <span slot="text">${this.text}</span>
256
256
  ${this.badge?`<span slot="badge">${this.badge}</span>`:""}
257
- `),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}render(){let t=this.querySelector('[slot="text"]');t&&(t.textContent=this.text),this.setAttribute("tabindex",this.disabled?"-1":"0"),this.selected?this.setAttribute("aria-current","page"):this.removeAttribute("aria-current");let e=this.querySelector('[slot="icon"] icon-ui');e&&e.setAttribute("weight",this.selected?"fill":"regular")}disconnected(){this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}};E();v("nav-item-ui",Io);var Do=class extends Z{static properties={...Z.properties,length:{type:Number,default:6,reflect:!0}};static template=()=>null;#t=[];#e=t=>{let e=this.#t.indexOf(t.currentTarget);e<0||this.#o(t,e)};#i=t=>{let e=this.#t.indexOf(t.currentTarget);e<0||this.#l(t,e)};#s=t=>{this.#c(t)};connected(){super.connected(),this.setAttribute("role","group"),this.setAttribute("aria-label","One-time password"),this.#r(),this.#n()}#r(){let t=this.length||6;this.innerHTML="",this.#t=[];for(let e=0;e<t;e++){let i=document.createElement("input");i.type="text",i.maxLength=1,i.inputMode="numeric",i.autocomplete="one-time-code",i.setAttribute("slot","digit"),i.setAttribute("aria-label",`Digit ${e+1}`),this.appendChild(i),this.#t.push(i)}}#n(){for(let t of this.#t)t.addEventListener("input",this.#e),t.addEventListener("keydown",this.#i),t.addEventListener("paste",this.#s)}#a(){for(let t of this.#t)t.removeEventListener("input",this.#e),t.removeEventListener("keydown",this.#i),t.removeEventListener("paste",this.#s)}render(){if(!this.#t.length)return;let t=this.disabled;for(let e of this.#t)e.disabled=t}#o(t,e){let i=this.#t[e];i.value=i.value.replace(/\D/g,"").slice(0,1),this.#h(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:this.value}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}})),i.value&&e<this.#t.length-1&&this.#t[e+1].focus(),this.#u()}#l(t,e){t.key==="Backspace"&&!this.#t[e].value&&e>0&&(this.#t[e-1].focus(),this.#t[e-1].value="",this.#h(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:this.value}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}})))}#c(t){t.preventDefault();let e=(t.clipboardData?.getData("text/plain")||"").replace(/\D/g,"");for(let r=0;r<this.#t.length;r++)this.#t[r].value=e[r]||"";this.#h(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:this.value}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}}));let i=this.#t.findIndex(r=>!r.value);i>=0?this.#t[i].focus():this.#t[this.#t.length-1].focus(),this.#u()}#h(){let t=this.#t.map(e=>e.value).join("");this.value=t,this.syncValue(t)}#u(){let t=this.#t.map(e=>e.value).join("");t.length===this.#t.length&&this.dispatchEvent(new CustomEvent("complete",{bubbles:!0,detail:{value:t}}))}focus(){let t=this.#t.findIndex(e=>!e.value);this.#t[t>=0?t:0]?.focus()}clear(){for(let t of this.#t)t.value="";this.value="",this.syncValue(""),this.#t[0]?.focus()}disconnected(){super.disconnected(),this.#a(),this.#t=[]}};E();v("otp-input-ui",Do);Q();var Xo=class extends w{static properties={src:{type:String,default:"",reflect:!0},alt:{type:String,default:"",reflect:!0},width:{type:String,default:"",reflect:!0},height:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},fit:{type:String,default:"cover",reflect:!0},radius:{type:String,default:"",reflect:!0},raw:{type:Boolean,default:!1,reflect:!0},fallback:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.#e=this.querySelector(':scope > [slot="skeleton"]'),this.#e||(this.#e=document.createElement("skeleton-ui"),this.#e.setAttribute("slot","skeleton"),this.#e.setAttribute("width","100%"),this.#e.setAttribute("height","100%"),this.appendChild(this.#e)),this.#t=this.querySelector(':scope > [slot="image"]'),this.#t||(this.#t=document.createElement("img"),this.#t.setAttribute("slot","image"),this.#t.loading="lazy",this.appendChild(this.#t)),this.#t.addEventListener("load",this.#s),this.#t.addEventListener("error",this.#r),this.#i()}render(){this.#t&&(this.#t.getAttribute("src")!==this.src&&(this.removeAttribute("data-loaded"),this.removeAttribute("data-error"),this.#t.src=this.src||""),this.#t.alt=this.alt||"",this.#i())}#i(){this.width&&(this.style.width=this.width),this.height&&(this.style.height=this.height)}#s=()=>{this.setAttribute("data-loaded",""),this.removeAttribute("data-error")};#r=()=>{this.fallback&&this.#t.src!==this.fallback?this.#t.src=this.fallback:this.setAttribute("data-error","")};disconnected(){this.#t&&(this.#t.removeEventListener("load",this.#s),this.#t.removeEventListener("error",this.#r)),this.#t=null,this.#e=null}};E();v("image-ui",Xo);var qo=class extends Z{static properties={...Z.properties,placeholder:{type:String,default:"Search...",reflect:!0},debounce:{type:Number,default:300,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;connected(){if(super.connected(),this.setAttribute("role","search"),!this.querySelector("input-ui")){let t=this.getAttribute("size");this.innerHTML=`<input-ui
257
+ `),this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#e)}render(){let t=this.querySelector('[slot="text"]');t&&(t.textContent=this.text),this.setAttribute("tabindex",this.disabled?"-1":"0"),this.selected?this.setAttribute("aria-current","page"):this.removeAttribute("aria-current");let e=this.querySelector('[slot="icon"] icon-ui');e&&e.setAttribute("weight",this.selected?"fill":"regular")}disconnected(){this.removeEventListener("click",this.#t),this.removeEventListener("keydown",this.#e)}};E();v("nav-item-ui",Io);var Do=class extends Z{static properties={...Z.properties,length:{type:Number,default:6,reflect:!0}};static template=()=>null;#t=[];#e=t=>{let e=this.#t.indexOf(t.currentTarget);e<0||this.#o(t,e)};#i=t=>{let e=this.#t.indexOf(t.currentTarget);e<0||this.#l(t,e)};#s=t=>{this.#c(t)};connected(){super.connected(),this.setAttribute("role","group"),this.setAttribute("aria-label","One-time password"),this.#r(),this.#n()}#r(){let t=this.length||6;this.innerHTML="",this.#t=[];for(let e=0;e<t;e++){let i=document.createElement("input");i.type="text",i.maxLength=1,i.inputMode="numeric",i.autocomplete="one-time-code",i.setAttribute("slot","digit"),i.setAttribute("aria-label",`Digit ${e+1}`),this.appendChild(i),this.#t.push(i)}}#n(){for(let t of this.#t)t.addEventListener("input",this.#e),t.addEventListener("keydown",this.#i),t.addEventListener("paste",this.#s)}#a(){for(let t of this.#t)t.removeEventListener("input",this.#e),t.removeEventListener("keydown",this.#i),t.removeEventListener("paste",this.#s)}render(){if(!this.#t.length)return;let t=this.disabled;for(let e of this.#t)e.disabled=t}#o(t,e){let i=this.#t[e];i.value=i.value.replace(/\D/g,"").slice(0,1),this.#h(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:this.value}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}})),i.value&&e<this.#t.length-1&&this.#t[e+1].focus(),this.#u()}#l(t,e){t.key==="Backspace"&&!this.#t[e].value&&e>0&&(this.#t[e-1].focus(),this.#t[e-1].value="",this.#h(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:this.value}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}})))}#c(t){t.preventDefault();let e=(t.clipboardData?.getData("text/plain")||"").replace(/\D/g,"");for(let r=0;r<this.#t.length;r++)this.#t[r].value=e[r]||"";this.#h(),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:this.value}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.value}}));let i=this.#t.findIndex(r=>!r.value);i>=0?this.#t[i].focus():this.#t[this.#t.length-1].focus(),this.#u()}#h(){let t=this.#t.map(e=>e.value).join("");this.value=t,this.syncValue(t)}#u(){let t=this.#t.map(e=>e.value).join("");t.length===this.#t.length&&this.dispatchEvent(new CustomEvent("complete",{bubbles:!0,detail:{value:t}}))}focus(){let t=this.#t.findIndex(e=>!e.value);this.#t[t>=0?t:0]?.focus()}clear(){for(let t of this.#t)t.value="";this.value="",this.syncValue(""),this.#t[0]?.focus()}disconnected(){super.disconnected(),this.#a(),this.#t=[]}};E();v("otp-input-ui",Do);Q();var Xo=class extends w{static properties={src:{type:String,default:"",reflect:!0},alt:{type:String,default:"",reflect:!0},width:{type:String,default:"",reflect:!0},height:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},fit:{type:String,default:"cover",reflect:!0},radius:{type:String,default:"",reflect:!0},raw:{type:Boolean,default:!1,reflect:!0},fallback:{type:String,default:"",reflect:!0}};static template=()=>null;#t=null;#e=null;connected(){this.#e=this.querySelector(':scope > [slot="skeleton"]'),this.#e||(this.#e=document.createElement("skeleton-ui"),this.#e.setAttribute("slot","skeleton"),this.#e.setAttribute("width","100%"),this.#e.setAttribute("height","100%"),this.appendChild(this.#e)),this.#t=this.querySelector(':scope > [slot="image"]'),this.#t||(this.#t=document.createElement("img"),this.#t.setAttribute("slot","image"),this.#t.loading="lazy",this.appendChild(this.#t)),this.#t.addEventListener("load",this.#s),this.#t.addEventListener("error",this.#r),this.#t.complete&&this.#t.naturalWidth>0&&this.#s(),this.#i()}render(){this.#t&&(this.#t.getAttribute("src")!==this.src&&(this.removeAttribute("data-loaded"),this.removeAttribute("data-error"),this.#t.src=this.src||""),this.#t.alt=this.alt||"",this.#i())}#i(){this.width&&(this.style.width=this.width),this.height&&(this.style.height=this.height)}#s=()=>{this.setAttribute("data-loaded",""),this.removeAttribute("data-error")};#r=()=>{this.fallback&&this.#t.src!==this.fallback?this.#t.src=this.fallback:this.setAttribute("data-error","")};disconnected(){this.#t&&(this.#t.removeEventListener("load",this.#s),this.#t.removeEventListener("error",this.#r)),this.#t=null,this.#e=null}};E();v("image-ui",Xo);var qo=class extends Z{static properties={...Z.properties,placeholder:{type:String,default:"Search...",reflect:!0},debounce:{type:Number,default:300,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;connected(){if(super.connected(),this.setAttribute("role","search"),!this.querySelector("input-ui")){let t=this.getAttribute("size");this.innerHTML=`<input-ui
258
258
  type="search"
259
259
  prefix="magnifying-glass"
260
260
  suffix="x-circle"
@@ -391,4 +391,4 @@ Correct shape for <chart-ui x="label" y="value">:
391
391
  <dd>${as(e.value!=null?String(e.value):"")}</dd>
392
392
  `).join("")}
393
393
  </dl>
394
- `:typeof t=="string"?t:""}#h(t){let e=t.tone||"neutral",i={success:"var(--a-success-strong)",warning:"var(--a-warning-strong)",danger:"var(--a-danger-strong)",info:"var(--a-primary-strong)",neutral:"var(--a-fg-muted)"}[e]||"var(--a-fg-muted)",r=t.dot===!1?"":`<icon-ui name="circle-fill" data-trace-dot style="color:${i}"></icon-ui>`,n=t.label!=null?String(t.label):"",o=t.value!=null?String(t.value):"",a=o?`${o}${n?` ${n}`:""}`:n;return`<span data-trace-pill>${r}<span>${as(a)}</span></span>`}};function as(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function OA(s){return String(s).replace(/"/g,"&quot;")}v("agent-trace-ui",Wl);Q();function BO({icon:s,text:t="",title:e=""}){let i=document.createElement("button-ui");return i.setAttribute("icon",s),i.setAttribute("variant","ghost"),i.setAttribute("size","sm"),t&&i.setAttribute("text",t),!t&&e&&i.setAttribute("title",e),i}var va=class extends w{static properties={saveLabel:{type:String,default:"",reflect:!0,attribute:"save-label"},saveIcon:{type:String,default:"bookmark-simple",reflect:!0,attribute:"save-icon"},disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=!1;#n=!1;connected(){this.#u()}disconnected(){this.#t?.removeEventListener("press",this.#a),this.#e?.removeEventListener("press",this.#o),this.#i?.removeEventListener("press",this.#l),this.#t=this.#e=this.#i=this.#s=null}setStatus(t,{lock:e=""}={}){this.#s&&(this.#s.textContent=t||"",(e==="rate"||e==="all")&&(this.#r=!0,this.#t&&(this.#t.disabled=!0),this.#e&&(this.#e.disabled=!0)),(e==="save"||e==="all")&&(this.#n=!0,this.#i&&(this.#i.disabled=!0)))}reset(){this.#r=!1,this.#n=!1,this.#s&&(this.#s.textContent=""),this.#t&&(this.#t.disabled=!1),this.#e&&(this.#e.disabled=!1),this.#i&&(this.#i.disabled=!1)}#a=()=>{!this.#r&&!this.disabled&&this.#c(5)};#o=()=>{!this.#r&&!this.disabled&&this.#c(2)};#l=()=>{!this.#n&&!this.disabled&&this.#h()};#c(t){this.dispatchEvent(new CustomEvent("feedback-rate",{bubbles:!0,detail:{rating:t}})),this.#s?.textContent||this.setStatus(t>=4?"Thanks!":"Noted",{lock:"rate"})}#h(){this.dispatchEvent(new CustomEvent("feedback-save",{bubbles:!0,detail:{}}))}render(){let t=this.saveLabel,e=this.saveIcon;this.#i&&(t?(this.#i.setAttribute("text",t),this.#i.hidden=!1):this.#i.hidden=!0,e&&this.#i.setAttribute("icon",e))}#u(){this.innerHTML="",this.#t=BO({icon:"thumbs-up",title:"Rate this response positively"}),this.#e=BO({icon:"thumbs-down",title:"Rate this response negatively"}),this.#i=BO({icon:this.saveIcon||"bookmark-simple",text:this.saveLabel||"",title:this.saveLabel?"":"Save this response"}),this.saveLabel||(this.#i.hidden=!0),this.#t.addEventListener("press",this.#a),this.#e.addEventListener("press",this.#o),this.#i.addEventListener("press",this.#l),this.#s=document.createElement("span"),this.#s.setAttribute("data-feedback-status",""),this.append(this.#t,this.#e,this.#i,this.#s)}};E();v("agent-feedback-bar-ui",va);Q();function XI(s,t){return typeof s!="string"?"":s.length>t?s.slice(0,t-1)+"\u2026":s}var ya=class extends w{static properties={variant:{type:String,default:"outline",reflect:!0},size:{type:String,default:"sm",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];get suggestions(){return this.#t}set suggestions(t){this.#t=Array.isArray(t)?t.slice():[],this.#e()}connected(){this.#e()}disconnected(){this.innerHTML=""}#e(){this.innerHTML="";for(let t=0;t<this.#t.length;t++){let e=this.#t[t],i=typeof e=="string"?e:e.label||e.prompt||"",r=typeof e=="string"?e:e.prompt||e.label||"",n=typeof e=="object"?e.icon:null,o=document.createElement("button-ui");o.setAttribute("text",XI(i,42)),o.setAttribute("variant",this.variant),o.setAttribute("size",this.size),n&&o.setAttribute("icon",n),this.disabled&&o.setAttribute("disabled",""),o.addEventListener("press",()=>{this.disabled||this.dispatchEvent(new CustomEvent("suggestion-select",{bubbles:!0,detail:{label:i,prompt:r,index:t}}))}),this.appendChild(o)}}};E();v("agent-suggestions-ui",ya);Q();var xa=class extends w{static properties={multi:{type:Boolean,default:!1,reflect:!0},question:{type:String,default:"",reflect:!0},helper:{type:String,default:"",reflect:!0},submitLabel:{type:String,default:"Continue",reflect:!0,attribute:"submit-label"}};static template=()=>null;#t=[];#e=new Set;#i=!1;#s=null;#r=null;#n=null;#a=null;get options(){return this.#t}set options(t){this.#t=Array.isArray(t)?t.slice():[],this.#e.clear(),this.#i=!1,this.#l()}connected(){this.#o()}disconnected(){this.#a?.removeEventListener("press",this.#f),this.#n?.removeEventListener("change",this.#c),this.#n?.removeEventListener("click",this.#h,!0),this.#n?.removeEventListener("keydown",this.#u,!0),this.#s=this.#r=this.#n=this.#a=null}render(){this.#s&&(this.#s.textContent=this.question||"",this.#s.hidden=!this.question),this.#r&&(this.#r.textContent=this.helper||"",this.#r.hidden=!this.helper),this.#a&&(this.#a.setAttribute("text",this.submitLabel||"Continue"),this.#a.hidden=!this.multi)}#o(){this.innerHTML="",this.#s=document.createElement("div"),this.#s.setAttribute("data-questions-q",""),this.question?this.#s.textContent=this.question:this.#s.hidden=!0,this.#r=document.createElement("div"),this.#r.setAttribute("data-questions-helper",""),this.helper?this.#r.textContent=this.helper:this.#r.hidden=!0,this.#n=document.createElement("div"),this.#n.setAttribute("data-questions-options",""),this.#n.addEventListener("change",this.#c),this.#n.addEventListener("click",this.#h,!0),this.#n.addEventListener("keydown",this.#u,!0),this.#a=document.createElement("button-ui"),this.#a.setAttribute("text",this.submitLabel||"Continue"),this.#a.setAttribute("variant","primary"),this.#a.setAttribute("size","sm"),this.#a.setAttribute("disabled",""),this.multi||(this.#a.hidden=!0),this.#a.addEventListener("press",this.#f),this.append(this.#s,this.#r,this.#n,this.#a),this.#l()}#l(){if(this.#n){this.#n.innerHTML="";for(let t of this.#t){let e=document.createElement("option-card-ui");e.setAttribute("data-questions-option",""),e.setAttribute("data-questions-option-id",t.id),e.name="questions-option",e.value=t.id,e.heading=t.label||"",e.description=t.description||"",e.icon=t.icon||"",this.#n.appendChild(e),this.multi&&e.setAttribute("role","checkbox"),e.checked=this.#e.has(t.id),e.disabled=this.#i}this.#a&&(this.#a.disabled=this.#i||this.#e.size===0)}}#c=t=>{if(this.multi||this.#i)return;let e=t.detail?.value,i=this.#t.find(r=>r.id===e);i&&(this.#e.clear(),this.#e.add(i.id),this.#i=!0,this.#l(),this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:[i.id],option:i}})))};#h=t=>{if(!this.multi)return;let e=t.target.closest?.("option-card-ui[data-questions-option]");!e||!this.#n.contains(e)||(t.stopPropagation(),this.#d(e))};#u=t=>{if(!this.multi)return;let e=t.target.closest?.("option-card-ui[data-questions-option]");if(!(!e||!this.#n.contains(e))){if(t.key===" "||t.key==="Enter"){t.preventDefault(),t.stopPropagation(),this.#d(e);return}(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="ArrowLeft"||t.key==="ArrowRight")&&t.stopPropagation()}};#d(t){if(this.#i)return;let e=t.dataset.questionsOptionId,i=this.#t.find(r=>r.id===e);i&&(this.#e.has(i.id)?this.#e.delete(i.id):this.#e.add(i.id),this.#l())}#f=()=>{if(this.#i||this.#e.size===0)return;this.#i=!0,this.#l();let t=[...this.#e],e=this.#t.find(i=>i.id===t[0])||null;this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:t,option:e}}))}};E();v("agent-questions-ui",xa);Q();var bA={neutral:"default",accent:"accent",warning:"warning",danger:"danger"},Sa=class extends w{static properties={title:{type:String,default:"",reflect:!0},kind:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},tone:{type:String,default:"neutral",reflect:!0}};static requiredIcons=["caret-right","caret-down"];static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;connected(){this.#l()}disconnected(){this.#t?.removeEventListener("click",this.#a),this.#t?.removeEventListener("keydown",this.#o),this.#t=this.#e=this.#i=null,this.#s=this.#r=this.#n=null}#a=t=>{t.target.closest('[slot="primary"], [slot="secondary"]')||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("artifact-toggle",{bubbles:!0,detail:{collapsed:this.collapsed}})),this.render())};#o=t=>{if(t.key===" "||t.key==="Enter"){if(t.target.closest('[slot="primary"], [slot="secondary"]'))return;t.preventDefault(),this.#a(t)}};render(){this.#t&&(this.#e&&(this.icon?(this.#e.setAttribute("name",this.icon),this.#e.hidden=!1):this.#e.hidden=!0),this.#i&&(this.#i.textContent=this.title||"",this.#i.hidden=!this.title),this.#s&&(this.#s.setAttribute("text",(this.kind||"").toUpperCase()),this.#s.setAttribute("variant",bA[this.tone]||"default"),this.#s.hidden=!this.kind),this.#r&&this.#r.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#n&&(this.#n.hidden=this.collapsed),this.#t&&this.#t.setAttribute("aria-expanded",String(!this.collapsed)))}#l(){let t=[],e=[],i=[],r=a=>a.getAttribute("role")==="presentation"||a.style?.display==="contents",n=a=>{for(let l of a){if(l.nodeType===1){let h=l;if(r(h)){n(h.childNodes);continue}let c=h.getAttribute("slot")||"";if(c==="primary"){t.push(h);continue}if(c==="secondary"){e.push(h);continue}}i.push(l)}};n(Array.from(this.childNodes)),this.innerHTML="",this.#t=document.createElement("div"),this.#t.setAttribute("data-artifact-header",""),this.#t.setAttribute("role","button"),this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-expanded",String(!this.collapsed)),this.#t.addEventListener("click",this.#a),this.#t.addEventListener("keydown",this.#o),this.#e=document.createElement("icon-ui"),this.#e.setAttribute("data-artifact-icon",""),this.#e.setAttribute("color","muted"),this.icon?this.#e.setAttribute("name",this.icon):this.#e.hidden=!0,this.#i=document.createElement("span"),this.#i.setAttribute("data-artifact-title",""),this.title?this.#i.textContent=this.title:this.#i.hidden=!0,this.#s=document.createElement("badge-ui"),this.#s.setAttribute("data-artifact-kind",""),this.#s.setAttribute("size","sm"),this.#s.setAttribute("variant",bA[this.tone]||"default"),this.kind?this.#s.setAttribute("text",this.kind.toUpperCase()):this.#s.hidden=!0;let o=document.createElement("span");o.setAttribute("data-artifact-actions","");for(let a of e)o.appendChild(a);for(let a of t)o.appendChild(a);this.#r=document.createElement("icon-ui"),this.#r.setAttribute("color","muted"),this.#r.setAttribute("data-artifact-caret",""),this.#r.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#t.append(this.#e,this.#i,this.#s,o,this.#r),this.#n=document.createElement("div"),this.#n.setAttribute("data-artifact-body","");for(let a of i)this.#n.appendChild(a);this.collapsed&&(this.#n.hidden=!0),this.append(this.#t,this.#n)}};E();v("agent-artifact-ui",Sa);export{wn as UIAccordion,kn as UIAccordionItem,Vo as UIActionItem,zo as UIActionList,tn as UIAdiaMark,en as UIAdiaWordmark,Sa as UIAgentArtifact,va as UIAgentFeedbackBar,xa as UIAgentQuestions,ba as UIAgentReasoning,ya as UIAgentSuggestions,Wl as UIAgentTrace,ln as UIAlert,Qr as UIAnchorBar,Kr as UIAvatar,Jr as UIAvatarGroup,Mr as UIBadge,Jo as UIBlock,$n as UIBlockquote,Rr as UIBreadcrumb,rr as UIButton,_o as UICalendarGrid,Wo as UICalendarPicker,td as UICanvas,Hr as UICard,yn as UIChart,xn as UIChartLegend,$a as UIChatInput,Ar as UIChatThread,lr as UICheck,go as UICode,fn as UICol,qr as UIColorInput,Xr as UIColorPicker,Zo as UICombobox,Ir as UICommand,ko as UIContextMenu,Fo as UIDateRangePicker,Ho as UIDatetimePicker,ra as UIDemoToggle,ga as UIDescriptionList,Qa as UIDisplayField,An as UIDivider,$r as UIDrawer,Ko as UIEmbed,jo as UIEmptyState,Ze as UIFeed,Er as UIFeedContainer,Pr as UIFeedItem,pn as UIField,mn as UIFields,vn as UIFrame,On as UIGrid,Oa as UIHeatmap,sr as UIIcon,Xo as UIImage,Eo as UIInlineEdit,hn as UIInlineMessage,or as UIInput,fa as UIInspector,dr as UIIntegrationCard,cn as UIKbd,nr as UILink,bo as UIList,vo as UIListItem,yo as UIListWindow,an as UILoadingOverlay,Co as UIMark,xo as UIMenu,wo as UIMenuDivider,So as UIMenuItem,Cr as UIModal,Mo as UINav,Ro as UINavGroup,Io as UINavItem,Zr as UINoodles,En as UINumberFormat,ur as UIOptionCard,Do as UIOtpInput,Sr as UIPage,Ln as UIPagination,xr as UIPane,Pn as UIPasswordStrength,pa as UIPipelineStatus,Sn as UIPopover,Oo as UIPreview,sn as UIProgress,Bo as UIProgressRow,Tn as UIQRCode,hr as UIRadio,cr as UIRadioGroup,br as UIRange,ma as UIRating,Cn as UIRelativeTime,na as UIRichText,gn as UIRow,qo as UISearch,gr as UISegment,Or as UISegmented,mr as UISelect,nn as UISkeleton,$o as UISkipNav,pr as UISlider,on as UISpinner,bn as UIStack,Bl as UIStat,rn as UIStepProgress,Wr as UIStepper,Fr as UIStepperItem,oa as UIStream,dn as UISwatch,Yr as UISwiper,fr as UISwitch,Ca as UITab,Br as UITable,Qn as UITableOfContents,zr as UITableToolbar,Tr as UITabs,un as UITag,No as UITagsInput,ta as UIText,ar as UITextarea,Go as UITimePicker,Vr as UITimeline,jr as UITimelineItem,us as UIToast,ia as UIToggleGroup,ea as UIToggleOption,sa as UIToggleScheme,To as UIToolbar,Lo as UIToolbarGroup,Lr as UITooltip,Po as UITour,Qo as UITourStep,vr as UITree,yr as UITreeItem,Ur as UIUpload,Ao as UIVisuallyHidden};
394
+ `:typeof t=="string"?t:""}#h(t){let e=t.tone||"neutral",i={success:"var(--a-success-strong)",warning:"var(--a-warning-strong)",danger:"var(--a-danger-strong)",info:"var(--a-primary-strong)",neutral:"var(--a-fg-muted)"}[e]||"var(--a-fg-muted)",r=t.dot===!1?"":`<icon-ui name="circle-fill" data-trace-dot style="color:${i}"></icon-ui>`,n=t.label!=null?String(t.label):"",o=t.value!=null?String(t.value):"",a=o?`${o}${n?` ${n}`:""}`:n;return`<span data-trace-pill>${r}<span>${as(a)}</span></span>`}};function as(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function OA(s){return String(s).replace(/"/g,"&quot;")}v("agent-trace-ui",Wl);Q();function BO({icon:s,text:t="",title:e=""}){let i=document.createElement("button-ui");return i.setAttribute("icon",s),i.setAttribute("variant","ghost"),i.setAttribute("size","sm"),t&&i.setAttribute("text",t),!t&&e&&i.setAttribute("title",e),i}var va=class extends w{static properties={saveLabel:{type:String,default:"",reflect:!0,attribute:"save-label"},saveIcon:{type:String,default:"bookmark-simple",reflect:!0,attribute:"save-icon"},disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=!1;#n=!1;connected(){this.#u()}disconnected(){this.#t?.removeEventListener("press",this.#a),this.#e?.removeEventListener("press",this.#o),this.#i?.removeEventListener("press",this.#l),this.#t=this.#e=this.#i=this.#s=null}setStatus(t,{lock:e=""}={}){this.#s&&(this.#s.textContent=t||"",(e==="rate"||e==="all")&&(this.#r=!0,this.#t&&(this.#t.disabled=!0),this.#e&&(this.#e.disabled=!0)),(e==="save"||e==="all")&&(this.#n=!0,this.#i&&(this.#i.disabled=!0)))}reset(){this.#r=!1,this.#n=!1,this.#s&&(this.#s.textContent=""),this.#t&&(this.#t.disabled=!1),this.#e&&(this.#e.disabled=!1),this.#i&&(this.#i.disabled=!1)}#a=()=>{!this.#r&&!this.disabled&&this.#c(5)};#o=()=>{!this.#r&&!this.disabled&&this.#c(2)};#l=()=>{!this.#n&&!this.disabled&&this.#h()};#c(t){this.dispatchEvent(new CustomEvent("feedback-rate",{bubbles:!0,detail:{rating:t}})),this.#s?.textContent||this.setStatus(t>=4?"Thanks!":"Noted",{lock:"rate"})}#h(){this.dispatchEvent(new CustomEvent("feedback-save",{bubbles:!0,detail:{}}))}render(){let t=this.saveLabel,e=this.saveIcon;this.#i&&(t?(this.#i.setAttribute("text",t),this.#i.hidden=!1):this.#i.hidden=!0,e&&this.#i.setAttribute("icon",e))}#u(){this.innerHTML="",this.#t=BO({icon:"thumbs-up",title:"Rate this response positively"}),this.#e=BO({icon:"thumbs-down",title:"Rate this response negatively"}),this.#i=BO({icon:this.saveIcon||"bookmark-simple",text:this.saveLabel||"",title:this.saveLabel?"":"Save this response"}),this.saveLabel||(this.#i.hidden=!0),this.#t.addEventListener("press",this.#a),this.#e.addEventListener("press",this.#o),this.#i.addEventListener("press",this.#l),this.#s=document.createElement("span"),this.#s.setAttribute("data-feedback-status",""),this.append(this.#t,this.#e,this.#i,this.#s)}};E();v("agent-feedback-bar-ui",va);Q();function XI(s,t){return typeof s!="string"?"":s.length>t?s.slice(0,t-1)+"\u2026":s}var ya=class extends w{static properties={variant:{type:String,default:"outline",reflect:!0},size:{type:String,default:"sm",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];get suggestions(){return this.#t}set suggestions(t){this.#t=Array.isArray(t)?t.slice():[],this.#e()}connected(){this.#e()}disconnected(){this.innerHTML=""}#e(){this.innerHTML="";for(let t=0;t<this.#t.length;t++){let e=this.#t[t],i=typeof e=="string"?e:e.label||e.prompt||"",r=typeof e=="string"?e:e.prompt||e.label||"",n=typeof e=="object"?e.icon:null,o=document.createElement("button-ui");o.setAttribute("text",XI(i,42)),o.setAttribute("variant",this.variant),o.setAttribute("size",this.size),n&&o.setAttribute("icon",n),this.disabled&&o.setAttribute("disabled",""),o.addEventListener("press",()=>{this.disabled||this.dispatchEvent(new CustomEvent("suggestion-select",{bubbles:!0,detail:{label:i,prompt:r,index:t}}))}),this.appendChild(o)}}};E();v("agent-suggestions-ui",ya);Q();var xa=class extends w{static properties={multi:{type:Boolean,default:!1,reflect:!0},question:{type:String,default:"",reflect:!0},helper:{type:String,default:"",reflect:!0},submitLabel:{type:String,default:"Continue",reflect:!0,attribute:"submit-label"}};static template=()=>null;#t=[];#e=new Set;#i=!1;#s=null;#r=null;#n=null;#a=null;get options(){return this.#t}set options(t){this.#t=Array.isArray(t)?t.slice():[],this.#e.clear(),this.#i=!1,this.#l()}connected(){this.#o()}disconnected(){this.#a?.removeEventListener("press",this.#f),this.#n?.removeEventListener("change",this.#c),this.#n?.removeEventListener("click",this.#h,!0),this.#n?.removeEventListener("keydown",this.#u,!0),this.#s=this.#r=this.#n=this.#a=null}render(){this.#s&&(this.#s.textContent=this.question||"",this.#s.hidden=!this.question),this.#r&&(this.#r.textContent=this.helper||"",this.#r.hidden=!this.helper),this.#a&&(this.#a.setAttribute("text",this.submitLabel||"Continue"),this.#a.hidden=!this.multi)}#o(){this.innerHTML="",this.#s=document.createElement("div"),this.#s.setAttribute("data-questions-q",""),this.question?this.#s.textContent=this.question:this.#s.hidden=!0,this.#r=document.createElement("div"),this.#r.setAttribute("data-questions-helper",""),this.helper?this.#r.textContent=this.helper:this.#r.hidden=!0,this.#n=document.createElement("div"),this.#n.setAttribute("data-questions-options",""),this.#n.addEventListener("change",this.#c),this.#n.addEventListener("click",this.#h,!0),this.#n.addEventListener("keydown",this.#u,!0),this.#a=document.createElement("button-ui"),this.#a.setAttribute("text",this.submitLabel||"Continue"),this.#a.setAttribute("variant","primary"),this.#a.setAttribute("disabled",""),this.multi||(this.#a.hidden=!0),this.#a.addEventListener("press",this.#f),this.append(this.#s,this.#r,this.#n,this.#a),this.#l()}#l(){if(this.#n){this.#n.innerHTML="";for(let t of this.#t){let e=document.createElement("option-card-ui");e.setAttribute("data-questions-option",""),e.setAttribute("data-questions-option-id",t.id),e.name="questions-option",e.value=t.id,e.heading=t.label||"",e.description=t.description||"",e.icon=t.icon||"",this.#n.appendChild(e),this.multi&&e.setAttribute("role","checkbox"),e.checked=this.#e.has(t.id),e.disabled=this.#i}this.#a&&(this.#a.disabled=this.#i||this.#e.size===0)}}#c=t=>{if(this.multi||this.#i)return;let e=t.detail?.value,i=this.#t.find(r=>r.id===e);i&&(this.#e.clear(),this.#e.add(i.id),this.#i=!0,this.#l(),this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:[i.id],option:i}})))};#h=t=>{if(!this.multi)return;let e=t.target.closest?.("option-card-ui[data-questions-option]");!e||!this.#n.contains(e)||(t.stopPropagation(),this.#d(e))};#u=t=>{if(!this.multi)return;let e=t.target.closest?.("option-card-ui[data-questions-option]");if(!(!e||!this.#n.contains(e))){if(t.key===" "||t.key==="Enter"){t.preventDefault(),t.stopPropagation(),this.#d(e);return}(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="ArrowLeft"||t.key==="ArrowRight")&&t.stopPropagation()}};#d(t){if(this.#i)return;let e=t.dataset.questionsOptionId,i=this.#t.find(r=>r.id===e);i&&(this.#e.has(i.id)?this.#e.delete(i.id):this.#e.add(i.id),this.#l())}#f=()=>{if(this.#i||this.#e.size===0)return;this.#i=!0,this.#l();let t=[...this.#e],e=this.#t.find(i=>i.id===t[0])||null;this.dispatchEvent(new CustomEvent("questions-answer",{bubbles:!0,detail:{selected:t,option:e}}))}};E();v("agent-questions-ui",xa);Q();var bA={neutral:"default",accent:"accent",warning:"warning",danger:"danger"},Sa=class extends w{static properties={title:{type:String,default:"",reflect:!0},kind:{type:String,default:"",reflect:!0},icon:{type:String,default:"",reflect:!0},collapsed:{type:Boolean,default:!1,reflect:!0},tone:{type:String,default:"neutral",reflect:!0}};static requiredIcons=["caret-right","caret-down"];static template=()=>null;#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;connected(){this.#l()}disconnected(){this.#t?.removeEventListener("click",this.#a),this.#t?.removeEventListener("keydown",this.#o),this.#t=this.#e=this.#i=null,this.#s=this.#r=this.#n=null}#a=t=>{t.target.closest('[slot="primary"], [slot="secondary"]')||(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent("artifact-toggle",{bubbles:!0,detail:{collapsed:this.collapsed}})),this.render())};#o=t=>{if(t.key===" "||t.key==="Enter"){if(t.target.closest('[slot="primary"], [slot="secondary"]'))return;t.preventDefault(),this.#a(t)}};render(){this.#t&&(this.#e&&(this.icon?(this.#e.setAttribute("name",this.icon),this.#e.hidden=!1):this.#e.hidden=!0),this.#i&&(this.#i.textContent=this.title||"",this.#i.hidden=!this.title),this.#s&&(this.#s.setAttribute("text",(this.kind||"").toUpperCase()),this.#s.setAttribute("variant",bA[this.tone]||"default"),this.#s.hidden=!this.kind),this.#r&&this.#r.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#n&&(this.#n.hidden=this.collapsed),this.#t&&this.#t.setAttribute("aria-expanded",String(!this.collapsed)))}#l(){let t=[],e=[],i=[],r=a=>a.getAttribute("role")==="presentation"||a.style?.display==="contents",n=a=>{for(let l of a){if(l.nodeType===1){let h=l;if(r(h)){n(h.childNodes);continue}let c=h.getAttribute("slot")||"";if(c==="primary"){t.push(h);continue}if(c==="secondary"){e.push(h);continue}}i.push(l)}};n(Array.from(this.childNodes)),this.innerHTML="",this.#t=document.createElement("div"),this.#t.setAttribute("data-artifact-header",""),this.#t.setAttribute("role","button"),this.#t.setAttribute("tabindex","0"),this.#t.setAttribute("aria-expanded",String(!this.collapsed)),this.#t.addEventListener("click",this.#a),this.#t.addEventListener("keydown",this.#o),this.#e=document.createElement("icon-ui"),this.#e.setAttribute("data-artifact-icon",""),this.#e.setAttribute("color","muted"),this.icon?this.#e.setAttribute("name",this.icon):this.#e.hidden=!0,this.#i=document.createElement("span"),this.#i.setAttribute("data-artifact-title",""),this.title?this.#i.textContent=this.title:this.#i.hidden=!0,this.#s=document.createElement("badge-ui"),this.#s.setAttribute("data-artifact-kind",""),this.#s.setAttribute("size","sm"),this.#s.setAttribute("variant",bA[this.tone]||"default"),this.kind?this.#s.setAttribute("text",this.kind.toUpperCase()):this.#s.hidden=!0;let o=document.createElement("span");o.setAttribute("data-artifact-actions","");for(let a of e)o.appendChild(a);for(let a of t)o.appendChild(a);this.#r=document.createElement("icon-ui"),this.#r.setAttribute("color","muted"),this.#r.setAttribute("data-artifact-caret",""),this.#r.setAttribute("name",this.collapsed?"caret-right":"caret-down"),this.#t.append(this.#e,this.#i,this.#s,o,this.#r),this.#n=document.createElement("div"),this.#n.setAttribute("data-artifact-body","");for(let a of i)this.#n.appendChild(a);this.collapsed&&(this.#n.hidden=!0),this.append(this.#t,this.#n)}};E();v("agent-artifact-ui",Sa);export{wn as UIAccordion,kn as UIAccordionItem,Vo as UIActionItem,zo as UIActionList,tn as UIAdiaMark,en as UIAdiaWordmark,Sa as UIAgentArtifact,va as UIAgentFeedbackBar,xa as UIAgentQuestions,ba as UIAgentReasoning,ya as UIAgentSuggestions,Wl as UIAgentTrace,ln as UIAlert,Qr as UIAnchorBar,Kr as UIAvatar,Jr as UIAvatarGroup,Mr as UIBadge,Jo as UIBlock,$n as UIBlockquote,Rr as UIBreadcrumb,rr as UIButton,_o as UICalendarGrid,Wo as UICalendarPicker,td as UICanvas,Hr as UICard,yn as UIChart,xn as UIChartLegend,$a as UIChatInput,Ar as UIChatThread,lr as UICheck,go as UICode,fn as UICol,qr as UIColorInput,Xr as UIColorPicker,Zo as UICombobox,Ir as UICommand,ko as UIContextMenu,Fo as UIDateRangePicker,Ho as UIDatetimePicker,ra as UIDemoToggle,ga as UIDescriptionList,Qa as UIDisplayField,An as UIDivider,$r as UIDrawer,Ko as UIEmbed,jo as UIEmptyState,Ze as UIFeed,Er as UIFeedContainer,Pr as UIFeedItem,pn as UIField,mn as UIFields,vn as UIFrame,On as UIGrid,Oa as UIHeatmap,sr as UIIcon,Xo as UIImage,Eo as UIInlineEdit,hn as UIInlineMessage,or as UIInput,fa as UIInspector,dr as UIIntegrationCard,cn as UIKbd,nr as UILink,bo as UIList,vo as UIListItem,yo as UIListWindow,an as UILoadingOverlay,Co as UIMark,xo as UIMenu,wo as UIMenuDivider,So as UIMenuItem,Cr as UIModal,Mo as UINav,Ro as UINavGroup,Io as UINavItem,Zr as UINoodles,En as UINumberFormat,ur as UIOptionCard,Do as UIOtpInput,Sr as UIPage,Ln as UIPagination,xr as UIPane,Pn as UIPasswordStrength,pa as UIPipelineStatus,Sn as UIPopover,Oo as UIPreview,sn as UIProgress,Bo as UIProgressRow,Tn as UIQRCode,hr as UIRadio,cr as UIRadioGroup,br as UIRange,ma as UIRating,Cn as UIRelativeTime,na as UIRichText,gn as UIRow,qo as UISearch,gr as UISegment,Or as UISegmented,mr as UISelect,nn as UISkeleton,$o as UISkipNav,pr as UISlider,on as UISpinner,bn as UIStack,Bl as UIStat,rn as UIStepProgress,Wr as UIStepper,Fr as UIStepperItem,oa as UIStream,dn as UISwatch,Yr as UISwiper,fr as UISwitch,Ca as UITab,Br as UITable,Qn as UITableOfContents,zr as UITableToolbar,Tr as UITabs,un as UITag,No as UITagsInput,ta as UIText,ar as UITextarea,Go as UITimePicker,Vr as UITimeline,jr as UITimelineItem,us as UIToast,ia as UIToggleGroup,ea as UIToggleOption,sa as UIToggleScheme,To as UIToolbar,Lo as UIToolbarGroup,Lr as UITooltip,Po as UITour,Qo as UITourStep,vr as UITree,yr as UITreeItem,Ur as UIUpload,Ao as UIVisuallyHidden};