plainframe-ui 0.1.80 → 0.1.81
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.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ ${b}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F()
|
|
|
10
10
|
0% { left: -200%; right: 100%; }
|
|
11
11
|
60% { left: 107%; right: -8%; }
|
|
12
12
|
100% { left: 107%; right: -8%; }
|
|
13
|
-
`,Gc=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),Xc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Yc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Gc(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&Xc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=fe.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),T=typeof t=="number",A=Math.max(o-n,1),y=T?Xa(t,n,o):void 0,x=T?(y-n)/A*100:void 0,g=Yc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Zc,{size:s,active:g,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Jc,{thickness:a,active:g,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Jc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),A=css([{position:"relative",width:"100%",height:rs(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,Ga):Ga,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...g,left:"-35%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...g,left:"-200%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:A,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Zc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),m=40,h=(m-t)/2,f=2*Math.PI*h,A=`${(o?Xa((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:rs(e,`${u.componentHeights.md}`),height:rs(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:A,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:g})})})};var Za=createContext(null),Qa=()=>{let e=useContext(Za);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},lu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),cu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),uu=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),ei=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:l,children:u,...m},h){let f=V(),T=useId(),A=useId(),y=useMemo(()=>{let M={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?M[c]:M.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},g=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??g:v==="warning"?x.warning??g:v==="success"?x.success??g:v==="info"?x.info??x.primary??g:g)(t),D=I?.[50]??g[50],P=I?.[300]??g[300],L=I?.[600]??I?.[500]??g[600],z=I?.[700]??L,w=I?.[800]??f.text?.primary??"#000",b=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:L,fg:b,border:void 0,iconColor:b}:n==="outlined"?{bg:D,fg:w,border:`1px solid ${P}`,iconColor:w}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:D,fg:w,border:void 0,iconColor:z}},[t,n,g,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),F=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),E=useMemo(()=>[cu,{color:d.iconColor}],[d.iconColor]),k=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[uu,{color:d.fg}],[d.fg]),_=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:A}),[d.fg,d.iconColor,y,T,A]),W=fe.Children.toArray(u).some(M=>fe.isValidElement(M)&&M.type===is),S=fe.Children.toArray(u).some(M=>fe.isValidElement(M)&&M.type===ls);return jsx(Za.Provider,{value:_,children:jsxs("div",{ref:h,role:p,"aria-live":p==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":W?T:void 0,"aria-describedby":S?A:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[F,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:E,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:lu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:k,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});ei.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Qa(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});is.displayName="AlertTitle";var ls=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Qa(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});ls.displayName="AlertDescription";var cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yt=e=>e==null?[]:Array.isArray(e)?e:[e],Jt=(...e)=>css(e.filter(Boolean));function ni(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var Qo=fe.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:A,togglePasswordVisible:y=false,showClear:x,type:g="text",step:d,focusRingMode:p="always",className:C,wrapperCss:F,inputCss:R,labelCss:E,helperRowCss:k,helperTextCss:$,startIconCss:_,endIconCss:W,css:S,onBlur:M,onFocus:I,onKeyDown:D,autoFocus:P,name:L,id:z,tabIndex:w,autoComplete:b,readOnly:v,required:B,maxLength:H,onSurfaceClick:O},K){let N=V(),U=Yo(),G=useId(),se=useMemo(()=>{let ue={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Ee=["sm","md","lg"].includes(m)?m:"md";return ue[Ee]},[m,N]),j=N.neutral,J=N.text,le=g==="number",de=g==="password",ge=n!==void 0,[Pe,Te]=useState(o),Re=ge?n:Pe,Ie=useCallback(ue=>{ge||Te(ue),r?.(ue);},[ge,r]),we=/^-?\d*(?:[.,]\d*)?$/,Q=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(Re??"")),ie=le?Q?"decimal":"numeric":void 0,me=le?Q?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ue=>{(ue===""||we.test(ue))&&Ie(ue);},[Ie]),xe=i?j[200]:a&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:a&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",ee=N.componentHeights.border,oe=h==="outlined"?`${ee} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Jt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?cs(u):void 0,flex:"0 0 auto",fontWeight:500}),be=useMemo(()=>Jt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?j[500]:J.primary,marginBottom:4,display:"inline-block"},...Yt(E)),[se.labelFont,a,i,j,J,N.palette.danger,E]),Ne=useMemo(()=>Jt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(se.paddingY)} ${cs(se.paddingX)}`,background:xe,border:oe,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Yt(F),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,xe,oe,f,i,F,S]),ze=useMemo(()=>Jt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?j[500]:a?N.palette.danger?.[800]??J.primary:J.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?N.palette.danger?.[700]??J.secondary:J.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??J.primary:J.primary} !important`,boxShadow:`0 0 0 1000px ${xe} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??J.primary:J.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Yt(R)),[se.fontSize,i,j,J,a,N.palette.danger,le,xe,R]),X$1=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Yt(_)),[a,N.palette.danger,J.secondary,_]),re=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Yt(W)),[a,N.palette.danger,J.secondary,i,W]),Z=useMemo(()=>Jt({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??J.secondary:J.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Yt(k)),[se.helperFont,a,N.palette.danger,J.secondary,k]),ce=useMemo(()=>Jt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Yt($)),[$]),pe=useRef(null),Ue=useCallback(ue=>{pe.current=ue,K&&(typeof K=="function"?K(ue):K.current=ue);},[K]),Oe=useCallback(ue=>{let Ee=ue.target.value;if(le){Y(Ee);return}H&&Ee.length>H||Ie(Ee);},[le,H,Ie,Y]),[ke,st]=useState(false),He=useCallback(()=>{i||st(ue=>!ue);},[i]),nt=useCallback(()=>{i||(Ie(""),pe.current?.focus());},[i,Ie]),qe=useMemo(()=>{let ue=se.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[se.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:X$1,children:ni(T,qe)}):null,[T,X$1,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ue=[];if(de&&y){let bt=ke?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ue.push(jsx("button",{type:"button",css:re,onMouseDown:Qn=>Qn.preventDefault(),onClick:Qn=>{Qn.stopPropagation(),He();},tabIndex:-1,"aria-label":ke?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&Re&&Re.length>0&&!i&&ue.push(jsx("button",{type:"button",css:re,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=A?jsx("span",{css:re,children:ni(A,qe)},"user-end"):null,at=ue.length>0,De=!!Ee;return !at&&!De?null:!at&&De?Ee:at&&!De?ue.length===1?ue[0]:jsx("span",{css:ot,children:ue}):jsxs("span",{css:ot,children:[ue,Ee]})},[de,y,ke,qe,re,ot,i,x,Re,A,He,nt]),rn=c!=null?`${z??G}-help`:void 0,Zn=z??G,Je=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=pe.current;if(!Ee)return;let at=ue.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),xt=useCallback(ue=>{if(i)return;let Ee=pe.current;if(Ee&&(O?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Zn,className:"plainframe-ui-textfield-label",css:be,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Ne],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Zn,className:"plainframe-ui-textfield-input",css:ze,type:de?ke?"text":"password":g==="number"?"text":g,inputMode:ie,pattern:me,value:Re,maxLength:le?void 0:H,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:M,onFocus:I,onKeyDown:D,autoFocus:P,name:L,tabIndex:w,autoComplete:b,readOnly:v,required:B,"aria-invalid":!!a||void 0,"aria-describedby":rn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Z,children:jsx("span",{id:rn,className:"plainframe-ui-textfield-helper-text",css:ce,children:c})})]})}));Qo.displayName="TextField";var er=fe.createContext("ghost"),Tt=fe.createContext(false),ii=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...m},h){let f=V(),[T,A]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),g=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:g,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:A}),[T]),F=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(D=>{if(D.closest('[role="menu"]')!==I)return false;let P=window.getComputedStyle(D);return P.display!=="none"&&P.visibility!=="hidden"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),A(false);},[]),k=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(k.current){k.current=false;return}let D=I.currentTarget,P=R(D);P.length>0&&(A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(L=>L.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true}));},[R]),_=useCallback(I=>{let D=I.currentTarget,P=R(D);if(P.length===0)return;if(I.key==="Tab"){k.current=true,D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),A(false),D.tabIndex=-1,requestAnimationFrame(()=>{D.tabIndex=0,k.current=false;});return}let L=D.querySelector("[data-highlighted]"),z=D.querySelector("[data-hovered]"),w=L||z,b=w?P.indexOf(w):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),b===-1&&(b=I.key==="ArrowDown"?-1:P.length);let v=I.key==="ArrowDown"?1:-1,B=(b+v+P.length)%P.length;P[B].setAttribute("data-highlighted",""),P[B].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[P.length-1].setAttribute("data-highlighted",""),P[P.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),A(false),D.blur();return}},[R]),W=useCallback(I=>{let D=I.currentTarget;D.hasAttribute("data-keyboard-nav")&&E(D);},[E]),S=useCallback(I=>{let D=I.currentTarget;D.hasAttribute("data-keyboard-nav")&&E(D);},[E]),M=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:F,children:jsx(Tt.Provider,{value:p,children:jsx(er.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:M,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:_,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ii.displayName="Menu";var ci=createContext(null),or=()=>{let e=useContext(ci);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function zu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)zu(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ou=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},tr=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Wu=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Ou(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let d=Array.from(g.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(R=>{let E=window.getComputedStyle(R);return E.display!=="none"&&E.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],F=document.activeElement;x.shiftKey&&F===p?(x.preventDefault(),C.focus()):!x.shiftKey&&F===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let A=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ci.Provider,{value:A,children:a})},ui=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:l}=or(),u=fe.Children.only(t),m=u.props||{},h=io(c,o,u.ref),f=a==="click"?{onClick:A=>{A.stopPropagation(),s(!r),m.onClick?.(A);}}:{onMouseEnter:A=>{l(),r||s(true),m.onMouseEnter?.(A);},onMouseLeave:A=>{i(),m.onMouseLeave?.(A);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let A=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[A,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});ui.displayName="PopoverTrigger";var di=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=fe.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return fe.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:ds(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});di.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var pi=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:A,setOpen:y,triggerOn:x,referenceRef:g,scheduleClose:d,cancelClose:p}=or(),C=V(),F=_u(e),{refs:R,x:E,y:k,strategy:$,context:_}=useFloating({open:A,onOpenChange:y,whileElementsMounted:autoUpdate,placement:F,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&R.setReference(g.current);},[R,g]);let W=useDismiss(_,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(_,{role:"dialog"}),{getFloatingProps:M}=useInteractions([W,S]),[I]=_.placement.split("-"),D=I,P=`${D==="left"?"right":D==="right"?"left":"center"} ${D==="top"?"bottom":D==="bottom"?"top":"center"}`,L=8,z=D==="top"?{y:L}:D==="bottom"?{y:-L}:D==="left"?{x:L}:{x:-L},w={initial:{opacity:0,scale:.96,...z},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...z},transition:{scale:{type:"spring",stiffness:520,damping:32,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.16,ease:"linear"}}},b=C.surface.panelBg,v=C.text.primary,B=`${C.componentHeights.border} solid ${C.surface.border}`,H=tr(i,C.spacing),O=tr(l,C.spacing),K=tr(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),K&&(N.paddingBlock=K);let U=tr(m,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:k??0,left:E??0,zIndex:1e3,transformOrigin:P,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(a)??"fit-content",height:ds(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),j=r?css({}):css({background:b,color:v,border:B,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),J=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},le=io(R.setFloating,T),de=jsx(motion.div,{className:"plainframe-ui-popover",...M({...f,ref:le,...J}),...w,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:A?de:null})})});pi.displayName="PopoverContent";var Ku=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=fe.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),A=ve(),y={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},x={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[d,p]=useState(n),C=g?!!t:d,[F,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let E=["sm","md","lg"].includes(s)?s:"md",k=y[E],$=`${x.slideMs}ms ${x.easing}`,_=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?_:W,M=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:D,thumb:P}=k,L=(D-P)/2,z=css({display:"inline-flex",alignItems:"center",gap:k.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),w=css({position:"relative",width:I,height:D,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),b=css({position:"absolute",top:L,left:C?I-P-L:L,width:P,height:P,backgroundColor:M,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:F?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),B=()=>{if(r)return;let O=!C;g||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:B,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,A({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[w,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[b,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[v,m],children:a})]})}));var Ju=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},sr=fe.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:A,...y},x)=>{let g=V(),d=ve(),p=typeof e=="boolean",[C,F]=useState(t),R=p?e:C,E=r==="sm"||r==="lg"?r:"md",k=useMemo(()=>Ju(g,E),[g,E]),{checkedBg:$,checkColor:_,borderCol:W,hoverBg:S,gapPx:M}=useMemo(()=>{let O=g.palette||{},K=g.neutral||{},N=g.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=K,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||K,G=l):(U=O.primary||K,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],j=N[G]??N.primary??g.text?.onColors?.primary??g.text.primary,J=typeof k.gap=="number"?k.gap+2:k.gap;return {checkedBg:se,checkColor:j,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:J}},[k.gap,l,g]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:M,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:W,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[W,$,a,o,M,S,s,g.radius.sm,g.spacing.xs]),D=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),P=useMemo(()=>css({width:k.box,height:k.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${k.borderWidth} solid ${W}`,outlineOffset:`-${k.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?g.radius.full:k.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, box-shadow .16s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden",transform:"translateZ(0)",backfaceVisibility:"hidden"}),[k.box,k.borderRadius,k.borderWidth,W,c,g.radius.full]),L=useMemo(()=>({w:Math.round(k.box*k.iconRatioW),h:Math.round(k.box*k.iconRatioH)}),[k.box,k.iconRatioH,k.iconRatioW]),z=useMemo(()=>css({width:L.w,height:L.h,transition:"opacity .14s ease, transform .14s ease",color:_,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[_,L.h,L.w]),w=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),b=useMemo(()=>css({fontSize:k.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[k.labelFont,g.text.primary]),v=useMemo(()=>css({fontSize:k.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[k.labelFont,a,s,g.spacing.xs,g.text.secondary]),B=useCallback(()=>{o||(p?n?.(!R):F(O=>{let K=!O;return n?.(K),K}));},[o,p,R,n]),H=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},[o,B]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",A||""].join(" ").trim(),css:[I,d({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:R,onChange:B,disabled:o,css:D,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[P,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:_,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:w,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[b,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,T],children:a})]})]})}));sr.displayName="Checkbox";var ed=()=>useContext(gn),td=()=>useContext(ro),nd=()=>useContext(cr),mn=null,hi=(e,t=35)=>{mn!==null&&window.clearTimeout(mn),mn=window.setTimeout(()=>{e(),mn=null;},t);},lo=()=>{mn!==null&&(window.clearTimeout(mn),mn=null);},Ht=fe.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:A,...y},x){let g=ed(),d=nd(),p=lr(),C=uo(),F=td(),R=V(),k=!!useContext(Tt),$=y["data-subtrigger"]!==void 0,_=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,M=useContext(er),I=M==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],D=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:S>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${S}))`:R.spacing.md,minHeight:k?R.componentHeights.sm:R.componentHeights.md,display:"flex",alignItems:"center",gap:R.spacing.sm,fontWeight:500,fontSize:R.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?R.palette.danger[800]:R.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?R.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:I},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:R.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[R,k,S,t,n,I]),P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),L=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),w=[];k&&w.push({minHeight:R.componentHeights.sm,paddingLeft:R.spacing.sm,paddingRight:R.spacing.xs,paddingTop:R.spacing.xs,paddingBottom:R.spacing.xs});let b=()=>{s?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let K=H.closest('[role="menu"]');if(!K)return;let N=Array.from(K.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(J=>{if(J.closest('[role="menu"]')!==K)return false;let le=window.getComputedStyle(J);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),j=N[se];j&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),g&&T!=null&&g.setActiveIndex(se));},B=t?-1:F?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:B,ref:H=>{if(g&&!A){let O=g.listRef.current;H&&(T!=null?O[T]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&hi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');K?.hasAttribute("data-keyboard-nav")&&K.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)lo();else {let N=!!H.currentTarget.closest("[data-submenu-content]");p&&!N&&hi(p.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&g&&T!=null&&(K?.hasAttribute("data-keyboard-nav")&&(K.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),g.setActiveIndex(T)),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&g&&!F?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!g){let K=O.closest('[role="menu"]');if(K){K.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=K.tabIndex;K.tabIndex=-1,requestAnimationFrame(()=>{K.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),b());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[D,...w,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),b());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:P,children:l}),a,(f!=null||_||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:L,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:R.typography.sizes.sm,color:R.text.secondary,whiteSpace:"nowrap"}),children:f}):null,_,m&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),xi=fe.createContext(null),hs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,A=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(A),l.current?.(A);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(xi.Provider,{value:m,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:m,...h},f){let T=useContext(xi),A=!!T&&r!==void 0,y=!A&&t!==void 0,[x,g]=useState(()=>A?T.values.some(W=>Object.is(W,r)):!!n),d=A?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),F=!!useContext(Tt),R=()=>{if(!c)if(A)T.toggle(r);else {let W=!d;y||g(W),o?.(W);}},E=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:F?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),k=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),_=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:E,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:d,css:k})}),u]});return jsx(Ht,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon:_,endIcon:m,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var vi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:m,...h},f){let T=t!==void 0,[A,y]=useState(!!n),x=T?!!t:A,d=!!useContext(Tt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),F=()=>{if(a)return;let E=!x;T||y(E),o?.(E);},R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(Ht,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:F,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(gs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});vi.displayName="MenuSwitchItem";var Ci=fe.createContext(null),Ri=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(Ci.Provider,{value:i,children:o})};Ri.displayName="MenuRadioGroup";var od=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(Ci),u=l?.value===t,m=V(),h=css({width:m.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:m.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Ht,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:h,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),fn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let m=V(),f=!!useContext(Tt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,A=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),g=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(A,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:a})]})});fn.displayName="MenuLabel";var rd=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var wi=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},ys=io,po=0,ur=null,dr=null,yd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function xd(){if(!(typeof document>"u")){if(po===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=yd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function vd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;ur!==null&&(e.style.overflow=ur),dr!==null&&(e.style.paddingRight=dr),ur=null,dr=null;}}var gn=createContext(null),pr=()=>{let e=useContext(gn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),Cd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Ei=createContext(null),lr=()=>useContext(Ei),Si=createContext(false),Rd=()=>useContext(Si),ro=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Td(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var wd=()=>Cd()?.activeIndex??null,Ii=0,Ln=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(M=>{M&&wi(h.current),e===void 0&&i(M),n?.(M);},[e,n]),m=useRef(`pfui-menu-${++Ii}`),h=useRef(null),f=useRef([]),T=useRef(null),[A,y]=useState(null),[x,g]=useState(false);useEffect(()=>{l||(y(null),f.current=[],g(false));},[l]);let d=useRef(null),p=useCallback((M,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let D=I??20;d.current=window.setTimeout(()=>u(M),D);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return xd(),()=>vd()},[l,r]);let F=xs(),[R]=useState(()=>F??Td()),E=useRef(new Set),k=useMemo(()=>({registerSubMenu:M=>(E.current.add(M),()=>E.current.delete(M)),closeAllSubMenus:()=>{E.current.forEach(M=>M());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),_=useMemo(()=>({activeIndex:A,setActiveIndex:y}),[A,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:g}),[x]),S=s==="sm";return jsx(cr.Provider,{value:R,children:jsx(Tt.Provider,{value:S,children:jsx(oo.Provider,{value:W,children:jsx(Ei.Provider,{value:k,children:jsx(mo.Provider,{value:_,children:jsx(gn.Provider,{value:$,children:a})})})})})})};Ln.displayName="DropdownMenu";var Bn=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:A,menuId:y}=pr(),x=uo(),g=lr(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,F=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:E,...k}=s,$=useMemo(()=>ys(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),_=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(P=>{let L=_();requestAnimationFrame(()=>L[P]?.focus());},[_]),S=useCallback(P=>{if(P.key==="Tab"&&c){P.preventDefault(),x?.setIsKeyboardNav(true);let L=A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=L.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');z&&(document.querySelectorAll("[data-highlighted]").forEach(w=>w.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(P.key==="ArrowRight"&&c){let L=document.querySelector("[data-subtrigger][data-hovered]");if(L){P.preventDefault(),P.stopPropagation(),x?.setIsKeyboardNav(true),L.removeAttribute("data-hovered"),L.setAttribute("data-highlighted",""),L.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});L.dispatchEvent(z);});return}}if(P.key==="ArrowDown"||P.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){P.preventDefault(),i(true),requestAnimationFrame(()=>{let L=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=Array.from(L.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==L)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let w=P.key==="ArrowDown"?0:z.length-1;h(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),C?.(P),R?.(P);return}if(c){P.preventDefault();let L=document.querySelectorAll("[data-hovered]");for(let w of Array.from(L))if(w.closest("[data-submenu-content]")){let v=w.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let B=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let K=window.getComputedStyle(O);return K.display!=="none"&&K.visibility!=="hidden"}),H=B.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),H!==-1&&B.length>0){let O=P.key==="ArrowDown"?1:-1,K=(H+O+B.length)%B.length;B[K]?.setAttribute("data-highlighted",""),B[K]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(z){z.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let w=Array.from(z.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(b=>{if(b.closest('[role="menu"]')!==z)return false;let v=window.getComputedStyle(b);return v.display!=="none"&&v.visibility!=="hidden"});if(w.length>0){let b=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),B=-1;b?B=w.indexOf(b):v&&(B=w.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(K=>K.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),B===-1&&(B=P.key==="ArrowDown"?-1:w.length);let H=P.key==="ArrowDown"?1:-1,O=(B+H+w.length)%w.length;h(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}C?.(P),R?.(P);return}}if((P.key==="Enter"||P.key===" ")&&!c){P.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let L=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=Array.from(L.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==L)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(P),R?.(P);return}C?.(P),R?.(P);},[c,i,h,C,R,_,W,m,x,y,A,g]),M=useCallback(P=>{l==="click"&&((P.nativeEvent.composedPath?.()??[]).some(b=>{let v=b;if(!v||!("tagName"in v))return false;let B=String(v.tagName).toUpperCase();if(B==="INPUT"||B==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(P.stopPropagation(),i(!c))),F?.(P),E?.(P);},[l,c,i,F,E]),I=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},D=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&p){let P=p.props,L=P.css,z=typeof P.className=="string"?P.className:void 0,w=typeof P.tabIndex=="number"?P.tabIndex:0,b={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[L,D,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...k};return cloneElement(p,b)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),D,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...k,children:t})});Bn.displayName="DropdownMenuTrigger";var yn=fe.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:A,exitPlacement:y,animateOnBusClose:x=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...F},R)=>{let{open:E,setOpen:k,referenceRef:$,clearSubmenuHover:_,setActiveIndex:W,floatingRef:S,menuId:M}=pr(),I=V(),D=xs(),P=uo();useEffect(()=>{if(!D)return;let X=D.registerCloser(()=>k(false));return ()=>{X&&X();}},[D,k]);let L=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,w=typeof s=="string"?parseFloat(s):s,b=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(X=>({getBoundingClientRect:()=>{let re=Math.round(X.x),Z=Math.round(X.y);return {x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0,toJSON:()=>({x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0})}},contextElement:void 0}),[]),B=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let X=e;return v({x:X.x,y:X.y})},[e,v]),{refs:H,x:O,y:K,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:k,placement:b,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:L??0,crossAxis:z??0}),flip({padding:w??8}),shift({padding:w??8}),size({apply({rects:X,elements:re}){let Z=re.floating;Z.style.boxSizing="border-box",i!=null?Z.style.height=typeof i=="number"?`${i}px`:String(i):Z.style.removeProperty("height"),c!=null?Z.style.width=typeof c=="number"?`${c}px`:String(c):a?Z.style.width=`${Math.round(X.reference.width)}px`:Z.style.width="200px",l!=null?Z.style.maxHeight=typeof l=="number"?`${l}px`:String(l):Z.style.removeProperty("max-height");}})]});useEffect(()=>{B?H.setReference(B):$.current&&H.setReference($.current);},[H,B,$]),useEffect(()=>{if(!E)return;let X=B||$.current,re=H.floating.current;if(!(!X||!re))return autoUpdate(X,re,G)},[E,B,$,H,G]),useEffect(()=>{G();},[G,a,c,i,l]),useEffect(()=>{E&&!h&&W(0);},[E,h,W]),useEffect(()=>{if(!m||!E)return;let X=()=>{let re=document.activeElement,Z=$.current,ce=H.floating.current;re&&(Z?.contains(re)||ce?.contains(re)||k(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,E,k,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:X=>{if(d?.length){let re=X.target;for(let Z of d)if(Z.current?.contains(re))return false}return true}}),j=useRole(U,{role:"menu"}),{getFloatingProps:J}=useInteractions([se,j]),le=useRef(false);useEffect(()=>{E?le.current=true:le.current&&$.current&&C&&(D?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[E,$,D,C]),useLayoutEffect(()=>{if(!E)return;let X=()=>{let ce=S?.current;if(!ce)return false;let pe=ce.closest('[data-floating-ui-portal="true"]')??ce,Ue=$?.current;if(!Ue)return false;let Oe=Ue.closest("[data-pfui-portal-owner]");if(Oe){let He=Oe.getAttribute("data-pfui-portal-owner");if(!He)return false;if(pe.getAttribute("data-pfui-portal-owner")===He&&ce.getAttribute("data-pfui-portal-owner")===He)return true;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=Oe.getAttribute("data-pfui-mode"),qe=Oe.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<Oe.style.length;Ge++){let ot=Oe.style[Ge];if(ot.startsWith("--pf-")){let dt=Oe.style.getPropertyValue(ot);pe.style.setProperty(ot,dt),ce.style.setProperty(ot,dt);}}return pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),Oe.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),Oe.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark")),true}let ke=Ue.closest('[data-floating-ui-portal="true"]');if(ke&&!ke.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let He=st.getAttribute("data-pfui-scope");if(!He)return false;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe)),pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),st.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${He}"]`);if(Ge&&Ge!==pe)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let rn=Ge.style.getPropertyValue(dt);pe.style.setProperty(dt,rn),ce.style.setProperty(dt,rn);}}return true}return false},re=[0,5,15,30,60,100,150,250],Z=[];for(let ce of re)Z.push(window.setTimeout(()=>X(),ce));return ()=>{for(let ce of Z)window.clearTimeout(ce);}},[E,$]);let de=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),ge=g===void 0?void 0:typeof g=="number"?g:I.spacing[g]??g,Pe=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":de,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:ge,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Te=-1,Re=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let Z=X.type?.displayName;if(Z==="DropdownMenu"||Z==="DropdownMenuSub")return X;if(Z==="MenuItem"||Z==="MenuCheckboxItem"||Z==="MenuRadioItem"||Z==="MenuSwitchItem")return Te+=1,cloneElement(X,{__index:Te,key:X.key??Te});if(Z==="DropdownMenuTrigger"){let pe=X.props.children;return cloneElement(X,{children:fe.Children.map(pe,Re)})}if(Z==="DropdownMenuSubTrigger"){Te+=1;let pe=Te;return cloneElement(X,{__index:pe,key:X.key??pe})}let ce=X.props.children;return ce==null?X:cloneElement(X,{children:fe.Children.map(ce,Re)})},Ie=fe.Children.map(A,Re),Q=U.placement.split("-")[0]||"bottom",ie=Q==="bottom"?"center top":Q==="top"?"center bottom":Q==="left"?"right center":"left center",me=Q==="bottom"?{opacity:0,y:-8,scale:.96}:Q==="top"?{opacity:0,y:8,scale:.96}:Q==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Y=y??Q,xe=Y==="bottom"?{opacity:0,y:-8,scale:.96}:Y==="top"?{opacity:0,y:8,scale:.96}:Y==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},oe=!!D?.isBusClosingRef.current&&!x?{scale:{duration:0},x:{duration:0},y:{duration:0},opacity:{duration:0}}:{scale:{type:"spring",stiffness:520,damping:38,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.12,ease:"linear"}},ae=css({position:N,top:K??0,left:O??0,zIndex:1e3,transformOrigin:ie}),be=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),P?.setIsKeyboardNav(true);let re=X.currentTarget;re.setAttribute("data-keyboard-nav","");let Z=Array.from(re.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(ce=>{if(ce.closest('[role="menu"]')!==re)return false;let pe=window.getComputedStyle(ce);return pe.display!=="none"&&pe.visibility!=="hidden"});if(Z.length>0){let ce=re.querySelector("[data-highlighted]"),pe=re.querySelector("[data-hovered]"),Ue=-1;ce?Ue=Z.indexOf(ce):pe&&(Ue=Z.indexOf(pe)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),pe&&pe.removeAttribute("data-hovered"),Ue===-1&&(Ue=X.key==="ArrowDown"?-1:Z.length);let Oe=X.key==="ArrowDown"?1:-1,ke=(Ue+Oe+Z.length)%Z.length;W(ke),Z[ke]?.setAttribute("data-highlighted",""),Z[ke]?.focus();}}},[P,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...F,ref:ys(R,H.setFloating,X=>{if(S&&(S.current=X),X&&$.current){let Z=$.current.closest("[data-pfui-portal-owner]");if(Z){let ce=Z.getAttribute("data-pfui-portal-owner");if(ce){X.setAttribute("data-pfui-portal-owner",ce);let pe=Z.getAttribute("data-pfui-mode"),Ue=Z.getAttribute("data-pfui-primary");pe&&X.setAttribute("data-pfui-mode",pe),Ue&&X.setAttribute("data-pfui-primary",Ue);for(let Oe=0;Oe<Z.style.length;Oe++){let ke=Z.style[Oe];ke.startsWith("--pf-")&&X.style.setProperty(ke,Z.style.getPropertyValue(ke));}Z.classList.contains("pf-light")&&X.classList.add("pf-light"),Z.classList.contains("pf-dark")&&X.classList.add("pf-dark");}}}})}),"data-menu-id":M,"data-keyboard-nav":P?.isKeyboardNav?"":void 0,className:f,css:[Pe,ae,T],initial:me,animate:{opacity:1,x:0,y:0,scale:1},exit:xe,transition:oe,onPointerMove:X=>ze(X.currentTarget),onPointerDown:X=>ze(X.currentTarget),onKeyDown:be,onMouseMove:Ne,onMouseEnter:()=>{_(),D?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:Ie})}):null})})});yn.displayName="DropdownMenuContent";var ki=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Rd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&wi(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,M)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=M??20;m.current=window.setTimeout(()=>{h.current=false,u(S);},I);},[o,u]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let A=lr();useEffect(()=>{if(!A)return;let S=()=>{T(),u(false);};return A.registerSubMenu(S)},[A,u,T]);let y=useRef(`pfui-submenu-${++Ii}`),x=useRef(null),g=useRef([]),d=useRef(null),[p,C]=useState(null),[F,R]=useState(false);useEffect(()=>{l||(C(null),g.current=[],R(false));},[l]);let E=useContext(Tt),k=r??E,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:g,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),_=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:F,setIsKeyboardNav:R}),[F]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:fe.Children.map(s,S=>{if(!isValidElement(S))return S;let M=S.type;return M?.displayName==="DropdownMenuSubTrigger"||M?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Si.Provider,{value:true,children:jsx(Tt.Provider,{value:k,children:jsx(mo.Provider,{value:_,children:jsx(oo.Provider,{value:W,children:jsx(gn.Provider,{value:$,children:s})})})})})};ki.displayName="DropdownMenuSub";var Ai=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=pr(),A=uo(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),g=x?t:null,d=g?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:F,onClick:R,...E}=s,k=useMemo(()=>ys(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,_=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let M=S.currentTarget,I=D=>{A?.setIsKeyboardNav(true);let P=M.closest("[data-menu-id]");if(!P)return;P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let L=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==P)return false;let B=window.getComputedStyle(v);return B.display!=="none"&&B.visibility!=="hidden"});if(!L.length)return;let z=L.indexOf(M),w=z>=0?z:0,b=D==="next"?(w+1)%L.length:(w-1+L.length)%L.length;L[b]?.setAttribute("data-highlighted",""),L[b]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),A?.setIsKeyboardNav(true);let D=S.currentTarget;i(true),requestAnimationFrame(()=>{let P=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(P){P.setAttribute("data-keyboard-nav",""),D.removeAttribute("data-highlighted"),D.removeAttribute("data-hovered");let L=P.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');L&&(L.setAttribute("data-highlighted",""),L.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let D=M.closest("[data-menu-id]");D&&D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),M.setAttribute("data-highlighted",""),M.focus(),A&&A.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),F?.(S);},[c,i,p,F,u,A,T]),W=l==="hover"?{onMouseEnter:S=>{let M=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),M.setAttribute("data-hovered",""),M.focus({preventScroll:true});let I=M.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),A&&A.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let M=S.currentTarget;lo(),M.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),M.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&g){let S=d?.css,M=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,D={ref:k,tabIndex:I,className:[M,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:P=>{if(P.target.hasAttribute("data-highlighted")){let L=P.target.closest("[data-menu-id]");L&&!L.hasAttribute("data-keyboard-nav")&&(L.setAttribute("data-keyboard-nav",""),A&&A.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(P);},...W,...E};return cloneElement(g,D)}return jsx("div",{ref:k,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:_,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let M=S.currentTarget.closest("[data-menu-id]");M&&!M.hasAttribute("data-keyboard-nav")&&(M.setAttribute("data-keyboard-nav",""),A&&A.setIsKeyboardNav(true));}},...W,...E,children:t})});Ai.displayName="DropdownMenuSubTrigger";var Mi=fe.forwardRef((e,t)=>{let n=xs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=pr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(yn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});Mi.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Id=css({display:"inline"}),Pi=css({display:"inline",fontWeight:700}),kd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Ad=css({display:"flex",alignItems:"center",gap:4}),Md=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Di=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Fd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Pd=()=>{},Dd=e=>e,Nd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Hd=e=>{e.preventDefault(),e.stopPropagation();},Ld=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Bd=e=>{e.preventDefault(),e.stopPropagation();},Ni=fe.memo(({onCapture:e})=>{let t=useContext(gn),n=useContext(mo),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Ni.displayName="CtxCapture";var vs=fe.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),A=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Md,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Fd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(g=>Object.is(g,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:A},e.value)}return s?jsx(Ht,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Ht,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:A},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));vs.displayName="AutocompleteRow";var Hi=fe.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:A,disabled:y=false,error:x=false,showClear:g=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:F=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:k=true,blurOnSelect:$=false,freeSolo:_=false,customValueLabel:W=false,maxHeight:S,maxItems:M,noResultsText:I="No Items Found",highlightTypedValue:D,typedValueHighlightCss:P,showNoResults:L=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:b,loading:v,loadingText:B="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:K,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:j,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:de,textFieldHelperRowCss:ge,textFieldHelperTextCss:Pe,textFieldStartIconCss:Te,textFieldEndIconCss:Re,menuContentCss:Ie})=>{let Q=V().text.secondary,[ie,me]=useState(""),Y=typeof d=="boolean",[xe,ee]=useState(false),oe=Y?d:xe,ae=useRef(null),be=useRef(null),Ne=useRef(null),ze=useRef(null),X=useRef(false),re=useRef(null),Z=useRef(false),ce=useRef(0),pe=useMemo(()=>[be],[]),[Ue,Oe]=useState(N??[]),ke=K??Ue,st=useRef(ke);st.current=ke;let[He,nt]=useState(null),qe=useRef(He);qe.current=He;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[rn,Zn]=useState(false),Je=typeof b=="function",xt=Je?ot:e,ue=useRef(xt);ue.current=xt;let Ee=!!v||rn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let De=useCallback(q=>{Y||ee(q),at.current?.(q);},[Y]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let q=ie;return bt.current=window.setTimeout(async()=>{Zn(true);try{let ne=await b(q)||[];dt(Array.isArray(ne)?ne:[]);}catch{dt([]);}finally{Zn(false);}},Math.max(0,H)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,b,H]);let Qn=useMemo(()=>{let q=mr(ie);return q?xt.some(ne=>mr(ne.title??ne.value)===q):false},[xt,ie]),la=_&&!!W&&ie.trim().length>0&&!Qn,ic=q=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),Ce=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||Ce){let Ae=ne?W.prefix??"":"",he=Ce?W.suffix??"":"";return `${Ae}${q}${he}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Je)return xt;let q=mr(ie);if(!q)return xt;let ne=[],Ce=[];for(let Ae of xt){let he=mr(Ae.title??Ae.value);he.split(" ").some(Ze=>Ze.startsWith(q))?ne.push(Ae):he.includes(q)&&Ce.push(Ae);}return ne.length>0?ne:Ce},[xt,ie,Je]),ca=useMemo(()=>{if(la){let q=ie.trim();return [...$r,{value:q,title:ic(q),__pfui_free__:true}]}return $r},[$r,la,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of ca){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof M=="number"?Math.max(0,M):1/0,he=[];for(let pt of q){if(Ae<=0)break;let an=ne.get(pt).slice(0,Ae);an.length>0&&(he.push({label:pt==="__ungrouped__"?void 0:pt,items:an}),Ae-=an.length);}return he},[ca,M]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),Ho=kn.length>0,zr=!Ho&&!!L&&!Ee&&ie.trim().length>0,An=Ee||Ho||zr,Lo=An||Je;useEffect(()=>{!Je&&oe&&!An&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));},[Je,oe,An,De]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(_&&!O){if(Wr.current){Wr.current=false;return}let q=ie.trim();if(Or.current===q)return;Or.current=q,t?.({value:q,title:q});}},[ie,_,O,t]);let _r=useCallback(q=>{let ne=ue.current,Ce=new Map(ne.map(he=>[he.value,he])),Ae=q.map(he=>Ce.get(he)??{value:he,title:he});U?.(Ae);},[U]),Bo=useCallback(q=>{let ne=q.map(String);K||Oe(ne),_r(ne);},[K,_r]),ua=useCallback(q=>{let Ce=ke.includes(q)?ke.filter(Ae=>Ae!==q):[...ke,q];Bo(Ce);},[ke,Bo]),$o=useCallback(q=>{let ne=ue.current.find(Ce=>Ce.value===q)??{value:q,title:q};ne.disabled||(Wr.current=true,Or.current=(ne.title??ne.value).trim(),nt(ne),me(ne.title??ne.value),t?.(ne),Y||(E?(X.current=false,Z.current=true,ee(false),at.current?.(false),setTimeout(()=>{Z.current=false;},150)):X.current=true),!E&&Ne.current?.setActiveIndex&&Ne.current.setActiveIndex(null),$?(X.current=false,setTimeout(()=>{ze.current&&ae.current?(ze.current.tabIndex=0,ze.current.focus(),ze.current.blur(),ze.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,Y,E,$]),lc=useCallback(q=>{if(y)return;me(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):_&&nt(null)),!Y&&!ne&&F&&!oe&&De(true);},[O,Y,F,oe,De,y,_,t]),it=Nd,da=Pd,cc=Dd,pa=useMemo(()=>P?[Pi,P]:Pi,[P]),uc=useCallback(q=>{let ne=ie.trim();if(!ne||ne.length<1)return q;let Ce=ne.toLowerCase(),he=q.toLowerCase().indexOf(Ce);return he<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Id,children:[q.slice(0,he),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:pa,children:q.slice(he,he+ne.length)}),q.slice(he+ne.length)]})},[ie,pa]),zo=D?uc:cc,dc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Hd,Wo=Ld,pc=useCallback(q=>{Ne.current=q;},[]),ma=useCallback(q=>{let ne=Ne.current;if(!ne)return;let Ce=kn.length;if(Ce===0)return;let Ae=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),he=-1;if(Ae){let Ze=Ae.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),an=Ae.querySelector("[data-active]")||Ae.querySelector("[data-hovered]");an&&(he=Array.from(Ze).indexOf(an));}he<0&&typeof ne.activeIndex=="number"&&(he=ne.activeIndex);let pt=he<0?q===1?0:Ce-1:(he+q+Ce)%Ce;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(Vr=>Vr.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(Vr=>Vr.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[kn.length]),mc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!An&&!Je)return;q.preventDefault(),!oe&&!Y&&De(true),ma(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let ne=Ne.current&&typeof Ne.current.activeIndex=="number"?Ne.current.activeIndex:-1,Ce=ne>=0&&ne<kn.length?kn[ne]:null;if(oe&&Ce&&ne>=0){q.preventDefault(),q.stopPropagation(),O?(ua(Ce.value),E||requestAnimationFrame(()=>ae.current?.focus())):$o(Ce.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),oe&&!Y&&(Z.current=true,De(false),q.target.focus(),setTimeout(()=>{Z.current=false;},150))):q.key==="Tab"&&oe&&!Y&&De(false);},[An,Je,oe,Y,kn,O,E,ma,ua,$o,De,y]),fc=useCallback(()=>{y||Z.current||C&&Lo&&(ce.current=Date.now(),Y||De(true));},[Y,C,Lo,De,y]),gc=useCallback(()=>{if(X.current){X.current=false;return}k&&De(false),!_&&!O&&(He?me(He.title??He.value):ie.trim()&&me(""));},[k,_,O,He,ie,De]),fa=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{q.push(jsx(vs,{item:he,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:da,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),jsx(hs,{values:ke,onValuesChange:Bo,children:q},"multi-group")},[Vt,it,Ge,s,zo,ke,Bo,da,Wo,Oo,Q]),ga=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{let pt=He?.value===he.value;q.push(jsx(vs,{item:he,absIndex:ne,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:E,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),q},[Vt,it,He,Ge,s,zo,E,$o,Wo,Oo,Q]),bc=useMemo(()=>Ee?jsx(fn,{css:w,className:it("label-loading"),children:B},"loading"):zr?jsx(fn,{css:z,className:it("label-empty"),children:I},"empty"):Vt.length===0?null:O?fa():ga(),[Ee,zr,Vt.length,it,B,I,O,fa,ga]),sn=oe?false:y||!Je&&!Ho&&!L,ba=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(sn||y)&&(Y||(oe?(Z.current=true,De(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{Z.current=false;},150)):(De(true),queueMicrotask(()=>ae.current?.focus()))));},[oe,Ho,Je,De,sn,y,Y]),ha=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:oe?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:sn?"not-allowed":"pointer",userSelect:"none",opacity:sn?.5:1}),[oe,sn]),_o=useMemo(()=>se?jsx("span",{ref:re,role:"button",tabIndex:-1,css:[ha,j],"aria-disabled":sn||void 0,onMouseDown:Bd,onClick:ba,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ha,j,sn,ba,G]),hc=useMemo(()=>T&&_o?jsxs("span",{css:Ad,children:[T,_o]}):T??_o,[T,_o]),yc=useCallback(q=>{if(!(re.current&&re.current.contains(q.target)||Z.current||y||Date.now()-ce.current<300)){if(oe){!ie.trim()&&!Y&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));return}R&&Lo&&(!Y||R)&&De(true);}},[oe,ie,R,Lo,De,y,Y]);return jsx("div",{ref:be,className:it(""),css:[dc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Ni,{onCapture:pc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:kd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:lc,onKeyDown:mc,onFocus:fc,onBlur:gc,onSurfaceClick:yc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:hc,size:A,width:n,fullWidth:o,disabled:y,error:x,showClear:g,css:i,wrapperCss:J,inputCss:le,labelCss:de,helperRowCss:ge,helperTextCss:Pe,startIconCss:Te,endIconCss:Re}),jsx("span",{ref:ze,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),An&&jsx(yn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:pe,disableOutsidePressDismiss:Y,returnFocus:!$,children:bc})]})})});Hi.displayName="Autocomplete";var _d=["sm","md","lg"],Kd=(e,t)=>typeof e=="number"?e:_d.includes(e)?t.componentHeights[e]:t.componentHeights.md,Vd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},jd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Ud=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Li=fe.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Kd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,A=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Vd(u,o),g=jd(u,o),d=Ud(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":g,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),F=css({fontSize:A,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[p,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:d})})}));Li.displayName="Avatar";var Bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),m=ve(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let R=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Bi(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),A=typeof t=="number"&&t>=0,y=A&&T.length>t?T.slice(0,t):T,x=A&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Bi(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${g}`,backgroundColor:g,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),F=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[p,r,m()],children:[y.map((R,E)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:jsx("span",{css:F,children:R})},E);let k=R,$=k.props?.css,_=$==null?F:[F,$],W=cloneElement(k,{size:n,rounded:s,css:_,style:{...k.props?.style,width:"100%",height:"100%",objectFit:k.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:W},E)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var Oi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ep=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",tp=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",np=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),op=fe.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:A,className:y,badgeClassName:x,css:g,badgeCss:d,offsetX:p,offsetY:C})=>{let F=V(),R=s==="dot",E=f??(R?8:17),k=r??(R?0:10),{scale:$,onKey:_}=Zd(F,t),W=Qd($),S=F.text?.onColors||{},M=ep(F,S,_,n),I=tp(e,a,s),D=np(i,s,e,c),P=css({position:"relative",display:"inline-block"}),L=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Oi(p??L),w=Oi(C??L),b=l.vertical||"top",v=l.horizontal||"right",B={},H="0",O="0";b==="center"?(B.top="50%",O="-50%"):b==="top"?(B.top=w,O="-45%"):(B.bottom=w,O="45%"),v==="center"?(B.left="50%",H="-50%"):v==="right"?(B.right=z,H="45%"):(B.left=z,H="-45%");let K=D?1:.8,N=css({minWidth:R?E:E/2,height:E,background:W,color:M,fontSize:typeof k=="number"?`${k}px`:k,fontWeight:o,borderRadius:999,padding:R?0:`0 ${E/4}px`,boxShadow:"0 2px 8px rgba(0,0,0,0.04)",lineHeight:1,position:"absolute",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",...T?{boxShadow:`0 0 0 2px ${A??F.surface?.appBg}`}:{},opacity:D?1:0,transform:`translate(${H}, ${O}) scale(${D?K:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...B});return jsxs("div",{className:["plainframe-ui-badge-wrapper",y||""].join(" ").trim(),css:[P,g],children:[m,jsx("span",{"aria-hidden":!D,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Is=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...A})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[g,d]=useState(e),[p,C]=useState(e),F=useRef(null),R=useRef(null),E=useRef(null);useEffect(()=>(F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),F.current=setTimeout(()=>{d(false),F.current=null;},u)),()=>{F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let M=document.body,I=M.style.overflow,D=M.style.paddingRight,P=window.innerWidth-document.documentElement.clientWidth,L=parseFloat(getComputedStyle(M).paddingRight||"0");return M.style.overflow="hidden",P>0&&(M.style.paddingRight=`${L+P}px`),()=>{M.style.overflow=I,M.style.paddingRight=D;}},[e,T]),useEffect(()=>{if(!p||!t)return;let M=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,t]);let k=M=>{if(!p||!t||!E.current)return;let I=M.target;I&&!E.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!g)return null;let _=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:p?"auto":"none",visibility:g?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[_,a],onPointerDown:k,...A,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,i],role:"presentation"}),jsx("div",{ref:E,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function lp(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var cp=fe.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let m=V(),h=ve(),f=fe.useMemo(()=>fe.Children.toArray(e).flatMap(d=>{if(!fe.isValidElement(d))return [];let{type:p,props:C}=lp(d);if(!(p===hr||typeof p=="function"&&"displayName"in p&&p.displayName===hr.displayName))return [];let R=C;return [{href:R.href,disabled:R.disabled,node:R.children,className:R.className,css:R.css,onClick:R.onClick,startIcon:R.startIcon,endIcon:R.endIcon}]}),[e]),T=fe.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),A=fe.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=fe.useCallback((d,p,C)=>{let F=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:F,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=fe.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=fe.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,F=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",F?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,F,d.disabled),o,C?r:s,F?a:void 0,h(),d.css],k=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(fe.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[A,c],children:t}),F?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:E,children:k}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:R,css:E,children:k})]},p)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},As=e=>typeof e=="number"?`${e}px`:e,Vi=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Vi(n)&&(t=true));}),t};function mp(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function fp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var ji=fe.memo(fe.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:A,...y},x)=>{let g=V(),d=ve(),p=useMemo(()=>mp(g,t),[g,t]),C=useMemo(()=>fp(g,e),[g,e]),F=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Vi(u)&&fe.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,E=useMemo(()=>ks(n,R),[n,R]),k=useMemo(()=>ks(o,R),[o,R]),$=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),_=useMemo(()=>F?"center":l??"center",[F,l]),W=!!c&&_==="center",S=!!c&&_==="start",M=!!c&&_==="end",I=a||c,D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,g,I]),P=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),L=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(F&&!s?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:As(p.iconSize)}:{fontSize:As(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[F,s,p,n,o]),w=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:As(g.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[g,W]),b=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),B=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),K=useMemo(()=>()=>{if(F)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?E||n:null}),jsx("span",{css:H(!!S),children:$})]})},[F,n,S,B,H,E,c,$]),N=useMemo(()=>()=>{if(F)return null;let G=!!o;return !G&&!M?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!M),children:G?k||o:null}),jsx("span",{css:H(!!M),children:$})]})},[F,o,M,B,H,k,c,$]),U=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[D,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),P,L,z,A],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:w,children:[K(),jsx("span",{className:"plainframe-ui-button-label",css:b,children:F?c?$:ks(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));ji.displayName="Button";var Cr=e=>isValidElement(e),gp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>gp(e)===t,Gi=e=>Ds(e,"ButtonGroup"),Xi=e=>Ds(e,"DropdownMenu"),Fs=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,bp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,hp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ps=(e,t)=>{if(!Cr(e))return null;if(Gi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ps(t?n[0]:n[n.length-1],t):null}if(Xi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Fs);return o?Ps(o,t):null}if(Fs(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},qi=(e,t)=>{if(!e)return false;let n=Ps(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return hp(o)},Yi=fe.memo(fe.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...A},y){let x=V(),g=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:g,p=o==="vertical",C=bp(x.componentHeights.border,1),F=x.surface.border,R=n&&!!f,E=n&&!!T,k=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?On(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:On(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,S=0,M=false,I=[];for(let D of $){if(!Cr(D)){I.push(D);continue}let P=S===0,L=S===W-1,z=D.props??{},w=z.disabled??s,b=z.size??a,v=0,B=0,H=0,O=0;n&&(p?(v=P?R?0:d:0,B=P?E?0:d:0,O=L?R?0:d:0,H=L?E?0:d:0):(v=P?R?0:d:0,O=P?R?0:d:0,B=L?E?0:d:0,H=L?E?0:d:0));let K=qi(D,"left"),N=qi(D,"right"),se=n&&!P&&!(M&&K)&&!(M||K)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${F}`}):null,j=n&&!P&&M&&K?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(B),borderBottomRightRadius:On(H),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Xi(D)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=Gi(D)&&n?{__clipLeft:!P,__clipRight:!L}:{},Q=cloneElement(D,{...z,disabled:w,size:b,className:Ie,css:[Re,de],...we});I.push(Q),M=N,S+=1;continue}let ge=z.children,Pe=Children.map(ge,Re=>{if(!Cr(Re)||!Fs(Re))return Re;let Ie=Re.props,we=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Re,{...Ie,css:[Ie.css,de],className:we,disabled:w,size:b})}),Te=cloneElement(D,{...z,children:Pe});I.push(Te),M=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[k,h],...A,children:I})}));Yi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Rr(n?.[e]??e)}}},wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Rr(n?.[e]??e)}}},Ep=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Sp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},Wn=fe.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:A,role:y,tabIndex:x,...g},d){let p=V(),C=p.surface??{},[F,R]=useState(!!u),E=l!=null,k=E?!!l:F,$=useMemo(()=>Ep(o,p),[o,p]),_=useMemo(()=>Sp(o,p,$),[o,p,$]),W=_,S=useMemo(()=>Tp(r,p),[r,p]),M=useMemo(()=>wp(s,p),[s,p]),I=!!c||!!i,D=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:M,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Rr(h),height:Rr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:I?"pointer":void 0,...I?{"&:hover":{backgroundColor:_}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,M,o,p.componentHeights,C.border,h,f,I,_,W]),P=useCallback(()=>{if(!i)return;let b=!k;E||R(b),m?.(b);},[E,m,i,k]),L=useCallback(b=>{i&&P(),T?.(b);},[i,P,T]),z=useCallback(b=>{i&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),P()),A?.(b);},[i,P,A]),w=ve();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&k?"true":void 0,"aria-pressed":i?k:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[w(),D,n],onClick:L,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...g,children:t})}));Wn.displayName="Container";var kp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Hs(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return kp(o)}return e}}}function yo(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ls(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ap(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function xo(e,t,n,o){let r=Hs(t,e),s=Hs(n,e),a=Hs(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Ji(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Zi=fe.createContext("horizontal"),Bs=()=>fe.useContext(Zi),Qi=fe.memo(fe.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:A,...y},x)=>{let g=V(),d=ve(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ap(h,g),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Zi.Provider,{value:f,children:jsx(Wn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:A,tabIndex:A?0:void 0,...y,children:e})})}));Qi.displayName="Card";var Mp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Ls(o),...u?{width:"100%"}:{flex:1,minWidth:0},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Fp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Pp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Dp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Ji(m,l)??m.text?.primary,textAlign:Ls(o),...xo(m,r,s,a),display:"flex",alignItems:"center",gap:m.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[h,t],...u,children:e})}),Np=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Ji(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Ls(o),...xo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var tl=e=>isValidElement(e),$p=e=>tl(e)?e.type?.displayName||e.type?.name:void 0,el=e=>$p(e)==="Card",zp=e=>typeof e=="number"?`${e}px`:e,nl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?zp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(el).length,x=0,g=T.map((d,p)=>{if(!el(d)||!tl(d))return d;let C=d.props,F=x++,R=F===0,E=F===y-1,k=s??C.variant,$=t?u?{borderTopLeftRadius:R?C.radius:0,borderTopRightRadius:R?C.radius:0,borderBottomLeftRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:{borderTopLeftRadius:R?C.radius:0,borderBottomLeftRadius:R?C.radius:0,borderTopRightRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:void 0,_=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=k==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,M=[$,_,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:k??C.variant,css:[C.css,...M],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:g})};nl.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,rl=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&rl(n)&&(t=true));}),t},Kp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},sl=fe.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:A},y){let x=V(),g=ve(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Kp(x,d),[x,d]),C=!!l&&!h,F=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),E=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),k=useCallback(G=>{let se=x.palette;return (E==="neutral"?x.neutral[G]:se[E]?.[G])??se.primary?.[G]},[E,x.neutral,x.palette]),$=useMemo(()=>E==="neutral"?x.neutral[100]:k(50),[E,k,x.neutral]),_=useMemo(()=>E==="neutral"?x.text.secondary:k(800),[E,k,x.text.secondary]),W=useMemo(()=>E==="neutral"?x.neutral[100]:k(50),[E,k,x.neutral]),S=useMemo(()=>E==="neutral"?x.text.secondary:k(800),[E,k,x.text.secondary]),M=useMemo(()=>E==="neutral"?x.neutral[400]:k(300),[E,k,x.neutral]),I=useMemo(()=>E==="neutral"?x.surface.subtleBg:k(600),[E,k,x.surface.subtleBg]),D=useMemo(()=>(x.text.onColors??{})[E]??(E==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[E,x.text.onColors,x.neutral]),P="transparent",L=useMemo(()=>E==="neutral"?x.text.secondary:k(700)??x.text.primary,[E,k,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!rl(t)&&fe.Children.count(t)===1,[a,c,t]),w=useMemo(()=>o==="filled"?css({backgroundColor:I,color:D,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:S,border:"none",boxShadow:`inset 0 0 0 ${R} ${M}`}):o==="ghost"?css({backgroundColor:P,color:L,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:_,border:"none",boxShadow:"none"}),[I,D,L,W,S,M,$,_,R,o]),b=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(p.gap),padding:o==="ghost"?0:z||t==null?Le(p.soloPadding):`${Le(p.paddingY)} ${Le(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:F,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,minHeight:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,F,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:Le(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Le(p.iconSize):void 0,height:z?Le(p.iconSize):void 0,display:z?"block":void 0}}),[p.fontSize,p.iconSize,z]),B=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Le(p.iconSize),lineHeight:0,"& > svg":{width:Le(p.iconSize),height:Le(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Le(p.gap),marginLeft:z||t==null?0:Le(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Le(p.gap),marginRight:z||t==null?0:Le(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),K=useMemo(()=>css({marginRight:s?0:Le(p.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:h?"not-allowed":"pointer",color:"currentColor",opacity:h?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Le(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[b,w,C?g({color:r??"primary"}):null,A],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":E,"data-size":i,"data-icon-only":z||void 0,children:[a&&jsx("span",{css:[B,H],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[B,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[K,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));sl.displayName="Chip";var qp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gp=fe.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let A=ve(),y=r.neutral,x=r.text,g=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),F=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),E=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),k=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",_=z=>css({width:E,height:E,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:k,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?A({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),M=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let w=Math.max(0,Math.min(o-1,z));C(w),d.current[w]?.focus();},[o]),D=useCallback((z,w)=>{let b=M(w).slice(0,1),v=[...F];v[z]=b,n(v.join("")),b&&z<o-1&&I(z+1);},[F,o,n,I]),P=useCallback((z,w)=>{if(w.key==="Backspace")if(!F[z]&&z>0){let b=[...F];b[z-1]="",n(b.join("")),I(z-1),w.preventDefault();return}else {let b=[...F];b[z]="",n(b.join(""));return}if(w.key==="ArrowLeft"&&z>0){w.preventDefault(),I(z-1);return}if(w.key==="ArrowRight"&&z<o-1){w.preventDefault(),I(z+1);return}if(w.key==="Home"){w.preventDefault(),I(0);return}if(w.key==="End"){w.preventDefault(),I(o-1);return}},[F,o,n,I]),L=useCallback(z=>{let w=M(z.clipboardData.getData("text")).slice(0,o);w&&(n(w),requestAnimationFrame(()=>{let b=Math.min(w.length,o-1);I(b);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,w)=>jsxs(fe.Fragment,{children:[jsx("input",{ref:b=>{d.current[w]=b;},type:"text",inputMode:"text",maxLength:1,value:F[w]||"",placeholder:F[w]?"":R[w]||"",disabled:l,onChange:b=>D(w,b.target.value),onKeyDown:b=>P(w,b),onFocus:()=>C(w),onPaste:w===0?L:void 0,className:"plainframe-ui-code-box",css:_(w===p),"aria-label":`Code character ${w+1}`,tabIndex:w===p?0:-1}),f&&w<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},w))})}),Xp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:A,labelCss:y,helperRowCss:x,helperTextCss:g,css:d})=>{let p=V(),C=useId(),F=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",E=F[R],k=p.neutral,$=p.text,_=t!=null,[W,S]=useState(n),M=_?t:W,I=H=>{_||S(H),o?.(H);},D=Math.max(2,Math.min(h,10)),P=p.spacing.sm,L=qp(l??P)??"0px",z=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(A)?A:A?[A]:[]),w=css({fontSize:E.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??$.primary:i?k[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),b=css({display:"flex",alignItems:"center",justifyContent:"center",gap:L,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:E.helperFont,color:a?p.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),B=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??$.primary:i?k[500]:$.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:w,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:b,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Gp,{value:M||"",onChange:I,len:D,theme:p,sizeKey:R,s:{codeFontSize:E.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:L})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:B,children:c})})]})};var ul=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},zs=e=>{if(!e||typeof e!="object")return false;let t=ul(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some(zs):zs(o)},Jp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=fe.useRef(null),[c,i]=fe.useState(false),l=fe.useCallback(v=>{i(v),o?.(v);},[o]),u=fe.useCallback(()=>l(false),[l]),m=fe.useRef({x:0,y:0}),h=fe.useRef(null),f=fe.useRef(null),T=fe.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let B=Math.round(m.current.x),H=Math.round(m.current.y);v.style.transform=`translate3d(${B}px, ${H}px, 0)`;},[]),A=fe.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);fe.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=fe.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),B=Math.round(m.current.y);return {x:v,y:B,left:v,top:B,right:v,bottom:B,width:0,height:0,toJSON:()=>({x:v,y:B})}}}),[]),x=fe.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=fe.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=fe.useRef(null),p=fe.useRef(null),C=fe.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),F=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=fe.useCallback(()=>{F(),p.current=window.setTimeout(()=>l(false),0);},[F,l]),E=fe.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),k=fe.useCallback((v,B)=>{m.current={x:v,y:B},A(),l(true);},[A,l]),$=typeof t=="function"?t({close:u}):t,_=zs($),W=v=>{if(!fe.isValidElement(v))return v;let B=ul(v),H=v,O=H.props.children,K=O==null?O:Array.isArray(O)?O.map(N=>fe.isValidElement(N)?W(N):N):fe.isValidElement(O)?W(O):O;if(B==="DropdownMenu"){let N=H.props.onOpenChange;return fe.cloneElement(H,{...H.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:K})}if(B==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return fe.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{F(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:K})}return K===O?H:fe.cloneElement(H,{...H.props,children:K})},S=_?W($):$,M=fe.useCallback(v=>{v.preventDefault(),k(v.clientX,v.clientY);},[k]),I=fe.useCallback(v=>{n==="contextmenu"&&M(v);},[n,M]),D=fe.useCallback(v=>{n==="dblclick"&&M(v);},[n,M]),P=fe.useCallback(v=>{n==="click"&&M(v);},[n,M]),L=fe.useCallback(v=>{if(n!=="hover")return;C(),F();let B=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=B.x+(r==="cursor"?s:0),O=B.y+(r==="cursor"?s:0);k(H,O);},0);},[n,r,s,E,k,C,F]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!_&&(m.current={x:v.clientX+s,y:v.clientY+s},A());},[n,c,r,_,s,A]),w=fe.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);fe.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let B=a.current?.matches(":hover"),H=g()?.matches?.(":hover");B||H?F():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,g,F,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let B=a.current?.matches(":hover"),H=g()?.matches?.(":hover");if(B||H?F():R(),r==="center"&&a.current){let O=E();m.current={x:O.x,y:O.y},A();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,E,A,l,F,R,g]),fe.useEffect(()=>()=>{C(),F();},[C,F]);let b=({children:v})=>c?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(m.current.x)}px, ${Math.round(m.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&F(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:D,onClick:P,onMouseEnter:L,onMouseMove:z,onMouseLeave:w,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,_?S:jsx(b,{children:S})]})};var Kn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tm=fe.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:A,className:y,...x},g){let d=V(),{t:p,strokeColor:C,labelTextColor:F,chipSubtleBg:R,chipOutlinedBg:E,outerM:k,padX:$,verticalStrokeMargin:_}=useMemo(()=>{let D=typeof s=="number"?`${s}px`:s,P=d.surface.border,L=d.text.secondary,z=d.surface.subtleBg,w=d.surface.panelBg,b=Kn(h,"10px"),v=o==="horizontal"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0",B=o==="vertical"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0";return {t:D,strokeColor:P,labelTextColor:L,chipSubtleBg:z,chipOutlinedBg:w,outerM:b,padX:v,verticalStrokeMargin:B}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:k,marginRight:k}:{flexDirection:"row",width:a?Kn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:k,marginBottom:k},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,k,a,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:_,marginBottom:_}:{height:p,flex:1}]),[C,m,d.radius.full,d.radius.xs,o,p,_]),M=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:F,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:E,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,F,u,R,E,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,A]}),[S,A]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="right"&&I,!t&&I]})}));var hl=fe.createContext(null),yl=()=>{let e=useContext(hl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},xl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(hl.Provider,{value:u,children:e})},rm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=yl(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:l,...r,children:t})});rm.displayName="DrawerTrigger";var To=0,vl="",Cl="",sm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function am(){if(!(typeof document>"u")){if(To===0){let e=document.body;vl=e.style.overflow||"",Cl=e.style.paddingRight||"";let t=sm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function im(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=vl,e.style.paddingRight=Cl;}}var lm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Rl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:A,css:y,...x},g){let d=V(),{open:p,setOpen:C,lockScroll:F,closeOnEscape:R}=yl();useEffect(()=>{if(!(!F||!p))return am(),()=>im()},[p,F]);let E=useMemo(()=>lm(a,0),[a]),k=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),_=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${E*2}px)`:"100%"),[n,r,s,E]),W=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${E*2}px)`:"100%"),[o,r,s,E]),S=useMemo(()=>{let j=String(d.radius.lg);switch(r){case "left":return `0 ${j} ${j} 0`;case "right":return `${j} 0 0 ${j}`;case "top":return `0 0 ${j} ${j}`;default:return `${j} ${j} 0 0`}},[r,d.radius.lg]),M=useMemo(()=>c??(s==="inset"?d.radius.lg:S),[c,s,d.radius.lg,S]),I=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:E,bottom:r==="top"?void 0:E,left:r==="right"?void 0:E,right:r==="left"?void 0:E}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,E]),D=useRef(null),P=useCallback(()=>{let j=D.current;if(!j)return 1;let J=j.getBoundingClientRect();return k==="x"?J.width:J.height},[k]),L=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(m??280)/1e3,ease:[.22,1,.36,1]}),[m]),w=useMemo(()=>$*1.1,[$]),b=useMemo(()=>k==="x"?{x:`${w*100}%`,y:0}:{y:`${w*100}%`,x:0},[k,w]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:_,height:W,backgroundColor:d.surface.panelBg,borderRadius:M,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:k==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,_,W,d.surface,M,p,k]),B=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,d.surface]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>k==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[k,$,T]),K=useMemo(()=>k==="x"?{left:0,right:0}:{top:0,bottom:0},[k]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((j,J)=>{let le=k==="x"?J.offset.x:J.offset.y,de=k==="x"?J.velocity.x:J.velocity.y,ge=$*le>0,Pe=Math.abs(le)>=P()*N,Te=$*de>f;ge&&(Pe||Te)&&C(false);},[k,$,P,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let j=setTimeout(()=>{let de=D.current;if(!de)return;let ge=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');ge.length>0?ge[0].focus():de.focus();},100),J=de=>{let ge=D.current;if(!ge||!de.target)return;let Pe=de.target;if(!ge.contains(Pe)){de.preventDefault();let Te=ge.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Te.length>0?Te[0].focus():ge.focus();}},le=de=>{de.key==="Escape"&&R&&(de.stopPropagation(),C(false));};return document.addEventListener("focusin",J,true),window.addEventListener("keydown",le),()=>{clearTimeout(j),document.removeEventListener("focusin",J,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,C,R]);let{...se}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:B,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:j=>{D.current=j,typeof g=="function"?g(j):g&&(g.current=j);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",A||""].join(" ").trim(),css:[v,y],drag:k,dragConstraints:K,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...b,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...b,opacity:.98},transition:m?z:L,...se,children:t},"panel")]}):null})});Rl.displayName="DrawerContent";var cm=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),A=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(xl,{open:A,onOpenChange:y,children:jsx(Rl,{ref:l,...i,children:c})})});cm.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),A=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(A)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Tl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wl=fe.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Tl(c),width:c?"100%":void 0,maxHeight:Tl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});wl.displayName="Flex";var Vs=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],A=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(A)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var El={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},wm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Em={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Vn=fe.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:A,style:y,as:x})=>{let g=V(),d=El[e]??El.body,p=x??Em[e]??"span",C=M=>M==null?d.size:typeof M=="number"?M:g?.typography?.sizes?.[M]??M,F=C(o)??C(d.size),R=r??d.weight,E=s??d.lh,k=a??d.ls,$=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",_=f??g.surface.border,W=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:F,fontWeight:R,lineHeight:E,letterSpacing:k,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:_,textDecorationThickness:wm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,A||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Gs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Il=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:A,placeholder:y,blurDataURL:x,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:F,onLoad:R,onError:E,...k},$){let[_,W]=useState(false),[S,M]=useState(false),[I,D]=useState(false),P=V(),L=km(s,P)??"0px",z=i?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:i?P.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${L})`}),b=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${L})`,maxWidth:o?Gs(o):"100%",maxHeight:r?Gs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:_&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:F?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?g:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),B=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:_&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",p||""].join(" ").trim(),css:[w,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:b,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:F,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:B,src:S&&d?d:t,alt:n,srcSet:T,sizes:A,loading:m,decoding:h,fetchPriority:f,onLoad:H=>{D(true),R?.(H);},onError:H=>{M(true),E?.(H);},...k})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Il.displayName="Image";var kl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pm=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Dm=e=>e*Math.PI/180,Nm=(e,t,n)=>{let o=Math.abs(Dm(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Hm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Lm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,Al=[1.02,1.03,1.02],Ml=[1.06,1.08,1.06],Bm={sm:150,md:200,lg:260,xl:340},$m=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function zm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return $m(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Om=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:A="md",label:y,labelAlign:x="center",css:g,className:d,...p}){let C=V(),F=Pm(r)??4/5,R=typeof o=="string"?o:void 0,E=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Bm[s],k=Math.max(1,E/F),_=Children.toArray(t).filter(isValidElement).slice(0,i),W=_.length,S=Hm(n,W),M=_.map((j,J)=>Lm(n,W,J)),I=j=>k*.6*M[j],D=j=>I(j)*F,P=0,L=0;for(let j=0;j<W;j++){let J=D(j),le=I(j),de=Math.max(Math.abs(S.base.ang[j]??0),Math.abs(S.exp.ang[j]??0)),ge=Math.max(Math.abs(S.base.dx[j]??0),Math.abs(S.exp.dx[j]??0)),Pe=Math.max(Math.abs(S.base.dy[j]??0),Math.abs(S.exp.dy[j]??0)),Te=a==="expand"?Ml[j]??1.08:a==="reveal"?Al[j]??1.03:1,Re=Nm(J,le,de),Ie=Re.w*Te,we=Re.h*Te,Q=ge/100*J*Te,ie=Pe/100*le*Te;P=Math.max(P,Ie/2+Q),L=Math.max(L,we/2+ie);}let z=Math.max(1,2*P),w=Math.max(1,2*L),b=Math.min(1,E/z,k/w),v=c===void 0?"pointer":"controlled",B=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:kl(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:kl(k)}),K=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${w}px`,transform:`translate(-50%, -50%) scale(${b})`,transformOrigin:"center center"}),N=zm(A,C)??"0px",U=j=>{let J=n==="fan"?`rotate(${S.base.ang[j]}deg) translate(${S.base.dx[j]}%, ${S.base.dy[j]}%)`:n==="slide"?`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[j]}%)`:`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[j]}deg) translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%)`:n==="slide"?`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[j]}%)`:`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`,de=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,ge=a==="expand"?`${le} scale(${Ml[j]??1.06})`:a==="reveal"?`${J} scale(${Al[j]??1.03})`:`${J} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${de}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&j===1?10:j+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${ge}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${ge}`}})},G=j=>css({width:`${D(j)}px`,aspectRatio:`${F}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":B,css:[H,g],tabIndex:-1,...p,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:K,children:_.map((j,J)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(J),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(J),children:j})},J))})}),y&&jsx(Vn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Pl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Km(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function Vm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var jm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},m){let h=V(),f=ve(),T=Pl[o]??Pl.sm,A=Km(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:A,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?g:n==="ghost"?d:p,R=s&&c>0&&Vm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var Xm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Xs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:c,distance:i})=>{let u=Xm(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,g=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:g,className:d,onTransitionEnd:T(p)})}let A=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:A,onTransitionEnd:T(),children:e})};var Js=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hl=fe.createContext(null),Ll=()=>{let e=useContext(Hl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},tf=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]);useEffect(()=>{if(!i||!s)return;let m=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",m,true),()=>window.removeEventListener("keydown",m,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Hl.Provider,{value:u,children:e})},Bl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Ll(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r,children:t})});Bl.displayName="ModalTrigger";var $l=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:A,...y},x)=>{let g=V(),{open:d,setOpen:p,lockScroll:C}=Ll(),F=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!d)return;R.current=document.activeElement;let I=setTimeout(()=>{let P=F.current;if(!P)return;let L=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');L.length>0?L[0].focus():P.focus();},100),D=P=>{let L=F.current;if(!L||!P.target)return;let z=P.target;if(!L.contains(z)){P.preventDefault();let w=L.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');w.length>0?w[0].focus():L.focus();}};return document.addEventListener("focusin",D,true),()=>{clearTimeout(I),document.removeEventListener("focusin",D,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let E=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),k=typeof g.spacing.sm=="number"?`calc(100% - ${g.spacing.sm*2}px)`:`calc(100% - (${E} + ${E}))`,$=css({width:"100%",height:Js(o),maxWidth:t==="inset"?`min(${Js(n)||"100%"}, ${k})`:Js(n),maxHeight:t==="inset"?k:"100%",margin:t==="inset"?`${E} auto`:void 0}),_=jsx(Wn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",A||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[$,f],ref:I=>{F.current=I,typeof x=="function"?x(I):x&&(x.current=I);},...y,children:e}),W=u==="none"?_:u==="slide"?jsx(Xs,{on:d,direction:m,duration:h,children:_}):u==="grow"?jsx(Vs,{initialScale:.75,on:d,duration:h,children:_}):jsx(Ks,{on:d,duration:h,children:_});if(!a)return jsx(Fragment,{children:W});let S=css({position:"fixed",inset:0,width:"100vw",height:"100vh",margin:0,maxWidth:"100vw",maxHeight:"100vh",display:"flex",alignItems:t==="full"?"flex-start":"center",justifyContent:t==="full"?"flex-start":"center"}),M=css({width:"100%",height:"100%",display:"flex",alignItems:t==="full"?"flex-start":"center",justifyContent:t==="full"?"flex-start":"center"});return jsx(Is,{on:d,blur:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[S,T].filter(Boolean),contentCss:M,lockScroll:C,children:W})});$l.displayName="ModalContent";var uf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:m,css:h})=>{let f=V(),T=ve(),A=t!==void 0,[y,x]=useState(n),g=Math.max(1,e),d=Ir(A?t:y,1,g),p=useCallback(b=>{let v=Ir(b,1,g);A||x(v),o?.(v);},[A,g,o]),C=useMemo(()=>df({count:g,page:d,siblingCount:r,boundaryCount:s}),[g,d,r,s]),F=f.palette?.primary?.[600],R=f.surface?.border,E=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,k=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",_=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:$,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),W=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:k,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),M=(b=false)=>css([W,T({color:b?"primary":"neutral"}),l==="outlined"?b?{background:F,color:f.text.onColors.primary,borderColor:F}:{background:"transparent",borderColor:R,":hover":{background:E}}:l==="ghost"?b?{background:F,color:f.text.onColors.primary}:{":hover":{background:E}}:b?{background:F,color:f.text.onColors.primary,borderColor:F}:{":hover":{background:E}}]),I=useCallback(()=>p(1),[p]),D=useCallback(()=>p(g),[p,g]),P=useCallback(()=>{d===1?i&&p(g):p(d-1);},[d,i,g,p]),L=useCallback(()=>{d===g?i&&p(1):p(d+1);},[d,i,g,p]),z=a||d===1&&!i,w=a||d===g&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",m||""].join(" ").trim(),css:_,onKeyDown:b=>{a||(b.key==="ArrowLeft"&&(b.preventDefault(),P()),b.key==="ArrowRight"&&(b.preventDefault(),L()),b.key==="Home"&&(b.preventDefault(),I()),b.key==="End"&&(b.preventDefault(),D()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((b,v)=>typeof b=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":b===d?`Page ${b}, current page`:`Go to page ${b}`,"aria-current":b===d?"page":void 0,css:M(b===d),onClick:()=>p(b),children:b},b):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:L,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Ir(e,t,n){return Math.max(t,Math.min(n,e))}function df({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Sr(1,e);let s=Sr(1,Math.min(o,e)),a=Sr(Math.max(e-o+1,o+1),e),c=Ir(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Ir(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=m=>{let h=l[l.length-1];h!==m&&(h==="ellipsis"&&m==="ellipsis"||l.push(m));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Sr(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var gf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,bf=fe.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:gf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var _l=createContext(null),vf=()=>{let e=useContext(_l);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Cf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Rf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),A=h?e:f,y=useRef([]),[x,g]=useState(0),d=()=>g(M=>M+1),p=useCallback(M=>{h||T(M),n?.(M);},[h,n]),C=useCallback(M=>(y.current.push(M),d(),y.current.length-1),[]),F=useCallback((M,I)=>{let D=y.current[M];D&&(y.current[M]={...D,...I},d());},[]),R=()=>y.current.map((M,I)=>({it:M,i:I})).filter(({it:M})=>M.ref&&!M.disabled).map(({i:M})=>M),E=useCallback((M,I)=>{let D=R();if(!D.length)return;let P=Math.max(0,D.indexOf(M)),L=D[(P+I+D.length)%D.length],z=y.current[L]?.ref;if(z){z.focus();let w=y.current[L]?.value;w!==void 0&&p(w);}},[p]),k=useCallback(M=>{let I=R();if(!I.length)return;let D=M==="first"?I[0]:I[I.length-1],P=y.current[D]?.ref;if(P){P.focus();let L=y.current[D]?.value;L!==void 0&&p(L);}},[p]),$=useMemo(()=>{let M=y.current.filter(D=>D.ref&&!D.disabled);return M.length?M.some(D=>D.value===A)?A:M[0]?.value:void 0},[A,x]),_=useMemo(()=>({selected:A,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:F,moveFocusBy:E,moveToEdge:k,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[A,p,o,r,s,a,C,F,E,k,$,m,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(_l.Provider,{value:_,children:i})})})},Tf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:A,anchorOrigin:y}=vf(),x=c||t,g=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],F=C(600),R=C(100),E=f.neutral[300],k=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],_="transparent",W=k,S=$;T==="soft"?(_=R,W=null,S=F):T==="outlined"?(_=C(50),W=k,S=F):(_=f.neutral[200],W="transparent",S=$),g&&(T==="outlined"?(_=R,W=k,S=F):T==="filled"?(_=F,W=null,S=$):(_=R,W=null,S=F));let M=T==="filled"?E:f.palette.primary[100],I=useRef(null),D=useRef(-1);useEffect(()=>{D.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(D.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let P=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||g?{}:{background:M,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${k}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),L=css({width:p,height:p,minWidth:p,minHeight:p,borderRadius:f.radius.full,background:_,boxShadow:W?`inset 0 0 0 ${f.componentHeights.border} ${W}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),z=css({width:g?p*.45:0,height:g?p*.45:0,borderRadius:f.radius.full,background:g?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),w=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),b=(()=>{let O=y.horizontal,K=y.vertical;return K==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:K==="top"?1:3}})(),B=!x&&A===e?0:-1,H=ve();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":x||void 0,disabled:x,tabIndex:B,onClick:()=>{x||a(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(D.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(D.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[P,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[L,css({gridColumn:b.col,gridRow:b.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:w,children:o})]})};var kf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],A=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:A,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var qn=e=>null;qn.displayName="SelectItem";var Mo=(...e)=>e.filter(Boolean).flat(),Ff=e=>{if(e.type===qn)return true;let t=e.props;return t?.type===qn||t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__===qn},Pf=e=>{if(e.type===qn)return e.props;let t=e.props||{},{type:n,__EMOTION_TYPE_PLEASE_DO_NOT_USE__:o,...r}=t;return r};function ea(e,t){if(e==null||typeof e=="boolean")return;if(Array.isArray(e)){for(let o of e)ea(o,t);return}if(!fe.isValidElement(e))return;let n=e;if(Ff(n)){t.push(n);return}if(n.type===fe.Fragment){ea(n.props.children,t);return}}var Vl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:A=280,wrapperCss:y,labelCss:x,triggerCss:g,menuCss:d,optionCss:p,children:C,className:F,menuSize:R="md",triggerRender:E})=>{let k=V(),$=ve(),_=fe.useId(),W=`${_}-label`,S=`${_}-menu`,M={sm:{minHeight:k.componentHeights.sm,radius:k.radius.sm},md:{minHeight:k.componentHeights.md,radius:k.radius.md},lg:{minHeight:k.componentHeights.lg,radius:k.radius.md}},I=M[l]||M.md,[D,P]=fe.useState(false),L=Q=>P(!!Q),z=typeof e<"u",w=c||Array.isArray(e)||Array.isArray(t),[b,v]=fe.useState(()=>typeof t<"u"?t:w?[]:void 0),B=z?e:b,H=Q=>{z||v(Q),n?.(Q);},O=[];ea(C,O);let K=O.map((Q,ie)=>{let me=Pf(Q),Y=typeof me.children=="string"||typeof me.children=="number"?String(me.children):void 0,xe=typeof me.value=="string"||typeof me.value=="number"?String(me.value):void 0,ee=me.label??Y??xe;return {key:Q.key??ie,value:me.value,startIcon:me.startIcon,endIcon:me.endIcon,node:me.children,triggerLabel:ee,itemCss:me.css,itemClassName:me.className}}),N=Q=>w?(Array.isArray(B)?B:[]).some(me=>Object.is(me,Q)):Object.is(B,Q),U=fe.useMemo(()=>{if(w){let ie=Array.isArray(B)?B:[];return K.filter(Y=>ie.some(xe=>Object.is(xe,Y.value))).map(Y=>Y.triggerLabel??Y.node)}let Q=K.find(ie=>Object.is(ie.value,B));if(Q)return Q.triggerLabel??Q.node},[B,w,K]),G=Q=>{i||(Object.is(Q,B)||H(Q),L(false));},se=Q=>{if(i)return;let ie=Array.isArray(B)?B:[],Y=ie.some(xe=>Object.is(xe,Q))?ie.filter(xe=>!Object.is(xe,Q)):[...ie,Q];H(Y);},j={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},J={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:k.typography.sizes.sm,padding:`0 ${typeof k.spacing.sm=="number"?`${k.spacing.sm}px`:k.spacing.sm} 0 ${typeof k.spacing.md=="number"?`${k.spacing.md}px`:k.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:k.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:k.surface.subtleBg}:u==="outlined"?{background:k.surface.panelBg,border:`1px solid ${k.surface.border}`}:{background:"transparent"},de={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},ge={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Pe={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Te=jsx(ChevronsUpDown,{size:16,css:css({color:k.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Re=()=>{if(E)return E(U);if(Array.isArray(U)){let ie=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),me=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:me,children:me})]})}let Q=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:typeof Q=="string"?Q:void 0,children:Q})]})},Ie={left:"start",center:"center",right:"end"},we=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),L(true));};return jsxs("div",{css:Mo(j,y),className:["plainframe-ui-select-wrapper",F||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Mo({marginBottom:6,fontSize:k.typography.sizes.sm,fontWeight:500,color:k.text.secondary},x),children:o}),jsxs(Ln,{size:R,open:D,onOpenChange:L,children:[jsx(Bn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":D||void 0,"aria-controls":S,"aria-labelledby":o?W:void 0,onKeyDown:we,onClick:()=>L(!D),className:"plainframe-ui-select-trigger",css:Mo(css(J),css(le),g,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(de),children:Re()}),a??Te]})}),jsx(yn,{id:S,gap:"xs",align:Ie[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Mo({maxHeight:typeof A=="number"?`${A}px`:A,overflowY:"auto"},d),children:K.map((Q,ie)=>{let me=N(Q.value);return jsx(Ht,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:me,disabled:i,closeOnSelect:!w,onSelect:()=>w?se(Q.value):G(Q.value),css:Mo(p,Q.itemCss),className:["plainframe-ui-select-option",Q.itemClassName||""].join(" ").trim(),children:Q.node},Q.key??ie)})})]})]})};Vl.displayName="Select";var ta=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Nf=keyframes`
|
|
13
|
+
`,Gc=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),Xc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Yc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Gc(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&Xc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=fe.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),T=typeof t=="number",A=Math.max(o-n,1),y=T?Xa(t,n,o):void 0,x=T?(y-n)/A*100:void 0,g=Yc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Zc,{size:s,active:g,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Jc,{thickness:a,active:g,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Jc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),A=css([{position:"relative",width:"100%",height:rs(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,Ga):Ga,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...g,left:"-35%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...g,left:"-200%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:A,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Zc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),m=40,h=(m-t)/2,f=2*Math.PI*h,A=`${(o?Xa((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:rs(e,`${u.componentHeights.md}`),height:rs(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:A,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:g})})})};var Za=createContext(null),Qa=()=>{let e=useContext(Za);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},lu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),cu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),uu=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),ei=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:l,children:u,...m},h){let f=V(),T=useId(),A=useId(),y=useMemo(()=>{let M={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?M[c]:M.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},g=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??g:v==="warning"?x.warning??g:v==="success"?x.success??g:v==="info"?x.info??x.primary??g:g)(t),D=I?.[50]??g[50],P=I?.[300]??g[300],L=I?.[600]??I?.[500]??g[600],z=I?.[700]??L,w=I?.[800]??f.text?.primary??"#000",b=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:L,fg:b,border:void 0,iconColor:b}:n==="outlined"?{bg:D,fg:w,border:`1px solid ${P}`,iconColor:w}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:D,fg:w,border:void 0,iconColor:z}},[t,n,g,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),F=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),E=useMemo(()=>[cu,{color:d.iconColor}],[d.iconColor]),k=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[uu,{color:d.fg}],[d.fg]),_=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:A}),[d.fg,d.iconColor,y,T,A]),W=fe.Children.toArray(u).some(M=>fe.isValidElement(M)&&M.type===is),S=fe.Children.toArray(u).some(M=>fe.isValidElement(M)&&M.type===ls);return jsx(Za.Provider,{value:_,children:jsxs("div",{ref:h,role:p,"aria-live":p==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":W?T:void 0,"aria-describedby":S?A:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[F,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:E,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:lu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:k,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});ei.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Qa(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});is.displayName="AlertTitle";var ls=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Qa(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});ls.displayName="AlertDescription";var cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yt=e=>e==null?[]:Array.isArray(e)?e:[e],Jt=(...e)=>css(e.filter(Boolean));function ni(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var Qo=fe.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:A,togglePasswordVisible:y=false,showClear:x,type:g="text",step:d,focusRingMode:p="always",className:C,wrapperCss:F,inputCss:R,labelCss:E,helperRowCss:k,helperTextCss:$,startIconCss:_,endIconCss:W,css:S,onBlur:M,onFocus:I,onKeyDown:D,autoFocus:P,name:L,id:z,tabIndex:w,autoComplete:b,readOnly:v,required:B,maxLength:H,onSurfaceClick:O},K){let N=V(),U=Yo(),G=useId(),se=useMemo(()=>{let ue={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Ee=["sm","md","lg"].includes(m)?m:"md";return ue[Ee]},[m,N]),j=N.neutral,J=N.text,le=g==="number",de=g==="password",ge=n!==void 0,[Pe,Te]=useState(o),Re=ge?n:Pe,Ie=useCallback(ue=>{ge||Te(ue),r?.(ue);},[ge,r]),we=/^-?\d*(?:[.,]\d*)?$/,Q=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(Re??"")),ie=le?Q?"decimal":"numeric":void 0,me=le?Q?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ue=>{(ue===""||we.test(ue))&&Ie(ue);},[Ie]),xe=i?j[200]:a&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:a&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",ee=N.componentHeights.border,oe=h==="outlined"?`${ee} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Jt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?cs(u):void 0,flex:"0 0 auto",fontWeight:500}),be=useMemo(()=>Jt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?j[500]:J.primary,marginBottom:4,display:"inline-block"},...Yt(E)),[se.labelFont,a,i,j,J,N.palette.danger,E]),Ne=useMemo(()=>Jt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(se.paddingY)} ${cs(se.paddingX)}`,background:xe,border:oe,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Yt(F),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,xe,oe,f,i,F,S]),ze=useMemo(()=>Jt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?j[500]:a?N.palette.danger?.[800]??J.primary:J.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?N.palette.danger?.[700]??J.secondary:J.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??J.primary:J.primary} !important`,boxShadow:`0 0 0 1000px ${xe} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??J.primary:J.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Yt(R)),[se.fontSize,i,j,J,a,N.palette.danger,le,xe,R]),X$1=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Yt(_)),[a,N.palette.danger,J.secondary,_]),re=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Yt(W)),[a,N.palette.danger,J.secondary,i,W]),Z=useMemo(()=>Jt({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??J.secondary:J.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Yt(k)),[se.helperFont,a,N.palette.danger,J.secondary,k]),ce=useMemo(()=>Jt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Yt($)),[$]),pe=useRef(null),Ue=useCallback(ue=>{pe.current=ue,K&&(typeof K=="function"?K(ue):K.current=ue);},[K]),Oe=useCallback(ue=>{let Ee=ue.target.value;if(le){Y(Ee);return}H&&Ee.length>H||Ie(Ee);},[le,H,Ie,Y]),[ke,st]=useState(false),He=useCallback(()=>{i||st(ue=>!ue);},[i]),nt=useCallback(()=>{i||(Ie(""),pe.current?.focus());},[i,Ie]),qe=useMemo(()=>{let ue=se.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[se.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:X$1,children:ni(T,qe)}):null,[T,X$1,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ue=[];if(de&&y){let bt=ke?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ue.push(jsx("button",{type:"button",css:re,onMouseDown:Qn=>Qn.preventDefault(),onClick:Qn=>{Qn.stopPropagation(),He();},tabIndex:-1,"aria-label":ke?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&Re&&Re.length>0&&!i&&ue.push(jsx("button",{type:"button",css:re,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=A?jsx("span",{css:re,children:ni(A,qe)},"user-end"):null,at=ue.length>0,De=!!Ee;return !at&&!De?null:!at&&De?Ee:at&&!De?ue.length===1?ue[0]:jsx("span",{css:ot,children:ue}):jsxs("span",{css:ot,children:[ue,Ee]})},[de,y,ke,qe,re,ot,i,x,Re,A,He,nt]),rn=c!=null?`${z??G}-help`:void 0,Zn=z??G,Je=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=pe.current;if(!Ee)return;let at=ue.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),xt=useCallback(ue=>{if(i)return;let Ee=pe.current;if(Ee&&(O?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Zn,className:"plainframe-ui-textfield-label",css:be,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Ne],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Zn,className:"plainframe-ui-textfield-input",css:ze,type:de?ke?"text":"password":g==="number"?"text":g,inputMode:ie,pattern:me,value:Re,maxLength:le?void 0:H,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:M,onFocus:I,onKeyDown:D,autoFocus:P,name:L,tabIndex:w,autoComplete:b,readOnly:v,required:B,"aria-invalid":!!a||void 0,"aria-describedby":rn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Z,children:jsx("span",{id:rn,className:"plainframe-ui-textfield-helper-text",css:ce,children:c})})]})}));Qo.displayName="TextField";var er=fe.createContext("ghost"),Tt=fe.createContext(false),ii=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...m},h){let f=V(),[T,A]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),g=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:g,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:A}),[T]),F=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(D=>{if(D.closest('[role="menu"]')!==I)return false;let P=window.getComputedStyle(D);return P.display!=="none"&&P.visibility!=="hidden"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),A(false);},[]),k=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(k.current){k.current=false;return}let D=I.currentTarget,P=R(D);P.length>0&&(A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(L=>L.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true}));},[R]),_=useCallback(I=>{let D=I.currentTarget,P=R(D);if(P.length===0)return;if(I.key==="Tab"){k.current=true,D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),A(false),D.tabIndex=-1,requestAnimationFrame(()=>{D.tabIndex=0,k.current=false;});return}let L=D.querySelector("[data-highlighted]"),z=D.querySelector("[data-hovered]"),w=L||z,b=w?P.indexOf(w):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),b===-1&&(b=I.key==="ArrowDown"?-1:P.length);let v=I.key==="ArrowDown"?1:-1,B=(b+v+P.length)%P.length;P[B].setAttribute("data-highlighted",""),P[B].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[P.length-1].setAttribute("data-highlighted",""),P[P.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),A(false),D.blur();return}},[R]),W=useCallback(I=>{let D=I.currentTarget;D.hasAttribute("data-keyboard-nav")&&E(D);},[E]),S=useCallback(I=>{let D=I.currentTarget;D.hasAttribute("data-keyboard-nav")&&E(D);},[E]),M=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:F,children:jsx(Tt.Provider,{value:p,children:jsx(er.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:M,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:_,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ii.displayName="Menu";var ci=createContext(null),or=()=>{let e=useContext(ci);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function zu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)zu(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ou=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},tr=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Wu=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Ou(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let d=Array.from(g.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(R=>{let E=window.getComputedStyle(R);return E.display!=="none"&&E.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],F=document.activeElement;x.shiftKey&&F===p?(x.preventDefault(),C.focus()):!x.shiftKey&&F===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let A=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ci.Provider,{value:A,children:a})},ui=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:l}=or(),u=fe.Children.only(t),m=u.props||{},h=io(c,o,u.ref),f=a==="click"?{onClick:A=>{A.stopPropagation(),s(!r),m.onClick?.(A);}}:{onMouseEnter:A=>{l(),r||s(true),m.onMouseEnter?.(A);},onMouseLeave:A=>{i(),m.onMouseLeave?.(A);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let A=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[A,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});ui.displayName="PopoverTrigger";var di=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=fe.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return fe.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:ds(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});di.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var pi=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:A,setOpen:y,triggerOn:x,referenceRef:g,scheduleClose:d,cancelClose:p}=or(),C=V(),F=_u(e),{refs:R,x:E,y:k,strategy:$,context:_}=useFloating({open:A,onOpenChange:y,whileElementsMounted:autoUpdate,placement:F,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&R.setReference(g.current);},[R,g]);let W=useDismiss(_,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(_,{role:"dialog"}),{getFloatingProps:M}=useInteractions([W,S]),[I]=_.placement.split("-"),D=I,P=`${D==="left"?"right":D==="right"?"left":"center"} ${D==="top"?"bottom":D==="bottom"?"top":"center"}`,L=8,z=D==="top"?{y:L}:D==="bottom"?{y:-L}:D==="left"?{x:L}:{x:-L},w={initial:{opacity:0,scale:.96,...z},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...z},transition:{scale:{type:"spring",stiffness:520,damping:32,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.16,ease:"linear"}}},b=C.surface.panelBg,v=C.text.primary,B=`${C.componentHeights.border} solid ${C.surface.border}`,H=tr(i,C.spacing),O=tr(l,C.spacing),K=tr(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),K&&(N.paddingBlock=K);let U=tr(m,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:k??0,left:E??0,zIndex:1e3,transformOrigin:P,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(a)??"fit-content",height:ds(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),j=r?css({}):css({background:b,color:v,border:B,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),J=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},le=io(R.setFloating,T),de=jsx(motion.div,{className:"plainframe-ui-popover",...M({...f,ref:le,...J}),...w,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:A?de:null})})});pi.displayName="PopoverContent";var Ku=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=fe.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),A=ve(),y={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},x={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[d,p]=useState(n),C=g?!!t:d,[F,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let E=["sm","md","lg"].includes(s)?s:"md",k=y[E],$=`${x.slideMs}ms ${x.easing}`,_=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?_:W,M=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:D,thumb:P}=k,L=(D-P)/2,z=css({display:"inline-flex",alignItems:"center",gap:k.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),w=css({position:"relative",width:I,height:D,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),b=css({position:"absolute",top:L,left:C?I-P-L:L,width:P,height:P,backgroundColor:M,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:F?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),B=()=>{if(r)return;let O=!C;g||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:B,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,A({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[w,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[b,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[v,m],children:a})]})}));var Ju=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},sr=fe.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:A,...y},x)=>{let g=V(),d=ve(),p=typeof e=="boolean",[C,F]=useState(t),R=p?e:C,E=r==="sm"||r==="lg"?r:"md",k=useMemo(()=>Ju(g,E),[g,E]),{checkedBg:$,checkColor:_,borderCol:W,hoverBg:S,gapPx:M}=useMemo(()=>{let O=g.palette||{},K=g.neutral||{},N=g.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=K,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||K,G=l):(U=O.primary||K,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],j=N[G]??N.primary??g.text?.onColors?.primary??g.text.primary,J=typeof k.gap=="number"?k.gap+2:k.gap;return {checkedBg:se,checkColor:j,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:J}},[k.gap,l,g]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:M,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:W,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[W,$,a,o,M,S,s,g.radius.sm,g.spacing.xs]),D=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),P=useMemo(()=>css({width:k.box,height:k.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${k.borderWidth} solid ${W}`,outlineOffset:`-${k.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?g.radius.full:k.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, box-shadow .16s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden",transform:"translateZ(0)",backfaceVisibility:"hidden"}),[k.box,k.borderRadius,k.borderWidth,W,c,g.radius.full]),L=useMemo(()=>({w:Math.round(k.box*k.iconRatioW),h:Math.round(k.box*k.iconRatioH)}),[k.box,k.iconRatioH,k.iconRatioW]),z=useMemo(()=>css({width:L.w,height:L.h,transition:"opacity .14s ease, transform .14s ease",color:_,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[_,L.h,L.w]),w=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),b=useMemo(()=>css({fontSize:k.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[k.labelFont,g.text.primary]),v=useMemo(()=>css({fontSize:k.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[k.labelFont,a,s,g.spacing.xs,g.text.secondary]),B=useCallback(()=>{o||(p?n?.(!R):F(O=>{let K=!O;return n?.(K),K}));},[o,p,R,n]),H=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},[o,B]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",A||""].join(" ").trim(),css:[I,d({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:R,onChange:B,disabled:o,css:D,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[P,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:_,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:w,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[b,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,T],children:a})]})]})}));sr.displayName="Checkbox";var ed=()=>useContext(gn),td=()=>useContext(ro),nd=()=>useContext(cr),mn=null,hi=(e,t=35)=>{mn!==null&&window.clearTimeout(mn),mn=window.setTimeout(()=>{e(),mn=null;},t);},lo=()=>{mn!==null&&(window.clearTimeout(mn),mn=null);},Ht=fe.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:A,...y},x){let g=ed(),d=nd(),p=lr(),C=uo(),F=td(),R=V(),k=!!useContext(Tt),$=y["data-subtrigger"]!==void 0,_=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,M=useContext(er),I=M==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],D=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:S>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${S}))`:R.spacing.md,minHeight:k?R.componentHeights.sm:R.componentHeights.md,display:"flex",alignItems:"center",gap:R.spacing.sm,fontWeight:500,fontSize:R.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?R.palette.danger[800]:R.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?R.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:I},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:R.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[R,k,S,t,n,I]),P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),L=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),w=[];k&&w.push({minHeight:R.componentHeights.sm,paddingLeft:R.spacing.sm,paddingRight:R.spacing.xs,paddingTop:R.spacing.xs,paddingBottom:R.spacing.xs});let b=()=>{s?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let K=H.closest('[role="menu"]');if(!K)return;let N=Array.from(K.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(J=>{if(J.closest('[role="menu"]')!==K)return false;let le=window.getComputedStyle(J);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),j=N[se];j&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),g&&T!=null&&g.setActiveIndex(se));},B=t?-1:F?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:B,ref:H=>{if(g&&!A){let O=g.listRef.current;H&&(T!=null?O[T]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&hi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');K?.hasAttribute("data-keyboard-nav")&&K.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)lo();else {let N=!!H.currentTarget.closest("[data-submenu-content]");p&&!N&&hi(p.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&g&&T!=null&&(K?.hasAttribute("data-keyboard-nav")&&(K.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),g.setActiveIndex(T)),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&g&&!F?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!g){let K=O.closest('[role="menu"]');if(K){K.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=K.tabIndex;K.tabIndex=-1,requestAnimationFrame(()=>{K.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),b());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[D,...w,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),b());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:P,children:l}),a,(f!=null||_||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:L,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:R.typography.sizes.sm,color:R.text.secondary,whiteSpace:"nowrap"}),children:f}):null,_,m&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),xi=fe.createContext(null),hs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,A=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(A),l.current?.(A);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(xi.Provider,{value:m,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:m,...h},f){let T=useContext(xi),A=!!T&&r!==void 0,y=!A&&t!==void 0,[x,g]=useState(()=>A?T.values.some(W=>Object.is(W,r)):!!n),d=A?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),F=!!useContext(Tt),R=()=>{if(!c)if(A)T.toggle(r);else {let W=!d;y||g(W),o?.(W);}},E=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:F?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),k=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),_=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:E,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:d,css:k})}),u]});return jsx(Ht,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon:_,endIcon:m,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var vi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:m,...h},f){let T=t!==void 0,[A,y]=useState(!!n),x=T?!!t:A,d=!!useContext(Tt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),F=()=>{if(a)return;let E=!x;T||y(E),o?.(E);},R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(Ht,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:F,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(gs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});vi.displayName="MenuSwitchItem";var Ci=fe.createContext(null),Ri=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(Ci.Provider,{value:i,children:o})};Ri.displayName="MenuRadioGroup";var od=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(Ci),u=l?.value===t,m=V(),h=css({width:m.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:m.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Ht,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:h,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),fn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let m=V(),f=!!useContext(Tt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,A=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),g=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(A,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:a})]})});fn.displayName="MenuLabel";var rd=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var wi=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},ys=io,po=0,ur=null,dr=null,yd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function xd(){if(!(typeof document>"u")){if(po===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=yd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function vd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;ur!==null&&(e.style.overflow=ur),dr!==null&&(e.style.paddingRight=dr),ur=null,dr=null;}}var gn=createContext(null),pr=()=>{let e=useContext(gn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),Cd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Ei=createContext(null),lr=()=>useContext(Ei),Si=createContext(false),Rd=()=>useContext(Si),ro=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Td(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var wd=()=>Cd()?.activeIndex??null,Ii=0,Ln=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(M=>{M&&wi(h.current),e===void 0&&i(M),n?.(M);},[e,n]),m=useRef(`pfui-menu-${++Ii}`),h=useRef(null),f=useRef([]),T=useRef(null),[A,y]=useState(null),[x,g]=useState(false);useEffect(()=>{l||(y(null),f.current=[],g(false));},[l]);let d=useRef(null),p=useCallback((M,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let D=I??20;d.current=window.setTimeout(()=>u(M),D);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return xd(),()=>vd()},[l,r]);let F=xs(),[R]=useState(()=>F??Td()),E=useRef(new Set),k=useMemo(()=>({registerSubMenu:M=>(E.current.add(M),()=>E.current.delete(M)),closeAllSubMenus:()=>{E.current.forEach(M=>M());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),_=useMemo(()=>({activeIndex:A,setActiveIndex:y}),[A,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:g}),[x]),S=s==="sm";return jsx(cr.Provider,{value:R,children:jsx(Tt.Provider,{value:S,children:jsx(oo.Provider,{value:W,children:jsx(Ei.Provider,{value:k,children:jsx(mo.Provider,{value:_,children:jsx(gn.Provider,{value:$,children:a})})})})})})};Ln.displayName="DropdownMenu";var Bn=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:A,menuId:y}=pr(),x=uo(),g=lr(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,F=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:E,...k}=s,$=useMemo(()=>ys(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),_=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(P=>{let L=_();requestAnimationFrame(()=>L[P]?.focus());},[_]),S=useCallback(P=>{if(P.key==="Tab"&&c){P.preventDefault(),x?.setIsKeyboardNav(true);let L=A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=L.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');z&&(document.querySelectorAll("[data-highlighted]").forEach(w=>w.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(P.key==="ArrowRight"&&c){let L=document.querySelector("[data-subtrigger][data-hovered]");if(L){P.preventDefault(),P.stopPropagation(),x?.setIsKeyboardNav(true),L.removeAttribute("data-hovered"),L.setAttribute("data-highlighted",""),L.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});L.dispatchEvent(z);});return}}if(P.key==="ArrowDown"||P.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){P.preventDefault(),i(true),requestAnimationFrame(()=>{let L=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=Array.from(L.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==L)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let w=P.key==="ArrowDown"?0:z.length-1;h(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),C?.(P),R?.(P);return}if(c){P.preventDefault();let L=document.querySelectorAll("[data-hovered]");for(let w of Array.from(L))if(w.closest("[data-submenu-content]")){let v=w.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let B=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let K=window.getComputedStyle(O);return K.display!=="none"&&K.visibility!=="hidden"}),H=B.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),H!==-1&&B.length>0){let O=P.key==="ArrowDown"?1:-1,K=(H+O+B.length)%B.length;B[K]?.setAttribute("data-highlighted",""),B[K]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(z){z.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let w=Array.from(z.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(b=>{if(b.closest('[role="menu"]')!==z)return false;let v=window.getComputedStyle(b);return v.display!=="none"&&v.visibility!=="hidden"});if(w.length>0){let b=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),B=-1;b?B=w.indexOf(b):v&&(B=w.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(K=>K.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),B===-1&&(B=P.key==="ArrowDown"?-1:w.length);let H=P.key==="ArrowDown"?1:-1,O=(B+H+w.length)%w.length;h(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}C?.(P),R?.(P);return}}if((P.key==="Enter"||P.key===" ")&&!c){P.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let L=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=Array.from(L.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==L)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(P),R?.(P);return}C?.(P),R?.(P);},[c,i,h,C,R,_,W,m,x,y,A,g]),M=useCallback(P=>{l==="click"&&((P.nativeEvent.composedPath?.()??[]).some(b=>{let v=b;if(!v||!("tagName"in v))return false;let B=String(v.tagName).toUpperCase();if(B==="INPUT"||B==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(P.stopPropagation(),i(!c))),F?.(P),E?.(P);},[l,c,i,F,E]),I=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},D=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&p){let P=p.props,L=P.css,z=typeof P.className=="string"?P.className:void 0,w=typeof P.tabIndex=="number"?P.tabIndex:0,b={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[L,D,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...k};return cloneElement(p,b)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),D,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...k,children:t})});Bn.displayName="DropdownMenuTrigger";var yn=fe.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:A,exitPlacement:y,animateOnBusClose:x=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...F},R)=>{let{open:E,setOpen:k,referenceRef:$,clearSubmenuHover:_,setActiveIndex:W,floatingRef:S,menuId:M}=pr(),I=V(),D=xs(),P=uo();useEffect(()=>{if(!D)return;let X=D.registerCloser(()=>k(false));return ()=>{X&&X();}},[D,k]);let L=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,w=typeof s=="string"?parseFloat(s):s,b=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(X=>({getBoundingClientRect:()=>{let re=Math.round(X.x),Z=Math.round(X.y);return {x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0,toJSON:()=>({x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0})}},contextElement:void 0}),[]),B=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let X=e;return v({x:X.x,y:X.y})},[e,v]),{refs:H,x:O,y:K,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:k,placement:b,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:L??0,crossAxis:z??0}),flip({padding:w??8}),shift({padding:w??8}),size({apply({rects:X,elements:re}){let Z=re.floating;Z.style.boxSizing="border-box",i!=null?Z.style.height=typeof i=="number"?`${i}px`:String(i):Z.style.removeProperty("height"),c!=null?Z.style.width=typeof c=="number"?`${c}px`:String(c):a?Z.style.width=`${Math.round(X.reference.width)}px`:Z.style.width="200px",l!=null?Z.style.maxHeight=typeof l=="number"?`${l}px`:String(l):Z.style.removeProperty("max-height");}})]});useEffect(()=>{B?H.setReference(B):$.current&&H.setReference($.current);},[H,B,$]),useEffect(()=>{if(!E)return;let X=B||$.current,re=H.floating.current;if(!(!X||!re))return autoUpdate(X,re,G)},[E,B,$,H,G]),useEffect(()=>{G();},[G,a,c,i,l]),useEffect(()=>{E&&!h&&W(0);},[E,h,W]),useEffect(()=>{if(!m||!E)return;let X=()=>{let re=document.activeElement,Z=$.current,ce=H.floating.current;re&&(Z?.contains(re)||ce?.contains(re)||k(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,E,k,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:X=>{if(d?.length){let re=X.target;for(let Z of d)if(Z.current?.contains(re))return false}return true}}),j=useRole(U,{role:"menu"}),{getFloatingProps:J}=useInteractions([se,j]),le=useRef(false);useEffect(()=>{E?le.current=true:le.current&&$.current&&C&&(D?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[E,$,D,C]),useLayoutEffect(()=>{if(!E)return;let X=()=>{let ce=S?.current;if(!ce)return false;let pe=ce.closest('[data-floating-ui-portal="true"]')??ce,Ue=$?.current;if(!Ue)return false;let Oe=Ue.closest("[data-pfui-portal-owner]");if(Oe){let He=Oe.getAttribute("data-pfui-portal-owner");if(!He)return false;if(pe.getAttribute("data-pfui-portal-owner")===He&&ce.getAttribute("data-pfui-portal-owner")===He)return true;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=Oe.getAttribute("data-pfui-mode"),qe=Oe.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<Oe.style.length;Ge++){let ot=Oe.style[Ge];if(ot.startsWith("--pf-")){let dt=Oe.style.getPropertyValue(ot);pe.style.setProperty(ot,dt),ce.style.setProperty(ot,dt);}}return pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),Oe.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),Oe.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark")),true}let ke=Ue.closest('[data-floating-ui-portal="true"]');if(ke&&!ke.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let He=st.getAttribute("data-pfui-scope");if(!He)return false;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe)),pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),st.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${He}"]`);if(Ge&&Ge!==pe)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let rn=Ge.style.getPropertyValue(dt);pe.style.setProperty(dt,rn),ce.style.setProperty(dt,rn);}}return true}return false},re=[0,5,15,30,60,100,150,250],Z=[];for(let ce of re)Z.push(window.setTimeout(()=>X(),ce));return ()=>{for(let ce of Z)window.clearTimeout(ce);}},[E,$]);let de=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),ge=g===void 0?void 0:typeof g=="number"?g:I.spacing[g]??g,Pe=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":de,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:ge,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Te=-1,Re=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let Z=X.type?.displayName;if(Z==="DropdownMenu"||Z==="DropdownMenuSub")return X;if(Z==="MenuItem"||Z==="MenuCheckboxItem"||Z==="MenuRadioItem"||Z==="MenuSwitchItem")return Te+=1,cloneElement(X,{__index:Te,key:X.key??Te});if(Z==="DropdownMenuTrigger"){let pe=X.props.children;return cloneElement(X,{children:fe.Children.map(pe,Re)})}if(Z==="DropdownMenuSubTrigger"){Te+=1;let pe=Te;return cloneElement(X,{__index:pe,key:X.key??pe})}let ce=X.props.children;return ce==null?X:cloneElement(X,{children:fe.Children.map(ce,Re)})},Ie=fe.Children.map(A,Re),Q=U.placement.split("-")[0]||"bottom",ie=Q==="bottom"?"center top":Q==="top"?"center bottom":Q==="left"?"right center":"left center",me=Q==="bottom"?{opacity:0,y:-8,scale:.96}:Q==="top"?{opacity:0,y:8,scale:.96}:Q==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Y=y??Q,xe=Y==="bottom"?{opacity:0,y:-8,scale:.96}:Y==="top"?{opacity:0,y:8,scale:.96}:Y==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},oe=!!D?.isBusClosingRef.current&&!x?{scale:{duration:0},x:{duration:0},y:{duration:0},opacity:{duration:0}}:{scale:{type:"spring",stiffness:520,damping:38,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.12,ease:"linear"}},ae=css({position:N,top:K??0,left:O??0,zIndex:1e3,transformOrigin:ie}),be=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),P?.setIsKeyboardNav(true);let re=X.currentTarget;re.setAttribute("data-keyboard-nav","");let Z=Array.from(re.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(ce=>{if(ce.closest('[role="menu"]')!==re)return false;let pe=window.getComputedStyle(ce);return pe.display!=="none"&&pe.visibility!=="hidden"});if(Z.length>0){let ce=re.querySelector("[data-highlighted]"),pe=re.querySelector("[data-hovered]"),Ue=-1;ce?Ue=Z.indexOf(ce):pe&&(Ue=Z.indexOf(pe)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),pe&&pe.removeAttribute("data-hovered"),Ue===-1&&(Ue=X.key==="ArrowDown"?-1:Z.length);let Oe=X.key==="ArrowDown"?1:-1,ke=(Ue+Oe+Z.length)%Z.length;W(ke),Z[ke]?.setAttribute("data-highlighted",""),Z[ke]?.focus();}}},[P,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...F,ref:ys(R,H.setFloating,X=>{if(S&&(S.current=X),X&&$.current){let Z=$.current.closest("[data-pfui-portal-owner]");if(Z){let ce=Z.getAttribute("data-pfui-portal-owner");if(ce){X.setAttribute("data-pfui-portal-owner",ce);let pe=Z.getAttribute("data-pfui-mode"),Ue=Z.getAttribute("data-pfui-primary");pe&&X.setAttribute("data-pfui-mode",pe),Ue&&X.setAttribute("data-pfui-primary",Ue);for(let Oe=0;Oe<Z.style.length;Oe++){let ke=Z.style[Oe];ke.startsWith("--pf-")&&X.style.setProperty(ke,Z.style.getPropertyValue(ke));}Z.classList.contains("pf-light")&&X.classList.add("pf-light"),Z.classList.contains("pf-dark")&&X.classList.add("pf-dark");}}}})}),"data-menu-id":M,"data-keyboard-nav":P?.isKeyboardNav?"":void 0,className:f,css:[Pe,ae,T],initial:me,animate:{opacity:1,x:0,y:0,scale:1},exit:xe,transition:oe,onPointerMove:X=>ze(X.currentTarget),onPointerDown:X=>ze(X.currentTarget),onKeyDown:be,onMouseMove:Ne,onMouseEnter:()=>{_(),D?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:Ie})}):null})})});yn.displayName="DropdownMenuContent";var ki=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Rd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&wi(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,M)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=M??20;m.current=window.setTimeout(()=>{h.current=false,u(S);},I);},[o,u]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let A=lr();useEffect(()=>{if(!A)return;let S=()=>{T(),u(false);};return A.registerSubMenu(S)},[A,u,T]);let y=useRef(`pfui-submenu-${++Ii}`),x=useRef(null),g=useRef([]),d=useRef(null),[p,C]=useState(null),[F,R]=useState(false);useEffect(()=>{l||(C(null),g.current=[],R(false));},[l]);let E=useContext(Tt),k=r??E,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:g,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),_=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:F,setIsKeyboardNav:R}),[F]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:fe.Children.map(s,S=>{if(!isValidElement(S))return S;let M=S.type;return M?.displayName==="DropdownMenuSubTrigger"||M?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Si.Provider,{value:true,children:jsx(Tt.Provider,{value:k,children:jsx(mo.Provider,{value:_,children:jsx(oo.Provider,{value:W,children:jsx(gn.Provider,{value:$,children:s})})})})})};ki.displayName="DropdownMenuSub";var Ai=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=pr(),A=uo(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),g=x?t:null,d=g?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:F,onClick:R,...E}=s,k=useMemo(()=>ys(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,_=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let M=S.currentTarget,I=D=>{A?.setIsKeyboardNav(true);let P=M.closest("[data-menu-id]");if(!P)return;P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let L=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==P)return false;let B=window.getComputedStyle(v);return B.display!=="none"&&B.visibility!=="hidden"});if(!L.length)return;let z=L.indexOf(M),w=z>=0?z:0,b=D==="next"?(w+1)%L.length:(w-1+L.length)%L.length;L[b]?.setAttribute("data-highlighted",""),L[b]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),A?.setIsKeyboardNav(true);let D=S.currentTarget;i(true),requestAnimationFrame(()=>{let P=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(P){P.setAttribute("data-keyboard-nav",""),D.removeAttribute("data-highlighted"),D.removeAttribute("data-hovered");let L=P.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');L&&(L.setAttribute("data-highlighted",""),L.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let D=M.closest("[data-menu-id]");D&&D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),M.setAttribute("data-highlighted",""),M.focus(),A&&A.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),F?.(S);},[c,i,p,F,u,A,T]),W=l==="hover"?{onMouseEnter:S=>{let M=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),M.setAttribute("data-hovered",""),M.focus({preventScroll:true});let I=M.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),A&&A.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let M=S.currentTarget;lo(),M.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),M.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&g){let S=d?.css,M=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,D={ref:k,tabIndex:I,className:[M,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:P=>{if(P.target.hasAttribute("data-highlighted")){let L=P.target.closest("[data-menu-id]");L&&!L.hasAttribute("data-keyboard-nav")&&(L.setAttribute("data-keyboard-nav",""),A&&A.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(P);},...W,...E};return cloneElement(g,D)}return jsx("div",{ref:k,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:_,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let M=S.currentTarget.closest("[data-menu-id]");M&&!M.hasAttribute("data-keyboard-nav")&&(M.setAttribute("data-keyboard-nav",""),A&&A.setIsKeyboardNav(true));}},...W,...E,children:t})});Ai.displayName="DropdownMenuSubTrigger";var Mi=fe.forwardRef((e,t)=>{let n=xs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=pr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(yn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});Mi.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Id=css({display:"inline"}),Pi=css({display:"inline",fontWeight:700}),kd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Ad=css({display:"flex",alignItems:"center",gap:4}),Md=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Di=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Fd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Pd=()=>{},Dd=e=>e,Nd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Hd=e=>{e.preventDefault(),e.stopPropagation();},Ld=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Bd=e=>{e.preventDefault(),e.stopPropagation();},Ni=fe.memo(({onCapture:e})=>{let t=useContext(gn),n=useContext(mo),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Ni.displayName="CtxCapture";var vs=fe.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),A=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Md,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Fd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(g=>Object.is(g,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:A},e.value)}return s?jsx(Ht,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Ht,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:A},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));vs.displayName="AutocompleteRow";var Hi=fe.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:A,disabled:y=false,error:x=false,showClear:g=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:F=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:k=true,blurOnSelect:$=false,freeSolo:_=false,customValueLabel:W=false,maxHeight:S,maxItems:M,noResultsText:I="No Items Found",highlightTypedValue:D,typedValueHighlightCss:P,showNoResults:L=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:b,loading:v,loadingText:B="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:K,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:j,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:de,textFieldHelperRowCss:ge,textFieldHelperTextCss:Pe,textFieldStartIconCss:Te,textFieldEndIconCss:Re,menuContentCss:Ie})=>{let Q=V().text.secondary,[ie,me]=useState(""),Y=typeof d=="boolean",[xe,ee]=useState(false),oe=Y?d:xe,ae=useRef(null),be=useRef(null),Ne=useRef(null),ze=useRef(null),X=useRef(false),re=useRef(null),Z=useRef(false),ce=useRef(0),pe=useMemo(()=>[be],[]),[Ue,Oe]=useState(N??[]),ke=K??Ue,st=useRef(ke);st.current=ke;let[He,nt]=useState(null),qe=useRef(He);qe.current=He;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[rn,Zn]=useState(false),Je=typeof b=="function",xt=Je?ot:e,ue=useRef(xt);ue.current=xt;let Ee=!!v||rn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let De=useCallback(q=>{Y||ee(q),at.current?.(q);},[Y]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let q=ie;return bt.current=window.setTimeout(async()=>{Zn(true);try{let ne=await b(q)||[];dt(Array.isArray(ne)?ne:[]);}catch{dt([]);}finally{Zn(false);}},Math.max(0,H)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,b,H]);let Qn=useMemo(()=>{let q=mr(ie);return q?xt.some(ne=>mr(ne.title??ne.value)===q):false},[xt,ie]),la=_&&!!W&&ie.trim().length>0&&!Qn,ic=q=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),Ce=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||Ce){let Ae=ne?W.prefix??"":"",he=Ce?W.suffix??"":"";return `${Ae}${q}${he}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Je)return xt;let q=mr(ie);if(!q)return xt;let ne=[],Ce=[];for(let Ae of xt){let he=mr(Ae.title??Ae.value);he.split(" ").some(Ze=>Ze.startsWith(q))?ne.push(Ae):he.includes(q)&&Ce.push(Ae);}return ne.length>0?ne:Ce},[xt,ie,Je]),ca=useMemo(()=>{if(la){let q=ie.trim();return [...$r,{value:q,title:ic(q),__pfui_free__:true}]}return $r},[$r,la,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of ca){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof M=="number"?Math.max(0,M):1/0,he=[];for(let pt of q){if(Ae<=0)break;let an=ne.get(pt).slice(0,Ae);an.length>0&&(he.push({label:pt==="__ungrouped__"?void 0:pt,items:an}),Ae-=an.length);}return he},[ca,M]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),Ho=kn.length>0,zr=!Ho&&!!L&&!Ee&&ie.trim().length>0,An=Ee||Ho||zr,Lo=An||Je;useEffect(()=>{!Je&&oe&&!An&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));},[Je,oe,An,De]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(_&&!O){if(Wr.current){Wr.current=false;return}let q=ie.trim();if(Or.current===q)return;Or.current=q,t?.({value:q,title:q});}},[ie,_,O,t]);let _r=useCallback(q=>{let ne=ue.current,Ce=new Map(ne.map(he=>[he.value,he])),Ae=q.map(he=>Ce.get(he)??{value:he,title:he});U?.(Ae);},[U]),Bo=useCallback(q=>{let ne=q.map(String);K||Oe(ne),_r(ne);},[K,_r]),ua=useCallback(q=>{let Ce=ke.includes(q)?ke.filter(Ae=>Ae!==q):[...ke,q];Bo(Ce);},[ke,Bo]),$o=useCallback(q=>{let ne=ue.current.find(Ce=>Ce.value===q)??{value:q,title:q};ne.disabled||(Wr.current=true,Or.current=(ne.title??ne.value).trim(),nt(ne),me(ne.title??ne.value),t?.(ne),Y||(E?(X.current=false,Z.current=true,ee(false),at.current?.(false),setTimeout(()=>{Z.current=false;},150)):X.current=true),!E&&Ne.current?.setActiveIndex&&Ne.current.setActiveIndex(null),$?(X.current=false,setTimeout(()=>{ze.current&&ae.current?(ze.current.tabIndex=0,ze.current.focus(),ze.current.blur(),ze.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,Y,E,$]),lc=useCallback(q=>{if(y)return;me(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):_&&nt(null)),!Y&&!ne&&F&&!oe&&De(true);},[O,Y,F,oe,De,y,_,t]),it=Nd,da=Pd,cc=Dd,pa=useMemo(()=>P?[Pi,P]:Pi,[P]),uc=useCallback(q=>{let ne=ie.trim();if(!ne||ne.length<1)return q;let Ce=ne.toLowerCase(),he=q.toLowerCase().indexOf(Ce);return he<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Id,children:[q.slice(0,he),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:pa,children:q.slice(he,he+ne.length)}),q.slice(he+ne.length)]})},[ie,pa]),zo=D?uc:cc,dc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Hd,Wo=Ld,pc=useCallback(q=>{Ne.current=q;},[]),ma=useCallback(q=>{let ne=Ne.current;if(!ne)return;let Ce=kn.length;if(Ce===0)return;let Ae=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),he=-1;if(Ae){let Ze=Ae.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),an=Ae.querySelector("[data-active]")||Ae.querySelector("[data-hovered]");an&&(he=Array.from(Ze).indexOf(an));}he<0&&typeof ne.activeIndex=="number"&&(he=ne.activeIndex);let pt=he<0?q===1?0:Ce-1:(he+q+Ce)%Ce;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(Vr=>Vr.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(Vr=>Vr.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[kn.length]),mc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!An&&!Je)return;q.preventDefault(),!oe&&!Y&&De(true),ma(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let ne=Ne.current&&typeof Ne.current.activeIndex=="number"?Ne.current.activeIndex:-1,Ce=ne>=0&&ne<kn.length?kn[ne]:null;if(oe&&Ce&&ne>=0){q.preventDefault(),q.stopPropagation(),O?(ua(Ce.value),E||requestAnimationFrame(()=>ae.current?.focus())):$o(Ce.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),oe&&!Y&&(Z.current=true,De(false),q.target.focus(),setTimeout(()=>{Z.current=false;},150))):q.key==="Tab"&&oe&&!Y&&De(false);},[An,Je,oe,Y,kn,O,E,ma,ua,$o,De,y]),fc=useCallback(()=>{y||Z.current||C&&Lo&&(ce.current=Date.now(),Y||De(true));},[Y,C,Lo,De,y]),gc=useCallback(()=>{if(X.current){X.current=false;return}k&&De(false),!_&&!O&&(He?me(He.title??He.value):ie.trim()&&me(""));},[k,_,O,He,ie,De]),fa=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{q.push(jsx(vs,{item:he,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:da,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),jsx(hs,{values:ke,onValuesChange:Bo,children:q},"multi-group")},[Vt,it,Ge,s,zo,ke,Bo,da,Wo,Oo,Q]),ga=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{let pt=He?.value===he.value;q.push(jsx(vs,{item:he,absIndex:ne,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:E,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),q},[Vt,it,He,Ge,s,zo,E,$o,Wo,Oo,Q]),bc=useMemo(()=>Ee?jsx(fn,{css:w,className:it("label-loading"),children:B},"loading"):zr?jsx(fn,{css:z,className:it("label-empty"),children:I},"empty"):Vt.length===0?null:O?fa():ga(),[Ee,zr,Vt.length,it,B,I,O,fa,ga]),sn=oe?false:y||!Je&&!Ho&&!L,ba=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(sn||y)&&(Y||(oe?(Z.current=true,De(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{Z.current=false;},150)):(De(true),queueMicrotask(()=>ae.current?.focus()))));},[oe,Ho,Je,De,sn,y,Y]),ha=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:oe?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:sn?"not-allowed":"pointer",userSelect:"none",opacity:sn?.5:1}),[oe,sn]),_o=useMemo(()=>se?jsx("span",{ref:re,role:"button",tabIndex:-1,css:[ha,j],"aria-disabled":sn||void 0,onMouseDown:Bd,onClick:ba,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ha,j,sn,ba,G]),hc=useMemo(()=>T&&_o?jsxs("span",{css:Ad,children:[T,_o]}):T??_o,[T,_o]),yc=useCallback(q=>{if(!(re.current&&re.current.contains(q.target)||Z.current||y||Date.now()-ce.current<300)){if(oe){!ie.trim()&&!Y&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));return}R&&Lo&&(!Y||R)&&De(true);}},[oe,ie,R,Lo,De,y,Y]);return jsx("div",{ref:be,className:it(""),css:[dc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Ni,{onCapture:pc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:kd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:lc,onKeyDown:mc,onFocus:fc,onBlur:gc,onSurfaceClick:yc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:hc,size:A,width:n,fullWidth:o,disabled:y,error:x,showClear:g,css:i,wrapperCss:J,inputCss:le,labelCss:de,helperRowCss:ge,helperTextCss:Pe,startIconCss:Te,endIconCss:Re}),jsx("span",{ref:ze,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),An&&jsx(yn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:pe,disableOutsidePressDismiss:Y,returnFocus:!$,children:bc})]})})});Hi.displayName="Autocomplete";var _d=["sm","md","lg"],Kd=(e,t)=>typeof e=="number"?e:_d.includes(e)?t.componentHeights[e]:t.componentHeights.md,Vd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},jd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Ud=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Li=fe.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Kd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,A=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Vd(u,o),g=jd(u,o),d=Ud(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":g,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),F=css({fontSize:A,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[p,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:d})})}));Li.displayName="Avatar";var Bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),m=ve(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let R=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Bi(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),A=typeof t=="number"&&t>=0,y=A&&T.length>t?T.slice(0,t):T,x=A&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Bi(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${g}`,backgroundColor:g,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),F=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[p,r,m()],children:[y.map((R,E)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:jsx("span",{css:F,children:R})},E);let k=R,$=k.props?.css,_=$==null?F:[F,$],W=cloneElement(k,{size:n,rounded:s,css:_,style:{...k.props?.style,width:"100%",height:"100%",objectFit:k.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:W},E)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var Oi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ep=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",tp=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",np=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),op=fe.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:A,className:y,badgeClassName:x,css:g,badgeCss:d,offsetX:p,offsetY:C})=>{let F=V(),R=s==="dot",E=f??(R?8:17),k=r??(R?0:10),{scale:$,onKey:_}=Zd(F,t),W=Qd($),S=F.text?.onColors||{},M=ep(F,S,_,n),I=tp(e,a,s),D=np(i,s,e,c),P=css({position:"relative",display:"inline-block"}),L=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Oi(p??L),w=Oi(C??L),b=l.vertical||"top",v=l.horizontal||"right",B={},H="0",O="0";b==="center"?(B.top="50%",O="-50%"):b==="top"?(B.top=w,O="-45%"):(B.bottom=w,O="45%"),v==="center"?(B.left="50%",H="-50%"):v==="right"?(B.right=z,H="45%"):(B.left=z,H="-45%");let K=D?1:.8,N=css({minWidth:R?E:E/2,height:E,background:W,color:M,fontSize:typeof k=="number"?`${k}px`:k,fontWeight:o,borderRadius:999,padding:R?0:`0 ${E/4}px`,boxShadow:"0 2px 8px rgba(0,0,0,0.04)",lineHeight:1,position:"absolute",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",...T?{boxShadow:`0 0 0 2px ${A??F.surface?.appBg}`}:{},opacity:D?1:0,transform:`translate(${H}, ${O}) scale(${D?K:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...B});return jsxs("div",{className:["plainframe-ui-badge-wrapper",y||""].join(" ").trim(),css:[P,g],children:[m,jsx("span",{"aria-hidden":!D,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Is=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...A})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[g,d]=useState(e),[p,C]=useState(e),F=useRef(null),R=useRef(null),E=useRef(null);useEffect(()=>(F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),F.current=setTimeout(()=>{d(false),F.current=null;},u)),()=>{F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let M=document.body,I=M.style.overflow,D=M.style.paddingRight,P=window.innerWidth-document.documentElement.clientWidth,L=parseFloat(getComputedStyle(M).paddingRight||"0");return M.style.overflow="hidden",P>0&&(M.style.paddingRight=`${L+P}px`),()=>{M.style.overflow=I,M.style.paddingRight=D;}},[e,T]),useEffect(()=>{if(!p||!t)return;let M=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,t]);let k=M=>{if(!p||!t||!E.current)return;let I=M.target;I&&!E.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!g)return null;let _=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:p?"auto":"none",visibility:g?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[_,a],onPointerDown:k,...A,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,i],role:"presentation"}),jsx("div",{ref:E,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function lp(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var cp=fe.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let m=V(),h=ve(),f=fe.useMemo(()=>fe.Children.toArray(e).flatMap(d=>{if(!fe.isValidElement(d))return [];let{type:p,props:C}=lp(d);if(!(p===hr||typeof p=="function"&&"displayName"in p&&p.displayName===hr.displayName))return [];let R=C;return [{href:R.href,disabled:R.disabled,node:R.children,className:R.className,css:R.css,onClick:R.onClick,startIcon:R.startIcon,endIcon:R.endIcon}]}),[e]),T=fe.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),A=fe.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=fe.useCallback((d,p,C)=>{let F=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:F,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=fe.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=fe.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,F=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",F?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,F,d.disabled),o,C?r:s,F?a:void 0,h(),d.css],k=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(fe.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[A,c],children:t}),F?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:E,children:k}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:R,css:E,children:k})]},p)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},As=e=>typeof e=="number"?`${e}px`:e,Vi=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Vi(n)&&(t=true));}),t};function mp(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function fp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var ji=fe.memo(fe.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:A,...y},x)=>{let g=V(),d=ve(),p=useMemo(()=>mp(g,t),[g,t]),C=useMemo(()=>fp(g,e),[g,e]),F=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Vi(u)&&fe.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,E=useMemo(()=>ks(n,R),[n,R]),k=useMemo(()=>ks(o,R),[o,R]),$=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),_=useMemo(()=>F?"center":l??"center",[F,l]),W=!!c&&_==="center",S=!!c&&_==="start",M=!!c&&_==="end",I=a||c,D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,g,I]),P=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),L=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(F&&!s?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:As(p.iconSize)}:{fontSize:As(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[F,s,p,n,o]),w=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:As(g.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[g,W]),b=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),B=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),K=useMemo(()=>()=>{if(F)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?E||n:null}),jsx("span",{css:H(!!S),children:$})]})},[F,n,S,B,H,E,c,$]),N=useMemo(()=>()=>{if(F)return null;let G=!!o;return !G&&!M?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!M),children:G?k||o:null}),jsx("span",{css:H(!!M),children:$})]})},[F,o,M,B,H,k,c,$]),U=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[D,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),P,L,z,A],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:w,children:[K(),jsx("span",{className:"plainframe-ui-button-label",css:b,children:F?c?$:ks(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));ji.displayName="Button";var Cr=e=>isValidElement(e),gp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>gp(e)===t,Gi=e=>Ds(e,"ButtonGroup"),Xi=e=>Ds(e,"DropdownMenu"),Fs=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,bp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,hp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ps=(e,t)=>{if(!Cr(e))return null;if(Gi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ps(t?n[0]:n[n.length-1],t):null}if(Xi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Fs);return o?Ps(o,t):null}if(Fs(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},qi=(e,t)=>{if(!e)return false;let n=Ps(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return hp(o)},Yi=fe.memo(fe.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...A},y){let x=V(),g=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:g,p=o==="vertical",C=bp(x.componentHeights.border,1),F=x.surface.border,R=n&&!!f,E=n&&!!T,k=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?On(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:On(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,S=0,M=false,I=[];for(let D of $){if(!Cr(D)){I.push(D);continue}let P=S===0,L=S===W-1,z=D.props??{},w=z.disabled??s,b=z.size??a,v=0,B=0,H=0,O=0;n&&(p?(v=P?R?0:d:0,B=P?E?0:d:0,O=L?R?0:d:0,H=L?E?0:d:0):(v=P?R?0:d:0,O=P?R?0:d:0,B=L?E?0:d:0,H=L?E?0:d:0));let K=qi(D,"left"),N=qi(D,"right"),se=n&&!P&&!(M&&K)&&!(M||K)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${F}`}):null,j=n&&!P&&M&&K?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(B),borderBottomRightRadius:On(H),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Xi(D)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=Gi(D)&&n?{__clipLeft:!P,__clipRight:!L}:{},Q=cloneElement(D,{...z,disabled:w,size:b,className:Ie,css:[Re,de],...we});I.push(Q),M=N,S+=1;continue}let ge=z.children,Pe=Children.map(ge,Re=>{if(!Cr(Re)||!Fs(Re))return Re;let Ie=Re.props,we=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Re,{...Ie,css:[Ie.css,de],className:we,disabled:w,size:b})}),Te=cloneElement(D,{...z,children:Pe});I.push(Te),M=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[k,h],...A,children:I})}));Yi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Rr(n?.[e]??e)}}},wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Rr(n?.[e]??e)}}},Ep=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Sp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},Wn=fe.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:A,role:y,tabIndex:x,...g},d){let p=V(),C=p.surface??{},[F,R]=useState(!!u),E=l!=null,k=E?!!l:F,$=useMemo(()=>Ep(o,p),[o,p]),_=useMemo(()=>Sp(o,p,$),[o,p,$]),W=_,S=useMemo(()=>Tp(r,p),[r,p]),M=useMemo(()=>wp(s,p),[s,p]),I=!!c||!!i,D=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:M,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Rr(h),height:Rr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:I?"pointer":void 0,...I?{"&:hover":{backgroundColor:_}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,M,o,p.componentHeights,C.border,h,f,I,_,W]),P=useCallback(()=>{if(!i)return;let b=!k;E||R(b),m?.(b);},[E,m,i,k]),L=useCallback(b=>{i&&P(),T?.(b);},[i,P,T]),z=useCallback(b=>{i&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),P()),A?.(b);},[i,P,A]),w=ve();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&k?"true":void 0,"aria-pressed":i?k:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[w(),D,n],onClick:L,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...g,children:t})}));Wn.displayName="Container";var kp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Hs(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return kp(o)}return e}}}function yo(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ls(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ap(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function xo(e,t,n,o){let r=Hs(t,e),s=Hs(n,e),a=Hs(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Ji(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Zi=fe.createContext("horizontal"),Bs=()=>fe.useContext(Zi),Qi=fe.memo(fe.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:A,...y},x)=>{let g=V(),d=ve(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ap(h,g),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Zi.Provider,{value:f,children:jsx(Wn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:A,tabIndex:A?0:void 0,...y,children:e})})}));Qi.displayName="Card";var Mp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Ls(o),...u?{width:"100%"}:{flex:1,minWidth:0},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Fp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Pp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Dp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Ji(m,l)??m.text?.primary,textAlign:Ls(o),...xo(m,r,s,a),display:"flex",alignItems:"center",gap:m.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[h,t],...u,children:e})}),Np=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Ji(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Ls(o),...xo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var tl=e=>isValidElement(e),$p=e=>tl(e)?e.type?.displayName||e.type?.name:void 0,el=e=>$p(e)==="Card",zp=e=>typeof e=="number"?`${e}px`:e,nl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?zp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(el).length,x=0,g=T.map((d,p)=>{if(!el(d)||!tl(d))return d;let C=d.props,F=x++,R=F===0,E=F===y-1,k=s??C.variant,$=t?u?{borderTopLeftRadius:R?C.radius:0,borderTopRightRadius:R?C.radius:0,borderBottomLeftRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:{borderTopLeftRadius:R?C.radius:0,borderBottomLeftRadius:R?C.radius:0,borderTopRightRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:void 0,_=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=k==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,M=[$,_,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:k??C.variant,css:[C.css,...M],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:g})};nl.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,rl=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&rl(n)&&(t=true));}),t},Kp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},sl=fe.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:A},y){let x=V(),g=ve(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Kp(x,d),[x,d]),C=!!l&&!h,F=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),E=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),k=useCallback(G=>{let se=x.palette;return (E==="neutral"?x.neutral[G]:se[E]?.[G])??se.primary?.[G]},[E,x.neutral,x.palette]),$=useMemo(()=>E==="neutral"?x.neutral[100]:k(50),[E,k,x.neutral]),_=useMemo(()=>E==="neutral"?x.text.secondary:k(800),[E,k,x.text.secondary]),W=useMemo(()=>E==="neutral"?x.neutral[100]:k(50),[E,k,x.neutral]),S=useMemo(()=>E==="neutral"?x.text.secondary:k(800),[E,k,x.text.secondary]),M=useMemo(()=>E==="neutral"?x.neutral[400]:k(300),[E,k,x.neutral]),I=useMemo(()=>E==="neutral"?x.surface.subtleBg:k(600),[E,k,x.surface.subtleBg]),D=useMemo(()=>(x.text.onColors??{})[E]??(E==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[E,x.text.onColors,x.neutral]),P="transparent",L=useMemo(()=>E==="neutral"?x.text.secondary:k(700)??x.text.primary,[E,k,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!rl(t)&&fe.Children.count(t)===1,[a,c,t]),w=useMemo(()=>o==="filled"?css({backgroundColor:I,color:D,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:S,border:"none",boxShadow:`inset 0 0 0 ${R} ${M}`}):o==="ghost"?css({backgroundColor:P,color:L,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:_,border:"none",boxShadow:"none"}),[I,D,L,W,S,M,$,_,R,o]),b=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(p.gap),padding:o==="ghost"?0:z||t==null?Le(p.soloPadding):`${Le(p.paddingY)} ${Le(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:F,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,minHeight:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,F,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:Le(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Le(p.iconSize):void 0,height:z?Le(p.iconSize):void 0,display:z?"block":void 0}}),[p.fontSize,p.iconSize,z]),B=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Le(p.iconSize),lineHeight:0,"& > svg":{width:Le(p.iconSize),height:Le(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Le(p.gap),marginLeft:z||t==null?0:Le(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Le(p.gap),marginRight:z||t==null?0:Le(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),K=useMemo(()=>css({marginRight:s?0:Le(p.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:h?"not-allowed":"pointer",color:"currentColor",opacity:h?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Le(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[b,w,C?g({color:r??"primary"}):null,A],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":E,"data-size":i,"data-icon-only":z||void 0,children:[a&&jsx("span",{css:[B,H],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[B,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[K,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));sl.displayName="Chip";var qp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gp=fe.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let A=ve(),y=r.neutral,x=r.text,g=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),F=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),E=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),k=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",_=z=>css({width:E,height:E,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:k,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?A({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),M=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let w=Math.max(0,Math.min(o-1,z));C(w),d.current[w]?.focus();},[o]),D=useCallback((z,w)=>{let b=M(w).slice(0,1),v=[...F];v[z]=b,n(v.join("")),b&&z<o-1&&I(z+1);},[F,o,n,I]),P=useCallback((z,w)=>{if(w.key==="Backspace")if(!F[z]&&z>0){let b=[...F];b[z-1]="",n(b.join("")),I(z-1),w.preventDefault();return}else {let b=[...F];b[z]="",n(b.join(""));return}if(w.key==="ArrowLeft"&&z>0){w.preventDefault(),I(z-1);return}if(w.key==="ArrowRight"&&z<o-1){w.preventDefault(),I(z+1);return}if(w.key==="Home"){w.preventDefault(),I(0);return}if(w.key==="End"){w.preventDefault(),I(o-1);return}},[F,o,n,I]),L=useCallback(z=>{let w=M(z.clipboardData.getData("text")).slice(0,o);w&&(n(w),requestAnimationFrame(()=>{let b=Math.min(w.length,o-1);I(b);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,w)=>jsxs(fe.Fragment,{children:[jsx("input",{ref:b=>{d.current[w]=b;},type:"text",inputMode:"text",maxLength:1,value:F[w]||"",placeholder:F[w]?"":R[w]||"",disabled:l,onChange:b=>D(w,b.target.value),onKeyDown:b=>P(w,b),onFocus:()=>C(w),onPaste:w===0?L:void 0,className:"plainframe-ui-code-box",css:_(w===p),"aria-label":`Code character ${w+1}`,tabIndex:w===p?0:-1}),f&&w<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},w))})}),Xp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:A,labelCss:y,helperRowCss:x,helperTextCss:g,css:d})=>{let p=V(),C=useId(),F=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",E=F[R],k=p.neutral,$=p.text,_=t!=null,[W,S]=useState(n),M=_?t:W,I=H=>{_||S(H),o?.(H);},D=Math.max(2,Math.min(h,10)),P=p.spacing.sm,L=qp(l??P)??"0px",z=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(A)?A:A?[A]:[]),w=css({fontSize:E.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??$.primary:i?k[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),b=css({display:"flex",alignItems:"center",justifyContent:"center",gap:L,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:E.helperFont,color:a?p.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),B=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??$.primary:i?k[500]:$.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:w,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:b,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Gp,{value:M||"",onChange:I,len:D,theme:p,sizeKey:R,s:{codeFontSize:E.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:L})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:B,children:c})})]})};var ul=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},zs=e=>{if(!e||typeof e!="object")return false;let t=ul(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some(zs):zs(o)},Jp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=fe.useRef(null),[c,i]=fe.useState(false),l=fe.useCallback(v=>{i(v),o?.(v);},[o]),u=fe.useCallback(()=>l(false),[l]),m=fe.useRef({x:0,y:0}),h=fe.useRef(null),f=fe.useRef(null),T=fe.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let B=Math.round(m.current.x),H=Math.round(m.current.y);v.style.transform=`translate3d(${B}px, ${H}px, 0)`;},[]),A=fe.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);fe.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=fe.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),B=Math.round(m.current.y);return {x:v,y:B,left:v,top:B,right:v,bottom:B,width:0,height:0,toJSON:()=>({x:v,y:B})}}}),[]),x=fe.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=fe.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=fe.useRef(null),p=fe.useRef(null),C=fe.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),F=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=fe.useCallback(()=>{F(),p.current=window.setTimeout(()=>l(false),0);},[F,l]),E=fe.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),k=fe.useCallback((v,B)=>{m.current={x:v,y:B},A(),l(true);},[A,l]),$=typeof t=="function"?t({close:u}):t,_=zs($),W=v=>{if(!fe.isValidElement(v))return v;let B=ul(v),H=v,O=H.props.children,K=O==null?O:Array.isArray(O)?O.map(N=>fe.isValidElement(N)?W(N):N):fe.isValidElement(O)?W(O):O;if(B==="DropdownMenu"){let N=H.props.onOpenChange;return fe.cloneElement(H,{...H.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:K})}if(B==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return fe.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{F(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:K})}return K===O?H:fe.cloneElement(H,{...H.props,children:K})},S=_?W($):$,M=fe.useCallback(v=>{v.preventDefault(),k(v.clientX,v.clientY);},[k]),I=fe.useCallback(v=>{n==="contextmenu"&&M(v);},[n,M]),D=fe.useCallback(v=>{n==="dblclick"&&M(v);},[n,M]),P=fe.useCallback(v=>{n==="click"&&M(v);},[n,M]),L=fe.useCallback(v=>{if(n!=="hover")return;C(),F();let B=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=B.x+(r==="cursor"?s:0),O=B.y+(r==="cursor"?s:0);k(H,O);},0);},[n,r,s,E,k,C,F]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!_&&(m.current={x:v.clientX+s,y:v.clientY+s},A());},[n,c,r,_,s,A]),w=fe.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);fe.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let B=a.current?.matches(":hover"),H=g()?.matches?.(":hover");B||H?F():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,g,F,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let B=a.current?.matches(":hover"),H=g()?.matches?.(":hover");if(B||H?F():R(),r==="center"&&a.current){let O=E();m.current={x:O.x,y:O.y},A();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,E,A,l,F,R,g]),fe.useEffect(()=>()=>{C(),F();},[C,F]);let b=({children:v})=>c?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(m.current.x)}px, ${Math.round(m.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&F(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:D,onClick:P,onMouseEnter:L,onMouseMove:z,onMouseLeave:w,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,_?S:jsx(b,{children:S})]})};var Kn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tm=fe.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:A,className:y,...x},g){let d=V(),{t:p,strokeColor:C,labelTextColor:F,chipSubtleBg:R,chipOutlinedBg:E,outerM:k,padX:$,verticalStrokeMargin:_}=useMemo(()=>{let D=typeof s=="number"?`${s}px`:s,P=d.surface.border,L=d.text.secondary,z=d.surface.subtleBg,w=d.surface.panelBg,b=Kn(h,"10px"),v=o==="horizontal"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0",B=o==="vertical"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0";return {t:D,strokeColor:P,labelTextColor:L,chipSubtleBg:z,chipOutlinedBg:w,outerM:b,padX:v,verticalStrokeMargin:B}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:k,marginRight:k}:{flexDirection:"row",width:a?Kn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:k,marginBottom:k},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,k,a,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:_,marginBottom:_}:{height:p,flex:1}]),[C,m,d.radius.full,d.radius.xs,o,p,_]),M=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:F,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:E,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,F,u,R,E,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,A]}),[S,A]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="right"&&I,!t&&I]})}));var hl=fe.createContext(null),yl=()=>{let e=useContext(hl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},xl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(hl.Provider,{value:u,children:e})},rm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=yl(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:l,...r,children:t})});rm.displayName="DrawerTrigger";var To=0,vl="",Cl="",sm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function am(){if(!(typeof document>"u")){if(To===0){let e=document.body;vl=e.style.overflow||"",Cl=e.style.paddingRight||"";let t=sm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function im(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=vl,e.style.paddingRight=Cl;}}var lm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Rl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:A,css:y,...x},g){let d=V(),{open:p,setOpen:C,lockScroll:F,closeOnEscape:R}=yl();useEffect(()=>{if(!(!F||!p))return am(),()=>im()},[p,F]);let E=useMemo(()=>lm(a,0),[a]),k=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),_=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${E*2}px)`:"100%"),[n,r,s,E]),W=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${E*2}px)`:"100%"),[o,r,s,E]),S=useMemo(()=>{let j=String(d.radius.lg);switch(r){case "left":return `0 ${j} ${j} 0`;case "right":return `${j} 0 0 ${j}`;case "top":return `0 0 ${j} ${j}`;default:return `${j} ${j} 0 0`}},[r,d.radius.lg]),M=useMemo(()=>c??(s==="inset"?d.radius.lg:S),[c,s,d.radius.lg,S]),I=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:E,bottom:r==="top"?void 0:E,left:r==="right"?void 0:E,right:r==="left"?void 0:E}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,E]),D=useRef(null),P=useCallback(()=>{let j=D.current;if(!j)return 1;let J=j.getBoundingClientRect();return k==="x"?J.width:J.height},[k]),L=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(m??280)/1e3,ease:[.22,1,.36,1]}),[m]),w=useMemo(()=>$*1.1,[$]),b=useMemo(()=>k==="x"?{x:`${w*100}%`,y:0}:{y:`${w*100}%`,x:0},[k,w]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:_,height:W,backgroundColor:d.surface.panelBg,borderRadius:M,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:k==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,_,W,d.surface,M,p,k]),B=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,d.surface]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>k==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[k,$,T]),K=useMemo(()=>k==="x"?{left:0,right:0}:{top:0,bottom:0},[k]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((j,J)=>{let le=k==="x"?J.offset.x:J.offset.y,de=k==="x"?J.velocity.x:J.velocity.y,ge=$*le>0,Pe=Math.abs(le)>=P()*N,Te=$*de>f;ge&&(Pe||Te)&&C(false);},[k,$,P,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let j=setTimeout(()=>{let de=D.current;if(!de)return;let ge=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');ge.length>0?ge[0].focus():de.focus();},100),J=de=>{let ge=D.current;if(!ge||!de.target)return;let Pe=de.target;if(!ge.contains(Pe)){de.preventDefault();let Te=ge.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Te.length>0?Te[0].focus():ge.focus();}},le=de=>{de.key==="Escape"&&R&&(de.stopPropagation(),C(false));};return document.addEventListener("focusin",J,true),window.addEventListener("keydown",le),()=>{clearTimeout(j),document.removeEventListener("focusin",J,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,C,R]);let{...se}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:B,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:j=>{D.current=j,typeof g=="function"?g(j):g&&(g.current=j);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",A||""].join(" ").trim(),css:[v,y],drag:k,dragConstraints:K,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...b,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...b,opacity:.98},transition:m?z:L,...se,children:t},"panel")]}):null})});Rl.displayName="DrawerContent";var cm=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),A=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(xl,{open:A,onOpenChange:y,children:jsx(Rl,{ref:l,...i,children:c})})});cm.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),A=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(A)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Tl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wl=fe.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Tl(c),width:c?"100%":void 0,maxHeight:Tl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});wl.displayName="Flex";var Vs=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],A=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(A)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var El={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},wm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Em={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Vn=fe.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:A,style:y,as:x})=>{let g=V(),d=El[e]??El.body,p=x??Em[e]??"span",C=M=>M==null?d.size:typeof M=="number"?M:g?.typography?.sizes?.[M]??M,F=C(o)??C(d.size),R=r??d.weight,E=s??d.lh,k=a??d.ls,$=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",_=f??g.surface.border,W=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:F,fontWeight:R,lineHeight:E,letterSpacing:k,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:_,textDecorationThickness:wm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,A||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Gs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Il=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:A,placeholder:y,blurDataURL:x,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:F,onLoad:R,onError:E,...k},$){let[_,W]=useState(false),[S,M]=useState(false),[I,D]=useState(false),P=V(),L=km(s,P)??"0px",z=i?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:i?P.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${L})`}),b=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${L})`,maxWidth:o?Gs(o):"100%",maxHeight:r?Gs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:_&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:F?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?g:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),B=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:_&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",p||""].join(" ").trim(),css:[w,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:b,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:F,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:B,src:S&&d?d:t,alt:n,srcSet:T,sizes:A,loading:m,decoding:h,fetchPriority:f,onLoad:H=>{D(true),R?.(H);},onError:H=>{M(true),E?.(H);},...k})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Il.displayName="Image";var kl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pm=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Dm=e=>e*Math.PI/180,Nm=(e,t,n)=>{let o=Math.abs(Dm(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Hm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Lm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,Al=[1.02,1.03,1.02],Ml=[1.06,1.08,1.06],Bm={sm:150,md:200,lg:260,xl:340},$m=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function zm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return $m(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Om=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:A="md",label:y,labelAlign:x="center",css:g,className:d,...p}){let C=V(),F=Pm(r)??4/5,R=typeof o=="string"?o:void 0,E=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Bm[s],k=Math.max(1,E/F),_=Children.toArray(t).filter(isValidElement).slice(0,i),W=_.length,S=Hm(n,W),M=_.map((j,J)=>Lm(n,W,J)),I=j=>k*.6*M[j],D=j=>I(j)*F,P=0,L=0;for(let j=0;j<W;j++){let J=D(j),le=I(j),de=Math.max(Math.abs(S.base.ang[j]??0),Math.abs(S.exp.ang[j]??0)),ge=Math.max(Math.abs(S.base.dx[j]??0),Math.abs(S.exp.dx[j]??0)),Pe=Math.max(Math.abs(S.base.dy[j]??0),Math.abs(S.exp.dy[j]??0)),Te=a==="expand"?Ml[j]??1.08:a==="reveal"?Al[j]??1.03:1,Re=Nm(J,le,de),Ie=Re.w*Te,we=Re.h*Te,Q=ge/100*J*Te,ie=Pe/100*le*Te;P=Math.max(P,Ie/2+Q),L=Math.max(L,we/2+ie);}let z=Math.max(1,2*P),w=Math.max(1,2*L),b=Math.min(1,E/z,k/w),v=c===void 0?"pointer":"controlled",B=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:kl(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:kl(k)}),K=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${w}px`,transform:`translate(-50%, -50%) scale(${b})`,transformOrigin:"center center"}),N=zm(A,C)??"0px",U=j=>{let J=n==="fan"?`rotate(${S.base.ang[j]}deg) translate(${S.base.dx[j]}%, ${S.base.dy[j]}%)`:n==="slide"?`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[j]}%)`:`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[j]}deg) translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%)`:n==="slide"?`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[j]}%)`:`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`,de=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,ge=a==="expand"?`${le} scale(${Ml[j]??1.06})`:a==="reveal"?`${J} scale(${Al[j]??1.03})`:`${J} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${de}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&j===1?10:j+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${ge}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${ge}`}})},G=j=>css({width:`${D(j)}px`,aspectRatio:`${F}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":B,css:[H,g],tabIndex:-1,...p,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:K,children:_.map((j,J)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(J),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(J),children:j})},J))})}),y&&jsx(Vn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Pl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Km(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function Vm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var jm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},m){let h=V(),f=ve(),T=Pl[o]??Pl.sm,A=Km(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:A,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?g:n==="ghost"?d:p,R=s&&c>0&&Vm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var Xm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Xs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:c,distance:i})=>{let u=Xm(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,g=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:g,className:d,onTransitionEnd:T(p)})}let A=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:A,onTransitionEnd:T(),children:e})};var Js=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hl=fe.createContext(null),Ll=()=>{let e=useContext(Hl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},tf=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]);useEffect(()=>{if(!i||!s)return;let m=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",m,true),()=>window.removeEventListener("keydown",m,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Hl.Provider,{value:u,children:e})},Bl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Ll(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r,children:t})});Bl.displayName="ModalTrigger";var $l=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:A,...y},x)=>{let g=V(),{open:d,setOpen:p,lockScroll:C}=Ll(),F=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!d)return;R.current=document.activeElement;let I=setTimeout(()=>{let P=F.current;if(!P)return;let L=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');L.length>0?L[0].focus():P.focus();},100),D=P=>{let L=F.current;if(!L||!P.target)return;let z=P.target;if(!L.contains(z)){P.preventDefault();let w=L.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');w.length>0?w[0].focus():L.focus();}};return document.addEventListener("focusin",D,true),()=>{clearTimeout(I),document.removeEventListener("focusin",D,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let E=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),k=typeof g.spacing.sm=="number"?`calc(100% - ${g.spacing.sm*2}px)`:`calc(100% - (${E} + ${E}))`,$=css({width:"100%",height:Js(o),maxWidth:t==="inset"?`min(${Js(n)||"100%"}, ${k})`:Js(n),maxHeight:t==="inset"?k:"100%",margin:t==="inset"?`${E} auto`:void 0}),_=jsx(Wn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",A||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[$,f],ref:I=>{F.current=I,typeof x=="function"?x(I):x&&(x.current=I);},...y,children:e}),W=u==="none"?_:u==="slide"?jsx(Xs,{on:d,direction:m,duration:h,children:_}):u==="grow"?jsx(Vs,{initialScale:.75,on:d,duration:h,children:_}):jsx(Ks,{on:d,duration:h,children:_});if(!a)return jsx(Fragment,{children:W});let S=css({position:"fixed",inset:0,width:"100vw",height:"100vh",margin:0,maxWidth:"100vw",maxHeight:"100vh",display:"flex",alignItems:t==="full"?"flex-start":"center",justifyContent:t==="full"?"flex-start":"center"}),M=css({display:"flex",alignItems:t==="full"?"flex-start":"center",justifyContent:t==="full"?"flex-start":"center",...t==="full"&&{width:"100%",height:"100%"}});return jsx(Is,{on:d,blur:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[S,T].filter(Boolean),contentCss:M,lockScroll:C,children:W})});$l.displayName="ModalContent";var uf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:m,css:h})=>{let f=V(),T=ve(),A=t!==void 0,[y,x]=useState(n),g=Math.max(1,e),d=Ir(A?t:y,1,g),p=useCallback(b=>{let v=Ir(b,1,g);A||x(v),o?.(v);},[A,g,o]),C=useMemo(()=>df({count:g,page:d,siblingCount:r,boundaryCount:s}),[g,d,r,s]),F=f.palette?.primary?.[600],R=f.surface?.border,E=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,k=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",_=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:$,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),W=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:k,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),M=(b=false)=>css([W,T({color:b?"primary":"neutral"}),l==="outlined"?b?{background:F,color:f.text.onColors.primary,borderColor:F}:{background:"transparent",borderColor:R,":hover":{background:E}}:l==="ghost"?b?{background:F,color:f.text.onColors.primary}:{":hover":{background:E}}:b?{background:F,color:f.text.onColors.primary,borderColor:F}:{":hover":{background:E}}]),I=useCallback(()=>p(1),[p]),D=useCallback(()=>p(g),[p,g]),P=useCallback(()=>{d===1?i&&p(g):p(d-1);},[d,i,g,p]),L=useCallback(()=>{d===g?i&&p(1):p(d+1);},[d,i,g,p]),z=a||d===1&&!i,w=a||d===g&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",m||""].join(" ").trim(),css:_,onKeyDown:b=>{a||(b.key==="ArrowLeft"&&(b.preventDefault(),P()),b.key==="ArrowRight"&&(b.preventDefault(),L()),b.key==="Home"&&(b.preventDefault(),I()),b.key==="End"&&(b.preventDefault(),D()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((b,v)=>typeof b=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":b===d?`Page ${b}, current page`:`Go to page ${b}`,"aria-current":b===d?"page":void 0,css:M(b===d),onClick:()=>p(b),children:b},b):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:L,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Ir(e,t,n){return Math.max(t,Math.min(n,e))}function df({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Sr(1,e);let s=Sr(1,Math.min(o,e)),a=Sr(Math.max(e-o+1,o+1),e),c=Ir(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Ir(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=m=>{let h=l[l.length-1];h!==m&&(h==="ellipsis"&&m==="ellipsis"||l.push(m));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Sr(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var gf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,bf=fe.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:gf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var _l=createContext(null),vf=()=>{let e=useContext(_l);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Cf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Rf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),A=h?e:f,y=useRef([]),[x,g]=useState(0),d=()=>g(M=>M+1),p=useCallback(M=>{h||T(M),n?.(M);},[h,n]),C=useCallback(M=>(y.current.push(M),d(),y.current.length-1),[]),F=useCallback((M,I)=>{let D=y.current[M];D&&(y.current[M]={...D,...I},d());},[]),R=()=>y.current.map((M,I)=>({it:M,i:I})).filter(({it:M})=>M.ref&&!M.disabled).map(({i:M})=>M),E=useCallback((M,I)=>{let D=R();if(!D.length)return;let P=Math.max(0,D.indexOf(M)),L=D[(P+I+D.length)%D.length],z=y.current[L]?.ref;if(z){z.focus();let w=y.current[L]?.value;w!==void 0&&p(w);}},[p]),k=useCallback(M=>{let I=R();if(!I.length)return;let D=M==="first"?I[0]:I[I.length-1],P=y.current[D]?.ref;if(P){P.focus();let L=y.current[D]?.value;L!==void 0&&p(L);}},[p]),$=useMemo(()=>{let M=y.current.filter(D=>D.ref&&!D.disabled);return M.length?M.some(D=>D.value===A)?A:M[0]?.value:void 0},[A,x]),_=useMemo(()=>({selected:A,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:F,moveFocusBy:E,moveToEdge:k,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[A,p,o,r,s,a,C,F,E,k,$,m,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(_l.Provider,{value:_,children:i})})})},Tf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:A,anchorOrigin:y}=vf(),x=c||t,g=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],F=C(600),R=C(100),E=f.neutral[300],k=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],_="transparent",W=k,S=$;T==="soft"?(_=R,W=null,S=F):T==="outlined"?(_=C(50),W=k,S=F):(_=f.neutral[200],W="transparent",S=$),g&&(T==="outlined"?(_=R,W=k,S=F):T==="filled"?(_=F,W=null,S=$):(_=R,W=null,S=F));let M=T==="filled"?E:f.palette.primary[100],I=useRef(null),D=useRef(-1);useEffect(()=>{D.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(D.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let P=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||g?{}:{background:M,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${k}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),L=css({width:p,height:p,minWidth:p,minHeight:p,borderRadius:f.radius.full,background:_,boxShadow:W?`inset 0 0 0 ${f.componentHeights.border} ${W}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),z=css({width:g?p*.45:0,height:g?p*.45:0,borderRadius:f.radius.full,background:g?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),w=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),b=(()=>{let O=y.horizontal,K=y.vertical;return K==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:K==="top"?1:3}})(),B=!x&&A===e?0:-1,H=ve();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":x||void 0,disabled:x,tabIndex:B,onClick:()=>{x||a(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(D.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(D.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[P,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[L,css({gridColumn:b.col,gridRow:b.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:w,children:o})]})};var kf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],A=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:A,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var qn=e=>null;qn.displayName="SelectItem";var Mo=(...e)=>e.filter(Boolean).flat(),Ff=e=>{if(e.type===qn)return true;let t=e.props;return t?.type===qn||t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__===qn},Pf=e=>{if(e.type===qn)return e.props;let t=e.props||{},{type:n,__EMOTION_TYPE_PLEASE_DO_NOT_USE__:o,...r}=t;return r};function ea(e,t){if(e==null||typeof e=="boolean")return;if(Array.isArray(e)){for(let o of e)ea(o,t);return}if(!fe.isValidElement(e))return;let n=e;if(Ff(n)){t.push(n);return}if(n.type===fe.Fragment){ea(n.props.children,t);return}}var Vl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:A=280,wrapperCss:y,labelCss:x,triggerCss:g,menuCss:d,optionCss:p,children:C,className:F,menuSize:R="md",triggerRender:E})=>{let k=V(),$=ve(),_=fe.useId(),W=`${_}-label`,S=`${_}-menu`,M={sm:{minHeight:k.componentHeights.sm,radius:k.radius.sm},md:{minHeight:k.componentHeights.md,radius:k.radius.md},lg:{minHeight:k.componentHeights.lg,radius:k.radius.md}},I=M[l]||M.md,[D,P]=fe.useState(false),L=Q=>P(!!Q),z=typeof e<"u",w=c||Array.isArray(e)||Array.isArray(t),[b,v]=fe.useState(()=>typeof t<"u"?t:w?[]:void 0),B=z?e:b,H=Q=>{z||v(Q),n?.(Q);},O=[];ea(C,O);let K=O.map((Q,ie)=>{let me=Pf(Q),Y=typeof me.children=="string"||typeof me.children=="number"?String(me.children):void 0,xe=typeof me.value=="string"||typeof me.value=="number"?String(me.value):void 0,ee=me.label??Y??xe;return {key:Q.key??ie,value:me.value,startIcon:me.startIcon,endIcon:me.endIcon,node:me.children,triggerLabel:ee,itemCss:me.css,itemClassName:me.className}}),N=Q=>w?(Array.isArray(B)?B:[]).some(me=>Object.is(me,Q)):Object.is(B,Q),U=fe.useMemo(()=>{if(w){let ie=Array.isArray(B)?B:[];return K.filter(Y=>ie.some(xe=>Object.is(xe,Y.value))).map(Y=>Y.triggerLabel??Y.node)}let Q=K.find(ie=>Object.is(ie.value,B));if(Q)return Q.triggerLabel??Q.node},[B,w,K]),G=Q=>{i||(Object.is(Q,B)||H(Q),L(false));},se=Q=>{if(i)return;let ie=Array.isArray(B)?B:[],Y=ie.some(xe=>Object.is(xe,Q))?ie.filter(xe=>!Object.is(xe,Q)):[...ie,Q];H(Y);},j={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},J={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:k.typography.sizes.sm,padding:`0 ${typeof k.spacing.sm=="number"?`${k.spacing.sm}px`:k.spacing.sm} 0 ${typeof k.spacing.md=="number"?`${k.spacing.md}px`:k.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:k.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:k.surface.subtleBg}:u==="outlined"?{background:k.surface.panelBg,border:`1px solid ${k.surface.border}`}:{background:"transparent"},de={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},ge={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Pe={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Te=jsx(ChevronsUpDown,{size:16,css:css({color:k.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Re=()=>{if(E)return E(U);if(Array.isArray(U)){let ie=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),me=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:me,children:me})]})}let Q=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:typeof Q=="string"?Q:void 0,children:Q})]})},Ie={left:"start",center:"center",right:"end"},we=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),L(true));};return jsxs("div",{css:Mo(j,y),className:["plainframe-ui-select-wrapper",F||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Mo({marginBottom:6,fontSize:k.typography.sizes.sm,fontWeight:500,color:k.text.secondary},x),children:o}),jsxs(Ln,{size:R,open:D,onOpenChange:L,children:[jsx(Bn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":D||void 0,"aria-controls":S,"aria-labelledby":o?W:void 0,onKeyDown:we,onClick:()=>L(!D),className:"plainframe-ui-select-trigger",css:Mo(css(J),css(le),g,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(de),children:Re()}),a??Te]})}),jsx(yn,{id:S,gap:"xs",align:Ie[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Mo({maxHeight:typeof A=="number"?`${A}px`:A,overflowY:"auto"},d),children:K.map((Q,ie)=>{let me=N(Q.value);return jsx(Ht,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:me,disabled:i,closeOnSelect:!w,onSelect:()=>w?se(Q.value):G(Q.value),css:Mo(p,Q.itemCss),className:["plainframe-ui-select-option",Q.itemClassName||""].join(" ").trim(),children:Q.node},Q.key??ie)})})]})]})};Vl.displayName="Select";var ta=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Nf=keyframes`
|
|
14
14
|
0% { background-position: -200% 0; }
|
|
15
15
|
100% { background-position: 200% 0; }
|
|
16
16
|
`,Hf=keyframes`
|