@domphy/ui 0.1.4 → 0.1.7

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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PartialElement, ValueOrState, DomphyElement, Notifier, Handler } from '@domphy/core';
2
- import { ThemeColor, ElementTone } from '@domphy/theme';
2
+ import { ThemeColor } from '@domphy/theme';
3
3
  import { Placement as Placement$1 } from '@floating-ui/dom';
4
4
 
5
5
  declare function abbreviation(props?: {
@@ -144,7 +144,9 @@ declare function image(props?: {
144
144
  color?: ThemeColor;
145
145
  }): PartialElement;
146
146
 
147
- declare function icon(): PartialElement;
147
+ declare function icon(props?: {
148
+ color?: ThemeColor;
149
+ }): PartialElement;
148
150
 
149
151
  declare function inputColor(props?: {
150
152
  color?: ThemeColor;
@@ -199,7 +201,6 @@ declare function link(props?: {
199
201
 
200
202
  declare function mark(props?: {
201
203
  accentColor?: ThemeColor;
202
- tone?: ElementTone;
203
204
  }): PartialElement;
204
205
 
205
206
  declare function paragraph(props?: {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PartialElement, ValueOrState, DomphyElement, Notifier, Handler } from '@domphy/core';
2
- import { ThemeColor, ElementTone } from '@domphy/theme';
2
+ import { ThemeColor } from '@domphy/theme';
3
3
  import { Placement as Placement$1 } from '@floating-ui/dom';
4
4
 
5
5
  declare function abbreviation(props?: {
@@ -144,7 +144,9 @@ declare function image(props?: {
144
144
  color?: ThemeColor;
145
145
  }): PartialElement;
146
146
 
147
- declare function icon(): PartialElement;
147
+ declare function icon(props?: {
148
+ color?: ThemeColor;
149
+ }): PartialElement;
148
150
 
149
151
  declare function inputColor(props?: {
150
152
  color?: ThemeColor;
@@ -199,7 +201,6 @@ declare function link(props?: {
199
201
 
200
202
  declare function mark(props?: {
201
203
  accentColor?: ThemeColor;
202
- tone?: ElementTone;
203
204
  }): PartialElement;
204
205
 
205
206
  declare function paragraph(props?: {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var zo=Object.defineProperty,$o=Object.defineProperties;var Mo=Object.getOwnPropertyDescriptors;var wt=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Ro=Object.prototype.propertyIsEnumerable;var It=(n,o,t)=>o in n?zo(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,_t=(n,o)=>{for(var t in o||(o={}))No.call(o,t)&&It(n,t,o[t]);if(wt)for(var t of wt(o))Ro.call(o,t)&&It(n,t,o[t]);return n},zt=(n,o)=>$o(n,Mo(o));import{themeColor as Ie,themeSpacing as Lo}from"@domphy/theme";function Fn(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{color:e=>Ie(e,"shift-7",o),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:e=>Ie(e,"shift-4",o),textUnderlineOffset:Lo(.72),cursor:"help","&:hover":{color:e=>Ie(e,"shift-8",t),textDecorationColor:e=>Ie(e,"shift-6",t)}}}}import{themeColor as X,themeDensity as D,themeSpacing as z}from"@domphy/theme";function Wn(n={}){let{color:o="neutral"}=n;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:t=>z(D(t)*2),backgroundColor:t=>X(t,"inherit",o),color:t=>X(t,"shift-7",o),outline:t=>`1px solid ${X(t,"shift-3",o)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:t=>z(D(t)*2),paddingInline:t=>z(D(t)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:t=>z(D(t)*4),color:t=>X(t,"shift-6",o),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:t=>z(D(t)*2),height:"auto"},"& > div":{gridArea:"content",padding:t=>z(D(t)*4),color:t=>X(t,"shift-7",o)},"& > footer":{gridArea:"footer",display:"flex",gap:z(2),paddingBlock:t=>z(D(t)*2),paddingInline:t=>z(D(t)*4),borderTop:t=>`1px solid ${X(t,"shift-2",o)}`}}}}import{merge as Do,toState as Ho}from"@domphy/core";import{themeColor as Ye,themeSpacing as Oo}from"@domphy/theme";function Yn(n={}){let{direction:o="horizontal",defaultSize:t=50,min:e=10,max:r=90}=n;return{_onSchedule:(i,s)=>{Do(s,{_context:{splitter:{direction:o,size:Ho(t),min:e,max:r}}})},style:{display:"flex",flexDirection:o==="horizontal"?"row":"column",overflow:"hidden"}}}function Gn(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal"?"width":"height";t.style[e]=`${o.size.get()}%`,t.style.flexShrink="0",t.style.overflow="auto";let r=o.size.onChange(i=>{t.style[e]=`${i}%`});n.addHook("Remove",r)}}}function Un(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal";t.style.cursor=e?"col-resize":"row-resize";let r=i=>{i.preventDefault();let s=t.parentElement,a=m=>{let c=s.getBoundingClientRect(),d=e?(m.clientX-c.left)/c.width*100:(m.clientY-c.top)/c.height*100;o.size.set(Math.min(Math.max(d,o.min),o.max))},l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)};t.addEventListener("mousedown",r),n.addHook("Remove",()=>t.removeEventListener("mousedown",r))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n=>Ye(n,"shift-2"),"&:hover":{backgroundColor:n=>Ye(n,"shift-3")},"&::after":{content:'""',borderRadius:Oo(999),backgroundColor:n=>Ye(n,"shift-4")}}}}import{merge as Bo,toState as Fo}from"@domphy/core";import{themeColor as $,themeDensity as _e,themeSize as $t,themeSpacing as J}from"@domphy/theme";function Zn(){return{_onSchedule:(n,o)=>{Bo(o,{_context:{command:{query:Fo("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function ei(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:e=>{let r=e.getContext("command"),i=e.domElement,s=()=>r.query.set(i.value);i.addEventListener("input",s),e.addHook("Remove",()=>i.removeEventListener("input",s))},style:{fontFamily:"inherit",fontSize:e=>$t(e,"inherit"),paddingInline:e=>J(_e(e)*3),paddingBlock:e=>J(_e(e)*2),border:"none",borderBottom:e=>`1px solid ${$(e,"shift-2",o)}`,outline:"none",color:e=>$(e,"shift-7",o),backgroundColor:e=>$(e,"inherit",o),"&::placeholder":{color:e=>$(e,"shift-4")},"&:focus-visible":{borderBottomColor:e=>$(e,"shift-5",t)}}}}function ti(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"option",_onMount:e=>{var l,m;let r=e.getContext("command"),i=e.domElement,s=(m=(l=i.textContent)==null?void 0:l.toLowerCase())!=null?m:"",a=r.query.onChange(c=>{i.hidden=c.length>0&&!s.includes(c.toLowerCase())});e.addHook("Remove",a)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:e=>$t(e,"inherit"),height:e=>J(6+_e(e)*2),paddingInline:e=>J(_e(e)*3),border:"none",outline:"none",color:e=>$(e,"shift-6",o),backgroundColor:e=>$(e,"inherit",o),"&:hover:not([disabled])":{backgroundColor:e=>$(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${J(.5)} solid ${$(e,"shift-5",t)}`,outlineOffset:`-${J(.5)}`}}}}import{themeColor as pe,themeSize as Vo,themeSpacing as Q}from"@domphy/theme";function ni(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"button",_onInsert:e=>{var l;e.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let r=e.getContext("toggleGroup"),s=((l=e.parent)==null?void 0:l.children.items).filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="button"),a=String(s.findIndex(m=>m===e));e.attributes.set("ariaPressed",m=>{let c=r.value.get(m);return Array.isArray(c)?c.includes(a):c===a}),e.addEvent("click",()=>{let m=r.value.get();if(r.multiple){let c=Array.isArray(m)?[...m]:[];r.value.set(c.includes(a)?c.filter(d=>d!==a):[...c,a])}else r.value.set(m===a?"":a)})},style:{cursor:"pointer",fontSize:e=>Vo(e,"inherit"),height:Q(6),paddingBlock:Q(1),paddingInline:Q(2),border:"none",borderRadius:Q(1),color:e=>pe(e,"shift-6",o),backgroundColor:e=>pe(e,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:e=>pe(e,"shift-1",o)},"&[aria-pressed=true]":{backgroundColor:e=>pe(e,"shift-1",o)},"&:focus-visible":{outline:e=>`${Q(.5)} solid ${pe(e,"shift-5",t)}`,outlineOffset:`-${Q(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as Ao}from"@domphy/core";import{themeSpacing as ze,themeColor as Mt,themeSize as Wo}from"@domphy/theme";function mi(n={}){var e;let{multiple:o=!1,color:t="neutral"}=n;return{role:"group",dataTone:"shift-1",_context:{toggleGroup:{value:Ao((e=n.value)!=null?e:o?[]:""),multiple:o}},style:{display:"flex",paddingBlock:ze(1),paddingInline:ze(1),gap:ze(1),borderRadius:ze(2),fontSize:r=>Wo(r,"inherit"),backgroundColor:r=>Mt(r,"inherit",t),outline:r=>`1px solid ${Mt(r,"shift-1",t)}`,outlineOffset:"-1px"}}}import{themeSpacing as Nt}from"@domphy/theme";function ui(){return{style:{display:"flex",alignItems:"center",gap:Nt(2),"& > *":{minWidth:Nt(8)+"!important"}},_onMount:n=>{let o=n.domElement,t=()=>Array.from(o.querySelectorAll("input")),e=s=>{let a=t(),l=s.target,m=a.indexOf(l);l.value&&m<a.length-1&&a[m+1].focus()},r=s=>{let a=t(),l=s.target,m=a.indexOf(l);s.key==="Backspace"&&!l.value&&m>0&&a[m-1].focus(),s.key==="ArrowLeft"&&m>0&&a[m-1].focus(),s.key==="ArrowRight"&&m<a.length-1&&a[m+1].focus()},i=s=>{var d,u,g;s.preventDefault();let a=(u=(d=s.clipboardData)==null?void 0:d.getData("text"))!=null?u:"",l=t(),m=l.indexOf(s.target);[...a].forEach((h,f)=>{l[m+f]&&(l[m+f].value=h)});let c=Math.min(m+a.length-1,l.length-1);(g=l[c])==null||g.focus()};o.addEventListener("input",e),o.addEventListener("keydown",r),o.addEventListener("paste",i),n.addHook("Remove",()=>{o.removeEventListener("input",e),o.removeEventListener("keydown",r),o.removeEventListener("paste",i)})}}}import{themeColor as Ge,themeDensity as Rt,themeSize as Ko,themeSpacing as $e}from"@domphy/theme";function fi(n={}){let{color:o="primary"}=n;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:$e(3),paddingBlock:t=>$e(Rt(t)*2),paddingInline:t=>$e(Rt(t)*4),boxShadow:t=>`inset ${$e(1)} 0 0 0 ${Ge(t,"shift-5",o)}`,backgroundColor:t=>Ge(t,"shift-1",o),color:t=>Ge(t,"shift-7",o),fontSize:t=>Ko(t,"inherit")}}}import{themeColor as Lt,themeSize as jo,themeSpacing as Dt}from"@domphy/theme";function yi(n={}){let{color:o="primary"}=n;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:Dt(8),height:Dt(8),fontSize:t=>jo(t,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:t=>Lt(t,"shift-3",o),color:t=>Lt(t,"shift-8",o),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}import{toState as qo}from"@domphy/core";import{themeSpacing as Ue,themeColor as Ht,themeSize as Yo}from"@domphy/theme";function Si(n={}){let{color:o="danger",label:t=999}=n,e=qo(t);return{style:{position:"relative","&::after":{content:r=>`"${e.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:Ue(1),minWidth:Ue(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>Yo(r,"decrease-1"),borderRadius:Ue(999),backgroundColor:r=>Ht(r,"shift-6",o),color:r=>Ht(r,"shift-0",o)}}}}import{themeColor as he,themeSize as Go,themeSpacing as Ot}from"@domphy/theme";function Pi(n={}){let{color:o="neutral",separator:t="/"}=n;return{_onInsert:e=>{e.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:e=>Go(e,"inherit"),gap:Ot(1),color:e=>he(e,"shift-6",o),backgroundColor:e=>he(e,"inherit",o),"& > *":{display:"inline-flex",alignItems:"center",color:e=>he(e,"shift-5",o)},"& > *:not(:last-child)::after":{content:`"${t}"`,color:e=>he(e,"shift-3",o),paddingInlineStart:Ot(1)},"& > [aria-current=page]":{color:e=>he(e,"shift-7",o),pointerEvents:"none"}}}}import{themeColor as Me,themeSize as Uo,themeSpacing as Ne}from"@domphy/theme";function _i(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:t=>Uo(t,"inherit"),paddingInline:Ne(1),border:"none",background:"none",cursor:"pointer",color:t=>Me(t,"shift-5",o),borderRadius:Ne(1),"&:hover":{color:t=>Me(t,"shift-7",o),backgroundColor:t=>Me(t,"shift-1",o)},"&:focus-visible":{outline:t=>`${Ne(.5)} solid ${Me(t,"shift-5",o)}`,outlineOffset:Ne(.5)}}}}import{toState as Ft,merge as Xe}from"@domphy/core";import{themeSpacing as j,themeColor as fe,themeDensity as Je,themeSize as Vt}from"@domphy/theme";import{themeColor as Re,themeSize as Xo,themeSpacing as M}from"@domphy/theme";var Jo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function Le(n={}){let{color:o="neutral",removable:t=!1}=n;return{dataTone:"shift-1",_onInit:e=>{let r={span:Jo,onClick:i=>{i.stopPropagation(),e.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:M(1),width:M(4),height:M(4),flexShrink:0,"&:hover":{backgroundColor:i=>Re(i,"shift-3",o)}}};t&&e.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:M(6),paddingBlock:"0px",borderRadius:M(1),paddingInlineStart:M(2),paddingInlineEnd:t?M(1):M(2),gap:M(2),fontSize:e=>Xo(e,"inherit"),backgroundColor:e=>Re(e,"inherit",o),color:e=>Re(e,"shift-6",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Re(e,"shift-3",o)}`}}}import{toState as Bt,merge as Qo}from"@domphy/core";import{computePosition as Zo,autoUpdate as er,offset as tr,flip as or,shift as rr}from"@floating-ui/dom";function H(n){let{open:o=!1,placement:t="bottom"}=n,e=null,r=null,i=null,s=null,a=Bt(o),l=Bt(t),m=()=>{i&&s&&(r&&r(),r=er(i,s,()=>{Zo(i,s,{placement:l.get(),middleware:[tr(12),or(),rr()],strategy:"fixed"}).then(({x:f,y:p,placement:b})=>{var y;Object.assign(s.style,{left:`${f}px`,top:`${p}px`}),b!==l.get()&&l.set(b),(y=n.onPlacement)==null||y.call(n,i,s,b)})}),a.set(!0))},c=()=>{r&&r(),r=null,a.set(!1)},d=()=>{e&&clearTimeout(e),e=setTimeout(m,100)},u=()=>{e&&clearTimeout(e),e=setTimeout(c,100)},g={style:{position:"fixed",pointerEvents:"auto",visibility:f=>a.get(f)?"visible":"hidden"},_onMount:f=>s=f.domElement,_portal:f=>{let p=f.domElement.querySelector("#domphy-floating");if(!p){let b={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};p=f.children.insert(b).domElement}return p}};return Qo(n.content,g),{show:d,hide:u,anchorPartial:{onKeyDown:f=>f.key==="Escape"&&u(),_onSchedule:f=>{let p=null;f.getRoot().addHook("Init",b=>{p=b.children.insert(n.content)}),f.addHook("BeforeRemove",()=>{u(),e&&clearTimeout(e),p&&p.remove()})},_onMount:f=>{i=f.domElement;let p=b=>{if(!a.get()||!i||!s)return;let y=b.target;!i.contains(y)&&!s.contains(y)&&u()};f.getRoot().domElement.addEventListener("click",p),f.addHook("BeforeRemove",()=>f.getRoot().domElement.removeEventListener("click",p))}}}}function Ki(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=Ft(n.value),a=Ft(r),{show:l,hide:m,anchorPartial:c}=H({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};Xe(n.content,d);let u={border:"none",outline:"none",padding:0,margin:0,flex:1,height:j(6),marginInlineStart:j(2),fontSize:p=>Vt(p,"inherit"),color:p=>fe(p,"shift-6",e),backgroundColor:p=>fe(p,"inherit",e)},g;n.input?(Xe(n.input,{onFocus:()=>l(),style:u,_key:"combobox-input"}),g=n.input):g={input:null,onFocus:()=>l(),value:p=>(s.get(p),""),style:u,_key:"combobox-input"};let h={div:p=>{let b=s.get(p),y=Array.isArray(b)?b:[b],T=o.filter(U=>y.includes(U.value)).map(U=>({span:U.label,$:[Le({color:e,removable:!0})],_key:U.value,_onRemove:qe=>{let ue=s.get(),Pt=(Array.isArray(ue)?ue:[ue]).filter(_o=>_o!==U.value);i?s.set(Pt):s.set(Pt[0])}}));return T.push(g),T},style:{display:"flex",flexWrap:"wrap",gap:j(1)}},f={_onInsert:p=>{p.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:p=>p.children.insert(h),style:{minWidth:j(32),outlineOffset:"-1px",outline:p=>`1px solid ${fe(p,"shift-3","neutral")}`,paddingBlock:p=>j(Je(p)*1),paddingInline:p=>j(Je(p)*1),borderRadius:p=>j(Je(p)*1),fontSize:p=>Vt(p,"inherit"),color:p=>fe(p,"shift-6",e),backgroundColor:p=>fe(p,"inherit",e)}};return Xe(c,f),c}import{toState as At}from"@domphy/core";import{themeSpacing as Qe,themeColor as Wt}from"@domphy/theme";function Kt(n={}){let{placement:o="bottom-end",color:t="neutral",sideOffset:e=Qe(6),bordered:r=!0}=n,i=At(o),s={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},a=At(s[i.get()]);i.onChange(c=>a.set(s[c]));let l=c=>c.includes("start")?e:c.includes("end")?"auto":"50%",m=c=>c.includes("end")?e:c.includes("start")?"auto":"50%";return{style:{position:"relative","&::after":{content:'""',position:"absolute",width:Qe(1.5),height:Qe(1.5),backgroundColor:c=>Wt(c,"inherit",t),borderWidth:r?"0px":"1px",borderColor:c=>Wt(c,"inherit",t),borderTopStyle:c=>{let d=a.get(c);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:c=>{let d=a.get(c);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:c=>{let d=a.get(c);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:c=>{let d=a.get(c);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:c=>{let d=a.get(c);return d.includes("top")?0:d.includes("bottom")?"auto":l(d)},right:c=>{let d=a.get(c);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:c=>{let d=a.get(c);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:c=>{let d=a.get(c);return d.includes("left")?0:d.includes("right")?"auto":l(d)},transform:c=>{let d=a.get(c),u=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",g=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${u},${g}) rotate(45deg)`}}}}}import{themeSpacing as Ze,themeColor as jt,themeDensity as qt,themeSize as nr}from"@domphy/theme";function Zi(n={}){let{color:o="inherit"}=n;return{_onInsert:t=>{t.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-1",style:{fontSize:t=>nr(t,"inherit"),backgroundColor:t=>jt(t,"inherit",o),boxShadow:t=>`inset ${Ze(1)} 0 0 0 ${jt(t,"shift-3",o)}`,border:"none",paddingBlock:t=>Ze(qt(t)*2),paddingInline:t=>Ze(qt(t)*4),margin:0}}}import{themeColor as N,themeDensity as et,themeSize as ir,themeSpacing as De}from"@domphy/theme";function ol(n={}){let{color:o="primary"}=n;return{_onInsert:t=>{t.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:t=>ir(t,"inherit"),paddingBlock:t=>De(et(t)*1),paddingInline:t=>De(et(t)*3),borderRadius:t=>De(et(t)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:t=>`1px solid ${N(t,"shift-3",o)}`,color:t=>N(t,"shift-6",o),backgroundColor:t=>N(t,"inherit",o),"&:hover:not([disabled]):not([aria-busy=true])":{color:t=>N(t,"shift-7",o),backgroundColor:t=>N(t,"shift-1",o)},"&:focus-visible":{boxShadow:t=>`inset 0 0 0 ${De(.5)} ${N(t,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>N(t,"shift-1","neutral"),outline:t=>`1px solid ${N(t,"shift-3","neutral")}`,color:t=>N(t,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}import{themeColor as x,themeSpacing as O,themeSize as lr}from"@domphy/theme";function ll(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"checkbox",_onInsert:e=>{e.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:e=>lr(e,"inherit"),display:"inline-flex",position:"relative",width:O(6),height:O(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:O(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${x(e,"shift-4",o)}`,color:e=>x(e,"shift-6",o),width:O(4),height:O(4)},"&:hover::before":{backgroundColor:e=>x(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${x(e,"shift-5",t)}`,backgroundColor:e=>x(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>x(e,"shift-4",t)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:e=>`${O(.5)} solid ${x(e,"inherit",t)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:e=>`1px solid ${x(e,"shift-4",t)}`,backgroundColor:e=>x(e,"inherit",t)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:e=>x(e,"shift-5",t)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:e=>x(e,"shift-4",t)},"&:focus-visible":{borderRadius:O(1.5),outline:e=>`${O(.5)} solid ${x(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>x(e,"shift-3","neutral"),pointerEvents:"none"}}}}import{themeSpacing as tt,themeColor as Yt,themeSize as ar}from"@domphy/theme";function cl(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:t=>ar(t,"inherit"),color:t=>Yt(t,"shift-6",o),backgroundColor:t=>Yt(t,"inherit",o),height:tt(6),paddingInline:tt(1.5),borderRadius:tt(1)}}}import{themeColor as B,themeDensity as ge,themeSize as Gt,themeSpacing as v}from"@domphy/theme";function hl(n={}){let{color:o="neutral",accentColor:t="primary",duration:e=240}=n;return{_onInsert:r=>{r.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:r=>Gt(r,"inherit"),color:r=>B(r,"shift-6",o),backgroundColor:r=>B(r,"inherit",o),overflow:"hidden","& > summary":{backgroundColor:r=>B(r,"shift-1",o),color:r=>B(r,"shift-7",o),fontSize:r=>Gt(r,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:v(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:r=>v(ge(r)*4),height:v(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:v(2),height:v(2),flexShrink:0,marginTop:`-${v(.5)}`,borderInlineEnd:r=>`${v(.5)} solid ${B(r,"shift-6",o)}`,borderBottom:r=>`${v(.5)} solid ${B(r,"shift-6",o)}`,transform:"rotate(45deg)",transition:`transform ${e}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:r=>B(r,"shift-2",o)},"& > summary:focus-visible":{borderRadius:r=>v(ge(r)*2),outlineOffset:`-${v(.5)}`,outline:r=>`${v(.5)} solid ${B(r,"shift-5",t)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:r=>v(ge(r)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${e}ms ease, opacity ${e}ms ease, padding ${e}ms ease`},"&[open] > :not(summary)":{maxHeight:v(250),opacity:1,paddingTop:r=>v(ge(r)*1),paddingBottom:r=>v(ge(r)*3)}}}}import{themeColor as Ut,themeSpacing as Xt,themeSize as Jt}from"@domphy/theme";function yl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${Xt(24)}, max-content) 1fr`,columnGap:Xt(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:t=>Jt(t,"inherit"),color:t=>Ut(t,"shift-7",o)},"& dd":{margin:0,fontSize:t=>Jt(t,"inherit"),color:t=>Ut(t,"shift-6",o)}}}}import{toState as sr}from"@domphy/core";import{themeColor as He,themeDensity as mr,themeSize as cr,themeSpacing as ot}from"@domphy/theme";function Sl(n={}){let{color:o="neutral",open:t=!1}=n,e=sr(t);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,i)=>{if(r.target!==i.domElement)return;let s=i.domElement.getBoundingClientRect();r.clientX>=s.left&&r.clientX<=s.right&&r.clientY>=s.top&&r.clientY<=s.bottom||e.set(!1)},onTransitionEnd:(r,i)=>{let s=i.domElement;s.style.opacity==="0"&&(s.close(),document.body.style.overflow="")},_onMount:r=>{let i=r.domElement,s=a=>{a?(i.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{i.style.opacity="1";let l=i.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');l==null||l.focus()})):i.style.opacity="0"};s(e.get()),e.onChange(s)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>cr(r,"inherit"),color:r=>He(r,"shift-7",o),backgroundColor:r=>He(r,"inherit",o),border:"none",padding:r=>ot(mr(r)*3),boxShadow:r=>`0 ${ot(8)} ${ot(16)} ${He(r,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:r=>He(r,"shift-1","neutral"),opacity:.75}}}}import{themeColor as dr,themeSize as ur}from"@domphy/theme";function wl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:t=>ur(t,"inherit"),fontStyle:"italic",color:t=>dr(t,"shift-7",o)}}}import{themeColor as Qt,themeSize as pr,themeSpacing as Oe}from"@domphy/theme";function $l(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:Oe(2),marginInline:0,marginTop:Oe(3),marginBottom:Oe(3),color:t=>Qt(t,"shift-6",o),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:Oe(2)},"& figcaption":{fontSize:t=>pr(t,"decrease-1"),color:t=>Qt(t,"shift-5",o),lineHeight:1.45}}}}import{themeColor as Be,themeDensity as Z,themeSpacing as R,themeSize as rt}from"@domphy/theme";function Rl(n={}){let{color:o="neutral",layout:t="horizontal"}=n,e=t==="vertical";return{_onInsert:r=>{r.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>R(Z(r)*3),paddingBlock:r=>R(Z(r)*3),border:"none",borderRadius:r=>R(Z(r)*2),fontSize:r=>rt(r,"inherit"),backgroundColor:r=>Be(r,"inherit",o),display:"grid",gridTemplateColumns:e?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:R(4),rowGap:R(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>rt(r,"inherit"),fontWeight:600,paddingBlock:r=>R(Z(r)*1),borderRadius:r=>R(Z(r)*2),color:r=>Be(r,"shift-6",o),backgroundColor:r=>Be(r,"inherit",o)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>e?"0px":R(Z(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:e?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:e?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:e?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${R(2)} * -1)`,fontSize:r=>rt(r,"decrease-1"),color:r=>Be(r,"shift-6",o)}}}}import{themeColor as hr,themeSize as fr,themeSpacing as gr}from"@domphy/theme";var br={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Ol(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{["h1","h2","h3","h4","h5","h6"].includes(t.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:t=>hr(t,"shift-8",o),marginTop:0,marginBottom:gr(2),fontSize:t=>{let e=br[t.elementNode.tagName]||"inherit";return fr(t,e)}}}}import{themeColor as yr,themeSpacing as Zt}from"@domphy/theme";function Al(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:Zt(3),marginBottom:Zt(3),backgroundColor:t=>yr(t,"shift-3",o)}}}import{themeColor as Cr,themeSpacing as vr}from"@domphy/theme";function ql(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:vr(2),backgroundColor:t=>Cr(t,"shift-1",o)}}}import{themeSpacing as eo}from"@domphy/theme";function Ul(){return{_onInsert:n=>{n.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:eo(6),height:eo(6)}}}import{themeColor as to,themeDensity as ee,themeSpacing as te,themeSize as xr}from"@domphy/theme";function Ql(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"color",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:e=>xr(e,"inherit"),paddingBlock:e=>te(ee(e)*1),paddingInline:e=>te(ee(e)*1),blockSize:e=>te(6+ee(e)*2),inlineSize:e=>te(6+ee(e)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:e=>te(ee(e)*1)},"&::-moz-color-swatch":{borderRadius:e=>te(ee(e)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>to(e,"shift-1","neutral"),outline:e=>`1px solid ${to(e,"shift-3","neutral")}`}}}}import{themeColor as F,themeDensity as nt,themeSpacing as be,themeSize as Er}from"@domphy/theme";function oa(n={}){let{mode:o="datetime-local",color:t="neutral",accentColor:e="primary"}=n;return{type:o,_onSchedule:(r,i)=>{r.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),i.type=o},style:{fontFamily:"inherit",fontSize:r=>Er(r,"inherit"),lineHeight:"inherit",color:r=>F(r,"shift-6",t),backgroundColor:r=>F(r,"inherit",t),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${F(r,"shift-3",t)}`,borderRadius:r=>be(nt(r)*1),paddingInline:r=>be(nt(r)*3),height:r=>be(6+nt(r)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${be(.5)} solid ${F(r,"shift-5",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>F(r,"shift-5","neutral"),backgroundColor:r=>F(r,"shift-1","neutral"),outline:r=>`1px solid ${F(r,"shift-3","neutral")}`},"&:invalid":{outline:r=>`${be(.5)} solid ${F(r,"shift-5","error")}`}}}}import{themeColor as E,themeDensity as it,themeSpacing as P,themeSize as Sr}from"@domphy/theme";function la(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"file",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),r.type="file"},style:{fontFamily:"inherit",fontSize:e=>Sr(e,"inherit"),lineHeight:"inherit",color:e=>E(e,"shift-6",o),backgroundColor:e=>E(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${E(e,"shift-3",o)}`,borderRadius:e=>P(it(e)*1),height:e=>P(6+it(e)*2),paddingInline:e=>P(it(e)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>E(e,"shift-7",t),backgroundColor:e=>E(e,"shift-2",t)},"&::-webkit-file-upload-button":{marginTop:P(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>E(e,"shift-7",o),backgroundColor:e=>E(e,"shift-2",o)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${P(.5)} solid ${E(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>E(e,"shift-5","neutral"),outline:e=>`1px solid ${E(e,"shift-3","neutral")}`,backgroundColor:e=>E(e,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:e=>E(e,"shift-5","neutral"),backgroundColor:e=>E(e,"shift-2","neutral")}}}}import{themeColor as V,themeDensity as lt,themeSpacing as ye,themeSize as kr}from"@domphy/theme";function ca(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"search",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),r.type="search"},style:{fontFamily:"inherit",fontSize:e=>kr(e,"inherit"),lineHeight:"inherit",color:e=>V(e,"shift-6",o),backgroundColor:e=>V(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${V(e,"shift-3",o)}`,borderRadius:e=>ye(lt(e)*1),minWidth:ye(32),paddingInline:e=>ye(lt(e)*3),paddingBlock:e=>ye(lt(e)*1),"&::placeholder":{color:e=>V(e,"shift-4",o)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${ye(.5)} solid ${V(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>V(e,"shift-5","neutral"),backgroundColor:e=>V(e,"shift-1","neutral"),outline:e=>`1px solid ${V(e,"shift-3","neutral")}`}}}}import{themeColor as S,themeDensity as at,themeSpacing as A,themeSize as Tr}from"@domphy/theme";function ha(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"text",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),r.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:A(32),paddingInline:e=>A(at(e)*3),paddingBlock:e=>A(at(e)*1),borderRadius:e=>A(at(e)*1),fontSize:e=>Tr(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${S(e,"shift-3",o)}`,color:e=>S(e,"shift-6",o),backgroundColor:e=>S(e,"inherit",o),"&::placeholder":{color:e=>S(e,"shift-4")},"&:not(:placeholder-shown)":{color:e=>S(e,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${A(.5)} solid ${S(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>S(e,"shift-1","neutral"),outline:e=>`1px solid ${S(e,"shift-3","neutral")}`,color:e=>S(e,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:e=>`${A(.5)} solid ${S(e,"shift-5","error")}`},"&[data-status=error]":{outline:e=>`${A(.5)} solid ${S(e,"shift-5","error")}`},"&[data-status=warning]":{outline:e=>`${A(.5)} solid ${S(e,"shift-5","warning")}`}}}}import{themeColor as q,themeSpacing as C}from"@domphy/theme";function ya(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"range",_onInsert:e=>{e.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:C(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>q(e,"shift-2",o)},"&::-moz-range-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>q(e,"shift-2",o)},"&::-webkit-slider-thumb":{appearance:"none",width:C(4),height:C(4),borderRadius:C(999),border:"none",marginTop:`calc((${C(1.5)} - ${C(4)}) / 2)`,backgroundColor:e=>q(e,"shift-6",t)},"&::-moz-range-thumb":{width:C(4),height:C(4),borderRadius:C(999),border:"none",backgroundColor:e=>q(e,"shift-6",t)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:e=>q(e,"shift-7",t)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:e=>q(e,"shift-7",t)},"&:focus-visible":{outline:e=>`${C(.5)} solid ${q(e,"shift-4",t)}`,outlineOffset:C(1),borderRadius:C(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as Y,themeDensity as st,themeSpacing as Ce,themeSize as Pr}from"@domphy/theme";function Ea(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"number",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),r.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:Ce(32),paddingInline:e=>Ce(st(e)*3),paddingBlock:e=>Ce(st(e)*1),borderRadius:e=>Ce(st(e)*1),fontSize:e=>Pr(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Y(e,"shift-3",o)}`,color:e=>Y(e,"shift-6",o),backgroundColor:e=>Y(e,"inherit",o),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${Ce(.5)} solid ${Y(e,"shift-5",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>Y(e,"shift-1","neutral"),outline:e=>`1px solid ${Y(e,"shift-3","neutral")}`,color:e=>Y(e,"shift-5","neutral")}}}}import{themeColor as mt,themeSize as wr,themeSpacing as ct}from"@domphy/theme";function Pa(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:t=>wr(t,"inherit"),color:t=>mt(t,"shift-6",o),backgroundColor:t=>mt(t,"inherit",o),paddingBlock:ct(.5),paddingInline:ct(1.5),borderRadius:ct(1),outline:t=>`1px solid ${mt(t,"shift-3",o)}`}}}import{themeColor as dt,themeSize as Ir,themeSpacing as _r}from"@domphy/theme";function za(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:_r(2),fontSize:e=>Ir(e,"inherit"),color:e=>dt(e,"shift-6",o),cursor:"pointer","&:focus-within":{color:e=>dt(e,"shift-7",t)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:e=>dt(e,"shift-5","neutral")}}}}import{themeColor as ve,themeSize as zr,themeSpacing as ut}from"@domphy/theme";function Na(n={}){let{color:o="primary",accentColor:t="secondary"}=n;return{_onInsert:e=>{e.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:e=>zr(e,"inherit"),color:e=>ve(e,"shift-6",o),textDecoration:"none","&:visited":{color:e=>ve(e,"shift-6",t)},"&:hover:not([disabled])":{color:e=>ve(e,"shift-7",o),textDecoration:"underline"},"&:focus-visible":{borderRadius:ut(1),outlineOffset:ut(1),outline:e=>`${ut(.5)} solid ${ve(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>ve(e,"shift-5","neutral")}}}}import{themeSpacing as pt,themeSize as $r,themeColor as oo}from"@domphy/theme";function Oa(n={}){let{accentColor:o="highlight",tone:t="shift-1"}=n;return{_onInsert:e=>{e.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:t,style:{display:"inline-flex",alignItems:"center",fontSize:e=>$r(e,"inherit"),color:e=>oo(e,"shift-6",o),backgroundColor:e=>oo(e,"inherit",o),height:pt(6),borderRadius:pt(1),paddingInline:pt(1.5)}}}import{themeColor as Mr,themeSize as Nr}from"@domphy/theme";function Wa(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:t=>Nr(t,"inherit"),color:t=>Mr(t,"shift-6",o),lineHeight:1.5,marginTop:0,marginBottom:0}}}import{themeColor as ro,themeDensity as ht,themeSpacing as ft,themeSize as Rr}from"@domphy/theme";function Ya(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:t=>Rr(t,"inherit"),color:t=>ro(t,"shift-6",o),backgroundColor:t=>ro(t,"shift-1",o),border:"none",paddingBlock:t=>ft(ht(t)*2),paddingInline:t=>ft(ht(t)*3),borderRadius:t=>ft(ht(t)*2)}}}import{themeColor as Fe,themeSpacing as xe}from"@domphy/theme";function Ja(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:xe(2),border:0,borderRadius:xe(999),overflow:"hidden",backgroundColor:e=>Fe(e,"shift-2",o),"&::-webkit-progress-bar":{backgroundColor:e=>Fe(e,"shift-2",o),borderRadius:xe(999)},"&::-webkit-progress-value":{backgroundColor:e=>Fe(e,"shift-6",t),borderRadius:xe(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:e=>Fe(e,"shift-6",t),borderRadius:xe(999)}}}}import{themeColor as W,themeSize as Lr,themeSpacing as Ee}from"@domphy/theme";function ts(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"radio",_onInsert:e=>{if(e.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:e=>Lr(e,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:Ee(6),height:Ee(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${W(e,"shift-4",o)}`,color:e=>W(e,"shift-6",o),width:Ee(4),height:Ee(4)},"&:hover::before":{backgroundColor:e=>W(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${W(e,"shift-5",t)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:e=>W(e,"shift-5",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>W(e,"shift-4",t)},"&:focus-visible":{borderRadius:"50%",outline:e=>`${Ee(.5)} solid ${W(e,"shift-5",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>W(e,"shift-3","neutral"),pointerEvents:"none"}}}}import{themeColor as w,themeDensity as Se,themeSize as Dr,themeSpacing as G}from"@domphy/theme";function ns(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:e=>Dr(e,"inherit"),lineHeight:"inherit",color:e=>w(e,"shift-6",o),backgroundColor:e=>w(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${w(e,"shift-3",o)}`,borderRadius:e=>G(Se(e)*1),paddingBlock:e=>G(Se(e)*1),paddingLeft:e=>G(Se(e)*3),paddingRight:e=>G(Se(e)*1),"&:not([multiple])":{height:e=>G(6+Se(e)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${G(.5)} solid ${w(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${G(.5)} solid ${w(e,"shift-5",t)}`},"& optgroup":{color:e=>w(e,"shift-8",o)},"& option[disabled]":{color:e=>w(e,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>w(e,"shift-5","neutral"),outline:e=>`1px solid ${w(e,"shift-3","neutral")}`,backgroundColor:e=>w(e,"shift-1","neutral")}}}}import{hashString as Hr}from"@domphy/core";import{themeColor as Or,themeSpacing as no}from"@domphy/theme";function ss(n={}){let{color:o="neutral"}=n,t={"0%,100%":{opacity:1},"50%":{opacity:.4}},e=Hr(JSON.stringify(t));return{ariaHidden:"true",style:{height:no(6),display:"block",borderRadius:no(1),backgroundColor:r=>Or(r,"shift-2",o),animation:`${e} 1.5s ease-in-out infinite`,[`@keyframes ${e}`]:t}}}import{hashString as Br}from"@domphy/core";import{themeColor as io,themeSpacing as gt}from"@domphy/theme";var ao={to:{transform:"rotate(360deg)"}},lo=Br(JSON.stringify(ao));function us(n={}){let{color:o="neutral"}=n;return{role:"status",ariaLabel:"loading",_onInsert:t=>{t.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{display:"inline-block",margin:0,flexShrink:0,width:gt(6),height:gt(6),borderRadius:"50%",border:t=>`${gt(.5)} solid ${io(t,"shift-3",o)}`,borderTopColor:t=>io(t,"shift-6",o),boxSizing:"border-box",padding:0,animation:`${lo} 0.7s linear infinite`,[`@keyframes ${lo}`]:ao}}}import{toState as Fr}from"@domphy/core";import{themeColor as Vr,themeDensity as so,themeSize as Ar,themeSpacing as mo}from"@domphy/theme";function bs(n={}){var s;let{color:o="neutral",multiple:t=!1}=n,e=Fr((s=n.value)!=null?s:t?[]:null),r={div:a=>{let l=e.get(a);return(Array.isArray(l)?l:[l]).map(c=>({input:null,name:n.name,value:c||""}))},hidden:!0};return{dataTone:"shift-11",_context:{select:{value:e,multiple:t}},_onInit:a=>{a.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),a.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:a=>mo(so(a)*2),paddingInline:a=>mo(so(a)*2),fontSize:a=>Ar(a,"inherit"),backgroundColor:a=>Vr(a,"inherit",o)}}}import{themeSpacing as Ve,themeColor as oe,themeDensity as co,themeSize as Wr}from"@domphy/theme";function xs(n={}){let{accentColor:o="primary",color:t="neutral",value:e=null}=n;return{role:"option",_onInit:i=>{i.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let s=i.getContext("select");if(s){let a=s.value;i.attributes.set("ariaSelected",l=>{let m=a.get(l);return s.multiple?m.includes(e):m==e}),i.addEvent("click",()=>{let l=a.get();s.multiple?l.includes(e)?a.set(l.filter(m=>m!==e)):a.set(l.concat([e])):l!=e&&a.set(e)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:i=>Wr(i,"inherit"),height:i=>Ve(6+co(i)*2),paddingInline:i=>Ve(co(i)*3),border:"none",outline:"none",color:i=>oe(i,"shift-6",t),backgroundColor:i=>oe(i,"inherit",t),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:i=>oe(i,"shift-1",t)},"&[aria-selected=true]":{backgroundColor:i=>oe(i,"shift-2",o),color:i=>oe(i,"shift-8")},"&:focus-visible":{outline:i=>`${Ve(.5)} solid ${oe(i,"shift-5",o)}`,outlineOffset:`-${Ve(.5)}`}}}}import{toState as uo,merge as po}from"@domphy/core";import{themeSpacing as ke,themeColor as bt,themeDensity as yt,themeSize as Kr}from"@domphy/theme";function ws(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=uo(n.value),a=uo(r),{show:l,hide:m,anchorPartial:c}=H({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&m()};po(n.content,d);let u={div:h=>{let f=s.get(h),p=Array.isArray(f)?f:[f];return o.filter(y=>p.includes(y.value)).map(y=>({span:y.label,$:[Le({color:e,removable:i})],_key:y.value,_onRemove:we=>{let T=s.get(),qe=(Array.isArray(T)?T:[T]).filter(ue=>ue!==y.value);i?s.set(qe):s.set(qe[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:ke(1),flex:1}},g={_onInsert:h=>{h.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:h=>h.children.insert(u),onClick:()=>a.get()?m():l(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:h=>ke(6+yt(h)*2),minWidth:ke(32),outlineOffset:"-1px",outline:h=>`1px solid ${bt(h,"shift-3","neutral")}`,paddingInline:h=>ke(yt(h)*2),borderRadius:h=>ke(yt(h)*1),fontSize:h=>Kr(h,"inherit"),color:h=>bt(h,"shift-6",e),backgroundColor:h=>bt(h,"inherit",e)}};return po(c,g),c}import{themeColor as Ct,themeSize as ho,themeSpacing as L}from"@domphy/theme";function $s(n={}){let{accentColor:o="primary"}=n;return{dataTone:"increase-2",type:"checkbox",_onSchedule:t=>{if(t.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:t=>ho(t,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:L(8),height:L(6),cursor:"pointer",margin:"0",paddingBlock:L(1),"&:checked":{"&::before":{backgroundColor:t=>Ct(t,"increase-3",o)},"&::after":{left:`calc(100% - ${L(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:L(3),height:L(3),borderRadius:L(999),left:L(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:t=>Ct(t,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:L(999),display:"inline-block",fontSize:t=>ho(t,"inherit"),lineHeight:1,backgroundColor:t=>Ct(t)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as jr}from"@domphy/core";import{themeColor as re,themeSize as qr,themeSpacing as k}from"@domphy/theme";function Ls(n={}){let{checked:o=!1,accentColor:t="primary",color:e="neutral"}=n,r=jr(o);return{_onSchedule:i=>{i.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:i=>r.get(i),dataTone:"increase-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:i=>qr(i),border:"none",outlineWidth:"1px",outline:i=>`1px solid ${re(i,"shift-2",e)}`,minWidth:k(12),minHeight:k(6),borderRadius:k(999),paddingLeft:k(7),paddingRight:k(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:i=>re(i,"inherit",e),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:k(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:k(5),height:k(5),borderRadius:k(999),color:i=>re(i,"shift-6"),backgroundColor:i=>re(i,"decrease-2",e)},"&[aria-checked=true]":{backgroundColor:i=>re(i,"increase-3",t),outline:"none",color:i=>re(i,"decrease-2"),paddingLeft:k(2),paddingRight:k(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${k(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as Yr,themeSize as Gr}from"@domphy/theme";function Bs(n={}){let{color:o="neutral"}=n;return{dataSize:"decrease-1",_onInsert:t=>{t.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:t=>Gr(t,"inherit"),color:t=>Yr(t,"shift-6",o)}}}import{themeColor as Ur,themeSize as Xr}from"@domphy/theme";function Ws(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:t=>Xr(t,"inherit"),fontWeight:700,color:t=>Ur(t,"shift-8",o)}}}import{themeColor as Jr,themeSize as Qr}from"@domphy/theme";function Ys(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:t=>Qr(t,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:t=>Jr(t,"shift-6",o)}}}import{themeColor as Zr,themeSize as en}from"@domphy/theme";function Js(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:t=>en(t,"decrease-1"),verticalAlign:"super",lineHeight:0,color:t=>Zr(t,"shift-6",o)}}}import{themeColor as I,themeDensity as ne,themeSpacing as ie,themeSize as fo}from"@domphy/theme";function em(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:t=>fo(t,"inherit"),color:t=>I(t,"shift-6",o),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-7",o),backgroundColor:t=>I(t,"inherit")},"& td":{textAlign:"left",paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-6",o),boxShadow:t=>`inset 0 1px 0 ${I(t,"shift-3",o)}`,fontSize:t=>fo(t,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-7",o),backgroundColor:t=>I(t,"inherit"),boxShadow:t=>`inset 0 -1px 0 ${I(t,"shift-3",o)}`},"& tr":{backgroundColor:t=>I(t,"inherit")},"& tbody tr:hover":{backgroundColor:t=>I(t,"shift-2")+"!important"}}}}import{themeColor as _,themeDensity as vt,themeSpacing as le,themeSize as tn}from"@domphy/theme";function nm(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:e=>le(vt(e)*4),paddingBlock:e=>le(vt(e)*2),border:"none",borderRadius:e=>le(vt(e)*2),fontSize:e=>tn(e,"inherit"),color:e=>_(e,"shift-6",o),outlineOffset:"-1px",outline:e=>`1px solid ${_(e,"shift-3",o)}`,backgroundColor:e=>_(e,"inherit",o),"&::placeholder":{color:e=>_(e,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${le(.5)} solid ${_(e,"shift-4",t)}`},"&:focus-visible":{outline:e=>`${le(.5)} solid ${_(e,"shift-5",t)}`},"&:invalid":{outline:e=>`${le(.5)} solid ${_(e,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>_(e,"shift-5","neutral"),outline:e=>`1px solid ${_(e,"shift-3","neutral")}`,backgroundColor:e=>_(e,"shift-1","neutral")}}}}import{themeColor as on,themeSize as rn,themeSpacing as nn}from"@domphy/theme";function sm(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:t=>rn(t,"inherit"),color:t=>on(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:nn(3),listStyleType:"disc",listStylePosition:"outside"}}}import{themeColor as ln,themeSize as an,themeSpacing as sn}from"@domphy/theme";function um(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:t=>an(t,"inherit"),color:t=>ln(t,"shift-6",o),marginTop:0,marginBottom:0,paddingLeft:sn(3),listStyleType:"decimal",listStylePosition:"outside"}}}import{toState as mn}from"@domphy/core";import{themeColor as ae,themeDensity as Te,themeSize as cn,themeSpacing as se}from"@domphy/theme";function dn(n,o){if(o<=7)return Array.from({length:o},(i,s)=>s+1);let t=[1];n>3&&t.push("...");let e=Math.max(2,n-1),r=Math.min(o-1,n+1);for(let i=e;i<=r;i++)t.push(i);return n<o-2&&t.push("..."),t.push(o),t}function gm(n){var a;let{total:o,color:t="neutral",accentColor:e="primary"}=n,r=mn((a=n.value)!=null?a:1),i={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:l=>se(6+Te(l)*2),height:l=>se(6+Te(l)*2),paddingInline:l=>se(Te(l)*2),borderRadius:l=>se(Te(l)*1),border:"none",cursor:"pointer",fontSize:l=>cn(l,"inherit"),backgroundColor:"transparent",color:l=>ae(l,"shift-6",t),"&:hover:not([disabled])":{backgroundColor:l=>ae(l,"shift-1",t)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},s=zt(_t({},i),{backgroundColor:l=>ae(l,"shift-2",e),color:l=>ae(l,"shift-8",e),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:l=>ae(l,"shift-2",e)}});return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:l=>{let m={div:c=>{let d=r.get(c),u=[];u.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:i});for(let g of dn(d,o))if(g==="...")u.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:h=>se(Te(h)*2),color:h=>ae(h,"shift-4",t)}});else{let h=g===d;u.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:h?"page":void 0,disabled:h,onClick:()=>r.set(g),style:h?s:i})}return u.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=o,onClick:()=>d<o&&r.set(d+1),style:i}),u},style:{display:"flex",alignItems:"center",gap:se(1)}};l.children.insert(m)},style:{display:"inline-flex"}}}import{themeColor as go,themeSize as un,themeSpacing as pn}from"@domphy/theme";function vm(n={}){let{color:o="neutral"}=n;return{role:"separator",_onInsert:t=>{t.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:pn(2),fontSize:t=>un(t,"inherit"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:t=>go(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:t=>go(t,"shift-3",o),borderWidth:"1px",borderBottomStyle:"solid"}}}}import{toState as hn}from"@domphy/core";import{themeColor as Ae,themeDensity as fn,themeSize as gn,themeSpacing as Pe}from"@domphy/theme";var bo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},bn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},xt=n=>n==="left"||n==="right";function km(n={}){let{color:o="neutral",open:t=!1,placement:e="right",size:r}=n,i=hn(t),s=xt(e)?Pe(80):Pe(64),a=r!=null?r:s;return{_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(l,m)=>{l.target===m.domElement&&i.set(!1)},onTransitionEnd:(l,m)=>{let c=m.domElement;i.get()||(c.close(),document.body.style.overflow="")},_onMount:l=>{let m=l.domElement,c=d=>{d?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=bo[e]};c(i.get()),i.onChange(c)},style:{transform:bo[e],transition:"transform 0.25s ease",fontSize:l=>gn(l,"inherit"),color:l=>Ae(l,"shift-7",o),backgroundColor:l=>Ae(l,"inherit",o),border:"none",padding:l=>Pe(fn(l)*3),margin:bn[e],width:xt(e)?a:"100dvw",height:xt(e)?"100dvh":a,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:l=>`0 ${Pe(4)} ${Pe(12)} ${Ae(l,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:l=>Ae(l,"shift-1","neutral"),opacity:.75}}}}import{toState as yn,merge as yo}from"@domphy/core";function $m(n){let{open:o=!1,placement:t="bottom",openOn:e="click"}=n,r=null,i=yn(o),{show:s,hide:a,anchorPartial:l}=H({open:i,placement:t,content:n.content,onPlacement:n.onPlacement}),m={role:"dialog",dataTone:"shift-6",onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),_onInsert:d=>{let u=d.attributes.get("id");r=u||d.nodeId,!u&&d.attributes.set("id",r)}};return yo(n.content,m),yo(l,{ariaHaspopup:"dialog",ariaExpanded:d=>i.get(d),onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),onClick:()=>e==="click"&&(i.get()?a():s()),onFocus:()=>s(),onBlur:()=>a(),_onMount:d=>r&&d.attributes.set("ariaControls",r)}),l}import{toState as Cn}from"@domphy/core";import{themeColor as Et,themeDensity as St,themeSize as vn,themeSpacing as K}from"@domphy/theme";function Lm(n={}){let{position:o="top-center",color:t="neutral"}=n,e=Cn(!1),r=o.startsWith("top"),i=o.endsWith("center"),s=o.endsWith("right"),a={div:[],id:`domphy-toast-${o}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":s?"end":"start",inset:0,gap:K(4),zIndex:30,padding:K(6),pointerEvents:"none"}};return{_portal:l=>{let m=l.domElement.querySelector(`#domphy-toast-${o}`);return m||(m=l.children.insert(a).domElement),m},role:"status",ariaAtomic:"true",style:{minWidth:K(32),pointerEvents:"auto",paddingBlock:l=>K(St(l)*2),paddingInline:l=>K(St(l)*4),borderRadius:l=>K(St(l)*2),fontSize:l=>vn(l,"inherit"),color:l=>Et(l,"shift-1",t),backgroundColor:l=>Et(l,"shift-9",t),boxShadow:l=>`0 ${K(2)} ${K(8)} ${Et(l,"shift-3","neutral")}`,opacity:l=>Number(e.get(l)),transform:l=>e.get(l)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>e.set(!0)),_onBeforeRemove:(l,m)=>{let c=d=>{d.propertyName==="transform"&&(l.domElement.removeEventListener("transitionend",c),m())};l.domElement.addEventListener("transitionend",c),e.set(!1)}}}import{toState as xn,merge as En}from"@domphy/core";import{themeSpacing as kt,themeColor as Co,themeDensity as Tt,themeSize as Sn}from"@domphy/theme";function jm(n={}){let{open:o=!1,placement:t="top",content:e="Tooltip Content"}=n,r=null,i=xn(t),s=typeof e=="string"?{span:e}:e,{show:a,hide:l,anchorPartial:m}=H({open:o,placement:t,content:s}),c={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-11",_onInsert:u=>{let g=u.attributes.get("id");r=g||u.nodeId,!g&&u.attributes.set("id",r)},style:{paddingBlock:u=>kt(Tt(u)*1),paddingInline:u=>kt(Tt(u)*3),borderRadius:u=>kt(Tt(u)*1),color:u=>Co(u,"shift-6"),backgroundColor:u=>Co(u),fontSize:u=>Sn(u,"inherit")},$:[Kt({placement:t,bordered:!1})]};return s.$||(s.$=[]),s.$.push(c),En(m,{onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),onKeyDown:u=>u.key==="Escape"&&l(),_onMount:u=>r&&u.attributes.set("ariaDescribedby",r)}),m}import{ElementNode as vo}from"@domphy/core";function xo(n,o){return n.key!==void 0&&n.key!==null?String(n.key):`index-${o}`}function Um(n={}){let{duration:o=300,delay:t=0}=n,e=new Map;return{_onBeforeUpdate:r=>{e=new Map,r.children.items.forEach((i,s)=>{if(!(i instanceof vo))return;let a=i.domElement;a&&e.set(xo(i,s),a.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((i,s)=>{if(!(i instanceof vo))return;let a=i.domElement;if(!a)return;let l=xo(i,s),m=e.get(l);if(!m)return;let c=a.getBoundingClientRect(),d=m.left-c.left,u=m.top-c.top;if(Math.abs(d)<.5&&Math.abs(u)<.5)return;let g=a.style.transition,h=a.style.transform;a.style.transition="none",a.style.transform=`translate(${d}px, ${u}px)`,a.getBoundingClientRect(),requestAnimationFrame(()=>{a.style.transition=`transform ${o}ms ease ${t}ms`,a.style.transform="translate(0px, 0px)"});let f=()=>{a.style.transition=g,a.style.transform=h,a.removeEventListener("transitionend",p)},p=b=>{b.propertyName==="transform"&&f()};a.addEventListener("transitionend",p),setTimeout(f,o+t+34)}),e.clear()}}}import{merge as kn}from"@domphy/core";import{toState as Tn}from"@domphy/core";function tc(n={}){return{role:"tablist",_onSchedule:(t,e)=>{let r={_context:{tabs:{activeKey:Tn(n.activeKey||0)}}};kn(e,r)}}}import{themeSpacing as me,themeColor as ce,themeDensity as Eo,themeSize as Pn}from"@domphy/theme";function ic(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"tab",_onInsert:r=>{var m;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let i=r.getContext("tabs"),s=(m=r.parent)==null?void 0:m.children.items;s=s.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tab");let a=r.key||s.findIndex(c=>c==r),l={id:"tab"+r.parent.nodeId+a,ariaControls:"tabpanel"+r.parent.nodeId+a,ariaSelected:c=>i.activeKey.get(c)==a,onClick:()=>i.activeKey.set(a),onKeyDown:c=>{var p,b,y,we;let d=c.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;c.preventDefault();let u=((b=(p=r.parent)==null?void 0:p.children.items)!=null?b:[]).filter(T=>T.type==="ElementNode"&&T.attributes.get("role")==="tab"),g=u.findIndex(T=>T===r),h=g;d==="ArrowRight"?h=(g+1)%u.length:d==="ArrowLeft"?h=(g-1+u.length)%u.length:d==="Home"?h=0:d==="End"&&(h=u.length-1);let f=u[h];i.activeKey.set((y=f.key)!=null?y:h),(we=f.domElement)==null||we.focus()}};r.merge(l)},style:{cursor:"pointer",fontSize:r=>Pn(r,"inherit"),height:r=>me(6+Eo(r)*2),paddingInline:r=>me(Eo(r)*4),border:"none",outline:"none",color:r=>ce(r,"shift-6"),backgroundColor:r=>ce(r,"inherit"),boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-2",t)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-3",t)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-4",o)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-6",o)}`}}}}import{themeSpacing as So,themeDensity as ko}from"@domphy/theme";function mc(){return{role:"tabpanel",style:{paddingBlock:o=>So(ko(o)*2),paddingInline:o=>So(ko(o)*2)},_onInsert:o=>{var s;let t=o.getContext("tabs"),e=(s=o.parent)==null?void 0:s.children.items;e=e.filter(a=>a.type=="ElementNode"&&a.attributes.get("role")=="tabpanel");let r=o.key||e.findIndex(a=>a==o),i={id:"tabpanel"+o.parent.nodeId+r,ariaLabelledby:"tab"+o.parent.nodeId+r,hidden:a=>t.activeKey.get(a)!=r};o.merge(i)}}}import{merge as wn}from"@domphy/core";import{toState as In}from"@domphy/core";import{themeColor as _n,themeDensity as To,themeSize as zn,themeSpacing as Po}from"@domphy/theme";function gc(n={}){let{color:o="neutral"}=n;return{role:"menu",dataTone:"shift-11",_onSchedule:(e,r)=>{let i={_context:{menu:{activeKey:In(n.activeKey||0)}}};wn(r,i)},style:{display:"flex",flexDirection:"column",paddingBlock:e=>Po(To(e)*2),paddingInline:e=>Po(To(e)*2),fontSize:e=>zn(e,"inherit"),backgroundColor:e=>_n(e,"inherit",o)}}}import{themeSpacing as We,themeColor as de,themeDensity as wo,themeSize as $n}from"@domphy/theme";function vc(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"menuitem",_onInsert:r=>{var l;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let i=r.getContext("menu"),s=(l=r.parent)==null?void 0:l.children.items;s=s.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="menuitem");let a=r.key||s.findIndex(m=>m==r);r.attributes.set("ariaCurrent",m=>i.activeKey.get(m)==a||void 0),r.addEvent("click",()=>i.activeKey.set(a))},onKeyDown:(r,i)=>{var c,d,u;let s=r.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(s))return;r.preventDefault();let a=((d=(c=i.parent)==null?void 0:c.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="menuitem"),l=a.findIndex(g=>g===i),m=l;s==="ArrowDown"?m=(l+1)%a.length:s==="ArrowUp"?m=(l-1+a.length)%a.length:s==="Home"?m=0:s==="End"&&(m=a.length-1),(u=a[m].domElement)==null||u.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:r=>$n(r,"inherit"),height:r=>We(6+wo(r)*2),paddingInline:r=>We(wo(r)*3),border:"none",outline:"none",color:r=>de(r,"shift-6"),backgroundColor:r=>de(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>de(r,"shift-1")},"&[aria-current=true]":{backgroundColor:r=>de(r,"shift-1",o),color:r=>de(r,"shift-7")},"&:focus-visible":{outline:r=>`${We(.5)} solid ${de(r,"shift-5",o)}`,outlineOffset:`-${We(.5)}`}}}}import{merge as Mn}from"@domphy/core";function kc(n){return{_onSchedule:(o,t)=>{Mn(t,{_context:{form:n}})}}}function Pc(n,o){return{_onInsert:t=>{let r=t.getContext("form").setField(n,void 0,o),i=t.tagName,s=t.attributes.get("type");["input","select","textarea"].includes(i)||console.warn('"field" patch must use input, select, or textarea tag');let a={onBlur:()=>r.setTouched(),ariaInvalid:l=>!!r.message("error",l)||void 0,dataStatus:l=>r.status(l)};i==="input"&&s==="checkbox"?(a.checked=r.value(),a.onChange=l=>r.setValue(l.target.checked)):i==="input"&&s==="radio"?a.onChange=l=>r.setValue(l.target.value):i==="select"?(a.value=r.value(),a.onChange=l=>r.setValue(l.target.value)):i==="textarea"?(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)):(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)),t.merge(a)}}}import{Notifier as Nn}from"@domphy/core";function Rn(n){return!!n&&typeof n.then=="function"}var je=class{constructor(o,t){this._notifier=new Nn;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=o,this._initValue=o,this._validator=t,t&&this.validate()}value(o){return o&&this._notifier.addListener("value",o),this._value}setValue(o){this._value=o,this._notifier.notify("value",o),this._notifier.notify("dirty",o!==this._initValue),this.validate()}dirty(o){return o&&this._notifier.addListener("dirty",o),this._value!==this._initValue}touched(o){return o&&this._notifier.addListener("touched",o),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(o,t){let e=!1;o!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=o,this._initValue=o,this._notifier.notify("value",o),this._notifier.notify("dirty",!1),e=!0),t!==void 0&&t!==this._validator&&(this._validator=t,e=!0),e&&this.validate()}message(o,t){return t&&this._notifier.addListener(o,t),this._messages[o]}status(o){return o&&this._notifier.addListener("status",o),Ke(this._messages)}setMessages(o){let t=this._messages;this._messages=o;for(let e of["error","warning","success"])t[e]!==o[e]&&this._notifier.notify(e,o[e]);Ke(t)!==Ke(o)&&this._notifier.notify("status",Ke(o))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let o=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let t=this._validator(this._value);Rn(t)?(this._pending=!0,Promise.resolve(t).then(e=>{o===this._validationToken&&(this._pending=!1,this.setMessages(e!=null?e:{}))}).catch(e=>{o===this._validationToken&&(this._pending=!1,console.error(e))})):(this._pending=!1,this.setMessages(t!=null?t:{}))}catch(t){o===this._validationToken&&(this._pending=!1),console.error(t)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Ke(n){if(n.error)return"error";if(n.warning)return"warning";if(n.success)return"success"}var Io=class{constructor(){this.fields=new Map}setField(o,t,e){let r=this.fields.get(o);return r?r.configure(t,e):(r=new je(t,e),this.fields.set(o,r)),r}getField(o){return this.setField(o)}removeField(o){var t;(t=this.fields.get(o))==null||t._dispose(),this.fields.delete(o)}get valid(){for(let o of this.fields.values())if(o._pending||o._messages.error)return!1;return!0}reset(){for(let o of this.fields.values())o.reset()}snapshot(){let o={};for(let[t,e]of this.fields)Ln(o,t,e._value);return o}_dispose(){for(let o of this.fields.values())o._dispose();this.fields.clear()}};function Ln(n,o,t){let e=o.split("."),r=n;for(let i=0;i<e.length-1;i++){let s=e[i];r[s]==null&&(r[s]=isNaN(Number(e[i+1]))?{}:[]),r=r[s]}r[e[e.length-1]]=t}export{je as FieldState,Io as FormState,Fn as abbreviation,fi as alert,yi as avatar,Si as badge,Zi as blockquote,Pi as breadcrumb,_i as breadcrumbEllipsis,ol as button,Ls as buttonSwitch,Wn as card,cl as code,Ki as combobox,Zn as command,ti as commandItem,ei as commandSearch,yl as descriptionList,hl as details,Sl as dialog,vm as divider,km as drawer,wl as emphasis,Pc as field,$l as figure,kc as form,Rl as formGroup,Ol as heading,Al as horizontalRule,Ul as icon,ql as image,ll as inputCheckbox,Ql as inputColor,oa as inputDateTime,la as inputFile,Ea as inputNumber,ui as inputOTP,ts as inputRadio,ya as inputRange,ca as inputSearch,$s as inputSwitch,ha as inputText,Pa as keyboard,za as label,Na as link,Oa as mark,gc as menu,vc as menuItem,um as orderedList,gm as pagination,Wa as paragraph,$m as popover,Kt as popoverArrow,Ya as preformated,Ja as progress,ns as select,ws as selectBox,xs as selectItem,bs as selectList,ss as skeleton,Bs as small,us as spinner,Yn as splitter,Un as splitterHandle,Gn as splitterPanel,Ws as strong,Ys as subscript,Js as superscript,ic as tab,mc as tabPanel,em as table,tc as tabs,Le as tag,nm as textarea,Lm as toast,ni as toggle,mi as toggleGroup,jm as tooltip,Um as transitionGroup,sm as unorderedList};
1
+ var Lo=Object.defineProperty,Ro=Object.defineProperties;var Do=Object.getOwnPropertyDescriptors;var zt=Object.getOwnPropertySymbols;var Ho=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var $t=(n,o,t)=>o in n?Lo(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,Mt=(n,o)=>{for(var t in o||(o={}))Ho.call(o,t)&&$t(n,t,o[t]);if(zt)for(var t of zt(o))Oo.call(o,t)&&$t(n,t,o[t]);return n},Nt=(n,o)=>Ro(n,Do(o));import{themeColor as he,themeSize as Bo,themeSpacing as Fo}from"@domphy/theme";function qn(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:e=>Bo(e),backgroundColor:e=>he(e),color:e=>he(e,"shift-10",o),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:e=>he(e,"shift-7",o),textUnderlineOffset:Fo(.72),cursor:"help","&:hover":{color:e=>he(e,"shift-11",t),textDecorationColor:e=>he(e,"shift-9",t)}}}}import{themeColor as X,themeDensity as D,themeSpacing as z}from"@domphy/theme";function Un(n={}){let{color:o="neutral"}=n;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:t=>z(D(t)*2),backgroundColor:t=>X(t,"inherit",o),color:t=>X(t,"shift-10",o),outline:t=>`1px solid ${X(t,"shift-4",o)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:t=>z(D(t)*2),paddingInline:t=>z(D(t)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:t=>z(D(t)*4),color:t=>X(t,"shift-9",o),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:t=>z(D(t)*2),height:"auto"},"& > div":{gridArea:"content",padding:t=>z(D(t)*4),color:t=>X(t,"shift-10",o)},"& > footer":{gridArea:"footer",display:"flex",gap:z(2),paddingBlock:t=>z(D(t)*2),paddingInline:t=>z(D(t)*4),borderTop:t=>`1px solid ${X(t,"shift-3",o)}`}}}}import{merge as Vo,toState as Ao}from"@domphy/core";import{themeColor as Xe,themeSpacing as Wo}from"@domphy/theme";function Zn(n={}){let{direction:o="horizontal",defaultSize:t=50,min:e=10,max:r=90}=n;return{_onSchedule:(i,s)=>{Vo(s,{_context:{splitter:{direction:o,size:Ao(t),min:e,max:r}}})},style:{display:"flex",flexDirection:o==="horizontal"?"row":"column",overflow:"hidden"}}}function ei(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal"?"width":"height";t.style[e]=`${o.size.get()}%`,t.style.flexShrink="0",t.style.overflow="auto";let r=o.size.onChange(i=>{t.style[e]=`${i}%`});n.addHook("Remove",r)}}}function ti(){return{_onMount:n=>{let o=n.getContext("splitter"),t=n.domElement,e=o.direction==="horizontal";t.style.cursor=e?"col-resize":"row-resize";let r=i=>{i.preventDefault();let s=t.parentElement,a=c=>{let m=s.getBoundingClientRect(),d=e?(c.clientX-m.left)/m.width*100:(c.clientY-m.top)/m.height*100;o.size.set(Math.min(Math.max(d,o.min),o.max))},l=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l)};t.addEventListener("mousedown",r),n.addHook("Remove",()=>t.removeEventListener("mousedown",r))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n=>Xe(n,"shift-2"),"&:hover":{backgroundColor:n=>Xe(n,"shift-3")},"&::after":{content:'""',borderRadius:Wo(999),backgroundColor:n=>Xe(n,"shift-4")}}}}import{merge as Ko,toState as jo}from"@domphy/core";import{themeColor as $,themeDensity as _e,themeSize as Lt,themeSpacing as J}from"@domphy/theme";function ii(){return{_onSchedule:(n,o)=>{Ko(o,{_context:{command:{query:jo("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function li(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:e=>{let r=e.getContext("command"),i=e.domElement,s=()=>r.query.set(i.value);i.addEventListener("input",s),e.addHook("Remove",()=>i.removeEventListener("input",s))},style:{fontFamily:"inherit",fontSize:e=>Lt(e,"inherit"),paddingInline:e=>J(_e(e)*3),paddingBlock:e=>J(_e(e)*2),border:"none",borderBottom:e=>`1px solid ${$(e,"shift-3",o)}`,outline:"none",color:e=>$(e,"shift-10",o),backgroundColor:e=>$(e,"inherit",o),"&::placeholder":{color:e=>$(e,"shift-7")},"&:focus-visible":{borderBottomColor:e=>$(e,"shift-6",t)}}}}function ai(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"option",_onMount:e=>{var l,c;let r=e.getContext("command"),i=e.domElement,s=(c=(l=i.textContent)==null?void 0:l.toLowerCase())!=null?c:"",a=r.query.onChange(m=>{i.hidden=m.length>0&&!s.includes(m.toLowerCase())});e.addHook("Remove",a)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:e=>Lt(e,"inherit"),height:e=>J(6+_e(e)*2),paddingInline:e=>J(_e(e)*3),border:"none",outline:"none",color:e=>$(e,"shift-9",o),backgroundColor:e=>$(e,"inherit",o),"&:hover:not([disabled])":{backgroundColor:e=>$(e,"shift-2",o)},"&:focus-visible":{outline:e=>`${J(.5)} solid ${$(e,"shift-6",t)}`,outlineOffset:`-${J(.5)}`}}}}import{themeColor as Q,themeSize as qo,themeSpacing as Z}from"@domphy/theme";function ci(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{role:"button",_onInsert:e=>{var l;e.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let r=e.getContext("toggleGroup"),s=((l=e.parent)==null?void 0:l.children.items).filter(c=>c.type==="ElementNode"&&c.attributes.get("role")==="button"),a=e.key!==void 0?String(e.key):String(s.findIndex(c=>c===e));e.attributes.set("ariaPressed",c=>{let m=r.value.get(c);return Array.isArray(m)?m.includes(a):m===a}),e.addEvent("click",()=>{let c=r.value.get();if(r.multiple){let m=Array.isArray(c)?[...c]:[];r.value.set(m.includes(a)?m.filter(d=>d!==a):[...m,a])}else r.value.set(c===a?"":a)})},style:{cursor:"pointer",fontSize:e=>qo(e,"inherit"),height:Z(6),paddingBlock:Z(1),paddingInline:Z(2),border:"none",borderRadius:Z(1),color:e=>Q(e,"shift-9",o),backgroundColor:e=>Q(e,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:e=>Q(e,"shift-2",o)},"&[aria-pressed=true]":{backgroundColor:e=>Q(e,"shift-3",t),color:e=>Q(e,"shift-12",t)},"&:focus-visible":{outline:e=>`${Z(.5)} solid ${Q(e,"shift-6",t)}`,outlineOffset:`-${Z(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as Yo}from"@domphy/core";import{themeSpacing as ze,themeColor as Rt,themeSize as Go}from"@domphy/theme";function fi(n={}){var e;let{multiple:o=!1,color:t="neutral"}=n;return{role:"group",_context:{toggleGroup:{value:Yo((e=n.value)!=null?e:o?[]:""),multiple:o}},style:{display:"flex",paddingBlock:ze(1),paddingInline:ze(1),gap:ze(1),borderRadius:ze(2),fontSize:r=>Go(r,"inherit"),backgroundColor:r=>Rt(r,"inherit",t),outline:r=>`1px solid ${Rt(r,"shift-3",t)}`,outlineOffset:"-1px"}}}import{themeSpacing as Dt}from"@domphy/theme";function yi(){return{style:{display:"flex",alignItems:"center",gap:Dt(2),"& > *":{minWidth:Dt(9)+"!important"}},_onMount:n=>{let o=n.domElement,t=()=>Array.from(o.querySelectorAll("input")),e=s=>{let a=t(),l=s.target,c=a.indexOf(l);l.value&&c<a.length-1&&a[c+1].focus()},r=s=>{let a=t(),l=s.target,c=a.indexOf(l);s.key==="Backspace"&&!l.value&&c>0&&a[c-1].focus(),s.key==="ArrowLeft"&&c>0&&a[c-1].focus(),s.key==="ArrowRight"&&c<a.length-1&&a[c+1].focus()},i=s=>{var d,u,g;s.preventDefault();let a=(u=(d=s.clipboardData)==null?void 0:d.getData("text"))!=null?u:"",l=t(),c=l.indexOf(s.target);[...a].forEach((p,f)=>{l[c+f]&&(l[c+f].value=p)});let m=Math.min(c+a.length-1,l.length-1);(g=l[m])==null||g.focus()};o.addEventListener("input",e),o.addEventListener("keydown",r),o.addEventListener("paste",i),n.addHook("Remove",()=>{o.removeEventListener("input",e),o.removeEventListener("keydown",r),o.removeEventListener("paste",i)})}}}import{themeColor as Je,themeDensity as Ht,themeSize as Uo,themeSpacing as $e}from"@domphy/theme";function xi(n={}){let{color:o="primary"}=n;return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:$e(3),paddingBlock:t=>$e(Ht(t)*2),paddingInline:t=>$e(Ht(t)*4),boxShadow:t=>`inset ${$e(1)} 0 0 0 ${Je(t,"shift-8",o)}`,backgroundColor:t=>Je(t,"inherit",o),color:t=>Je(t,"shift-10",o),fontSize:t=>Uo(t,"inherit")}}}import{themeColor as Ot,themeSize as Xo,themeSpacing as Bt}from"@domphy/theme";function ki(n={}){let{color:o="primary"}=n;return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:Bt(9),height:Bt(9),fontSize:t=>Xo(t,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:t=>Ot(t,"inherit",o),color:t=>Ot(t,"shift-11",o),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}import{toState as Jo}from"@domphy/core";import{themeSpacing as Qe,themeColor as Ft,themeSize as Qo}from"@domphy/theme";function _i(n={}){let{color:o="danger",label:t=999}=n,e=Jo(t);return{style:{position:"relative","&::after":{content:r=>`"${e.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:Qe(1),minWidth:Qe(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>Qo(r,"decrease-1"),borderRadius:Qe(999),backgroundColor:r=>Ft(r,"shift-9",o),color:r=>Ft(r,"shift-0",o)}}}}import{themeColor as pe,themeSize as Zo,themeSpacing as Vt}from"@domphy/theme";function Mi(n={}){let{color:o="neutral",separator:t="/"}=n;return{_onInsert:e=>{e.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:e=>Zo(e,"inherit"),gap:Vt(1),color:e=>pe(e,"shift-9",o),backgroundColor:e=>pe(e,"inherit",o),"& > *":{display:"inline-flex",alignItems:"center",color:e=>pe(e,"shift-8",o)},"& > *:not(:last-child)::after":{content:`"${t}"`,color:e=>pe(e,"shift-4",o),paddingInlineStart:Vt(1)},"& > [aria-current=page]":{color:e=>pe(e,"shift-10",o),pointerEvents:"none"}}}}import{themeColor as Me,themeSize as er,themeSpacing as Ne}from"@domphy/theme";function Ri(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:t=>er(t,"inherit"),paddingInline:Ne(1),border:"none",background:"none",cursor:"pointer",color:t=>Me(t,"shift-8",o),borderRadius:Ne(1),"&:hover":{color:t=>Me(t,"shift-10",o),backgroundColor:t=>Me(t,"shift-2",o)},"&:focus-visible":{outline:t=>`${Ne(.5)} solid ${Me(t,"shift-6",o)}`,outlineOffset:Ne(.5)}}}}import{toState as Wt,merge as Ze}from"@domphy/core";import{themeSpacing as j,themeColor as fe,themeDensity as et,themeSize as Kt}from"@domphy/theme";import{themeColor as Le,themeSize as tr,themeSpacing as M}from"@domphy/theme";var or='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function Re(n={}){let{color:o="neutral",removable:t=!1}=n;return{dataTone:"shift-2",_onInit:e=>{let r={span:or,onClick:i=>{i.stopPropagation(),e.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:M(1),width:M(4),height:M(4),flexShrink:0,"&:hover":{backgroundColor:i=>Le(i,"shift-4",o)}}};t&&e.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:M(6),paddingBlock:"0px",borderRadius:M(1),paddingInlineStart:M(2),paddingInlineEnd:t?M(1):M(2),gap:M(2),fontSize:e=>tr(e,"inherit"),backgroundColor:e=>Le(e,"inherit",o),color:e=>Le(e,"shift-9",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Le(e,"shift-4",o)}`}}}import{toState as At,merge as rr}from"@domphy/core";import{computePosition as nr,autoUpdate as ir,offset as lr,flip as ar,shift as sr}from"@floating-ui/dom";function H(n){let{open:o=!1,placement:t="bottom"}=n,e=null,r=null,i=null,s=null,a=At(o),l=At(t),c=()=>{i&&s&&(r&&r(),r=ir(i,s,()=>{nr(i,s,{placement:l.get(),middleware:[lr(12),ar(),sr()],strategy:"fixed"}).then(({x:f,y:h,placement:b})=>{var y;Object.assign(s.style,{left:`${f}px`,top:`${h}px`}),b!==l.get()&&l.set(b),(y=n.onPlacement)==null||y.call(n,i,s,b)})}),a.set(!0))},m=()=>{r&&r(),r=null,a.set(!1)},d=()=>{e&&clearTimeout(e),e=setTimeout(c,100)},u=()=>{e&&clearTimeout(e),e=setTimeout(m,100)},g={style:{position:"fixed",pointerEvents:"auto",visibility:f=>a.get(f)?"visible":"hidden"},_onMount:f=>s=f.domElement,_portal:f=>{let h=f.domElement.querySelector("#domphy-floating");if(!h){let b={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};h=f.children.insert(b).domElement}return h}};return rr(n.content,g),{show:d,hide:u,anchorPartial:{onKeyDown:f=>f.key==="Escape"&&u(),_onSchedule:f=>{let h=null;f.getRoot().addHook("Init",b=>{h=b.children.insert(n.content)}),f.addHook("BeforeRemove",()=>{u(),e&&clearTimeout(e),h&&h.remove()})},_onMount:f=>{i=f.domElement;let h=b=>{if(!a.get()||!i||!s)return;let y=b.target;!i.contains(y)&&!s.contains(y)&&u()};f.getRoot().domElement.addEventListener("click",h),f.addHook("BeforeRemove",()=>f.getRoot().domElement.removeEventListener("click",h))}}}}function Xi(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=Wt(n.value),a=Wt(r),{show:l,hide:c,anchorPartial:m}=H({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&c()};Ze(n.content,d);let u={border:"none",outline:"none",padding:0,margin:0,flex:1,height:j(6),marginInlineStart:j(2),fontSize:h=>Kt(h,"inherit"),color:h=>fe(h,"shift-9",e),backgroundColor:h=>fe(h,"inherit",e)},g;n.input?(Ze(n.input,{onFocus:()=>l(),style:u,_key:"combobox-input"}),g=n.input):g={input:null,onFocus:()=>l(),value:h=>(s.get(h),""),style:u,_key:"combobox-input"};let p={div:h=>{let b=s.get(h),y=Array.isArray(b)?b:[b],T=o.filter(U=>y.includes(U.value)).map(U=>({span:U.label,$:[Re({color:e,removable:!0})],_key:U.value,_onRemove:Ue=>{let ue=s.get(),_t=(Array.isArray(ue)?ue:[ue]).filter(No=>No!==U.value);i?s.set(_t):s.set(_t[0])}}));return T.push(g),T},style:{display:"flex",flexWrap:"wrap",gap:j(1)}},f={_onInsert:h=>{h.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:h=>h.children.insert(p),style:{minWidth:j(32),outlineOffset:"-1px",outline:h=>`1px solid ${fe(h,"shift-4","neutral")}`,paddingBlock:h=>j(et(h)*1),paddingInline:h=>j(et(h)*1),borderRadius:h=>j(et(h)*1),fontSize:h=>Kt(h,"inherit"),color:h=>fe(h,"shift-9",e),backgroundColor:h=>fe(h,"inherit",e)}};return Ze(m,f),m}import{toState as jt}from"@domphy/core";import{themeSpacing as tt,themeColor as De,themeSize as mr}from"@domphy/theme";function qt(n={}){let{placement:o="bottom-end",color:t="neutral",sideOffset:e=tt(6),bordered:r=!0}=n,i=jt(o),s={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},a=jt(s[i.get()]);i.onChange(m=>a.set(s[m]));let l=m=>m.includes("start")?e:m.includes("end")?"auto":"50%",c=m=>m.includes("end")?e:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>mr(m),backgroundColor:m=>De(m),color:m=>De(m,"shift-9",t),position:"relative","&::after":{content:'""',position:"absolute",width:tt(1.5),height:tt(1.5),backgroundColor:m=>De(m,"inherit",t),borderWidth:r?"0px":"1px",borderColor:m=>De(m,"inherit",t),borderTopStyle:m=>{let d=a.get(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=a.get(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=a.get(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=a.get(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=a.get(m);return d.includes("top")?0:d.includes("bottom")?"auto":l(d)},right:m=>{let d=a.get(m);return d.includes("right")?0:d.includes("left")?"auto":c(d)},bottom:m=>{let d=a.get(m);return d.includes("bottom")?0:d.includes("top")?"auto":c(d)},left:m=>{let d=a.get(m);return d.includes("left")?0:d.includes("right")?"auto":l(d)},transform:m=>{let d=a.get(m),u=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",g=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${u},${g}) rotate(45deg)`}}}}}import{themeSpacing as ot,themeColor as Yt,themeDensity as Gt,themeSize as cr}from"@domphy/theme";function il(n={}){let{color:o="inherit"}=n;return{_onInsert:t=>{t.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:t=>cr(t,"inherit"),backgroundColor:t=>Yt(t,"inherit",o),boxShadow:t=>`inset ${ot(1)} 0 0 0 ${Yt(t,"shift-4",o)}`,border:"none",paddingBlock:t=>ot(Gt(t)*2),paddingInline:t=>ot(Gt(t)*4),margin:0}}}import{themeColor as N,themeDensity as rt,themeSize as dr,themeSpacing as He}from"@domphy/theme";function sl(n={}){let{color:o="primary"}=n;return{_onInsert:t=>{t.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:t=>dr(t,"inherit"),paddingBlock:t=>He(rt(t)*1),paddingInline:t=>He(rt(t)*3),borderRadius:t=>He(rt(t)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:t=>`1px solid ${N(t,"shift-4",o)}`,color:t=>N(t,"shift-9",o),backgroundColor:t=>N(t,"inherit",o),"&:hover:not([disabled]):not([aria-busy=true])":{color:t=>N(t,"shift-10",o),backgroundColor:t=>N(t,"shift-2",o)},"&:focus-visible":{boxShadow:t=>`inset 0 0 0 ${He(.5)} ${N(t,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>N(t,"shift-2","neutral"),outline:t=>`1px solid ${N(t,"shift-4","neutral")}`,color:t=>N(t,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}import{themeColor as x,themeSpacing as O,themeSize as ur}from"@domphy/theme";function ul(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"checkbox",_onInsert:e=>{e.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:e=>ur(e,"inherit"),display:"inline-flex",position:"relative",width:O(6),height:O(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:O(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${x(e,"shift-4",o)}`,color:e=>x(e,"shift-9",o),width:O(4),height:O(4)},"&:hover::before":{backgroundColor:e=>x(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${x(e,"shift-6",t)}`,backgroundColor:e=>x(e,"shift-8",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>x(e,"shift-7",t)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:e=>`${O(.5)} solid ${x(e,"inherit",t)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:e=>`1px solid ${x(e,"shift-6",t)}`,backgroundColor:e=>x(e,"shift-3",t)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:e=>x(e,"shift-8",t)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:e=>x(e,"shift-7",t)},"&:focus-visible":{borderRadius:O(1.5),outline:e=>`${O(.5)} solid ${x(e,"shift-6",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>x(e,"shift-4","neutral"),pointerEvents:"none"}}}}import{themeSpacing as nt,themeColor as Ut,themeSize as hr}from"@domphy/theme";function gl(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:t=>hr(t,"inherit"),color:t=>Ut(t,"shift-9",o),backgroundColor:t=>Ut(t,"inherit",o),height:nt(6),paddingInline:nt(1.5),borderRadius:nt(1)}}}import{themeColor as B,themeDensity as ge,themeSize as Xt,themeSpacing as v}from"@domphy/theme";function vl(n={}){let{color:o="neutral",accentColor:t="primary",duration:e=240}=n;return{_onInsert:r=>{r.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:r=>Xt(r,"inherit"),color:r=>B(r,"shift-9",o),backgroundColor:r=>B(r,"inherit",o),overflow:"hidden","& > summary":{backgroundColor:r=>B(r,"shift-2",o),color:r=>B(r,"shift-10",o),fontSize:r=>Xt(r,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:v(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:r=>v(ge(r)*4),height:v(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:v(2),height:v(2),flexShrink:0,marginTop:`-${v(.5)}`,borderInlineEnd:r=>`${v(.5)} solid ${B(r,"shift-9",o)}`,borderBottom:r=>`${v(.5)} solid ${B(r,"shift-9",o)}`,transform:"rotate(45deg)",transition:`transform ${e}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:r=>B(r,"shift-3",o)},"& > summary:focus-visible":{borderRadius:r=>v(ge(r)*2),outlineOffset:`-${v(.5)}`,outline:r=>`${v(.5)} solid ${B(r,"shift-6",t)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:r=>v(ge(r)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${e}ms ease, opacity ${e}ms ease, padding ${e}ms ease`},"&[open] > :not(summary)":{maxHeight:v(250),opacity:1,paddingTop:r=>v(ge(r)*1),paddingBottom:r=>v(ge(r)*3)}}}}import{themeColor as Jt,themeSpacing as Qt,themeSize as Zt}from"@domphy/theme";function kl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${Qt(24)}, max-content) 1fr`,columnGap:Qt(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:t=>Zt(t,"inherit"),color:t=>Jt(t,"shift-10",o)},"& dd":{margin:0,fontSize:t=>Zt(t,"inherit"),color:t=>Jt(t,"shift-9",o)}}}}import{toState as pr}from"@domphy/core";import{themeColor as Oe,themeDensity as fr,themeSize as gr,themeSpacing as it}from"@domphy/theme";function _l(n={}){let{color:o="neutral",open:t=!1}=n,e=pr(t);return{_onInsert:r=>{r.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(r,i)=>{if(r.target!==i.domElement)return;let s=i.domElement.getBoundingClientRect();r.clientX>=s.left&&r.clientX<=s.right&&r.clientY>=s.top&&r.clientY<=s.bottom||e.set(!1)},onTransitionEnd:(r,i)=>{let s=i.domElement;s.style.opacity==="0"&&(s.close(),document.body.style.overflow="")},_onMount:r=>{let i=r.domElement,s=a=>{a?(i.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{i.style.opacity="1";let l=i.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');l==null||l.focus()})):i.style.opacity="0"};s(e.get()),e.onChange(s)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:r=>gr(r,"inherit"),color:r=>Oe(r,"shift-10",o),backgroundColor:r=>Oe(r,"inherit",o),border:"none",padding:r=>it(fr(r)*3),boxShadow:r=>`0 ${it(9)} ${it(16)} ${Oe(r,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:r=>Oe(r,"shift-2","neutral"),opacity:.75}}}}import{themeColor as br,themeSize as yr}from"@domphy/theme";function Nl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:t=>yr(t,"inherit"),fontStyle:"italic",color:t=>br(t,"shift-10",o)}}}import{themeColor as eo,themeSize as Cr,themeSpacing as Be}from"@domphy/theme";function Hl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:Be(2),marginInline:0,marginTop:Be(3),marginBottom:Be(3),color:t=>eo(t,"shift-9",o),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:Be(2)},"& figcaption":{fontSize:t=>Cr(t,"decrease-1"),color:t=>eo(t,"shift-8",o),lineHeight:1.45}}}}import{themeColor as Fe,themeDensity as ee,themeSpacing as L,themeSize as lt}from"@domphy/theme";function Fl(n={}){let{color:o="neutral",layout:t="horizontal"}=n,e=t==="vertical";return{_onInsert:r=>{r.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>L(ee(r)*3),paddingBlock:r=>L(ee(r)*3),border:"none",borderRadius:r=>L(ee(r)*2),fontSize:r=>lt(r,"inherit"),backgroundColor:r=>Fe(r,"inherit",o),display:"grid",gridTemplateColumns:e?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:L(4),rowGap:L(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>lt(r,"inherit"),fontWeight:600,paddingBlock:r=>L(ee(r)*1),borderRadius:r=>L(ee(r)*2),color:r=>Fe(r,"shift-9",o),backgroundColor:r=>Fe(r,"inherit",o)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>e?"0px":L(ee(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:e?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:e?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:e?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${L(2)} * -1)`,fontSize:r=>lt(r,"decrease-1"),color:r=>Fe(r,"shift-9",o)}}}}import{themeColor as vr,themeSize as xr,themeSpacing as Sr}from"@domphy/theme";var Er={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Kl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{["h1","h2","h3","h4","h5","h6"].includes(t.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:t=>vr(t,"shift-11",o),marginTop:0,marginBottom:Sr(2),fontSize:t=>{let e=Er[t.elementNode.tagName]||"inherit";return xr(t,e)}}}}import{themeColor as kr,themeSpacing as to}from"@domphy/theme";function Gl(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:to(3),marginBottom:to(3),backgroundColor:t=>kr(t,"shift-4",o)}}}import{themeColor as Tr,themeSpacing as Pr}from"@domphy/theme";function Ql(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:Pr(2),backgroundColor:t=>Tr(t,"inherit",o)}}}import{themeSpacing as oo,themeColor as wr,themeSize as Ir}from"@domphy/theme";function ta(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:oo(6),height:oo(6),fontSize:t=>Ir(t),backgroundColor:"transparent",color:t=>wr(t,"shift-9",o)}}}import{themeColor as ro,themeDensity as be,themeSpacing as ye,themeSize as _r}from"@domphy/theme";function na(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"color",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:e=>_r(e,"inherit"),paddingBlock:e=>ye(be(e)*1),paddingInline:e=>ye(be(e)*1),blockSize:e=>ye(6+be(e)*2),inlineSize:e=>ye(6+be(e)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:e=>ye(be(e)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>ro(e,"shift-2","neutral"),outline:e=>`1px solid ${ro(e,"shift-4","neutral")}`}}}}import{themeColor as F,themeDensity as at,themeSpacing as Ce,themeSize as zr}from"@domphy/theme";function sa(n={}){let{mode:o="datetime-local",color:t="neutral",accentColor:e="primary"}=n;return{type:o,_onSchedule:(r,i)=>{r.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),i.type=o},style:{fontFamily:"inherit",fontSize:r=>zr(r,"inherit"),lineHeight:"inherit",color:r=>F(r,"shift-9",t),backgroundColor:r=>F(r,"inherit",t),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${F(r,"shift-4",t)}`,borderRadius:r=>Ce(at(r)*1),paddingInline:r=>Ce(at(r)*3),height:r=>Ce(6+at(r)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${Ce(.5)} solid ${F(r,"shift-6",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>F(r,"shift-8","neutral"),backgroundColor:r=>F(r,"shift-2","neutral"),outline:r=>`1px solid ${F(r,"shift-4","neutral")}`},"&:invalid":{outline:r=>`${Ce(.5)} solid ${F(r,"shift-6","error")}`}}}}import{themeColor as S,themeDensity as st,themeSpacing as P,themeSize as $r}from"@domphy/theme";function ua(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"file",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),r.type="file"},style:{fontFamily:"inherit",fontSize:e=>$r(e,"inherit"),lineHeight:"inherit",color:e=>S(e,"shift-9",o),backgroundColor:e=>S(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${S(e,"shift-4",o)}`,borderRadius:e=>P(st(e)*1),height:e=>P(6+st(e)*2),paddingInline:e=>P(st(e)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>S(e,"shift-10",t),backgroundColor:e=>S(e,"shift-3",t)},"&::-webkit-file-upload-button":{marginTop:P(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:P(1),height:P(6),paddingInline:P(2),cursor:"pointer",color:e=>S(e,"shift-10",o),backgroundColor:e=>S(e,"shift-3",o)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${P(.5)} solid ${S(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>S(e,"shift-8","neutral"),outline:e=>`1px solid ${S(e,"shift-4","neutral")}`,backgroundColor:e=>S(e,"shift-2","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:e=>S(e,"shift-8","neutral"),backgroundColor:e=>S(e,"shift-3","neutral")}}}}import{themeColor as V,themeDensity as mt,themeSpacing as ve,themeSize as Mr}from"@domphy/theme";function ga(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"search",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),r.type="search"},style:{fontFamily:"inherit",fontSize:e=>Mr(e,"inherit"),lineHeight:"inherit",color:e=>V(e,"shift-9",o),backgroundColor:e=>V(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${V(e,"shift-4",o)}`,borderRadius:e=>ve(mt(e)*1),minWidth:ve(32),paddingInline:e=>ve(mt(e)*3),paddingBlock:e=>ve(mt(e)*1),"&::placeholder":{color:e=>V(e,"shift-7",o)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${ve(.5)} solid ${V(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>V(e,"shift-8","neutral"),backgroundColor:e=>V(e,"shift-2","neutral"),outline:e=>`1px solid ${V(e,"shift-4","neutral")}`}}}}import{themeColor as E,themeDensity as ct,themeSpacing as A,themeSize as Nr}from"@domphy/theme";function va(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"text",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),r.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:A(10),paddingInline:e=>A(ct(e)*3),paddingBlock:e=>A(ct(e)*1),borderRadius:e=>A(ct(e)*1),fontSize:e=>Nr(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${E(e,"shift-4",o)}`,color:e=>E(e,"shift-9",o),backgroundColor:e=>E(e,"inherit",o),"&::placeholder":{color:e=>E(e,"shift-7")},"&:not(:placeholder-shown)":{color:e=>E(e,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${A(.5)} solid ${E(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>E(e,"shift-2","neutral"),outline:e=>`1px solid ${E(e,"shift-4","neutral")}`,color:e=>E(e,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:e=>`${A(.5)} solid ${E(e,"shift-6","error")}`},"&[data-status=error]":{outline:e=>`${A(.5)} solid ${E(e,"shift-6","error")}`},"&[data-status=warning]":{outline:e=>`${A(.5)} solid ${E(e,"shift-6","warning")}`}}}}import{themeColor as q,themeSpacing as C}from"@domphy/theme";function ka(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"range",_onInsert:e=>{e.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:C(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>q(e,"shift-3",o)},"&::-moz-range-track":{height:C(1.5),borderRadius:C(999),backgroundColor:e=>q(e,"shift-3",o)},"&::-webkit-slider-thumb":{appearance:"none",width:C(4),height:C(4),borderRadius:C(999),border:"none",marginTop:`calc((${C(1.5)} - ${C(4)}) / 2)`,backgroundColor:e=>q(e,"shift-9",t)},"&::-moz-range-thumb":{width:C(4),height:C(4),borderRadius:C(999),border:"none",backgroundColor:e=>q(e,"shift-9",t)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:e=>q(e,"shift-10",t)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:e=>q(e,"shift-10",t)},"&:focus-visible":{outline:e=>`${C(.5)} solid ${q(e,"shift-6",t)}`,outlineOffset:C(1),borderRadius:C(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as Y,themeDensity as dt,themeSpacing as xe,themeSize as Lr}from"@domphy/theme";function Ia(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"number",_onSchedule:(e,r)=>{e.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),r.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:xe(10),paddingInline:e=>xe(dt(e)*3),paddingBlock:e=>xe(dt(e)*1),borderRadius:e=>xe(dt(e)*1),fontSize:e=>Lr(e,"inherit"),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${Y(e,"shift-4",o)}`,color:e=>Y(e,"shift-9",o),backgroundColor:e=>Y(e,"inherit",o),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:e=>`${xe(.5)} solid ${Y(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:e=>Y(e,"shift-2","neutral"),outline:e=>`1px solid ${Y(e,"shift-4","neutral")}`,color:e=>Y(e,"shift-8","neutral")}}}}import{themeColor as ut,themeSize as Rr,themeSpacing as ht}from"@domphy/theme";function Ma(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:t=>Rr(t,"inherit"),color:t=>ut(t,"shift-9",o),backgroundColor:t=>ut(t,"inherit",o),paddingBlock:ht(.5),paddingInline:ht(1.5),borderRadius:ht(1),outline:t=>`1px solid ${ut(t,"shift-4",o)}`}}}import{themeColor as pt,themeSize as Dr,themeSpacing as Hr}from"@domphy/theme";function Da(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:Hr(2),fontSize:e=>Dr(e,"inherit"),color:e=>pt(e,"shift-9",o),cursor:"pointer","&:focus-within":{color:e=>pt(e,"shift-10",t)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:e=>pt(e,"shift-8","neutral")}}}}import{themeColor as te,themeSize as Or,themeSpacing as ft}from"@domphy/theme";function Ba(n={}){let{color:o="primary",accentColor:t="secondary"}=n;return{_onInsert:e=>{e.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:e=>Or(e,"inherit"),backgroundColor:e=>te(e),color:e=>te(e,"shift-9",o),textDecoration:"none","&:visited":{color:e=>te(e,"shift-9",t)},"&:hover:not([disabled])":{color:e=>te(e,"shift-10",o),textDecoration:"underline"},"&:focus-visible":{borderRadius:ft(1),outlineOffset:ft(1),outline:e=>`${ft(.5)} solid ${te(e,"shift-6",t)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>te(e,"shift-8","neutral")}}}}import{themeSpacing as gt,themeSize as Br,themeColor as no}from"@domphy/theme";function Wa(n={}){let{accentColor:o="highlight"}=n;return{_onInsert:t=>{t.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:t=>Br(t,"inherit"),color:t=>no(t,"shift-9",o),backgroundColor:t=>no(t,"inherit",o),height:gt(6),borderRadius:gt(1),paddingInline:gt(1.5)}}}import{themeColor as Fr,themeSize as Vr}from"@domphy/theme";function Ga(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:t=>Vr(t,"inherit"),color:t=>Fr(t,"shift-9",o),lineHeight:1.5,marginTop:0,marginBottom:0}}}import{themeColor as io,themeDensity as bt,themeSpacing as yt,themeSize as Ar}from"@domphy/theme";function Qa(n={}){let{color:o="neutral"}=n;return{dataTone:"shift-2",_onInsert:t=>{t.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:t=>Ar(t,"inherit"),color:t=>io(t,"shift-9",o),backgroundColor:t=>io(t,"inherit",o),border:"none",paddingBlock:t=>yt(bt(t)*2),paddingInline:t=>yt(bt(t)*3),borderRadius:t=>yt(bt(t)*2)}}}import{themeColor as Ve,themeSpacing as Se}from"@domphy/theme";function os(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:Se(2),border:0,borderRadius:Se(999),overflow:"hidden",backgroundColor:e=>Ve(e,"shift-3",o),"&::-webkit-progress-bar":{backgroundColor:e=>Ve(e,"shift-3",o),borderRadius:Se(999)},"&::-webkit-progress-value":{backgroundColor:e=>Ve(e,"shift-9",t),borderRadius:Se(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:e=>Ve(e,"shift-9",t),borderRadius:Se(999)}}}}import{themeColor as W,themeSize as Wr,themeSpacing as Ee}from"@domphy/theme";function ls(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{type:"radio",_onInsert:e=>{if(e.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:e=>Wr(e,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:Ee(6),height:Ee(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${W(e,"shift-4",o)}`,color:e=>W(e,"shift-9",o),width:Ee(4),height:Ee(4)},"&:hover::before":{backgroundColor:e=>W(e,"shift-2",o)},"&:checked::before":{outline:e=>`1px solid ${W(e,"shift-6",t)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:e=>W(e,"shift-8",t)},"&:checked:hover:not([disabled])::before":{backgroundColor:e=>W(e,"shift-7",t)},"&:focus-visible":{borderRadius:"50%",outline:e=>`${Ee(.5)} solid ${W(e,"shift-6",t)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:e=>W(e,"shift-4","neutral"),pointerEvents:"none"}}}}import{themeColor as w,themeDensity as ke,themeSize as Kr,themeSpacing as G}from"@domphy/theme";function ms(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:e=>Kr(e,"inherit"),lineHeight:"inherit",color:e=>w(e,"shift-9",o),backgroundColor:e=>w(e,"inherit",o),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${w(e,"shift-4",o)}`,borderRadius:e=>G(ke(e)*1),paddingBlock:e=>G(ke(e)*1),paddingLeft:e=>G(ke(e)*3),paddingRight:e=>G(ke(e)*1),"&:not([multiple])":{height:e=>G(6+ke(e)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${G(.5)} solid ${w(e,"shift-5",t)}`},"&:focus-visible":{outline:e=>`${G(.5)} solid ${w(e,"shift-6",t)}`},"& optgroup":{color:e=>w(e,"shift-11",o)},"& option[disabled]":{color:e=>w(e,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>w(e,"shift-8","neutral"),outline:e=>`1px solid ${w(e,"shift-4","neutral")}`,backgroundColor:e=>w(e,"shift-2","neutral")}}}}import{hashString as jr}from"@domphy/core";import{themeColor as lo,themeSize as qr,themeSpacing as ao}from"@domphy/theme";function hs(n={}){let{color:o="neutral"}=n,t={"0%,100%":{opacity:1},"50%":{opacity:.4}},e=jr(JSON.stringify(t));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:r=>qr(r),color:r=>lo(r,"shift-9",o),height:ao(6),display:"block",borderRadius:ao(1),backgroundColor:r=>lo(r,"inherit",o),animation:`${e} 1.5s ease-in-out infinite`,[`@keyframes ${e}`]:t}}}import{hashString as Yr}from"@domphy/core";import{themeColor as Ae,themeSize as Gr,themeSpacing as Ct}from"@domphy/theme";var mo={to:{transform:"rotate(360deg)"}},so=Yr(JSON.stringify(mo));function bs(n={}){let{color:o="neutral"}=n;return{role:"status",ariaLabel:"loading",_onInsert:t=>{t.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:t=>Gr(t),backgroundColor:t=>Ae(t),color:t=>Ae(t,"shift-9",o),display:"inline-block",margin:0,flexShrink:0,width:Ct(6),height:Ct(6),borderRadius:"50%",border:t=>`${Ct(.5)} solid ${Ae(t,"shift-4",o)}`,borderTopColor:t=>Ae(t,"shift-9",o),boxSizing:"border-box",padding:0,animation:`${so} 0.7s linear infinite`,[`@keyframes ${so}`]:mo}}}import{toState as Ur}from"@domphy/core";import{themeColor as Xr,themeDensity as co,themeSize as Jr,themeSpacing as uo}from"@domphy/theme";function Ss(n={}){var s;let{color:o="neutral",multiple:t=!1}=n,e=Ur((s=n.value)!=null?s:t?[]:null),r={div:a=>{let l=e.get(a);return(Array.isArray(l)?l:[l]).map(m=>({input:null,name:n.name,value:m||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:e,multiple:t}},_onInit:a=>{a.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),a.children.insert(r)},style:{display:"flex",flexDirection:"column",paddingBlock:a=>uo(co(a)*2),paddingInline:a=>uo(co(a)*2),fontSize:a=>Jr(a,"inherit"),backgroundColor:a=>Xr(a,"inherit",o)}}}import{themeSpacing as We,themeColor as oe,themeDensity as ho,themeSize as Qr}from"@domphy/theme";function Ps(n={}){let{accentColor:o="primary",color:t="neutral",value:e=null}=n;return{role:"option",_onInit:i=>{i.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let s=i.getContext("select");if(s){let a=s.value;i.attributes.set("ariaSelected",l=>{let c=a.get(l);return s.multiple?c.includes(e):c==e}),i.addEvent("click",()=>{let l=a.get();s.multiple?l.includes(e)?a.set(l.filter(c=>c!==e)):a.set(l.concat([e])):l!=e&&a.set(e)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:i=>Qr(i,"inherit"),height:i=>We(6+ho(i)*2),paddingInline:i=>We(ho(i)*3),border:"none",outline:"none",color:i=>oe(i,"shift-9",t),backgroundColor:i=>oe(i,"inherit",t),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:i=>oe(i,"shift-2",t)},"&[aria-selected=true]":{backgroundColor:i=>oe(i,"shift-6",o),color:i=>oe(i,"shift-11")},"&:focus-visible":{outline:i=>`${We(.5)} solid ${oe(i,"shift-6",o)}`,outlineOffset:`-${We(.5)}`}}}}import{toState as po,merge as fo}from"@domphy/core";import{themeSpacing as Te,themeColor as vt,themeDensity as xt,themeSize as Zr}from"@domphy/theme";function Ms(n){let{options:o=[],placement:t="bottom",color:e="neutral",open:r=!1,multiple:i=!1}=n,s=po(n.value),a=po(r),{show:l,hide:c,anchorPartial:m}=H({open:a,placement:t,content:n.content,onPlacement:n.onPlacement}),d={onClick:()=>!i&&c()};fo(n.content,d);let u={div:p=>{let f=s.get(p),h=Array.isArray(f)?f:[f];return o.filter(y=>h.includes(y.value)).map(y=>({span:y.label,$:[Re({color:e,removable:i})],_key:y.value,_onRemove:Ie=>{let T=s.get(),Ue=(Array.isArray(T)?T:[T]).filter(ue=>ue!==y.value);i?s.set(Ue):s.set(Ue[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:Te(1),flex:1}},g={_onInsert:p=>{p.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:p=>p.children.insert(u),onClick:()=>a.get()?c():l(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:p=>Te(6+xt(p)*2),minWidth:Te(32),outlineOffset:"-1px",outline:p=>`1px solid ${vt(p,"shift-4","neutral")}`,paddingInline:p=>Te(xt(p)*2),borderRadius:p=>Te(xt(p)*1),fontSize:p=>Zr(p,"inherit"),color:p=>vt(p,"shift-9",e),backgroundColor:p=>vt(p,"inherit",e)}};return fo(m,g),m}import{themeColor as St,themeSize as go,themeSpacing as R}from"@domphy/theme";function Ds(n={}){let{accentColor:o="primary"}=n;return{dataTone:"shift-2",type:"checkbox",_onSchedule:t=>{if(t.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:t=>go(t,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:R(9),height:R(6),cursor:"pointer",margin:"0",paddingBlock:R(1),"&:checked":{"&::before":{backgroundColor:t=>St(t,"increase-3",o)},"&::after":{left:`calc(100% - ${R(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:R(3),height:R(3),borderRadius:R(999),left:R(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:t=>St(t,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:R(999),display:"inline-block",fontSize:t=>go(t,"inherit"),lineHeight:1,backgroundColor:t=>St(t)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{toState as en}from"@domphy/core";import{themeColor as re,themeSize as tn,themeSpacing as k}from"@domphy/theme";function Fs(n={}){let{checked:o=!1,accentColor:t="primary",color:e="neutral"}=n,r=en(o);return{_onSchedule:i=>{i.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:i=>r.get(i),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:i=>tn(i),border:"none",outlineWidth:"1px",outline:i=>`1px solid ${re(i,"shift-3",e)}`,minWidth:k(12),minHeight:k(6),borderRadius:k(999),paddingLeft:k(7),paddingRight:k(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:i=>re(i,"inherit",e),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:k(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:k(5),height:k(5),borderRadius:k(999),color:i=>re(i,"shift-9"),backgroundColor:i=>re(i,"decrease-2",e)},"&[aria-checked=true]":{backgroundColor:i=>re(i,"increase-3",t),outline:"none",color:i=>re(i,"decrease-2"),paddingLeft:k(2),paddingRight:k(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${k(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}import{themeColor as on,themeSize as rn}from"@domphy/theme";function Ks(n={}){let{color:o="neutral"}=n;return{dataSize:"decrease-1",_onInsert:t=>{t.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:t=>rn(t,"inherit"),color:t=>on(t,"shift-9",o)}}}import{themeColor as bo,themeSize as nn}from"@domphy/theme";function Gs(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:t=>nn(t,"inherit"),fontWeight:700,color:t=>bo(t,"shift-11",o),backgroundColor:t=>bo(t)}}}import{themeColor as ln,themeSize as an}from"@domphy/theme";function Qs(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:t=>an(t,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:t=>ln(t,"shift-9",o)}}}import{themeColor as sn,themeSize as mn}from"@domphy/theme";function om(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:t=>mn(t,"decrease-1"),verticalAlign:"super",lineHeight:0,color:t=>sn(t,"shift-9",o)}}}import{themeColor as I,themeDensity as ne,themeSpacing as ie,themeSize as yo}from"@domphy/theme";function im(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:t=>yo(t,"inherit"),color:t=>I(t,"shift-9",o),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-10",o),backgroundColor:t=>I(t,"inherit")},"& td":{textAlign:"left",paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-9",o),boxShadow:t=>`inset 0 1px 0 ${I(t,"shift-4",o)}`,fontSize:t=>yo(t,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:t=>ie(ne(t)*3),paddingBlock:t=>ie(ne(t)*1),color:t=>I(t,"shift-10",o),backgroundColor:t=>I(t,"inherit"),boxShadow:t=>`inset 0 -1px 0 ${I(t,"shift-4",o)}`},"& tr":{backgroundColor:t=>I(t,"inherit")},"& tbody tr:hover":{backgroundColor:t=>I(t,"shift-3")+"!important"}}}}import{themeColor as _,themeDensity as Et,themeSpacing as le,themeSize as cn}from"@domphy/theme";function mm(n={}){let{color:o="neutral",accentColor:t="primary"}=n;return{_onInsert:e=>{e.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:e=>le(Et(e)*4),paddingBlock:e=>le(Et(e)*2),border:"none",borderRadius:e=>le(Et(e)*2),fontSize:e=>cn(e,"inherit"),color:e=>_(e,"shift-9",o),outlineOffset:"-1px",outline:e=>`1px solid ${_(e,"shift-4",o)}`,backgroundColor:e=>_(e,"inherit",o),"&::placeholder":{color:e=>_(e,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:e=>`${le(.5)} solid ${_(e,"shift-5",t)}`},"&:focus-visible":{outline:e=>`${le(.5)} solid ${_(e,"shift-6",t)}`},"&:invalid":{outline:e=>`${le(.5)} solid ${_(e,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:e=>_(e,"shift-8","neutral"),outline:e=>`1px solid ${_(e,"shift-4","neutral")}`,backgroundColor:e=>_(e,"shift-2","neutral")}}}}import{themeColor as Co,themeSize as dn,themeSpacing as un}from"@domphy/theme";function hm(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:t=>dn(t,"inherit"),backgroundColor:t=>Co(t),color:t=>Co(t,"shift-9",o),marginTop:0,marginBottom:0,paddingLeft:un(3),listStyleType:"disc",listStylePosition:"outside"}}}import{themeColor as vo,themeSize as hn,themeSpacing as pn}from"@domphy/theme";function bm(n={}){let{color:o="neutral"}=n;return{_onInsert:t=>{t.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:t=>hn(t,"inherit"),backgroundColor:t=>vo(t),color:t=>vo(t,"shift-9",o),marginTop:0,marginBottom:0,paddingLeft:pn(3),listStyleType:"decimal",listStylePosition:"outside"}}}import{toState as fn}from"@domphy/core";import{themeColor as ae,themeDensity as Pe,themeSize as gn,themeSpacing as se}from"@domphy/theme";function bn(n,o){if(o<=7)return Array.from({length:o},(i,s)=>s+1);let t=[1];n>3&&t.push("...");let e=Math.max(2,n-1),r=Math.min(o-1,n+1);for(let i=e;i<=r;i++)t.push(i);return n<o-2&&t.push("..."),t.push(o),t}function xm(n){var a;let{total:o,color:t="neutral",accentColor:e="primary"}=n,r=fn((a=n.value)!=null?a:1),i={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:l=>se(6+Pe(l)*2),height:l=>se(6+Pe(l)*2),paddingInline:l=>se(Pe(l)*2),borderRadius:l=>se(Pe(l)*1),border:"none",cursor:"pointer",fontSize:l=>gn(l,"inherit"),backgroundColor:"transparent",color:l=>ae(l,"shift-9",t),"&:hover:not([disabled])":{backgroundColor:l=>ae(l,"shift-2",t)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},s=Nt(Mt({},i),{backgroundColor:l=>ae(l,"shift-6",e),color:l=>ae(l,"shift-11",e),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:l=>ae(l,"shift-6",e)}});return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:l=>{let c={div:m=>{let d=r.get(m),u=[];u.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&r.set(d-1),style:i});for(let g of bn(d,o))if(g==="...")u.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:p=>se(Pe(p)*2),color:p=>ae(p,"shift-7",t)}});else{let p=g===d;u.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:p?"page":void 0,disabled:p,onClick:()=>r.set(g),style:p?s:i})}return u.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=o,onClick:()=>d<o&&r.set(d+1),style:i}),u},style:{display:"flex",alignItems:"center",gap:se(1)}};l.children.insert(c)},style:{display:"inline-flex"}}}import{themeColor as Ke,themeSize as yn,themeSpacing as Cn}from"@domphy/theme";function Tm(n={}){let{color:o="neutral"}=n;return{role:"separator",_onInsert:t=>{t.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:Cn(2),fontSize:t=>yn(t,"inherit"),backgroundColor:t=>Ke(t),color:t=>Ke(t,"shift-9",o),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:t=>Ke(t,"shift-4",o),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:t=>Ke(t,"shift-4",o),borderWidth:"1px",borderBottomStyle:"solid"}}}}import{toState as vn}from"@domphy/core";import{themeColor as je,themeDensity as xn,themeSize as Sn,themeSpacing as we}from"@domphy/theme";var xo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},En={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},kt=n=>n==="left"||n==="right";function _m(n={}){let{color:o="neutral",open:t=!1,placement:e="right",size:r}=n,i=vn(t),s=kt(e)?we(80):we(64),a=r!=null?r:s;return{_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(l,c)=>{l.target===c.domElement&&i.set(!1)},onTransitionEnd:(l,c)=>{let m=c.domElement;i.get()||(m.close(),document.body.style.overflow="")},_onMount:l=>{let c=l.domElement,m=d=>{d?(c.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{c.style.transform="translate(0, 0)"})):c.style.transform=xo[e]};m(i.get()),i.onChange(m)},style:{transform:xo[e],transition:"transform 0.25s ease",fontSize:l=>Sn(l,"inherit"),color:l=>je(l,"shift-10",o),backgroundColor:l=>je(l,"inherit",o),border:"none",padding:l=>we(xn(l)*3),margin:En[e],width:kt(e)?a:"100dvw",height:kt(e)?"100dvh":a,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:l=>`0 ${we(4)} ${we(12)} ${je(l,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:l=>je(l,"shift-2","neutral"),opacity:.75}}}}import{toState as kn,merge as So}from"@domphy/core";function Dm(n){let{open:o=!1,placement:t="bottom",openOn:e="click"}=n,r=null,i=kn(o),{show:s,hide:a,anchorPartial:l}=H({open:i,placement:t,content:n.content,onPlacement:n.onPlacement}),c={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),_onInsert:d=>{let u=d.attributes.get("id");r=u||d.nodeId,!u&&d.attributes.set("id",r)}};return So(n.content,c),So(l,{ariaHaspopup:"dialog",ariaExpanded:d=>i.get(d),onMouseEnter:()=>e==="hover"&&s(),onMouseLeave:()=>e==="hover"&&a(),onClick:()=>e==="click"&&(i.get()?a():s()),onFocus:()=>s(),onBlur:()=>a(),_onMount:d=>r&&d.attributes.set("ariaControls",r)}),l}import{toState as Tn}from"@domphy/core";import{themeColor as Tt,themeDensity as Pt,themeSize as Pn,themeSpacing as K}from"@domphy/theme";function Fm(n={}){let{position:o="top-center",color:t="neutral"}=n,e=Tn(!1),r=o.startsWith("top"),i=o.endsWith("center"),s=o.endsWith("right"),a={div:[],id:`domphy-toast-${o}`,style:{position:"fixed",display:"flex",flexDirection:r?"column":"column-reverse",alignItems:i?"center":s?"end":"start",inset:0,gap:K(4),zIndex:30,padding:K(6),pointerEvents:"none"}};return{_portal:l=>{let c=l.domElement.querySelector(`#domphy-toast-${o}`);return c||(c=l.children.insert(a).domElement),c},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:K(32),pointerEvents:"auto",paddingBlock:l=>K(Pt(l)*2),paddingInline:l=>K(Pt(l)*4),borderRadius:l=>K(Pt(l)*2),fontSize:l=>Pn(l,"inherit"),color:l=>Tt(l,"shift-9",t),backgroundColor:l=>Tt(l,"inherit",t),boxShadow:l=>`0 ${K(2)} ${K(9)} ${Tt(l,"shift-4","neutral")}`,opacity:l=>Number(e.get(l)),transform:l=>e.get(l)?"translateY(0)":r?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>e.set(!0)),_onBeforeRemove:(l,c)=>{let m=d=>{d.propertyName==="transform"&&(l.domElement.removeEventListener("transitionend",m),c())};l.domElement.addEventListener("transitionend",m),e.set(!1)}}}import{toState as wn,merge as In}from"@domphy/core";import{themeSpacing as wt,themeColor as Eo,themeDensity as It,themeSize as _n}from"@domphy/theme";function Xm(n={}){let{open:o=!1,placement:t="top",content:e="Tooltip Content"}=n,r=null,i=wn(t),s=typeof e=="string"?{span:e}:e,{show:a,hide:l,anchorPartial:c}=H({open:o,placement:t,content:s}),m={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:u=>{let g=u.attributes.get("id");r=g||u.nodeId,!g&&u.attributes.set("id",r)},style:{paddingBlock:u=>wt(It(u)*1),paddingInline:u=>wt(It(u)*3),borderRadius:u=>wt(It(u)*1),color:u=>Eo(u,"shift-9"),backgroundColor:u=>Eo(u),fontSize:u=>_n(u,"inherit")},$:[qt({placement:t,bordered:!1})]};return s.$||(s.$=[]),s.$.push(m),In(c,{onMouseEnter:()=>a(),onMouseLeave:()=>l(),onFocus:()=>a(),onBlur:()=>l(),onKeyDown:u=>u.key==="Escape"&&l(),_onMount:u=>r&&u.attributes.set("ariaDescribedby",r)}),c}import{ElementNode as ko}from"@domphy/core";function To(n,o){return n.key!==void 0&&n.key!==null?String(n.key):`index-${o}`}function ec(n={}){let{duration:o=300,delay:t=0}=n,e=new Map;return{_onBeforeUpdate:r=>{e=new Map,r.children.items.forEach((i,s)=>{if(!(i instanceof ko))return;let a=i.domElement;a&&e.set(To(i,s),a.getBoundingClientRect())})},_onUpdate:r=>{r.children.items.forEach((i,s)=>{if(!(i instanceof ko))return;let a=i.domElement;if(!a)return;let l=To(i,s),c=e.get(l);if(!c)return;let m=a.getBoundingClientRect(),d=c.left-m.left,u=c.top-m.top;if(Math.abs(d)<.5&&Math.abs(u)<.5)return;let g=a.style.transition,p=a.style.transform;a.style.transition="none",a.style.transform=`translate(${d}px, ${u}px)`,a.getBoundingClientRect(),requestAnimationFrame(()=>{a.style.transition=`transform ${o}ms ease ${t}ms`,a.style.transform="translate(0px, 0px)"});let f=()=>{a.style.transition=g,a.style.transform=p,a.removeEventListener("transitionend",h)},h=b=>{b.propertyName==="transform"&&f()};a.addEventListener("transitionend",h),setTimeout(f,o+t+34)}),e.clear()}}}import{merge as zn}from"@domphy/core";import{toState as $n}from"@domphy/core";function lc(n={}){return{role:"tablist",_onSchedule:(t,e)=>{let r={_context:{tabs:{activeKey:$n(n.activeKey||0)}}};zn(e,r)}}}import{themeSpacing as me,themeColor as ce,themeDensity as Po,themeSize as Mn}from"@domphy/theme";function cc(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"tab",_onInsert:r=>{var c;r.tagName!="button"&&console.warn('"tab" patch must use button tag');let i=r.getContext("tabs"),s=(c=r.parent)==null?void 0:c.children.items;s=s.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="tab");let a=r.key||s.findIndex(m=>m==r),l={id:"tab"+r.parent.nodeId+a,ariaControls:"tabpanel"+r.parent.nodeId+a,ariaSelected:m=>i.activeKey.get(m)==a,onClick:()=>i.activeKey.set(a),onKeyDown:m=>{var h,b,y,Ie;let d=m.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;m.preventDefault();let u=((b=(h=r.parent)==null?void 0:h.children.items)!=null?b:[]).filter(T=>T.type==="ElementNode"&&T.attributes.get("role")==="tab"),g=u.findIndex(T=>T===r),p=g;d==="ArrowRight"?p=(g+1)%u.length:d==="ArrowLeft"?p=(g-1+u.length)%u.length:d==="Home"?p=0:d==="End"&&(p=u.length-1);let f=u[p];i.activeKey.set((y=f.key)!=null?y:p),(Ie=f.domElement)==null||Ie.focus()}};r.merge(l)},style:{cursor:"pointer",fontSize:r=>Mn(r,"inherit"),height:r=>me(6+Po(r)*2),paddingInline:r=>me(Po(r)*4),border:"none",outline:"none",color:r=>ce(r,"shift-9"),backgroundColor:r=>ce(r,"inherit"),boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-1",t)}`,"&:hover:not([disabled])":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-2",t)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-6",o)}`},"&:focus-visible":{boxShadow:r=>`inset 0 -${me(.5)} 0 0 ${ce(r,"shift-6",o)}`}}}}import{themeSpacing as wo,themeDensity as Io}from"@domphy/theme";function pc(){return{role:"tabpanel",style:{paddingBlock:o=>wo(Io(o)*2),paddingInline:o=>wo(Io(o)*2)},_onInsert:o=>{var s;let t=o.getContext("tabs"),e=(s=o.parent)==null?void 0:s.children.items;e=e.filter(a=>a.type=="ElementNode"&&a.attributes.get("role")=="tabpanel");let r=o.key||e.findIndex(a=>a==o),i={id:"tabpanel"+o.parent.nodeId+r,ariaLabelledby:"tab"+o.parent.nodeId+r,hidden:a=>t.activeKey.get(a)!=r};o.merge(i)}}}import{merge as Nn}from"@domphy/core";import{toState as Ln}from"@domphy/core";import{themeColor as Rn,themeDensity as _o,themeSize as Dn,themeSpacing as zo}from"@domphy/theme";function xc(n={}){let{color:o="neutral"}=n;return{role:"menu",dataTone:"shift-17",_onSchedule:(e,r)=>{let i={_context:{menu:{activeKey:Ln(n.activeKey||0)}}};Nn(r,i)},style:{display:"flex",flexDirection:"column",paddingBlock:e=>zo(_o(e)*2),paddingInline:e=>zo(_o(e)*2),fontSize:e=>Dn(e,"inherit"),backgroundColor:e=>Rn(e,"inherit",o)}}}import{themeSpacing as qe,themeColor as de,themeDensity as $o,themeSize as Hn}from"@domphy/theme";function Tc(n={}){let{accentColor:o="primary",color:t="neutral"}=n;return{role:"menuitem",_onInsert:r=>{var l;r.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let i=r.getContext("menu"),s=(l=r.parent)==null?void 0:l.children.items;s=s.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="menuitem");let a=r.key||s.findIndex(c=>c==r);r.attributes.set("ariaCurrent",c=>i.activeKey.get(c)==a||void 0),r.addEvent("click",()=>i.activeKey.set(a))},onKeyDown:(r,i)=>{var m,d,u;let s=r.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(s))return;r.preventDefault();let a=((d=(m=i.parent)==null?void 0:m.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="menuitem"),l=a.findIndex(g=>g===i),c=l;s==="ArrowDown"?c=(l+1)%a.length:s==="ArrowUp"?c=(l-1+a.length)%a.length:s==="Home"?c=0:s==="End"&&(c=a.length-1),(u=a[c].domElement)==null||u.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:r=>Hn(r,"inherit"),height:r=>qe(6+$o(r)*2),paddingInline:r=>qe($o(r)*3),border:"none",outline:"none",color:r=>de(r,"shift-9"),backgroundColor:r=>de(r,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:r=>de(r,"shift-2")},"&[aria-current=true]":{backgroundColor:r=>de(r,"shift-3",o),color:r=>de(r,"shift-10")},"&:focus-visible":{outline:r=>`${qe(.5)} solid ${de(r,"shift-6",o)}`,outlineOffset:`-${qe(.5)}`}}}}import{merge as On}from"@domphy/core";function _c(n){return{_onSchedule:(o,t)=>{On(t,{_context:{form:n}})}}}function $c(n,o){return{_onInsert:t=>{let r=t.getContext("form").setField(n,void 0,o),i=t.tagName,s=t.attributes.get("type");["input","select","textarea"].includes(i)||console.warn('"field" patch must use input, select, or textarea tag');let a={onBlur:()=>r.setTouched(),ariaInvalid:l=>!!r.message("error",l)||void 0,dataStatus:l=>r.status(l)};i==="input"&&s==="checkbox"?(a.checked=r.value(),a.onChange=l=>r.setValue(l.target.checked)):i==="input"&&s==="radio"?a.onChange=l=>r.setValue(l.target.value):i==="select"?(a.value=r.value(),a.onChange=l=>r.setValue(l.target.value)):i==="textarea"?(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)):(a.value=r.value(),a.onInput=l=>r.setValue(l.target.value)),t.merge(a)}}}import{Notifier as Bn}from"@domphy/core";function Fn(n){return!!n&&typeof n.then=="function"}var Ge=class{constructor(o,t){this._notifier=new Bn;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=o,this._initValue=o,this._validator=t,t&&this.validate()}value(o){return o&&this._notifier.addListener("value",o),this._value}setValue(o){this._value=o,this._notifier.notify("value",o),this._notifier.notify("dirty",o!==this._initValue),this.validate()}dirty(o){return o&&this._notifier.addListener("dirty",o),this._value!==this._initValue}touched(o){return o&&this._notifier.addListener("touched",o),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(o,t){let e=!1;o!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=o,this._initValue=o,this._notifier.notify("value",o),this._notifier.notify("dirty",!1),e=!0),t!==void 0&&t!==this._validator&&(this._validator=t,e=!0),e&&this.validate()}message(o,t){return t&&this._notifier.addListener(o,t),this._messages[o]}status(o){return o&&this._notifier.addListener("status",o),Ye(this._messages)}setMessages(o){let t=this._messages;this._messages=o;for(let e of["error","warning","success"])t[e]!==o[e]&&this._notifier.notify(e,o[e]);Ye(t)!==Ye(o)&&this._notifier.notify("status",Ye(o))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let o=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let t=this._validator(this._value);Fn(t)?(this._pending=!0,Promise.resolve(t).then(e=>{o===this._validationToken&&(this._pending=!1,this.setMessages(e!=null?e:{}))}).catch(e=>{o===this._validationToken&&(this._pending=!1,console.error(e))})):(this._pending=!1,this.setMessages(t!=null?t:{}))}catch(t){o===this._validationToken&&(this._pending=!1),console.error(t)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Ye(n){if(n.error)return"error";if(n.warning)return"warning";if(n.success)return"success"}var Mo=class{constructor(){this.fields=new Map}setField(o,t,e){let r=this.fields.get(o);return r?r.configure(t,e):(r=new Ge(t,e),this.fields.set(o,r)),r}getField(o){return this.setField(o)}removeField(o){var t;(t=this.fields.get(o))==null||t._dispose(),this.fields.delete(o)}get valid(){for(let o of this.fields.values())if(o._pending||o._messages.error)return!1;return!0}reset(){for(let o of this.fields.values())o.reset()}snapshot(){let o={};for(let[t,e]of this.fields)Vn(o,t,e._value);return o}_dispose(){for(let o of this.fields.values())o._dispose();this.fields.clear()}};function Vn(n,o,t){let e=o.split("."),r=n;for(let i=0;i<e.length-1;i++){let s=e[i];r[s]==null&&(r[s]=isNaN(Number(e[i+1]))?{}:[]),r=r[s]}r[e[e.length-1]]=t}export{Ge as FieldState,Mo as FormState,qn as abbreviation,xi as alert,ki as avatar,_i as badge,il as blockquote,Mi as breadcrumb,Ri as breadcrumbEllipsis,sl as button,Fs as buttonSwitch,Un as card,gl as code,Xi as combobox,ii as command,ai as commandItem,li as commandSearch,kl as descriptionList,vl as details,_l as dialog,Tm as divider,_m as drawer,Nl as emphasis,$c as field,Hl as figure,_c as form,Fl as formGroup,Kl as heading,Gl as horizontalRule,ta as icon,Ql as image,ul as inputCheckbox,na as inputColor,sa as inputDateTime,ua as inputFile,Ia as inputNumber,yi as inputOTP,ls as inputRadio,ka as inputRange,ga as inputSearch,Ds as inputSwitch,va as inputText,Ma as keyboard,Da as label,Ba as link,Wa as mark,xc as menu,Tc as menuItem,bm as orderedList,xm as pagination,Ga as paragraph,Dm as popover,qt as popoverArrow,Qa as preformated,os as progress,ms as select,Ms as selectBox,Ps as selectItem,Ss as selectList,hs as skeleton,Ks as small,bs as spinner,Zn as splitter,ti as splitterHandle,ei as splitterPanel,Gs as strong,Qs as subscript,om as superscript,cc as tab,pc as tabPanel,im as table,lc as tabs,Re as tag,mm as textarea,Fm as toast,ci as toggle,fi as toggleGroup,Xm as tooltip,ec as transitionGroup,hm as unorderedList};
2
2
  //# sourceMappingURL=index.js.map