plainframe-ui 0.1.90 → 0.1.91
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 +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,14 +10,14 @@ ${b}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),P()
|
|
|
10
10
|
0% { left: -200%; right: 100%; }
|
|
11
11
|
60% { left: 107%; right: -8%; }
|
|
12
12
|
100% { left: 107%; right: -8%; }
|
|
13
|
-
`,Yc=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("),Jc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Zc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Yc(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]&&Jc.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",M=Math.max(o-n,1),y=T?Ya(t,n,o):void 0,x=T?(y-n)/M*100:void 0,g=Zc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(eu,{size:s,active:g,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Qc,{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})}),Qc=({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]:[]]),M=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,Xa):Xa,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:`${Gc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...g,left:"-200%",right:"100%",animation:`${Xc} 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:M,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})]})})})},eu=({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,M=`${(o?Ya((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:M,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":`${qc} ${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 Qa=createContext(null),ei=()=>{let e=useContext(Qa);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},uu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),du=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),pu=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}}),ti=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(),M=useId(),y=useMemo(()=>{let A={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)?A[c]:A.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],F=I?.[300]??g[300],H=I?.[600]??I?.[500]??g[600],z=I?.[700]??H,w=I?.[800]??f.text?.primary??"#000",b=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:H,fg:b,border:void 0,iconColor:b}:n==="outlined"?{bg:D,fg:w,border:`1px solid ${F}`,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]),P=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(()=>[du,{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(()=>[pu,{color:d.fg}],[d.fg]),_=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:M}),[d.fg,d.iconColor,y,T,M]),W=fe.Children.toArray(u).some(A=>fe.isValidElement(A)&&A.type===is),S=fe.Children.toArray(u).some(A=>fe.isValidElement(A)&&A.type===ls);return jsx(Qa.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?M:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[P,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:uu,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})})})]})})});ti.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=ei(),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}=ei(),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 oi(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:M,togglePasswordVisible:y=false,showClear:x,type:g="text",step:d,focusRingMode:p="always",className:C,wrapperCss:P,inputCss:R,labelCss:E,helperRowCss:k,helperTextCss:$,startIconCss:_,endIconCss:W,css:S,onBlur:A,onFocus:I,onKeyDown:D,autoFocus:F,name:H,id:z,tabIndex:w,autoComplete:b,readOnly:v,required:B,maxLength:L,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.surface.panelBg??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(P),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,xe,oe,f,i,P,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}L&&Ee.length>L||Ie(Ee);},[le,L,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:oi(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=M?jsx("span",{css:re,children:oi(M,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,M,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:L,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:A,onFocus:I,onKeyDown:D,autoFocus:F,name:H,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),li=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,M]=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:M}),[T]),P=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 F=window.getComputedStyle(D);return F.display!=="none"&&F.visibility!=="hidden"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),M(false);},[]),k=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(k.current){k.current=false;return}let D=I.currentTarget,F=R(D);F.length>0&&(M(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")),F[0].setAttribute("data-highlighted",""),F[0].focus({preventScroll:true}));},[R]),_=useCallback(I=>{let D=I.currentTarget,F=R(D);if(F.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")),M(false),D.tabIndex=-1,requestAnimationFrame(()=>{D.tabIndex=0,k.current=false;});return}let H=D.querySelector("[data-highlighted]"),z=D.querySelector("[data-hovered]"),w=H||z,b=w?F.indexOf(w):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),M(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")),b===-1&&(b=I.key==="ArrowDown"?-1:F.length);let v=I.key==="ArrowDown"?1:-1,B=(b+v+F.length)%F.length;F[B].setAttribute("data-highlighted",""),F[B].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),M(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")),F[0].setAttribute("data-highlighted",""),F[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),M(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")),F[F.length-1].setAttribute("data-highlighted",""),F[F.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")),M(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]),A=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:P,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:A,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})]})})})})})});li.displayName="Menu";var ui=createContext(null),or=()=>{let e=useContext(ui);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Wu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)Wu(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,_u=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}},Ku=({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);};_u(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],P=document.activeElement;x.shiftKey&&P===p?(x.preventDefault(),C.focus()):!x.shiftKey&&P===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let M=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ui.Provider,{value:M,children:a})},di=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:M=>{M.stopPropagation(),s(!r),m.onClick?.(M);}}:{onMouseEnter:M=>{l(),r||s(true),m.onMouseEnter?.(M);},onMouseLeave:M=>{i(),m.onMouseLeave?.(M);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let M=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[M,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});di.displayName="PopoverTrigger";var pi=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})});pi.displayName="PopoverAnchor";function Vu(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 mi=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:M,setOpen:y,triggerOn:x,referenceRef:g,scheduleClose:d,cancelClose:p}=or(),C=V(),P=Vu(e),{refs:R,x:E,y:k,strategy:$,context:_}=useFloating({open:M,onOpenChange:y,whileElementsMounted:autoUpdate,placement:P,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:A}=useInteractions([W,S]),[I]=_.placement.split("-"),D=I,F=`${D==="left"?"right":D==="right"?"left":"center"} ${D==="top"?"bottom":D==="bottom"?"top":"center"}`,H=8,z=D==="top"?{y:H}:D==="bottom"?{y:-H}:D==="left"?{x:H}:{x:-H},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}`,L=tr(i,C.spacing),O=tr(l,C.spacing),K=tr(u,C.spacing),N={};L&&(N.padding=L),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:F,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",...A({...f,ref:le,...J}),...w,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:M?de:null})})});mi.displayName="PopoverContent";var ju=()=>{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(),M=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,[P,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,A=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:D,thumb:F}=k,H=(D-F)/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:H,left:C?I-F-H:H,width:F,height:F,backgroundColor:A,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:P?"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,M({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 Qu=(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:M,...y},x)=>{let g=V(),d=ve(),p=typeof e=="boolean",[C,P]=useState(t),R=p?e:C,E=r==="sm"||r==="lg"?r:"md",k=useMemo(()=>Qu(g,E),[g,E]),{checkedBg:$,checkColor:_,borderCol:W,hoverBg:S,gapPx:A}=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:A,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,A,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"}),[]),F=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]),H=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:H.w,height:H.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"}}),[_,H.h,H.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):P(O=>{let K=!O;return n?.(K),K}));},[o,p,R,n]),L=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",M||""].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:L,children:[jsx("input",{type:"checkbox",checked:R,onChange:B,disabled:o,css:D,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[F,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 nd=()=>useContext(gn),od=()=>useContext(ro),rd=()=>useContext(cr),mn=null,yi=(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:M,...y},x){let g=nd(),d=rd(),p=lr(),C=uo(),P=od(),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,A=useContext(er),I=A==="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]),F=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"}}),[]),H=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=(L,O)=>{let K=L.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(L),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:P?.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:L=>{if(g&&!M){let O=g.listRef.current;L&&(T!=null?O[T]=L:O.includes(L)||O.push(L));}typeof x=="function"?x(L):x&&"current"in x&&(x.current=L);},onMouseMove:L=>{if(L.currentTarget.hasAttribute("data-hovered"))return;let O=!!L.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&yi(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");}),L.currentTarget.setAttribute("data-hovered","");let K=L.currentTarget.closest("[data-menu-id]")||L.currentTarget.closest('[role="menu"]');K?.hasAttribute("data-keyboard-nav")&&K.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!P?.allItemsTabbable&&L.currentTarget.focus({preventScroll:true});},onMouseEnter:L=>{if($)lo();else {let N=!!L.currentTarget.closest("[data-submenu-content]");p&&!N&&yi(p.closeAllSubMenus);}L.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");})),L.currentTarget.setAttribute("data-hovered","");let K=L.currentTarget.closest("[data-menu-id]")||L.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&&!P?.allItemsTabbable&&L.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:L=>{if(t)return;let O=L.currentTarget;if(L.key==="Tab"&&g&&!P?.allItemsTabbable){L.preventDefault();return}if(L.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(L.key==="Enter"||L.key===" "||L.key==="ArrowRight"){$||L.key!=="ArrowRight"&&(L.preventDefault(),L.stopPropagation(),b());return}if(L.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){L.preventDefault(),L.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(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(L.key==="ArrowDown"){L.preventDefault(),L.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(L.key==="ArrowUp"){L.preventDefault(),L.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(L.key==="Home"){L.preventDefault(),L.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(L.key==="End"){L.preventDefault(),L.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:L=>{t||(L.currentTarget.removeAttribute("data-highlighted"),b());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:F,children:l}),a,(f!=null||_||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:H,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})})]})]})}),vi=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,M=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(M),l.current?.(M);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(vi.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(vi),M=!!T&&r!==void 0,y=!M&&t!==void 0,[x,g]=useState(()=>M?T.values.some(W=>Object.is(W,r)):!!n),d=M?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),P=!!useContext(Tt),R=()=>{if(!c)if(M)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:P?-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 Ci=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,[M,y]=useState(!!n),x=T?!!t:M,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}),P=()=>{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:P,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})})]})});Ci.displayName="MenuSwitchItem";var Ri=fe.createContext(null),Ti=({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(Ri.Provider,{value:i,children:o})};Ti.displayName="MenuRadioGroup";var sd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(Ri),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,M=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(M,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 ad=({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 Ei=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,vd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function Cd(){if(!(typeof document>"u")){if(po===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=vd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function Rd(){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),Td=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Si=createContext(null),lr=()=>useContext(Si),Ii=createContext(false),wd=()=>useContext(Ii),ro=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Ed(){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 Sd=()=>Td()?.activeIndex??null,ki=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(A=>{A&&Ei(h.current),e===void 0&&i(A),n?.(A);},[e,n]),m=useRef(`pfui-menu-${++ki}`),h=useRef(null),f=useRef([]),T=useRef(null),[M,y]=useState(null),[x,g]=useState(false);useEffect(()=>{l||(y(null),f.current=[],g(false));},[l]);let d=useRef(null),p=useCallback((A,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let D=I??20;d.current=window.setTimeout(()=>u(A),D);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return Cd(),()=>Rd()},[l,r]);let P=xs(),[R]=useState(()=>P??Ed()),E=useRef(new Set),k=useMemo(()=>({registerSubMenu:A=>(E.current.add(A),()=>E.current.delete(A)),closeAllSubMenus:()=>{E.current.forEach(A=>A());}}),[]),$=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:M,setActiveIndex:y}),[M,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(Si.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:M,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,P=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(F=>{let H=_();requestAnimationFrame(()=>H[F]?.focus());},[_]),S=useCallback(F=>{if(F.key==="Tab"&&c){F.preventDefault(),x?.setIsKeyboardNav(true);let H=M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=H.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(F.key==="ArrowRight"&&c){let H=document.querySelector("[data-subtrigger][data-hovered]");if(H){F.preventDefault(),F.stopPropagation(),x?.setIsKeyboardNav(true),H.removeAttribute("data-hovered"),H.setAttribute("data-highlighted",""),H.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});H.dispatchEvent(z);});return}}if(F.key==="ArrowDown"||F.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){F.preventDefault(),i(true),requestAnimationFrame(()=>{let H=y?document.querySelector(`[data-menu-id="${y}"]`):M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=Array.from(H.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!==H)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let w=F.key==="ArrowDown"?0:z.length-1;h(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),C?.(F),R?.(F);return}if(c){F.preventDefault();let H=document.querySelectorAll("[data-hovered]");for(let w of Array.from(H))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"}),L=B.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),L!==-1&&B.length>0){let O=F.key==="ArrowDown"?1:-1,K=(L+O+B.length)%B.length;B[K]?.setAttribute("data-highlighted",""),B[K]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):M?.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=F.key==="ArrowDown"?-1:w.length);let L=F.key==="ArrowDown"?1:-1,O=(B+L+w.length)%w.length;h(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}C?.(F),R?.(F);return}}if((F.key==="Enter"||F.key===" ")&&!c){F.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let H=y?document.querySelector(`[data-menu-id="${y}"]`):M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=Array.from(H.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!==H)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?.(F),R?.(F);return}C?.(F),R?.(F);},[c,i,h,C,R,_,W,m,x,y,M,g]),A=useCallback(F=>{l==="click"&&((F.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 L="getAttribute"in v?v.getAttribute("role"):null;return L==="textbox"||L==="combobox"})||(F.stopPropagation(),i(!c))),P?.(F),E?.(F);},[l,c,i,P,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 F=p.props,H=F.css,z=typeof F.className=="string"?F.className:void 0,w=typeof F.tabIndex=="number"?F.tabIndex:0,b={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[H,D,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:A,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:A,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:M,exitPlacement:y,animateOnBusClose:x=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...P},R)=>{let{open:E,setOpen:k,referenceRef:$,clearSubmenuHover:_,setActiveIndex:W,floatingRef:S,menuId:A}=pr(),I=V(),D=xs(),F=uo();useEffect(()=>{if(!D)return;let X=D.registerCloser(()=>k(false));return ()=>{X&&X();}},[D,k]);let H=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:L,x:O,y:K,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:k,placement:b,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:H??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?L.setReference(B):$.current&&L.setReference($.current);},[L,B,$]),useEffect(()=>{if(!E)return;let X=B||$.current,re=L.floating.current;if(!(!X||!re))return autoUpdate(X,re,G)},[E,B,$,L,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=L.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,$,L.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(M,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(),F?.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();}}},[F,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),F?.isKeyboardNav&&F.setIsKeyboardNav(false);},[F]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),F?.isKeyboardNav&&F.setIsKeyboardNav(false);},[F]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...P,ref:ys(R,L.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":A,"data-keyboard-nav":F?.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 Ai=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=wd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&Ei(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,A)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=A??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 M=lr();useEffect(()=>{if(!M)return;let S=()=>{T(),u(false);};return M.registerSubMenu(S)},[M,u,T]);let y=useRef(`pfui-submenu-${++ki}`),x=useRef(null),g=useRef([]),d=useRef(null),[p,C]=useState(null),[P,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:P,setIsKeyboardNav:R}),[P]);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 A=S.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Ii.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})})})})})};Ai.displayName="DropdownMenuSub";var Mi=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(),M=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:P,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 A=S.currentTarget,I=D=>{M?.setIsKeyboardNav(true);let F=A.closest("[data-menu-id]");if(!F)return;F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let H=Array.from(F.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]")!==F)return false;let B=window.getComputedStyle(v);return B.display!=="none"&&B.visibility!=="hidden"});if(!H.length)return;let z=H.indexOf(A),w=z>=0?z:0,b=D==="next"?(w+1)%H.length:(w-1+H.length)%H.length;H[b]?.setAttribute("data-highlighted",""),H[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(),M?.setIsKeyboardNav(true);let D=S.currentTarget;i(true),requestAnimationFrame(()=>{let F=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(F){F.setAttribute("data-keyboard-nav",""),D.removeAttribute("data-highlighted"),D.removeAttribute("data-hovered");let H=F.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])');H&&(H.setAttribute("data-highlighted",""),H.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let D=A.closest("[data-menu-id]");D&&D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(F=>F.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(F=>F.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),M&&M.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),P?.(S);},[c,i,p,P,u,M,T]),W=l==="hover"?{onMouseEnter:S=>{let A=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let I=A.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),M&&M.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let A=S.currentTarget;lo(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),A.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,A=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,D={ref:k,tabIndex:I,className:[A,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:F=>{if(F.target.hasAttribute("data-highlighted")){let H=F.target.closest("[data-menu-id]");H&&!H.hasAttribute("data-keyboard-nav")&&(H.setAttribute("data-keyboard-nav",""),M&&M.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(F);},...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 A=S.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),M&&M.setIsKeyboardNav(true));}},...W,...E,children:t})});Mi.displayName="DropdownMenuSubTrigger";var Fi=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);}})});Fi.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ad=css({display:"inline"}),Di=css({display:"inline",fontWeight:700}),Md=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Fd=css({display:"flex",alignItems:"center",gap:4}),Pd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Ni=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Dd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Nd=()=>{},Hd=e=>e,Ld=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Bd=e=>{e.preventDefault(),e.stopPropagation();},$d=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},zd=e=>{e.preventDefault(),e.stopPropagation();},Hi=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});Hi.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]),M=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Pd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ni,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Dd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ni,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:M},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:M},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 Li=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:M,disabled:y=false,error:x=false,showClear:g=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:P=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:k=true,blurOnSelect:$=false,freeSolo:_=false,customValueLabel:W=false,maxHeight:S,maxItems:A,noResultsText:I="No Items Found",highlightTypedValue:D,typedValueHighlightCss:F,showNoResults:H=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:b,loading:v,loadingText:B="Loading\u2026",debounceMs:L=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,L)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,b,L]);let Qn=useMemo(()=>{let q=mr(ie);return q?xt.some(ne=>mr(ne.title??ne.value)===q):false},[xt,ie]),ca=_&&!!W&&ie.trim().length>0&&!Qn,cc=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]),ua=useMemo(()=>{if(ca){let q=ie.trim();return [...$r,{value:q,title:cc(q),__pfui_free__:true}]}return $r},[$r,ca,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of ua){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof A=="number"?Math.max(0,A):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},[ua,A]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),Ho=kn.length>0,zr=!Ho&&!!H&&!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]),da=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,$]),uc=useCallback(q=>{if(y)return;me(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):_&&nt(null)),!Y&&!ne&&P&&!oe&&De(true);},[O,Y,P,oe,De,y,_,t]),it=Ld,pa=Nd,dc=Hd,ma=useMemo(()=>F?[Di,F]:Di,[F]),pc=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:Ad,children:[q.slice(0,he),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:ma,children:q.slice(he,he+ne.length)}),q.slice(he+ne.length)]})},[ie,ma]),zo=D?pc:dc,mc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Bd,Wo=$d,fc=useCallback(q=>{Ne.current=q;},[]),fa=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]),gc=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),fa(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?(da(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,fa,da,$o,De,y]),bc=useCallback(()=>{y||Z.current||C&&Lo&&(ce.current=Date.now(),Y||De(true));},[Y,C,Lo,De,y]),hc=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]),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=>{q.push(jsx(vs,{item:he,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:pa,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,pa,Wo,Oo,Q]),ba=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]),yc=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?ga():ba(),[Ee,zr,Vt.length,it,B,I,O,ga,ba]),sn=oe?false:y||!Je&&!Ho&&!H,ha=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]),ya=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:[ya,j],"aria-disabled":sn||void 0,onMouseDown:zd,onClick:ha,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ya,j,sn,ha,G]),xc=useMemo(()=>T&&_o?jsxs("span",{css:Fd,children:[T,_o]}):T??_o,[T,_o]),vc=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:[mc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Hi,{onCapture:fc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:Md,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:uc,onKeyDown:gc,onFocus:bc,onBlur:hc,onSurfaceClick:vc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:xc,size:M,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:yc})]})})});Li.displayName="Autocomplete";var Vd=["sm","md","lg"],jd=(e,t)=>typeof e=="number"?e:Vd.includes(e)?t.componentHeights[e]:t.componentHeights.md,Ud=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},qd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Gd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Bi=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=jd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,M=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Ud(u,o),g=qd(u,o),d=Gd(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"}),P=css({fontSize:M,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:P,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:d})})}));Bi.displayName="Avatar";var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=({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 $i(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),M=typeof t=="number"&&t>=0,y=M&&T.length>t?T.slice(0,t):T,x=M&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=$i(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"}),P=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:P,children:R})},E);let k=R,$=k.props?.css,_=$==null?P:[P,$],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 Wi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,ep=(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"}},tp=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",np=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",op=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",rp=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),sp=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:M,className:y,badgeClassName:x,css:g,badgeCss:d,offsetX:p,offsetY:C})=>{let P=V(),R=s==="dot",E=f??(R?8:17),k=r??(R?0:10),{scale:$,onKey:_}=ep(P,t),W=tp($),S=P.text?.onColors||{},A=np(P,S,_,n),I=op(e,a,s),D=rp(i,s,e,c),F=css({position:"relative",display:"inline-block"}),H=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Wi(p??H),w=Wi(C??H),b=l.vertical||"top",v=l.horizontal||"right",B={},L="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%",L="-50%"):v==="right"?(B.right=z,L="45%"):(B.left=z,L="-45%");let K=D?1:.8,N=css({minWidth:R?E:E/2,height:E,background:W,color:A,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 ${M??P.surface?.appBg}`}:{},opacity:D?1:0,transform:`translate(${L}, ${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:[F,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,...M})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[g,d]=useState(e),[p,C]=useState(e),P=useRef(null),R=useRef(null),E=useRef(null);useEffect(()=>(P.current&&(clearTimeout(P.current),P.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),P.current=setTimeout(()=>{d(false),P.current=null;},u)),()=>{P.current&&(clearTimeout(P.current),P.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let A=document.body,I=A.style.overflow,D=A.style.paddingRight,F=window.innerWidth-document.documentElement.clientWidth,H=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",F>0&&(A.style.paddingRight=`${H+F}px`),()=>{A.style.overflow=I,A.style.paddingRight=D;}},[e,T]),useEffect(()=>{if(!p||!t)return;let A=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[p,t]);let k=A=>{if(!p||!t)return;let I=E.current?.querySelector('[role="dialog"]');if(I){let F=I.getBoundingClientRect(),H=A.clientX,z=A.clientY;(H<F.left||H>F.right||z<F.top||z>F.bottom)&&t();return}let D=A.target;D&&(E.current?.contains(D)||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,...M,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 up(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 dp=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}=up(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]),M=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 P=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:P,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,P=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",P?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,P,d.disabled),o,C?r:s,P?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:[M,c],children:t}),P?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,ji=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)&&ji(n)&&(t=true));}),t};function gp(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 bp(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 Ui=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:M,...y},x)=>{let g=V(),d=ve(),p=useMemo(()=>gp(g,t),[g,t]),C=useMemo(()=>bp(g,e),[g,e]),P=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!ji(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(()=>P?"center":l??"center",[P,l]),W=!!c&&_==="center",S=!!c&&_==="start",A=!!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]),F=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),H=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(P&&!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}`}),[P,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]),L=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(P)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:L(!S),children:G?E||n:null}),jsx("span",{css:L(!!S),children:$})]})},[P,n,S,B,L,E,c,$]),N=useMemo(()=>()=>{if(P)return null;let G=!!o;return !G&&!A?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:L(!A),children:G?k||o:null}),jsx("span",{css:L(!!A),children:$})]})},[P,o,A,B,L,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"}),F,H,z,M],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:P?c?$:ks(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));Ui.displayName="Button";var Cr=e=>isValidElement(e),hp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>hp(e)===t,Xi=e=>Ds(e,"ButtonGroup"),Yi=e=>Ds(e,"DropdownMenu"),Fs=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,yp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,xp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ps=(e,t)=>{if(!Cr(e))return null;if(Xi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ps(t?n[0]:n[n.length-1],t):null}if(Yi(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},Gi=(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 xp(o)},Ji=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,...M},y){let x=V(),g=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:g,p=o==="vertical",C=yp(x.componentHeights.border,1),P=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,A=false,I=[];for(let D of $){if(!Cr(D)){I.push(D);continue}let F=S===0,H=S===W-1,z=D.props??{},w=z.disabled??s,b=z.size??a,v=0,B=0,L=0,O=0;n&&(p?(v=F?R?0:d:0,B=F?E?0:d:0,O=H?R?0:d:0,L=H?E?0:d:0):(v=F?R?0:d:0,O=F?R?0:d:0,B=H?E?0:d:0,L=H?E?0:d:0));let K=Gi(D,"left"),N=Gi(D,"right"),se=n&&!F&&!(A&&K)&&!(A||K)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${P}`}):null,j=n&&!F&&A&&K?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(B),borderBottomRightRadius:On(L),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Yi(D)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=Xi(D)&&n?{__clipLeft:!F,__clipRight:!H}:{},Q=cloneElement(D,{...z,disabled:w,size:b,className:Ie,css:[Re,de],...we});I.push(Q),A=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),A=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],...M,children:I})}));Ji.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ep=(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)}}},Sp=(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)}}},Ip=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},kp=(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:M,role:y,tabIndex:x,...g},d){let p=V(),C=p.surface??{},[P,R]=useState(!!u),E=l!=null,k=E?!!l:P,$=useMemo(()=>Ip(o,p),[o,p]),_=useMemo(()=>kp(o,p,$),[o,p,$]),W=_,S=useMemo(()=>Ep(r,p),[r,p]),A=useMemo(()=>Sp(s,p),[s,p]),I=!!c||!!i,D=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:A,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,A,o,p.componentHeights,C.border,h,f,I,_,W]),F=useCallback(()=>{if(!i)return;let b=!k;E||R(b),m?.(b);},[E,m,i,k]),H=useCallback(b=>{i&&F(),T?.(b);},[i,F,T]),z=useCallback(b=>{i&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),F()),M?.(b);},[i,F,M]),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:H,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...g,children:t})}));Wn.displayName="Container";var Mp=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 Mp(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 Fp(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 Zi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Qi=fe.createContext("horizontal"),Bs=()=>fe.useContext(Qi),el=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:M,...y},x)=>{let g=V(),d=ve(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Fp(h,g),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Qi.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:M,tabIndex:M?0:void 0,...y,children:e})})}));el.displayName="Card";var 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",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})}),Dp=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})}),Np=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})}),Hp=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:Zi(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})}),Lp=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:Zi(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 nl=e=>isValidElement(e),Op=e=>nl(e)?e.type?.displayName||e.type?.name:void 0,tl=e=>Op(e)==="Card",Wp=e=>typeof e=="number"?`${e}px`:e,ol=({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"?Wp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(tl).length,x=0,g=T.map((d,p)=>{if(!tl(d)||!nl(d))return d;let C=d.props,P=x++,R=P===0,E=P===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,A=[$,_,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,...A],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})};ol.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,sl=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)&&sl(n)&&(t=true));}),t},jp=(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"},al=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:M},y){let x=V(),g=ve(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>jp(x,d),[x,d]),C=!!l&&!h,P=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]),A=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]),F="transparent",H=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&&!sl(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} ${A}`}):o==="ghost"?css({backgroundColor:F,color:H,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:_,border:"none",boxShadow:"none"}),[I,D,H,W,S,A,$,_,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:P,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,P,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]),L=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,M],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,L],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})]})}));al.displayName="Chip";var Xp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yp=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 M=ve(),y=r.neutral,x=r.text,g=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),P=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.surface.panelBg??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?M({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"}),A=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=A(w).slice(0,1),v=[...P];v[z]=b,n(v.join("")),b&&z<o-1&&I(z+1);},[P,o,n,I]),F=useCallback((z,w)=>{if(w.key==="Backspace")if(!P[z]&&z>0){let b=[...P];b[z-1]="",n(b.join("")),I(z-1),w.preventDefault();return}else {let b=[...P];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}},[P,o,n,I]),H=useCallback(z=>{let w=A(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:P[w]||"",placeholder:P[w]?"":R[w]||"",disabled:l,onChange:b=>D(w,b.target.value),onKeyDown:b=>F(w,b),onFocus:()=>C(w),onPaste:w===0?H: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))})}),Jp=({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:M,labelCss:y,helperRowCss:x,helperTextCss:g,css:d})=>{let p=V(),C=useId(),P=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=P[R],k=p.neutral,$=p.text,_=t!=null,[W,S]=useState(n),A=_?t:W,I=L=>{_||S(L),o?.(L);},D=Math.max(2,Math.min(h,10)),F=p.spacing.sm,H=Xp(l??F)??"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(M)?M:M?[M]:[]),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:H,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(Yp,{value:A||"",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:H})}),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 dl=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=dl(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)},Qp=({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),L=Math.round(m.current.y);v.style.transform=`translate3d(${B}px, ${L}px, 0)`;},[]),M=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;},[]),P=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=fe.useCallback(()=>{P(),p.current=window.setTimeout(()=>l(false),0);},[P,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},M(),l(true);},[M,l]),$=typeof t=="function"?t({close:u}):t,_=zs($),W=v=>{if(!fe.isValidElement(v))return v;let B=dl(v),L=v,O=L.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=L.props.onOpenChange;return fe.cloneElement(L,{...L.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:K})}if(B==="DropdownMenuContent"){let N=L.props.onMouseEnter,U=L.props.onMouseLeave;return fe.cloneElement(L,{...L.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{P(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:K})}return K===O?L:fe.cloneElement(L,{...L.props,children:K})},S=_?W($):$,A=fe.useCallback(v=>{v.preventDefault(),k(v.clientX,v.clientY);},[k]),I=fe.useCallback(v=>{n==="contextmenu"&&A(v);},[n,A]),D=fe.useCallback(v=>{n==="dblclick"&&A(v);},[n,A]),F=fe.useCallback(v=>{n==="click"&&A(v);},[n,A]),H=fe.useCallback(v=>{if(n!=="hover")return;C(),P();let B=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let L=B.x+(r==="cursor"?s:0),O=B.y+(r==="cursor"?s:0);k(L,O);},0);},[n,r,s,E,k,C,P]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!_&&(m.current={x:v.clientX+s,y:v.clientY+s},M());},[n,c,r,_,s,M]),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"),L=g()?.matches?.(":hover");B||L?P():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,g,P,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let B=a.current?.matches(":hover"),L=g()?.matches?.(":hover");if(B||L?P():R(),r==="center"&&a.current){let O=E();m.current={x:O.x,y:O.y},M();}}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,M,l,P,R,g]),fe.useEffect(()=>()=>{C(),P();},[C,P]);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"&&P(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:D,onClick:F,onMouseEnter:H,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,om=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:M,className:y,...x},g){let d=V(),{t:p,strokeColor:C,labelTextColor:P,chipSubtleBg:R,chipOutlinedBg:E,outerM:k,padX:$,verticalStrokeMargin:_}=useMemo(()=>{let D=typeof s=="number"?`${s}px`:s,F=d.surface.border,H=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:F,labelTextColor:H,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,_]),A=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:P,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,P,u,R,E,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,M]}),[S,M]);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:A,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:A,children:t}),t&&r!=="right"&&I,!t&&I]})}));var yl=fe.createContext(null),xl=()=>{let e=useContext(yl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},vl=({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(yl.Provider,{value:u,children:e})},Cl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=xl(),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})});Cl.displayName="DrawerTrigger";var To=0,Rl="",Tl="",am=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function im(){if(!(typeof document>"u")){if(To===0){let e=document.body;Rl=e.style.overflow||"",Tl=e.style.paddingRight||"";let t=am();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function lm(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=Rl,e.style.paddingRight=Tl;}}var cm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Ks=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:M,css:y,...x},g){let d=V(),{open:p,setOpen:C,lockScroll:P,closeOnEscape:R}=xl();useEffect(()=>{if(!(!P||!p))return im(),()=>lm()},[p,P]);let E=useMemo(()=>cm(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]),A=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),F=useCallback(()=>{let j=D.current;if(!j)return 1;let J=j.getBoundingClientRect();return k==="x"?J.width:J.height},[k]),H=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:A,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,A,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]),L=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)>=F()*N,Te=$*de>f;ge&&(Pe||Te)&&C(false);},[k,$,F,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:L},"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",M||""].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:H,...se,children:t},"panel")]}):null})});Ks.displayName="DrawerContent";var wl=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),M=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(vl,{open:M,onOpenChange:y,children:jsx(Ks,{ref:l,...i,children:c})})});wl.displayName="DrawerLegacy";var Vs=({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(),M=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(M)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var El=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sl=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:El(c),width:c?"100%":void 0,maxHeight:El(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})});Sl.displayName="Flex";var js=({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],M=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(M)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var Il={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:M,style:y,as:x})=>{let g=V(),d=Il[e]??Il.body,p=x??Em[e]??"span",C=A=>A==null?d.size:typeof A=="number"?A:g?.typography?.sizes?.[A]??A,P=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:P,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}`,M||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var Xs=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 Xs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Al=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:M,placeholder:y,blurDataURL:x,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:P,onLoad:R,onError:E,...k},$){let[_,W]=useState(false),[S,A]=useState(false),[I,D]=useState(false),F=V(),H=km(s,F)??"0px",z=i?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:i?F.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${H})`}),b=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${H})`,maxWidth:o?Xs(o):"100%",maxHeight:r?Xs(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:P?"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:P,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:M,loading:m,decoding:h,fetchPriority:f,onLoad:L=>{D(true),R?.(L);},onError:L=>{A(true),E?.(L);},...k})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Al.displayName="Image";var Ml=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,Fl=[1.02,1.03,1.02],Pl=[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:M="md",label:y,labelAlign:x="center",css:g,className:d,...p}){let C=V(),P=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/P),_=Children.toArray(t).filter(isValidElement).slice(0,i),W=_.length,S=Hm(n,W),A=_.map((j,J)=>Lm(n,W,J)),I=j=>k*.6*A[j],D=j=>I(j)*P,F=0,H=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"?Pl[j]??1.08:a==="reveal"?Fl[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;F=Math.max(F,Ie/2+Q),H=Math.max(H,we/2+ie);}let z=Math.max(1,2*F),w=Math.max(1,2*H),b=Math.min(1,E/z,k/w),v=c===void 0?"pointer":"controlled",B=c?"true":void 0,L=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:Ml(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:Ml(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(M,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(${Pl[j]??1.06})`:a==="reveal"?`${J} scale(${Fl[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:`${P}`,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:[L,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 Dl=e=>typeof e=="number"?`${e}px`:e,Nl={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 Dl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Dl(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=Nl[o]??Nl.sm,M=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:M,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,Ys=({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 M=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:M,onTransitionEnd:T(),children:e})};var Zs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Bl=fe.createContext(null),$l=()=>{let e=useContext(Bl);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(Bl.Provider,{value:u,children:e})},zl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=$l(),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})});zl.displayName="ModalTrigger";var Ol=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:M,...y},x)=>{let g=V(),{open:d,setOpen:p,lockScroll:C}=$l(),P=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!d)return;R.current=document.activeElement;let I=setTimeout(()=>{let F=P.current;if(!F)return;let H=F.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');H.length>0?H[0].focus():F.focus();},100),D=F=>{let H=P.current;if(!H||!F.target)return;let z=F.target;if(!H.contains(z)){F.preventDefault();let w=H.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');w.length>0?w[0].focus():H.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:Zs(o),maxWidth:t==="inset"?`min(${Zs(n)||"100%"}, ${k})`:Zs(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",M||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[$,f],ref:I=>{P.current=I,typeof x=="function"?x(I):x&&(x.current=I);},...y,children:e}),W=u==="none"?_:u==="slide"?jsx(Ys,{on:d,direction:m,duration:h,children:_}):u==="grow"?jsx(js,{initialScale:.75,on:d,duration:h,children:_}):jsx(Vs,{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"}),A=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:A,lockScroll:C,children:W})});Ol.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(),M=t!==void 0,[y,x]=useState(n),g=Math.max(1,e),d=Ir(M?t:y,1,g),p=useCallback(b=>{let v=Ir(b,1,g);M||x(v),o?.(v);},[M,g,o]),C=useMemo(()=>df({count:g,page:d,siblingCount:r,boundaryCount:s}),[g,d,r,s]),P=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}),A=(b=false)=>css([W,T({color:b?"primary":"neutral"}),l==="outlined"?b?{background:P,color:f.text.onColors.primary,borderColor:P}:{background:"transparent",borderColor:R,":hover":{background:E}}:l==="ghost"?b?{background:P,color:f.text.onColors.primary}:{":hover":{background:E}}:b?{background:P,color:f.text.onColors.primary,borderColor:P}:{":hover":{background:E}}]),I=useCallback(()=>p(1),[p]),D=useCallback(()=>p(g),[p,g]),F=useCallback(()=>{d===1?i&&p(g):p(d-1);},[d,i,g,p]),H=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(),F()),b.key==="ArrowRight"&&(b.preventDefault(),H()),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:[A(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:[A(false),S],onClick:F,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:A(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:[A(false),S],onClick:H,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:[A(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 Vl=createContext(null),vf=()=>{let e=useContext(Vl);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),M=h?e:f,y=useRef([]),[x,g]=useState(0),d=()=>g(A=>A+1),p=useCallback(A=>{h||T(A),n?.(A);},[h,n]),C=useCallback(A=>(y.current.push(A),d(),y.current.length-1),[]),P=useCallback((A,I)=>{let D=y.current[A];D&&(y.current[A]={...D,...I},d());},[]),R=()=>y.current.map((A,I)=>({it:A,i:I})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),E=useCallback((A,I)=>{let D=R();if(!D.length)return;let F=Math.max(0,D.indexOf(A)),H=D[(F+I+D.length)%D.length],z=y.current[H]?.ref;if(z){z.focus();let w=y.current[H]?.value;w!==void 0&&p(w);}},[p]),k=useCallback(A=>{let I=R();if(!I.length)return;let D=A==="first"?I[0]:I[I.length-1],F=y.current[D]?.ref;if(F){F.focus();let H=y.current[D]?.value;H!==void 0&&p(H);}},[p]),$=useMemo(()=>{let A=y.current.filter(D=>D.ref&&!D.disabled);return A.length?A.some(D=>D.value===M)?M:A[0]?.value:void 0},[M,x]),_=useMemo(()=>({selected:M,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:P,moveFocusBy:E,moveToEdge:k,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[M,p,o,r,s,a,C,P,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(Vl.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:M,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],P=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=P):T==="outlined"?(_=C(50),W=k,S=P):(_=f.neutral[200],W="transparent",S=$),g&&(T==="outlined"?(_=R,W=k,S=P):T==="filled"?(_=P,W=null,S=$):(_=R,W=null,S=P));let A=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 F=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:A,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${k}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),H=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&&M===e?0:-1,L=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:[F,L({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[H,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],M=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:M,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 ta(e,t){if(e==null||typeof e=="boolean")return;if(Array.isArray(e)){for(let o of e)ta(o,t);return}if(!fe.isValidElement(e))return;let n=e;if(Ff(n)){t.push(n);return}if(n.type===fe.Fragment){ta(n.props.children,t);return}}var Ul=({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:M=280,wrapperCss:y,labelCss:x,triggerCss:g,menuCss:d,optionCss:p,children:C,className:P,menuSize:R="md",triggerRender:E})=>{let k=V(),$=ve(),_=fe.useId(),W=`${_}-label`,S=`${_}-menu`,A={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=A[l]||A.md,[D,F]=fe.useState(false),H=Q=>F(!!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,L=Q=>{z||v(Q),n?.(Q);},O=[];ta(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)||L(Q),H(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];L(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(),H(true));};return jsxs("div",{css:Mo(j,y),className:["plainframe-ui-select-wrapper",P||""].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:H,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:()=>H(!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 M=="number"?`${M}px`:M,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)})})]})]})};Ul.displayName="Select";var na=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Nf=keyframes`
|
|
13
|
+
`,Yc=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("),Jc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Zc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Yc(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]&&Jc.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",M=Math.max(o-n,1),y=T?Ya(t,n,o):void 0,x=T?(y-n)/M*100:void 0,g=Zc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(eu,{size:s,active:g,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Qc,{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})}),Qc=({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]:[]]),M=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,Xa):Xa,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:`${Gc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...g,left:"-200%",right:"100%",animation:`${Xc} 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:M,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})]})})})},eu=({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,M=`${(o?Ya((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:M,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":`${qc} ${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 Qa=createContext(null),ei=()=>{let e=useContext(Qa);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},uu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),du=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),pu=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}}),ti=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(),M=useId(),y=useMemo(()=>{let A={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)?A[c]:A.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],F=I?.[300]??g[300],H=I?.[600]??I?.[500]??g[600],z=I?.[700]??H,w=I?.[800]??f.text?.primary??"#000",b=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:H,fg:b,border:void 0,iconColor:b}:n==="outlined"?{bg:D,fg:w,border:`1px solid ${F}`,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]),P=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(()=>[du,{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(()=>[pu,{color:d.fg}],[d.fg]),_=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:M}),[d.fg,d.iconColor,y,T,M]),W=fe.Children.toArray(u).some(A=>fe.isValidElement(A)&&A.type===is),S=fe.Children.toArray(u).some(A=>fe.isValidElement(A)&&A.type===ls);return jsx(Qa.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?M:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[P,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:uu,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})})})]})})});ti.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=ei(),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}=ei(),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 oi(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:M,togglePasswordVisible:y=false,showClear:x,type:g="text",step:d,focusRingMode:p="always",className:C,wrapperCss:P,inputCss:R,labelCss:E,helperRowCss:k,helperTextCss:$,startIconCss:_,endIconCss:W,css:S,onBlur:A,onFocus:I,onKeyDown:D,autoFocus:F,name:H,id:z,tabIndex:w,autoComplete:b,readOnly:v,required:B,maxLength:L,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(P),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,xe,oe,f,i,P,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}L&&Ee.length>L||Ie(Ee);},[le,L,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:oi(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=M?jsx("span",{css:re,children:oi(M,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,M,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:L,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:A,onFocus:I,onKeyDown:D,autoFocus:F,name:H,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),li=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,M]=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:M}),[T]),P=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 F=window.getComputedStyle(D);return F.display!=="none"&&F.visibility!=="hidden"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),M(false);},[]),k=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(k.current){k.current=false;return}let D=I.currentTarget,F=R(D);F.length>0&&(M(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")),F[0].setAttribute("data-highlighted",""),F[0].focus({preventScroll:true}));},[R]),_=useCallback(I=>{let D=I.currentTarget,F=R(D);if(F.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")),M(false),D.tabIndex=-1,requestAnimationFrame(()=>{D.tabIndex=0,k.current=false;});return}let H=D.querySelector("[data-highlighted]"),z=D.querySelector("[data-hovered]"),w=H||z,b=w?F.indexOf(w):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),M(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")),b===-1&&(b=I.key==="ArrowDown"?-1:F.length);let v=I.key==="ArrowDown"?1:-1,B=(b+v+F.length)%F.length;F[B].setAttribute("data-highlighted",""),F[B].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),M(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")),F[0].setAttribute("data-highlighted",""),F[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),M(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")),F[F.length-1].setAttribute("data-highlighted",""),F[F.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")),M(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]),A=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:P,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:A,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})]})})})})})});li.displayName="Menu";var ui=createContext(null),or=()=>{let e=useContext(ui);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Wu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)Wu(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,_u=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}},Ku=({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);};_u(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],P=document.activeElement;x.shiftKey&&P===p?(x.preventDefault(),C.focus()):!x.shiftKey&&P===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let M=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ui.Provider,{value:M,children:a})},di=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:M=>{M.stopPropagation(),s(!r),m.onClick?.(M);}}:{onMouseEnter:M=>{l(),r||s(true),m.onMouseEnter?.(M);},onMouseLeave:M=>{i(),m.onMouseLeave?.(M);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let M=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[M,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});di.displayName="PopoverTrigger";var pi=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})});pi.displayName="PopoverAnchor";function Vu(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 mi=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:M,setOpen:y,triggerOn:x,referenceRef:g,scheduleClose:d,cancelClose:p}=or(),C=V(),P=Vu(e),{refs:R,x:E,y:k,strategy:$,context:_}=useFloating({open:M,onOpenChange:y,whileElementsMounted:autoUpdate,placement:P,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:A}=useInteractions([W,S]),[I]=_.placement.split("-"),D=I,F=`${D==="left"?"right":D==="right"?"left":"center"} ${D==="top"?"bottom":D==="bottom"?"top":"center"}`,H=8,z=D==="top"?{y:H}:D==="bottom"?{y:-H}:D==="left"?{x:H}:{x:-H},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}`,L=tr(i,C.spacing),O=tr(l,C.spacing),K=tr(u,C.spacing),N={};L&&(N.padding=L),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:F,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",...A({...f,ref:le,...J}),...w,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:M?de:null})})});mi.displayName="PopoverContent";var ju=()=>{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(),M=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,[P,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,A=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:D,thumb:F}=k,H=(D-F)/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:H,left:C?I-F-H:H,width:F,height:F,backgroundColor:A,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:P?"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,M({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 Qu=(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:M,...y},x)=>{let g=V(),d=ve(),p=typeof e=="boolean",[C,P]=useState(t),R=p?e:C,E=r==="sm"||r==="lg"?r:"md",k=useMemo(()=>Qu(g,E),[g,E]),{checkedBg:$,checkColor:_,borderCol:W,hoverBg:S,gapPx:A}=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:A,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,A,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"}),[]),F=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]),H=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:H.w,height:H.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"}}),[_,H.h,H.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):P(O=>{let K=!O;return n?.(K),K}));},[o,p,R,n]),L=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",M||""].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:L,children:[jsx("input",{type:"checkbox",checked:R,onChange:B,disabled:o,css:D,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[F,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 nd=()=>useContext(gn),od=()=>useContext(ro),rd=()=>useContext(cr),mn=null,yi=(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:M,...y},x){let g=nd(),d=rd(),p=lr(),C=uo(),P=od(),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,A=useContext(er),I=A==="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]),F=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"}}),[]),H=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=(L,O)=>{let K=L.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(L),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:P?.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:L=>{if(g&&!M){let O=g.listRef.current;L&&(T!=null?O[T]=L:O.includes(L)||O.push(L));}typeof x=="function"?x(L):x&&"current"in x&&(x.current=L);},onMouseMove:L=>{if(L.currentTarget.hasAttribute("data-hovered"))return;let O=!!L.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&yi(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");}),L.currentTarget.setAttribute("data-hovered","");let K=L.currentTarget.closest("[data-menu-id]")||L.currentTarget.closest('[role="menu"]');K?.hasAttribute("data-keyboard-nav")&&K.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!P?.allItemsTabbable&&L.currentTarget.focus({preventScroll:true});},onMouseEnter:L=>{if($)lo();else {let N=!!L.currentTarget.closest("[data-submenu-content]");p&&!N&&yi(p.closeAllSubMenus);}L.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");})),L.currentTarget.setAttribute("data-hovered","");let K=L.currentTarget.closest("[data-menu-id]")||L.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&&!P?.allItemsTabbable&&L.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:L=>{if(t)return;let O=L.currentTarget;if(L.key==="Tab"&&g&&!P?.allItemsTabbable){L.preventDefault();return}if(L.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(L.key==="Enter"||L.key===" "||L.key==="ArrowRight"){$||L.key!=="ArrowRight"&&(L.preventDefault(),L.stopPropagation(),b());return}if(L.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){L.preventDefault(),L.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(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(L.key==="ArrowDown"){L.preventDefault(),L.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(L.key==="ArrowUp"){L.preventDefault(),L.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(L.key==="Home"){L.preventDefault(),L.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(L.key==="End"){L.preventDefault(),L.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:L=>{t||(L.currentTarget.removeAttribute("data-highlighted"),b());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:F,children:l}),a,(f!=null||_||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:H,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})})]})]})}),vi=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,M=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(M),l.current?.(M);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(vi.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(vi),M=!!T&&r!==void 0,y=!M&&t!==void 0,[x,g]=useState(()=>M?T.values.some(W=>Object.is(W,r)):!!n),d=M?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),P=!!useContext(Tt),R=()=>{if(!c)if(M)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:P?-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 Ci=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,[M,y]=useState(!!n),x=T?!!t:M,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}),P=()=>{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:P,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})})]})});Ci.displayName="MenuSwitchItem";var Ri=fe.createContext(null),Ti=({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(Ri.Provider,{value:i,children:o})};Ti.displayName="MenuRadioGroup";var sd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(Ri),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,M=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(M,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 ad=({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 Ei=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,vd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function Cd(){if(!(typeof document>"u")){if(po===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=vd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function Rd(){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),Td=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Si=createContext(null),lr=()=>useContext(Si),Ii=createContext(false),wd=()=>useContext(Ii),ro=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Ed(){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 Sd=()=>Td()?.activeIndex??null,ki=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(A=>{A&&Ei(h.current),e===void 0&&i(A),n?.(A);},[e,n]),m=useRef(`pfui-menu-${++ki}`),h=useRef(null),f=useRef([]),T=useRef(null),[M,y]=useState(null),[x,g]=useState(false);useEffect(()=>{l||(y(null),f.current=[],g(false));},[l]);let d=useRef(null),p=useCallback((A,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let D=I??20;d.current=window.setTimeout(()=>u(A),D);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return Cd(),()=>Rd()},[l,r]);let P=xs(),[R]=useState(()=>P??Ed()),E=useRef(new Set),k=useMemo(()=>({registerSubMenu:A=>(E.current.add(A),()=>E.current.delete(A)),closeAllSubMenus:()=>{E.current.forEach(A=>A());}}),[]),$=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:M,setActiveIndex:y}),[M,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(Si.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:M,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,P=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(F=>{let H=_();requestAnimationFrame(()=>H[F]?.focus());},[_]),S=useCallback(F=>{if(F.key==="Tab"&&c){F.preventDefault(),x?.setIsKeyboardNav(true);let H=M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=H.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(F.key==="ArrowRight"&&c){let H=document.querySelector("[data-subtrigger][data-hovered]");if(H){F.preventDefault(),F.stopPropagation(),x?.setIsKeyboardNav(true),H.removeAttribute("data-hovered"),H.setAttribute("data-highlighted",""),H.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});H.dispatchEvent(z);});return}}if(F.key==="ArrowDown"||F.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){F.preventDefault(),i(true),requestAnimationFrame(()=>{let H=y?document.querySelector(`[data-menu-id="${y}"]`):M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=Array.from(H.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!==H)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let w=F.key==="ArrowDown"?0:z.length-1;h(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),C?.(F),R?.(F);return}if(c){F.preventDefault();let H=document.querySelectorAll("[data-hovered]");for(let w of Array.from(H))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"}),L=B.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),L!==-1&&B.length>0){let O=F.key==="ArrowDown"?1:-1,K=(L+O+B.length)%B.length;B[K]?.setAttribute("data-highlighted",""),B[K]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):M?.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=F.key==="ArrowDown"?-1:w.length);let L=F.key==="ArrowDown"?1:-1,O=(B+L+w.length)%w.length;h(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}C?.(F),R?.(F);return}}if((F.key==="Enter"||F.key===" ")&&!c){F.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let H=y?document.querySelector(`[data-menu-id="${y}"]`):M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=Array.from(H.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!==H)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?.(F),R?.(F);return}C?.(F),R?.(F);},[c,i,h,C,R,_,W,m,x,y,M,g]),A=useCallback(F=>{l==="click"&&((F.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 L="getAttribute"in v?v.getAttribute("role"):null;return L==="textbox"||L==="combobox"})||(F.stopPropagation(),i(!c))),P?.(F),E?.(F);},[l,c,i,P,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 F=p.props,H=F.css,z=typeof F.className=="string"?F.className:void 0,w=typeof F.tabIndex=="number"?F.tabIndex:0,b={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[H,D,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:A,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:A,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:M,exitPlacement:y,animateOnBusClose:x=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...P},R)=>{let{open:E,setOpen:k,referenceRef:$,clearSubmenuHover:_,setActiveIndex:W,floatingRef:S,menuId:A}=pr(),I=V(),D=xs(),F=uo();useEffect(()=>{if(!D)return;let X=D.registerCloser(()=>k(false));return ()=>{X&&X();}},[D,k]);let H=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:L,x:O,y:K,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:k,placement:b,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:H??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?L.setReference(B):$.current&&L.setReference($.current);},[L,B,$]),useEffect(()=>{if(!E)return;let X=B||$.current,re=L.floating.current;if(!(!X||!re))return autoUpdate(X,re,G)},[E,B,$,L,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=L.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,$,L.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(M,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(),F?.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();}}},[F,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),F?.isKeyboardNav&&F.setIsKeyboardNav(false);},[F]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),F?.isKeyboardNav&&F.setIsKeyboardNav(false);},[F]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...P,ref:ys(R,L.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":A,"data-keyboard-nav":F?.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 Ai=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=wd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&Ei(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,A)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=A??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 M=lr();useEffect(()=>{if(!M)return;let S=()=>{T(),u(false);};return M.registerSubMenu(S)},[M,u,T]);let y=useRef(`pfui-submenu-${++ki}`),x=useRef(null),g=useRef([]),d=useRef(null),[p,C]=useState(null),[P,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:P,setIsKeyboardNav:R}),[P]);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 A=S.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Ii.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})})})})})};Ai.displayName="DropdownMenuSub";var Mi=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(),M=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:P,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 A=S.currentTarget,I=D=>{M?.setIsKeyboardNav(true);let F=A.closest("[data-menu-id]");if(!F)return;F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let H=Array.from(F.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]")!==F)return false;let B=window.getComputedStyle(v);return B.display!=="none"&&B.visibility!=="hidden"});if(!H.length)return;let z=H.indexOf(A),w=z>=0?z:0,b=D==="next"?(w+1)%H.length:(w-1+H.length)%H.length;H[b]?.setAttribute("data-highlighted",""),H[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(),M?.setIsKeyboardNav(true);let D=S.currentTarget;i(true),requestAnimationFrame(()=>{let F=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(F){F.setAttribute("data-keyboard-nav",""),D.removeAttribute("data-highlighted"),D.removeAttribute("data-hovered");let H=F.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])');H&&(H.setAttribute("data-highlighted",""),H.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let D=A.closest("[data-menu-id]");D&&D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(F=>F.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(F=>F.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),M&&M.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),P?.(S);},[c,i,p,P,u,M,T]),W=l==="hover"?{onMouseEnter:S=>{let A=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let I=A.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),M&&M.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let A=S.currentTarget;lo(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),A.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,A=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,D={ref:k,tabIndex:I,className:[A,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:F=>{if(F.target.hasAttribute("data-highlighted")){let H=F.target.closest("[data-menu-id]");H&&!H.hasAttribute("data-keyboard-nav")&&(H.setAttribute("data-keyboard-nav",""),M&&M.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(F);},...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 A=S.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),M&&M.setIsKeyboardNav(true));}},...W,...E,children:t})});Mi.displayName="DropdownMenuSubTrigger";var Fi=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);}})});Fi.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ad=css({display:"inline"}),Di=css({display:"inline",fontWeight:700}),Md=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Fd=css({display:"flex",alignItems:"center",gap:4}),Pd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Ni=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Dd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Nd=()=>{},Hd=e=>e,Ld=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Bd=e=>{e.preventDefault(),e.stopPropagation();},$d=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},zd=e=>{e.preventDefault(),e.stopPropagation();},Hi=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});Hi.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]),M=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Pd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ni,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Dd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ni,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:M},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:M},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 Li=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:M,disabled:y=false,error:x=false,showClear:g=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:P=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:k=true,blurOnSelect:$=false,freeSolo:_=false,customValueLabel:W=false,maxHeight:S,maxItems:A,noResultsText:I="No Items Found",highlightTypedValue:D,typedValueHighlightCss:F,showNoResults:H=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:b,loading:v,loadingText:B="Loading\u2026",debounceMs:L=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,L)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,b,L]);let Qn=useMemo(()=>{let q=mr(ie);return q?xt.some(ne=>mr(ne.title??ne.value)===q):false},[xt,ie]),ca=_&&!!W&&ie.trim().length>0&&!Qn,cc=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]),ua=useMemo(()=>{if(ca){let q=ie.trim();return [...$r,{value:q,title:cc(q),__pfui_free__:true}]}return $r},[$r,ca,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of ua){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof A=="number"?Math.max(0,A):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},[ua,A]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),Ho=kn.length>0,zr=!Ho&&!!H&&!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]),da=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,$]),uc=useCallback(q=>{if(y)return;me(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):_&&nt(null)),!Y&&!ne&&P&&!oe&&De(true);},[O,Y,P,oe,De,y,_,t]),it=Ld,pa=Nd,dc=Hd,ma=useMemo(()=>F?[Di,F]:Di,[F]),pc=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:Ad,children:[q.slice(0,he),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:ma,children:q.slice(he,he+ne.length)}),q.slice(he+ne.length)]})},[ie,ma]),zo=D?pc:dc,mc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Bd,Wo=$d,fc=useCallback(q=>{Ne.current=q;},[]),fa=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]),gc=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),fa(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?(da(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,fa,da,$o,De,y]),bc=useCallback(()=>{y||Z.current||C&&Lo&&(ce.current=Date.now(),Y||De(true));},[Y,C,Lo,De,y]),hc=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]),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=>{q.push(jsx(vs,{item:he,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:pa,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,pa,Wo,Oo,Q]),ba=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]),yc=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?ga():ba(),[Ee,zr,Vt.length,it,B,I,O,ga,ba]),sn=oe?false:y||!Je&&!Ho&&!H,ha=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]),ya=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:[ya,j],"aria-disabled":sn||void 0,onMouseDown:zd,onClick:ha,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ya,j,sn,ha,G]),xc=useMemo(()=>T&&_o?jsxs("span",{css:Fd,children:[T,_o]}):T??_o,[T,_o]),vc=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:[mc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Hi,{onCapture:fc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:Md,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:uc,onKeyDown:gc,onFocus:bc,onBlur:hc,onSurfaceClick:vc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:xc,size:M,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:yc})]})})});Li.displayName="Autocomplete";var Vd=["sm","md","lg"],jd=(e,t)=>typeof e=="number"?e:Vd.includes(e)?t.componentHeights[e]:t.componentHeights.md,Ud=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},qd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Gd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Bi=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=jd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,M=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Ud(u,o),g=qd(u,o),d=Gd(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"}),P=css({fontSize:M,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:P,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:d})})}));Bi.displayName="Avatar";var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=({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 $i(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),M=typeof t=="number"&&t>=0,y=M&&T.length>t?T.slice(0,t):T,x=M&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=$i(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"}),P=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:P,children:R})},E);let k=R,$=k.props?.css,_=$==null?P:[P,$],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 Wi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,ep=(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"}},tp=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",np=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",op=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",rp=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),sp=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:M,className:y,badgeClassName:x,css:g,badgeCss:d,offsetX:p,offsetY:C})=>{let P=V(),R=s==="dot",E=f??(R?8:17),k=r??(R?0:10),{scale:$,onKey:_}=ep(P,t),W=tp($),S=P.text?.onColors||{},A=np(P,S,_,n),I=op(e,a,s),D=rp(i,s,e,c),F=css({position:"relative",display:"inline-block"}),H=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Wi(p??H),w=Wi(C??H),b=l.vertical||"top",v=l.horizontal||"right",B={},L="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%",L="-50%"):v==="right"?(B.right=z,L="45%"):(B.left=z,L="-45%");let K=D?1:.8,N=css({minWidth:R?E:E/2,height:E,background:W,color:A,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 ${M??P.surface?.appBg}`}:{},opacity:D?1:0,transform:`translate(${L}, ${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:[F,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,...M})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[g,d]=useState(e),[p,C]=useState(e),P=useRef(null),R=useRef(null),E=useRef(null);useEffect(()=>(P.current&&(clearTimeout(P.current),P.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),P.current=setTimeout(()=>{d(false),P.current=null;},u)),()=>{P.current&&(clearTimeout(P.current),P.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let A=document.body,I=A.style.overflow,D=A.style.paddingRight,F=window.innerWidth-document.documentElement.clientWidth,H=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",F>0&&(A.style.paddingRight=`${H+F}px`),()=>{A.style.overflow=I,A.style.paddingRight=D;}},[e,T]),useEffect(()=>{if(!p||!t)return;let A=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[p,t]);let k=A=>{if(!p||!t)return;let I=E.current?.querySelector('[role="dialog"]');if(I){let F=I.getBoundingClientRect(),H=A.clientX,z=A.clientY;(H<F.left||H>F.right||z<F.top||z>F.bottom)&&t();return}let D=A.target;D&&(E.current?.contains(D)||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,...M,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 up(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 dp=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}=up(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]),M=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 P=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:P,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,P=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",P?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,P,d.disabled),o,C?r:s,P?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:[M,c],children:t}),P?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,ji=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)&&ji(n)&&(t=true));}),t};function gp(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 bp(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 Ui=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:M,...y},x)=>{let g=V(),d=ve(),p=useMemo(()=>gp(g,t),[g,t]),C=useMemo(()=>bp(g,e),[g,e]),P=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!ji(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(()=>P?"center":l??"center",[P,l]),W=!!c&&_==="center",S=!!c&&_==="start",A=!!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]),F=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),H=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(P&&!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}`}),[P,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]),L=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(P)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:L(!S),children:G?E||n:null}),jsx("span",{css:L(!!S),children:$})]})},[P,n,S,B,L,E,c,$]),N=useMemo(()=>()=>{if(P)return null;let G=!!o;return !G&&!A?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:L(!A),children:G?k||o:null}),jsx("span",{css:L(!!A),children:$})]})},[P,o,A,B,L,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"}),F,H,z,M],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:P?c?$:ks(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));Ui.displayName="Button";var Cr=e=>isValidElement(e),hp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>hp(e)===t,Xi=e=>Ds(e,"ButtonGroup"),Yi=e=>Ds(e,"DropdownMenu"),Fs=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,yp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,xp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ps=(e,t)=>{if(!Cr(e))return null;if(Xi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ps(t?n[0]:n[n.length-1],t):null}if(Yi(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},Gi=(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 xp(o)},Ji=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,...M},y){let x=V(),g=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:g,p=o==="vertical",C=yp(x.componentHeights.border,1),P=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,A=false,I=[];for(let D of $){if(!Cr(D)){I.push(D);continue}let F=S===0,H=S===W-1,z=D.props??{},w=z.disabled??s,b=z.size??a,v=0,B=0,L=0,O=0;n&&(p?(v=F?R?0:d:0,B=F?E?0:d:0,O=H?R?0:d:0,L=H?E?0:d:0):(v=F?R?0:d:0,O=F?R?0:d:0,B=H?E?0:d:0,L=H?E?0:d:0));let K=Gi(D,"left"),N=Gi(D,"right"),se=n&&!F&&!(A&&K)&&!(A||K)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${P}`}):null,j=n&&!F&&A&&K?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(B),borderBottomRightRadius:On(L),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Yi(D)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=Xi(D)&&n?{__clipLeft:!F,__clipRight:!H}:{},Q=cloneElement(D,{...z,disabled:w,size:b,className:Ie,css:[Re,de],...we});I.push(Q),A=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),A=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],...M,children:I})}));Ji.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ep=(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)}}},Sp=(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)}}},Ip=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},kp=(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:M,role:y,tabIndex:x,...g},d){let p=V(),C=p.surface??{},[P,R]=useState(!!u),E=l!=null,k=E?!!l:P,$=useMemo(()=>Ip(o,p),[o,p]),_=useMemo(()=>kp(o,p,$),[o,p,$]),W=_,S=useMemo(()=>Ep(r,p),[r,p]),A=useMemo(()=>Sp(s,p),[s,p]),I=!!c||!!i,D=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:A,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,A,o,p.componentHeights,C.border,h,f,I,_,W]),F=useCallback(()=>{if(!i)return;let b=!k;E||R(b),m?.(b);},[E,m,i,k]),H=useCallback(b=>{i&&F(),T?.(b);},[i,F,T]),z=useCallback(b=>{i&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),F()),M?.(b);},[i,F,M]),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:H,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...g,children:t})}));Wn.displayName="Container";var Mp=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 Mp(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 Fp(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 Zi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Qi=fe.createContext("horizontal"),Bs=()=>fe.useContext(Qi),el=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:M,...y},x)=>{let g=V(),d=ve(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Fp(h,g),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Qi.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:M,tabIndex:M?0:void 0,...y,children:e})})}));el.displayName="Card";var 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",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})}),Dp=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})}),Np=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})}),Hp=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:Zi(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})}),Lp=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:Zi(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 nl=e=>isValidElement(e),Op=e=>nl(e)?e.type?.displayName||e.type?.name:void 0,tl=e=>Op(e)==="Card",Wp=e=>typeof e=="number"?`${e}px`:e,ol=({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"?Wp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(tl).length,x=0,g=T.map((d,p)=>{if(!tl(d)||!nl(d))return d;let C=d.props,P=x++,R=P===0,E=P===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,A=[$,_,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,...A],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})};ol.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,sl=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)&&sl(n)&&(t=true));}),t},jp=(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"},al=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:M},y){let x=V(),g=ve(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>jp(x,d),[x,d]),C=!!l&&!h,P=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]),A=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]),F="transparent",H=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&&!sl(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} ${A}`}):o==="ghost"?css({backgroundColor:F,color:H,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:_,border:"none",boxShadow:"none"}),[I,D,H,W,S,A,$,_,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:P,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,P,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]),L=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,M],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,L],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})]})}));al.displayName="Chip";var Xp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yp=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 M=ve(),y=r.neutral,x=r.text,g=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),P=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?M({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"}),A=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=A(w).slice(0,1),v=[...P];v[z]=b,n(v.join("")),b&&z<o-1&&I(z+1);},[P,o,n,I]),F=useCallback((z,w)=>{if(w.key==="Backspace")if(!P[z]&&z>0){let b=[...P];b[z-1]="",n(b.join("")),I(z-1),w.preventDefault();return}else {let b=[...P];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}},[P,o,n,I]),H=useCallback(z=>{let w=A(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:P[w]||"",placeholder:P[w]?"":R[w]||"",disabled:l,onChange:b=>D(w,b.target.value),onKeyDown:b=>F(w,b),onFocus:()=>C(w),onPaste:w===0?H: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))})}),Jp=({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:M,labelCss:y,helperRowCss:x,helperTextCss:g,css:d})=>{let p=V(),C=useId(),P=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=P[R],k=p.neutral,$=p.text,_=t!=null,[W,S]=useState(n),A=_?t:W,I=L=>{_||S(L),o?.(L);},D=Math.max(2,Math.min(h,10)),F=p.spacing.sm,H=Xp(l??F)??"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(M)?M:M?[M]:[]),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:H,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(Yp,{value:A||"",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:H})}),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 dl=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=dl(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)},Qp=({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),L=Math.round(m.current.y);v.style.transform=`translate3d(${B}px, ${L}px, 0)`;},[]),M=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;},[]),P=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=fe.useCallback(()=>{P(),p.current=window.setTimeout(()=>l(false),0);},[P,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},M(),l(true);},[M,l]),$=typeof t=="function"?t({close:u}):t,_=zs($),W=v=>{if(!fe.isValidElement(v))return v;let B=dl(v),L=v,O=L.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=L.props.onOpenChange;return fe.cloneElement(L,{...L.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:K})}if(B==="DropdownMenuContent"){let N=L.props.onMouseEnter,U=L.props.onMouseLeave;return fe.cloneElement(L,{...L.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{P(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:K})}return K===O?L:fe.cloneElement(L,{...L.props,children:K})},S=_?W($):$,A=fe.useCallback(v=>{v.preventDefault(),k(v.clientX,v.clientY);},[k]),I=fe.useCallback(v=>{n==="contextmenu"&&A(v);},[n,A]),D=fe.useCallback(v=>{n==="dblclick"&&A(v);},[n,A]),F=fe.useCallback(v=>{n==="click"&&A(v);},[n,A]),H=fe.useCallback(v=>{if(n!=="hover")return;C(),P();let B=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let L=B.x+(r==="cursor"?s:0),O=B.y+(r==="cursor"?s:0);k(L,O);},0);},[n,r,s,E,k,C,P]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!_&&(m.current={x:v.clientX+s,y:v.clientY+s},M());},[n,c,r,_,s,M]),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"),L=g()?.matches?.(":hover");B||L?P():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,g,P,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let B=a.current?.matches(":hover"),L=g()?.matches?.(":hover");if(B||L?P():R(),r==="center"&&a.current){let O=E();m.current={x:O.x,y:O.y},M();}}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,M,l,P,R,g]),fe.useEffect(()=>()=>{C(),P();},[C,P]);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"&&P(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:D,onClick:F,onMouseEnter:H,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,om=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:M,className:y,...x},g){let d=V(),{t:p,strokeColor:C,labelTextColor:P,chipSubtleBg:R,chipOutlinedBg:E,outerM:k,padX:$,verticalStrokeMargin:_}=useMemo(()=>{let D=typeof s=="number"?`${s}px`:s,F=d.surface.border,H=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:F,labelTextColor:H,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,_]),A=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:P,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,P,u,R,E,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,M]}),[S,M]);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:A,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:A,children:t}),t&&r!=="right"&&I,!t&&I]})}));var yl=fe.createContext(null),xl=()=>{let e=useContext(yl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},vl=({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(yl.Provider,{value:u,children:e})},Cl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=xl(),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})});Cl.displayName="DrawerTrigger";var To=0,Rl="",Tl="",am=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function im(){if(!(typeof document>"u")){if(To===0){let e=document.body;Rl=e.style.overflow||"",Tl=e.style.paddingRight||"";let t=am();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function lm(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=Rl,e.style.paddingRight=Tl;}}var cm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Ks=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:M,css:y,...x},g){let d=V(),{open:p,setOpen:C,lockScroll:P,closeOnEscape:R}=xl();useEffect(()=>{if(!(!P||!p))return im(),()=>lm()},[p,P]);let E=useMemo(()=>cm(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]),A=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),F=useCallback(()=>{let j=D.current;if(!j)return 1;let J=j.getBoundingClientRect();return k==="x"?J.width:J.height},[k]),H=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:A,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,A,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]),L=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)>=F()*N,Te=$*de>f;ge&&(Pe||Te)&&C(false);},[k,$,F,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:L},"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",M||""].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:H,...se,children:t},"panel")]}):null})});Ks.displayName="DrawerContent";var wl=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),M=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(vl,{open:M,onOpenChange:y,children:jsx(Ks,{ref:l,...i,children:c})})});wl.displayName="DrawerLegacy";var Vs=({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(),M=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(M)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var El=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sl=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:El(c),width:c?"100%":void 0,maxHeight:El(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})});Sl.displayName="Flex";var js=({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],M=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(M)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var Il={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:M,style:y,as:x})=>{let g=V(),d=Il[e]??Il.body,p=x??Em[e]??"span",C=A=>A==null?d.size:typeof A=="number"?A:g?.typography?.sizes?.[A]??A,P=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:P,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}`,M||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var Xs=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 Xs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Al=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:M,placeholder:y,blurDataURL:x,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:P,onLoad:R,onError:E,...k},$){let[_,W]=useState(false),[S,A]=useState(false),[I,D]=useState(false),F=V(),H=km(s,F)??"0px",z=i?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:i?F.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${H})`}),b=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${H})`,maxWidth:o?Xs(o):"100%",maxHeight:r?Xs(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:P?"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:P,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:M,loading:m,decoding:h,fetchPriority:f,onLoad:L=>{D(true),R?.(L);},onError:L=>{A(true),E?.(L);},...k})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Al.displayName="Image";var Ml=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,Fl=[1.02,1.03,1.02],Pl=[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:M="md",label:y,labelAlign:x="center",css:g,className:d,...p}){let C=V(),P=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/P),_=Children.toArray(t).filter(isValidElement).slice(0,i),W=_.length,S=Hm(n,W),A=_.map((j,J)=>Lm(n,W,J)),I=j=>k*.6*A[j],D=j=>I(j)*P,F=0,H=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"?Pl[j]??1.08:a==="reveal"?Fl[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;F=Math.max(F,Ie/2+Q),H=Math.max(H,we/2+ie);}let z=Math.max(1,2*F),w=Math.max(1,2*H),b=Math.min(1,E/z,k/w),v=c===void 0?"pointer":"controlled",B=c?"true":void 0,L=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:Ml(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:Ml(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(M,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(${Pl[j]??1.06})`:a==="reveal"?`${J} scale(${Fl[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:`${P}`,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:[L,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 Dl=e=>typeof e=="number"?`${e}px`:e,Nl={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 Dl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Dl(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=Nl[o]??Nl.sm,M=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:M,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,Ys=({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 M=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:M,onTransitionEnd:T(),children:e})};var Zs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Bl=fe.createContext(null),$l=()=>{let e=useContext(Bl);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(Bl.Provider,{value:u,children:e})},zl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=$l(),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})});zl.displayName="ModalTrigger";var Ol=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:M,...y},x)=>{let g=V(),{open:d,setOpen:p,lockScroll:C}=$l(),P=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!d)return;R.current=document.activeElement;let I=setTimeout(()=>{let F=P.current;if(!F)return;let H=F.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');H.length>0?H[0].focus():F.focus();},100),D=F=>{let H=P.current;if(!H||!F.target)return;let z=F.target;if(!H.contains(z)){F.preventDefault();let w=H.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');w.length>0?w[0].focus():H.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:Zs(o),maxWidth:t==="inset"?`min(${Zs(n)||"100%"}, ${k})`:Zs(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",M||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[$,f],ref:I=>{P.current=I,typeof x=="function"?x(I):x&&(x.current=I);},...y,children:e}),W=u==="none"?_:u==="slide"?jsx(Ys,{on:d,direction:m,duration:h,children:_}):u==="grow"?jsx(js,{initialScale:.75,on:d,duration:h,children:_}):jsx(Vs,{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"}),A=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:A,lockScroll:C,children:W})});Ol.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(),M=t!==void 0,[y,x]=useState(n),g=Math.max(1,e),d=Ir(M?t:y,1,g),p=useCallback(b=>{let v=Ir(b,1,g);M||x(v),o?.(v);},[M,g,o]),C=useMemo(()=>df({count:g,page:d,siblingCount:r,boundaryCount:s}),[g,d,r,s]),P=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}),A=(b=false)=>css([W,T({color:b?"primary":"neutral"}),l==="outlined"?b?{background:P,color:f.text.onColors.primary,borderColor:P}:{background:"transparent",borderColor:R,":hover":{background:E}}:l==="ghost"?b?{background:P,color:f.text.onColors.primary}:{":hover":{background:E}}:b?{background:P,color:f.text.onColors.primary,borderColor:P}:{":hover":{background:E}}]),I=useCallback(()=>p(1),[p]),D=useCallback(()=>p(g),[p,g]),F=useCallback(()=>{d===1?i&&p(g):p(d-1);},[d,i,g,p]),H=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(),F()),b.key==="ArrowRight"&&(b.preventDefault(),H()),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:[A(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:[A(false),S],onClick:F,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:A(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:[A(false),S],onClick:H,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:[A(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 Vl=createContext(null),vf=()=>{let e=useContext(Vl);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),M=h?e:f,y=useRef([]),[x,g]=useState(0),d=()=>g(A=>A+1),p=useCallback(A=>{h||T(A),n?.(A);},[h,n]),C=useCallback(A=>(y.current.push(A),d(),y.current.length-1),[]),P=useCallback((A,I)=>{let D=y.current[A];D&&(y.current[A]={...D,...I},d());},[]),R=()=>y.current.map((A,I)=>({it:A,i:I})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),E=useCallback((A,I)=>{let D=R();if(!D.length)return;let F=Math.max(0,D.indexOf(A)),H=D[(F+I+D.length)%D.length],z=y.current[H]?.ref;if(z){z.focus();let w=y.current[H]?.value;w!==void 0&&p(w);}},[p]),k=useCallback(A=>{let I=R();if(!I.length)return;let D=A==="first"?I[0]:I[I.length-1],F=y.current[D]?.ref;if(F){F.focus();let H=y.current[D]?.value;H!==void 0&&p(H);}},[p]),$=useMemo(()=>{let A=y.current.filter(D=>D.ref&&!D.disabled);return A.length?A.some(D=>D.value===M)?M:A[0]?.value:void 0},[M,x]),_=useMemo(()=>({selected:M,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:P,moveFocusBy:E,moveToEdge:k,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[M,p,o,r,s,a,C,P,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(Vl.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:M,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],P=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=P):T==="outlined"?(_=C(50),W=k,S=P):(_=f.neutral[200],W="transparent",S=$),g&&(T==="outlined"?(_=R,W=k,S=P):T==="filled"?(_=P,W=null,S=$):(_=R,W=null,S=P));let A=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 F=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:A,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${k}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),H=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&&M===e?0:-1,L=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:[F,L({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[H,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],M=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:M,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 ta(e,t){if(e==null||typeof e=="boolean")return;if(Array.isArray(e)){for(let o of e)ta(o,t);return}if(!fe.isValidElement(e))return;let n=e;if(Ff(n)){t.push(n);return}if(n.type===fe.Fragment){ta(n.props.children,t);return}}var Ul=({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:M=280,wrapperCss:y,labelCss:x,triggerCss:g,menuCss:d,optionCss:p,children:C,className:P,menuSize:R="md",triggerRender:E})=>{let k=V(),$=ve(),_=fe.useId(),W=`${_}-label`,S=`${_}-menu`,A={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=A[l]||A.md,[D,F]=fe.useState(false),H=Q=>F(!!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,L=Q=>{z||v(Q),n?.(Q);},O=[];ta(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)||L(Q),H(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];L(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(),H(true));};return jsxs("div",{css:Mo(j,y),className:["plainframe-ui-select-wrapper",P||""].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:H,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:()=>H(!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 M=="number"?`${M}px`:M,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)})})]})]})};Ul.displayName="Select";var na=(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`
|
|
17
17
|
0% { opacity: .6; }
|
|
18
18
|
50% { opacity: 1; }
|
|
19
19
|
100% { opacity: .6; }
|
|
20
|
-
`,Lf=fe.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=V(),u=l.surface.subtleBg,m=l.neutral[200],h=na(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":na(r,String(r)),height:s==null?"fit-content":na(s,String(s))}),T=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:u,willChange:"background-position, opacity"}),M=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Nf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Hf} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,M]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var Ar=8,oa=20,Xn=4,Jl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:M="horizontal",className:y,...x})=>{let g=V(),d=M==="vertical",p=useRef(null),[C,P]=useState(false),[R,E]=useState(false),[k,$]=useState(false),_=e!==void 0,W=useCallback(Y=>Math.min(r,Math.max(o,Y)),[o,r]),S=useCallback(Y=>W(Math.round((Y-o)/s)*s+o),[o,s,W]),[A,I]=useState(()=>S(t??o)),D=_?S(e):A;useEffect(()=>{_||I(Y=>S(Y));},[o,r,s,_,S]);let F=g.palette.primary[600];g.surface.panelBg;let z=g.neutral[500],w=useMemo(()=>{let Y=r-o||1;return (D-o)/Y*100},[D,o,r]),b=useCallback(Y=>{_||I(Y),n?.(Y);},[_,n]),v=useCallback((Y,xe)=>{let ee=p.current;if(!ee)return D;let oe=ee.getBoundingClientRect(),ae=d?(oe.bottom-xe)/oe.height:(Y-oe.left)/oe.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[D,d,o,r,S]),B=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),b(v(Y.clientX,Y.clientY)),P(true));},[a,b,v]),L=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),P(true));},[a]),O=useCallback(Y=>{!C||a||b(v(Y.clientX,Y.clientY));},[C,a,b,v]),K=useCallback(()=>P(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K);}},[C,O,K]);let N=useCallback(Y=>{if(a)return;let xe=D;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")xe=D+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")xe=D-s;else if(Y.key==="Home")xe=o;else if(Y.key==="End")xe=r;else return;Y.preventDefault(),b(S(xe));},[a,D,s,o,r,b,S]),U=C||R||k,G=(R||C)&&!a,se=`color-mix(in srgb, ${F} 25%, transparent)`,j=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":m?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),J=css({marginBottom:d?0:4,marginRight:d?8:0,color:g.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Ar:"100%",height:d?"100%":Ar,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),de=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Ar:`calc(100% - ${Xn*.5}px)`,height:d?`calc(100% - ${Xn*.5}px)`:Ar,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),ge=css({width:Xn,height:Xn,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-w}% )`:0,bottom:0,width:d?"100%":`${w}%`,height:d?`${w}%`:"100%",backgroundColor:a?z:F,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Te=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:g.text.onColors.primary,width:oa,height:oa,left:d?"50%":`calc(${w}% - ${oa/2}px)`,bottom:d?`${w}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${a?z:F}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),Re=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ie=css({position:"absolute",top:d?`calc(50% - ${Xn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Xn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:g.neutral[800],color:g.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:g.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),we=h,Q=f,ie=T,me=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[j,we],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:J,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[le,Q],onPointerDown:B,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:de,children:Array.from({length:me}).map((Y,xe)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:ge},xe))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":D,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:L,onPointerUp:K,onPointerCancel:K,onMouseEnter:()=>E(true),onMouseLeave:()=>E(false),className:"plainframe-ui-slider-thumb",css:[Te,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Re,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ie,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:D})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Jl.displayName="Slider";var _f=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Kf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Vf=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),jf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Uf=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),qf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),Gf=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),Xf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Zl=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),Yf=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),Jf=fe.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:M}){let y=V(),x=ve(),{MAIN:g,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:P,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:E,UPCOMING_FG:k}=r,$="transparent",_=k,W=E;s==="subtle"?i?($=C,_=P,W=C):c?($=g,_=d,W=g):($=R,_=k,W=R):i?($=C,_=P,W=C):c?($="transparent",_=p,W=g):($="transparent",_=k,W=E);let S=n.label,A=n.icon??jsx("span",{css:Xf,children:typeof S=="number"?S:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Vf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[Gf(o,$,_,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&M(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Zl(!i),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Zl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Yf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:qf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:jf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Uf(i?1:0,u,h),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),aa=()=>null;aa.displayName="PlainframeUIStep";var Zf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:M,className:y,children:x,...g})=>{let d=V(),p=e==="outlined"?"outlined":"subtle",C=fe.useMemo(()=>{let v=fe.Children.toArray(x).filter(B=>fe.isValidElement(B)&&B.type===aa);return v.length?v.map((B,L)=>({index:L,...B.props})):[{value:1},{value:2},{value:3}]},[x]),P=fe.useCallback((v,B)=>v?d.palette?.[v]??v:B,[d.palette]),R=fe.useMemo(()=>({MAIN:String(P(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(P(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(P(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(P(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(P(m,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[P,i,l,u,m,d.palette.primary,d.neutral,d.text]),E=fe.useMemo(()=>{let v=P(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[P,c,d.palette.primary]),[k,$]=fe.useState(()=>C.some(B=>B?.value===n)?n:C[0]?.value),_=t!==void 0,W=_?t:k,{activeIndex:S,afterLast:A}=fe.useMemo(()=>{let v=C.findIndex(B=>B.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let B=Math.floor(W)-1;if(B>=C.length)return {activeIndex:C.length-1,afterLast:true};if(B>=0)return {activeIndex:B,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=fe.useCallback(v=>{r||(_||$(v),o?.(v));},[r,_,o]),D=fe.useCallback(v=>a||!!C[v]?.complete||(A?true:v<S),[a,C,A,S]),F=fe.useCallback(v=>{if(r)return false;let B=C[v];if(!B||B.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>S)return false}else if(typeof s=="function"&&!s(S,v))return false;return true},[r,C,s,S]),[H,z]=fe.useState(false);fe.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let w=fe.useCallback(v=>{if(!C.length||r)return;let B=S;if(v.key==="ArrowRight")B=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")B=Math.max(0,S-1);else if(v.key==="Home")B=0;else if(v.key==="End")B=C.length-1;else return;v.preventDefault(),F(B)&&I(C[B].value);},[C,r,S,F,I]),b=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[_f(T),M],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:w,css:Kf,children:C.map((v,B)=>jsx(fe.Fragment,{children:jsx(Jf,{i:B,item:v,size:b,tokens:R,variant:p,titlePosition:f,isActive:!A&&B===S,completed:D(B),disabled:r||!!v.disabled,connectorColor:E,showConnector:B<C.length-1,animate:H,separator:h,canGoToIndex:F,setSelected:I})},String(v.value??B)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function eg(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var tg=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:M,activeTabCss:y,activeIndicatorCss:x})=>{let g=V(),d=ve(),p=s==="vertical",C=l||i!=null,P=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:E,contents:k}=fe.useMemo(()=>{let ee=[],oe=[];return fe.Children.forEach(e,ae=>{if(!fe.isValidElement(ae))return;let{type:be,props:Ne}=eg(ae),ze=be===Fr||be?.displayName===Fr.displayName,X=be===Pr||be?.displayName===Pr.displayName;if(ze){let re=Ne;if(re?.value===void 0)return;ee.push({value:re.value,disabled:re.disabled,node:re.children,className:re.className,css:re.css,activeCss:re.activeCss});}else if(X){let re=Ne;if(re?.value===void 0)return;oe.push({value:re.value,node:re.children,className:re.className,css:re.css});}}),{tabs:ee,contents:oe}},[e]),$=fe.useMemo(()=>E.find(ee=>!ee.disabled)?.value,[E]),[_,W]=fe.useState(()=>t!==void 0&&E.some(oe=>oe.value===t&&!oe.disabled)?t:$),S=n!==void 0,A=S?n:_,I=fe.useRef(null),D=fe.useRef([]),F=Math.max(0,E.findIndex(ee=>ee.value===A)),[H,z]=fe.useState({left:0,top:0,width:0,height:0}),[w,b]=fe.useState(false),[v,B]=fe.useState(false),L=fe.useCallback(()=>{let ee=I.current,oe=D.current[F];if(!ee||!oe)return;let ae=ee.getBoundingClientRect(),be=oe.getBoundingClientRect();z({left:be.left-ae.left,top:be.top-ae.top,width:be.width,height:be.height});},[F]);fe.useLayoutEffect(()=>{L(),w||(b(true),requestAnimationFrame(()=>B(true)));},[L,w]),fe.useEffect(()=>{let ee=new ResizeObserver(()=>L());I.current&&ee.observe(I.current);let oe=D.current[F];oe&&ee.observe(oe);let ae=()=>L();return window.addEventListener("resize",ae),()=>{ee.disconnect(),window.removeEventListener("resize",ae);}},[L,F]);let O=(ee,oe)=>{if(!E.length)return ee;let ae=ee;for(let be=0;be<E.length;be++)if(ae=(ae+oe+E.length)%E.length,!E[ae].disabled)return ae;return ee},K=ee=>{S||W(ee),o?.(ee);},N=ee=>{if(!E.length)return;let oe=F;if(ee.key===(p?"ArrowDown":"ArrowRight"))oe=O(F,1);else if(ee.key===(p?"ArrowUp":"ArrowLeft"))oe=O(F,-1);else if(ee.key==="Home")oe=E.findIndex(be=>!be.disabled);else if(ee.key==="End"){let be=[...E].reverse().findIndex(Ne=>!Ne.disabled);oe=be===-1?F:E.length-1-be;}else return;ee.preventDefault();let ae=E[oe]?.value;ae!==void 0&&K(ae),requestAnimationFrame(()=>D.current[oe]?.focus());},U=g.text.primary,G=g.text.secondary,se=g.neutral[500],j=r==="subtle"?g.surface.subtleBg:"transparent",J=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",le=g.text.primary,de=r==="subtle"||r==="ghost"||r==="underlined",ge=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Te=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:Pe?g.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?p?g.radius.lg:g.radius.full:g.radius.lg:"none"}),Re=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:w?1:0,visibility:w?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":J,...p?{top:`${H.top}px`,height:`${H.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${H.left}px`,width:`${H.width}px`,top:g.spacing.xs,bottom:g.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ie=css(r!=="underlined"?{}:p?{background:"transparent",top:`${H.top}px`,height:`${H.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${H.left}px`,width:`${H.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),we=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${g.spacing.md}`:r==="ghost"&&s!=="vertical"?`${g.spacing.md}`:`${g.spacing.xs} ${g.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:P}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:g.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Q=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[P]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),ie=css({marginTop:g.spacing.sm,width:"100%"}),me=fe.useId(),Y=new Map;k.forEach((ee,oe)=>Y.set(ee.value,`${me}-panel-${oe}`));let xe=ee=>`${me}-tab-${ee}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[ge,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Te,T],children:[de&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Re,Ie,M,x]}),E.map((ee,oe)=>{let ae=A===ee.value;return jsx("button",{ref:be=>{D.current[oe]=be;},role:"tab",id:xe(oe),"aria-selected":ae,"aria-controls":Y.get(ee.value),"aria-disabled":ee.disabled||void 0,disabled:ee.disabled,tabIndex:ee.disabled?-1:oe===F?0:-1,className:["plainframe-ui-tab",ee.className||""].join(" ").trim(),onClick:()=>{ee.disabled||K(ee.value);},css:[we,!ee.disabled&&d(),ee.css,ae?ee.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Q,children:ee.node})},String(ee.value??oe))})]}),k.map((ee,oe)=>{if(!(ee.value===A))return null;let be=E.findIndex(ze=>ze.value===ee.value),Ne=be>=0?xe(be):void 0;return jsx("div",{role:"tabpanel",id:Y.get(ee.value),"aria-labelledby":Ne,className:["plainframe-ui-tab-panel",ee.className||""].join(" ").trim(),css:[ie,ee.css],children:ee.node},oe)})]})};var Po=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sn=e=>e==null?[]:Array.isArray(e)?e:[e],Do=(...e)=>css(e.filter(Boolean)),ig=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:M,showCharCount:y,focusRingMode:x="always",resizable:g=false,className:d,wrapperCss:p,inputCss:C,labelCss:P,helperRowCss:R,helperTextCss:E,charCountCss:k,css:$,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:A,name:I,id:D,tabIndex:F,autoComplete:H,readOnly:z,required:w})=>{let b=V(),v=Yo(),B=useId(),L=useMemo(()=>({sm:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.sm,labelFont:b.typography.sizes.xs,helperFont:b.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:b.spacing.md},md:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.md,labelFont:b.typography.sizes.sm,helperFont:b.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:b.spacing.md},lg:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.lg,labelFont:b.typography.sizes.md,helperFont:b.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:b.spacing.md}}),[b]),O=["sm","md","lg"].includes(u)?u:"md",K=L[O],N=b.neutral,U=b.text,G=t!==void 0,[se,j]=useState(n),J=G?t:se,le=useCallback(ae=>{G||j(ae),o?.(ae);},[G,o]),de=useMemo(()=>c?N[200]:s&&m==="outlined"?b.surface.panelBg??b.surface.panelBg:s&&m==="subtle"?b.palette.danger?.[50]??b.surface.subtleBg:m==="outlined"?b.surface.panelBg:m==="subtle"?b.surface.subtleBg:"transparent",[c,s,m,N,b.surface,b.palette.danger]),ge=b.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${ge} solid ${s?b.palette.danger?.[300]??b.surface.border:b.surface.border}`:"none",[m,ge,s,b.palette.danger,b.surface.border]),Te=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Po(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),Re=useMemo(()=>Do({fontSize:K.labelFont,fontWeight:500,color:s?b.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...Sn(P)),[K.labelFont,s,c,N,U,b.palette.danger,P]),Ie=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:b.spacing.sm,padding:`${Po(K.paddingY)} 0 ${Po(K.paddingY)} ${Po(K.paddingX)}`,background:de,border:Pe,borderRadius:h?b.radius.full:b.radius.md,minHeight:K.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...Sn(p),...Sn($)],[b,K,de,Pe,ge,h,c,p,$]),we=typeof K.minHeight=="number"?`${K.minHeight}px`:K.minHeight,Q=useMemo(()=>Do({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:K.fontSize,lineHeight:1.5,color:c?N[500]:s?b.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Po(K.paddingX),overflowY:"auto",minHeight:we,"&::placeholder":{color:s?b.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?b.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${de} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?b.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${we} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...Sn(C)),[g,K,c,s,N,U,b.palette.danger,we,de,f,C]),ie=useMemo(()=>Do({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...Sn(R)),[R]),me=useMemo(()=>Do({fontSize:K.helperFont,color:s?b.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...Sn(E)),[K.helperFont,s,b.palette.danger,U,E]),Y=useMemo(()=>Do({fontSize:K.helperFont,color:M&&J.length>M?b.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...Sn(k)),[K.helperFont,M,J.length,b.palette.danger,U,k]),xe=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=xe.current;if(!ae)return;if(g){let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);return}(()=>{let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);let Z=T?ze*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,Z)}px`;})();},[J,f,T,K.minHeight,g]);let ee=a!=null||y?`${D??B}-help`:void 0,oe=D??B;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Te,children:[e&&jsx("label",{htmlFor:oe,className:"plainframe-ui-textarea-label",css:Re,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Ie],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&xe.current?.focus(),children:jsx("textarea",{ref:xe,id:oe,className:"plainframe-ui-textarea-input",css:Q,rows:f,value:J,onChange:ae=>{let be=ae.target.value;M&&be.length>M||le(be);},placeholder:r||"",disabled:c,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:A,name:I,tabIndex:F,autoComplete:H,readOnly:z,required:w,"aria-invalid":!!s||void 0,"aria-describedby":ee})}),(a!=null||y&&M!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:ee,className:"plainframe-ui-textarea-helper-text",css:me,children:a}),y&&M!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",M]})]})]})};var gg=jo,bg={type:"spring",stiffness:920,damping:100},tc="__toast_root__",hg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Nr=(e,t)=>{for(let n of t){let o=hg(e,n);if(o!=null&&o!=="")return o}},la=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function yg(e){let t=Nr(e,["radius.md","shape.borderRadius","radii.md"]),n=Nr(e,["spacing.lg","space.4","spacing.4"]),o=Nr(e,["spacing.md","space.3","spacing.3"]),r=Nr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:la(t,16),padX:la(n,14),padY:la(o,12),shadow:String(r)}}var xg=yg(gg),Kt=null,Yn=null,ye={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function rc(){typeof document>"u"||(Kt||(Kt=document.getElementById("toast-host"),Kt||(Kt=document.createElement("div"),Kt.id="toast-host",document.body.appendChild(Kt))),Yn||(Yn=Kt[tc]??null,Yn||(Yn=createRoot(Kt),Kt[tc]=Yn,Yn.render(jsx(La,{children:jsx(Mg,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},In=()=>{te.sync(),te.notify();},vg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Hr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||te.timers.has(e.id))return;let o=Date.now(),r=te.remaining.get(e.id),s=r!=null?Math.max(0,r):n;te.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Be.dismiss(e.id),s);te.timers.set(e.id,a);}function Lr(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function Cg(){let e=false;for(;te.displayed.length<ye.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],In();}),Hr(t);}e&&In();}function Rg(){if(te.displayed.length<ye.max)return;let e=te.displayed.filter(o=>!te.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=te.expiry.get(t.id);n!=null&&te.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),te.exiting[t.id]=true,te.displayed=te.displayed.filter(o=>o.id!==t.id),delete te.enterFrom[t.id],te.queue.push(t),In();}var Tg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function wg(e,t){let n=Tg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,M=o.palette;return {bg:T?.[m]??M?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Be=Object.assign((e,t)=>{rc();let n=i=>i!=null&&typeof i[Symbol.iterator]=="function",o=i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function",r;typeof e=="object"&&e!=null&&!fe.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(fe.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??vg(),a=i=>{let l=i.findIndex(h=>h.id===s);if(l===-1)return false;let u=i[l],m={...u,status:r.status??u.status,content:r.content??u.content,title:r.title??u.title,description:r.description??u.description,startIcon:r.startIcon??u.startIcon,endIcon:r.endIcon??u.endIcon,action:r.action??u.action,onClose:r.onClose??u.onClose,duration:r.duration===void 0?u.duration:r.duration,pauseOnHover:r.pauseOnHover??u.pauseOnHover,showDismiss:r.showDismiss??u.showDismiss,render:r.render??u.render,bare:r.bare??u.bare,onClick:r.onClick??u.onClick,width:r.width??u.width};return i[l]=m,Lr(s),te.remaining.delete(s),te.paused.has(s)||Hr(m),In(),true};if(a(te.displayed)||a(te.queue))return s;let c={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?ye.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return te.displayed.length>=ye.max&&Rg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],In();}),In(),Hr(c),s},{success:(e,t={})=>Be(e,{...t,status:"success"}),error:(e,t={})=>Be(e,{...t,status:"error"}),warning:(e,t={})=>Be(e,{...t,status:"warning"}),info:(e,t={})=>Be(e,{...t,status:"info"}),custom:(e,t={})=>Be(e,{...t}),update:(e,t)=>Be({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Be.dismiss(n);return}Lr(e),te.remaining.delete(e),te.paused.delete(e),te.exiting[e]=true;let t=te.displayed.find(n=>n.id===e);te.displayed=te.displayed.filter(n=>n.id!==e),delete te.enterFrom[e],In(),window.setTimeout(()=>t?.onClose?.(),120),Cg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Be.dismiss(t));},pause:e=>{if(te.paused.has(e))return;let t=te.expiry.get(e);t!=null&&te.remaining.set(e,Math.max(0,t-Date.now())),te.paused.add(e),Lr(e);},resume:e=>{if(!te.paused.has(e))return;te.paused.delete(e);let t=te.displayed.find(o=>o.id===e)??te.queue.find(o=>o.id===e),n=te.remaining.get(e);t&&Hr(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Be.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Be.resume(e.id);},promise:(e,t,n={})=>{let o=Be(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Be.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Be.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ye.max=e.max),e.position&&(ye.position=e.position),e.gutter!=null&&(ye.gutter=e.gutter),e.zIndex!=null&&(ye.zIndex=e.zIndex),e.duration!==void 0&&(ye.duration=e.duration),e.showDismiss&&(ye.showDismiss=e.showDismiss),e.styles&&(ye.styles={...ye.styles,...e.styles}),e.renderer!==void 0&&(ye.renderer=e.renderer),e.bareRenderer!==void 0&&(ye.bareRenderer=e.bareRenderer);}});function Eg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ye.showDismiss}function Sg(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var Ig=css({display:"flex",alignItems:"flex-start",gap:10}),nc=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),kg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Ag=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Mg=fe.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=V(),o=ye.position.startsWith("bottom"),r=fe.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=fe.useMemo(()=>({position:"fixed",zIndex:ye.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Sg(ye.position),...ye.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,c)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,u=c>0?ye.gutter:0,m={toast:a,close:Be.dismiss,pause:Be.pause,resume:Be.resume},{bg:h,fg:f,border:T}=wg(n,a.status),M={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:xg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:h,color:f,cursor:a.onClick?"pointer":"default",border:T?`1px solid ${T}`:"1px solid transparent"},y=typeof ye.styles.surface=="function"?ye.styles.surface(a):ye.styles.surface??{},x=Eg(a.showDismiss),g={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(g[d]={opacity:0,pointerEvents:"none"},g[p]={opacity:1,pointerEvents:"auto"}):x==="always"?g[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(g[d]={display:"none"});let C=css({...M,...y,...g}),P=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...ye.styles.close??{}}),R;if(a.bare&&a.render){let E=typeof a.render=="function"?a.render(m):a.render;R=jsx("div",{style:{pointerEvents:"auto"},onClick:k=>a.onClick?.(a.id,k),children:E});}else if(ye.bareRenderer&&ye.renderer){let E=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:k=>a.onClick?.(a.id,k),children:E});}else {let E;ye.renderer?E=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer:a.render&&!a.bare?E=typeof a.render=="function"?a.render(m):a.render:E=jsxs(Fragment,{children:[jsxs("div",{css:Ig,children:[a.startIcon&&jsx("div",{css:nc,children:a.startIcon}),jsx("div",{css:kg,children:a.content}),a.endIcon&&jsx("div",{css:nc,children:a.endIcon})]}),a.action&&jsx("div",{css:Ag,children:a.action})]}),R=jsxs("div",{css:C,onClick:k=>a.onClick?.(a.id,k),children:[E,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:P,onClick:k=>{k.stopPropagation(),Be.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Fg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Fg=fe.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:c,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:bg});},[l]);let u={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:a!=null?typeof a=="number"?`${a}px`:a:"none",...ye.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),g=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:g}}).then(()=>Be.dismiss(n));},onMouseEnter:c?()=>Be.pause(n):void 0,onMouseLeave:c?()=>Be.resume(n):void 0,children:i})}),oc=false;(function(){oc||(oc=true,rc());})();var eb=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},ic=createContext(null),lc=()=>{let e=useContext(ic);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},tb=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),M=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),g=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([M,y,x,g]),C=useId(),P=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(ic.Provider,{value:P,children:e})},nb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=lc(),c=fe.isValidElement(t),i=c&&typeof t.type=="string";if(e&&c&&i){let l=t,u="ref"in l?l.ref:void 0,m=s({...l.props,"aria-describedby":a,ref:eb(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return fe.cloneElement(l,{...m,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},ob=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:c,getFloatingProps:i,placement:l,id:u,autoWidth:m,allowArrow:h,arrowRef:f}=lc(),T=V(),M=l.split("-")[0]||"top",x=M==="bottom"?{opacity:0,y:-8,scale:.98}:M==="top"?{opacity:0,y:8,scale:.98}:M==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},g=x,d=M==="bottom"?"center top":M==="top"?"center bottom":M==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),P=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[M];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:g,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:P?.x!=null?`${P.x}px`:void 0,top:P?.y!=null?`${P.y}px`:void 0,[R]:"-3px"}})]})})})};function ib(){let e=V();return jsx(Global,{styles:css`
|
|
20
|
+
`,Lf=fe.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=V(),u=l.surface.subtleBg,m=l.neutral[200],h=na(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":na(r,String(r)),height:s==null?"fit-content":na(s,String(s))}),T=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:u,willChange:"background-position, opacity"}),M=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Nf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Hf} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,M]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var Ar=8,oa=20,Xn=4,Jl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:M="horizontal",className:y,...x})=>{let g=V(),d=M==="vertical",p=useRef(null),[C,P]=useState(false),[R,E]=useState(false),[k,$]=useState(false),_=e!==void 0,W=useCallback(Y=>Math.min(r,Math.max(o,Y)),[o,r]),S=useCallback(Y=>W(Math.round((Y-o)/s)*s+o),[o,s,W]),[A,I]=useState(()=>S(t??o)),D=_?S(e):A;useEffect(()=>{_||I(Y=>S(Y));},[o,r,s,_,S]);let F=g.palette.primary[600];g.surface.panelBg;let z=g.neutral[500],w=useMemo(()=>{let Y=r-o||1;return (D-o)/Y*100},[D,o,r]),b=useCallback(Y=>{_||I(Y),n?.(Y);},[_,n]),v=useCallback((Y,xe)=>{let ee=p.current;if(!ee)return D;let oe=ee.getBoundingClientRect(),ae=d?(oe.bottom-xe)/oe.height:(Y-oe.left)/oe.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[D,d,o,r,S]),B=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),b(v(Y.clientX,Y.clientY)),P(true));},[a,b,v]),L=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),P(true));},[a]),O=useCallback(Y=>{!C||a||b(v(Y.clientX,Y.clientY));},[C,a,b,v]),K=useCallback(()=>P(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K);}},[C,O,K]);let N=useCallback(Y=>{if(a)return;let xe=D;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")xe=D+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")xe=D-s;else if(Y.key==="Home")xe=o;else if(Y.key==="End")xe=r;else return;Y.preventDefault(),b(S(xe));},[a,D,s,o,r,b,S]),U=C||R||k,G=(R||C)&&!a,se=`color-mix(in srgb, ${F} 25%, transparent)`,j=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":m?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),J=css({marginBottom:d?0:4,marginRight:d?8:0,color:g.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Ar:"100%",height:d?"100%":Ar,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),de=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Ar:`calc(100% - ${Xn*.5}px)`,height:d?`calc(100% - ${Xn*.5}px)`:Ar,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),ge=css({width:Xn,height:Xn,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-w}% )`:0,bottom:0,width:d?"100%":`${w}%`,height:d?`${w}%`:"100%",backgroundColor:a?z:F,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Te=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:g.text.onColors.primary,width:oa,height:oa,left:d?"50%":`calc(${w}% - ${oa/2}px)`,bottom:d?`${w}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${a?z:F}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),Re=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ie=css({position:"absolute",top:d?`calc(50% - ${Xn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Xn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:g.neutral[800],color:g.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:g.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),we=h,Q=f,ie=T,me=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[j,we],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:J,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[le,Q],onPointerDown:B,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:de,children:Array.from({length:me}).map((Y,xe)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:ge},xe))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":D,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:L,onPointerUp:K,onPointerCancel:K,onMouseEnter:()=>E(true),onMouseLeave:()=>E(false),className:"plainframe-ui-slider-thumb",css:[Te,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Re,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ie,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:D})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Jl.displayName="Slider";var _f=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Kf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Vf=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),jf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Uf=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),qf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),Gf=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),Xf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Zl=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),Yf=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),Jf=fe.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:M}){let y=V(),x=ve(),{MAIN:g,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:P,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:E,UPCOMING_FG:k}=r,$="transparent",_=k,W=E;s==="subtle"?i?($=C,_=P,W=C):c?($=g,_=d,W=g):($=R,_=k,W=R):i?($=C,_=P,W=C):c?($="transparent",_=p,W=g):($="transparent",_=k,W=E);let S=n.label,A=n.icon??jsx("span",{css:Xf,children:typeof S=="number"?S:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Vf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[Gf(o,$,_,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&M(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Zl(!i),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Zl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Yf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:qf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:jf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Uf(i?1:0,u,h),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),aa=()=>null;aa.displayName="PlainframeUIStep";var Zf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:M,className:y,children:x,...g})=>{let d=V(),p=e==="outlined"?"outlined":"subtle",C=fe.useMemo(()=>{let v=fe.Children.toArray(x).filter(B=>fe.isValidElement(B)&&B.type===aa);return v.length?v.map((B,L)=>({index:L,...B.props})):[{value:1},{value:2},{value:3}]},[x]),P=fe.useCallback((v,B)=>v?d.palette?.[v]??v:B,[d.palette]),R=fe.useMemo(()=>({MAIN:String(P(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(P(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(P(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(P(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(P(m,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[P,i,l,u,m,d.palette.primary,d.neutral,d.text]),E=fe.useMemo(()=>{let v=P(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[P,c,d.palette.primary]),[k,$]=fe.useState(()=>C.some(B=>B?.value===n)?n:C[0]?.value),_=t!==void 0,W=_?t:k,{activeIndex:S,afterLast:A}=fe.useMemo(()=>{let v=C.findIndex(B=>B.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let B=Math.floor(W)-1;if(B>=C.length)return {activeIndex:C.length-1,afterLast:true};if(B>=0)return {activeIndex:B,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=fe.useCallback(v=>{r||(_||$(v),o?.(v));},[r,_,o]),D=fe.useCallback(v=>a||!!C[v]?.complete||(A?true:v<S),[a,C,A,S]),F=fe.useCallback(v=>{if(r)return false;let B=C[v];if(!B||B.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>S)return false}else if(typeof s=="function"&&!s(S,v))return false;return true},[r,C,s,S]),[H,z]=fe.useState(false);fe.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let w=fe.useCallback(v=>{if(!C.length||r)return;let B=S;if(v.key==="ArrowRight")B=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")B=Math.max(0,S-1);else if(v.key==="Home")B=0;else if(v.key==="End")B=C.length-1;else return;v.preventDefault(),F(B)&&I(C[B].value);},[C,r,S,F,I]),b=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[_f(T),M],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:w,css:Kf,children:C.map((v,B)=>jsx(fe.Fragment,{children:jsx(Jf,{i:B,item:v,size:b,tokens:R,variant:p,titlePosition:f,isActive:!A&&B===S,completed:D(B),disabled:r||!!v.disabled,connectorColor:E,showConnector:B<C.length-1,animate:H,separator:h,canGoToIndex:F,setSelected:I})},String(v.value??B)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function eg(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var tg=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:M,activeTabCss:y,activeIndicatorCss:x})=>{let g=V(),d=ve(),p=s==="vertical",C=l||i!=null,P=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:E,contents:k}=fe.useMemo(()=>{let ee=[],oe=[];return fe.Children.forEach(e,ae=>{if(!fe.isValidElement(ae))return;let{type:be,props:Ne}=eg(ae),ze=be===Fr||be?.displayName===Fr.displayName,X=be===Pr||be?.displayName===Pr.displayName;if(ze){let re=Ne;if(re?.value===void 0)return;ee.push({value:re.value,disabled:re.disabled,node:re.children,className:re.className,css:re.css,activeCss:re.activeCss});}else if(X){let re=Ne;if(re?.value===void 0)return;oe.push({value:re.value,node:re.children,className:re.className,css:re.css});}}),{tabs:ee,contents:oe}},[e]),$=fe.useMemo(()=>E.find(ee=>!ee.disabled)?.value,[E]),[_,W]=fe.useState(()=>t!==void 0&&E.some(oe=>oe.value===t&&!oe.disabled)?t:$),S=n!==void 0,A=S?n:_,I=fe.useRef(null),D=fe.useRef([]),F=Math.max(0,E.findIndex(ee=>ee.value===A)),[H,z]=fe.useState({left:0,top:0,width:0,height:0}),[w,b]=fe.useState(false),[v,B]=fe.useState(false),L=fe.useCallback(()=>{let ee=I.current,oe=D.current[F];if(!ee||!oe)return;let ae=ee.getBoundingClientRect(),be=oe.getBoundingClientRect();z({left:be.left-ae.left,top:be.top-ae.top,width:be.width,height:be.height});},[F]);fe.useLayoutEffect(()=>{L(),w||(b(true),requestAnimationFrame(()=>B(true)));},[L,w]),fe.useEffect(()=>{let ee=new ResizeObserver(()=>L());I.current&&ee.observe(I.current);let oe=D.current[F];oe&&ee.observe(oe);let ae=()=>L();return window.addEventListener("resize",ae),()=>{ee.disconnect(),window.removeEventListener("resize",ae);}},[L,F]);let O=(ee,oe)=>{if(!E.length)return ee;let ae=ee;for(let be=0;be<E.length;be++)if(ae=(ae+oe+E.length)%E.length,!E[ae].disabled)return ae;return ee},K=ee=>{S||W(ee),o?.(ee);},N=ee=>{if(!E.length)return;let oe=F;if(ee.key===(p?"ArrowDown":"ArrowRight"))oe=O(F,1);else if(ee.key===(p?"ArrowUp":"ArrowLeft"))oe=O(F,-1);else if(ee.key==="Home")oe=E.findIndex(be=>!be.disabled);else if(ee.key==="End"){let be=[...E].reverse().findIndex(Ne=>!Ne.disabled);oe=be===-1?F:E.length-1-be;}else return;ee.preventDefault();let ae=E[oe]?.value;ae!==void 0&&K(ae),requestAnimationFrame(()=>D.current[oe]?.focus());},U=g.text.primary,G=g.text.secondary,se=g.neutral[500],j=r==="subtle"?g.surface.subtleBg:"transparent",J=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",le=g.text.primary,de=r==="subtle"||r==="ghost"||r==="underlined",ge=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Te=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:Pe?g.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?p?g.radius.lg:g.radius.full:g.radius.lg:"none"}),Re=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:w?1:0,visibility:w?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":J,...p?{top:`${H.top}px`,height:`${H.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${H.left}px`,width:`${H.width}px`,top:g.spacing.xs,bottom:g.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ie=css(r!=="underlined"?{}:p?{background:"transparent",top:`${H.top}px`,height:`${H.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${H.left}px`,width:`${H.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),we=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${g.spacing.md}`:r==="ghost"&&s!=="vertical"?`${g.spacing.md}`:`${g.spacing.xs} ${g.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:P}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:g.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Q=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[P]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),ie=css({marginTop:g.spacing.sm,width:"100%"}),me=fe.useId(),Y=new Map;k.forEach((ee,oe)=>Y.set(ee.value,`${me}-panel-${oe}`));let xe=ee=>`${me}-tab-${ee}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[ge,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Te,T],children:[de&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Re,Ie,M,x]}),E.map((ee,oe)=>{let ae=A===ee.value;return jsx("button",{ref:be=>{D.current[oe]=be;},role:"tab",id:xe(oe),"aria-selected":ae,"aria-controls":Y.get(ee.value),"aria-disabled":ee.disabled||void 0,disabled:ee.disabled,tabIndex:ee.disabled?-1:oe===F?0:-1,className:["plainframe-ui-tab",ee.className||""].join(" ").trim(),onClick:()=>{ee.disabled||K(ee.value);},css:[we,!ee.disabled&&d(),ee.css,ae?ee.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Q,children:ee.node})},String(ee.value??oe))})]}),k.map((ee,oe)=>{if(!(ee.value===A))return null;let be=E.findIndex(ze=>ze.value===ee.value),Ne=be>=0?xe(be):void 0;return jsx("div",{role:"tabpanel",id:Y.get(ee.value),"aria-labelledby":Ne,className:["plainframe-ui-tab-panel",ee.className||""].join(" ").trim(),css:[ie,ee.css],children:ee.node},oe)})]})};var Po=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sn=e=>e==null?[]:Array.isArray(e)?e:[e],Do=(...e)=>css(e.filter(Boolean)),ig=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:M,showCharCount:y,focusRingMode:x="always",resizable:g=false,className:d,wrapperCss:p,inputCss:C,labelCss:P,helperRowCss:R,helperTextCss:E,charCountCss:k,css:$,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:A,name:I,id:D,tabIndex:F,autoComplete:H,readOnly:z,required:w})=>{let b=V(),v=Yo(),B=useId(),L=useMemo(()=>({sm:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.sm,labelFont:b.typography.sizes.xs,helperFont:b.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:b.spacing.md},md:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.md,labelFont:b.typography.sizes.sm,helperFont:b.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:b.spacing.md},lg:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.lg,labelFont:b.typography.sizes.md,helperFont:b.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:b.spacing.md}}),[b]),O=["sm","md","lg"].includes(u)?u:"md",K=L[O],N=b.neutral,U=b.text,G=t!==void 0,[se,j]=useState(n),J=G?t:se,le=useCallback(ae=>{G||j(ae),o?.(ae);},[G,o]),de=useMemo(()=>c?N[200]:s&&m==="outlined"?b.palette.danger?.[50]??b.surface.panelBg:s&&m==="subtle"?b.palette.danger?.[50]??b.surface.subtleBg:m==="outlined"?b.surface.panelBg:m==="subtle"?b.surface.subtleBg:"transparent",[c,s,m,N,b.surface,b.palette.danger]),ge=b.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${ge} solid ${s?b.palette.danger?.[300]??b.surface.border:b.surface.border}`:"none",[m,ge,s,b.palette.danger,b.surface.border]),Te=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Po(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),Re=useMemo(()=>Do({fontSize:K.labelFont,fontWeight:500,color:s?b.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...Sn(P)),[K.labelFont,s,c,N,U,b.palette.danger,P]),Ie=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:b.spacing.sm,padding:`${Po(K.paddingY)} 0 ${Po(K.paddingY)} ${Po(K.paddingX)}`,background:de,border:Pe,borderRadius:h?b.radius.full:b.radius.md,minHeight:K.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...Sn(p),...Sn($)],[b,K,de,Pe,ge,h,c,p,$]),we=typeof K.minHeight=="number"?`${K.minHeight}px`:K.minHeight,Q=useMemo(()=>Do({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:K.fontSize,lineHeight:1.5,color:c?N[500]:s?b.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Po(K.paddingX),overflowY:"auto",minHeight:we,"&::placeholder":{color:s?b.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?b.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${de} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?b.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${we} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...Sn(C)),[g,K,c,s,N,U,b.palette.danger,we,de,f,C]),ie=useMemo(()=>Do({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...Sn(R)),[R]),me=useMemo(()=>Do({fontSize:K.helperFont,color:s?b.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...Sn(E)),[K.helperFont,s,b.palette.danger,U,E]),Y=useMemo(()=>Do({fontSize:K.helperFont,color:M&&J.length>M?b.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...Sn(k)),[K.helperFont,M,J.length,b.palette.danger,U,k]),xe=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=xe.current;if(!ae)return;if(g){let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);return}(()=>{let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);let Z=T?ze*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,Z)}px`;})();},[J,f,T,K.minHeight,g]);let ee=a!=null||y?`${D??B}-help`:void 0,oe=D??B;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Te,children:[e&&jsx("label",{htmlFor:oe,className:"plainframe-ui-textarea-label",css:Re,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Ie],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&xe.current?.focus(),children:jsx("textarea",{ref:xe,id:oe,className:"plainframe-ui-textarea-input",css:Q,rows:f,value:J,onChange:ae=>{let be=ae.target.value;M&&be.length>M||le(be);},placeholder:r||"",disabled:c,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:A,name:I,tabIndex:F,autoComplete:H,readOnly:z,required:w,"aria-invalid":!!s||void 0,"aria-describedby":ee})}),(a!=null||y&&M!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:ee,className:"plainframe-ui-textarea-helper-text",css:me,children:a}),y&&M!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",M]})]})]})};var gg=jo,bg={type:"spring",stiffness:920,damping:100},tc="__toast_root__",hg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Nr=(e,t)=>{for(let n of t){let o=hg(e,n);if(o!=null&&o!=="")return o}},la=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function yg(e){let t=Nr(e,["radius.md","shape.borderRadius","radii.md"]),n=Nr(e,["spacing.lg","space.4","spacing.4"]),o=Nr(e,["spacing.md","space.3","spacing.3"]),r=Nr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:la(t,16),padX:la(n,14),padY:la(o,12),shadow:String(r)}}var xg=yg(gg),Kt=null,Yn=null,ye={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function rc(){typeof document>"u"||(Kt||(Kt=document.getElementById("toast-host"),Kt||(Kt=document.createElement("div"),Kt.id="toast-host",document.body.appendChild(Kt))),Yn||(Yn=Kt[tc]??null,Yn||(Yn=createRoot(Kt),Kt[tc]=Yn,Yn.render(jsx(La,{children:jsx(Mg,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},In=()=>{te.sync(),te.notify();},vg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Hr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||te.timers.has(e.id))return;let o=Date.now(),r=te.remaining.get(e.id),s=r!=null?Math.max(0,r):n;te.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Be.dismiss(e.id),s);te.timers.set(e.id,a);}function Lr(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function Cg(){let e=false;for(;te.displayed.length<ye.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],In();}),Hr(t);}e&&In();}function Rg(){if(te.displayed.length<ye.max)return;let e=te.displayed.filter(o=>!te.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=te.expiry.get(t.id);n!=null&&te.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),te.exiting[t.id]=true,te.displayed=te.displayed.filter(o=>o.id!==t.id),delete te.enterFrom[t.id],te.queue.push(t),In();}var Tg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function wg(e,t){let n=Tg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,M=o.palette;return {bg:T?.[m]??M?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Be=Object.assign((e,t)=>{rc();let n=i=>i!=null&&typeof i[Symbol.iterator]=="function",o=i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function",r;typeof e=="object"&&e!=null&&!fe.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(fe.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??vg(),a=i=>{let l=i.findIndex(h=>h.id===s);if(l===-1)return false;let u=i[l],m={...u,status:r.status??u.status,content:r.content??u.content,title:r.title??u.title,description:r.description??u.description,startIcon:r.startIcon??u.startIcon,endIcon:r.endIcon??u.endIcon,action:r.action??u.action,onClose:r.onClose??u.onClose,duration:r.duration===void 0?u.duration:r.duration,pauseOnHover:r.pauseOnHover??u.pauseOnHover,showDismiss:r.showDismiss??u.showDismiss,render:r.render??u.render,bare:r.bare??u.bare,onClick:r.onClick??u.onClick,width:r.width??u.width};return i[l]=m,Lr(s),te.remaining.delete(s),te.paused.has(s)||Hr(m),In(),true};if(a(te.displayed)||a(te.queue))return s;let c={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?ye.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return te.displayed.length>=ye.max&&Rg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],In();}),In(),Hr(c),s},{success:(e,t={})=>Be(e,{...t,status:"success"}),error:(e,t={})=>Be(e,{...t,status:"error"}),warning:(e,t={})=>Be(e,{...t,status:"warning"}),info:(e,t={})=>Be(e,{...t,status:"info"}),custom:(e,t={})=>Be(e,{...t}),update:(e,t)=>Be({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Be.dismiss(n);return}Lr(e),te.remaining.delete(e),te.paused.delete(e),te.exiting[e]=true;let t=te.displayed.find(n=>n.id===e);te.displayed=te.displayed.filter(n=>n.id!==e),delete te.enterFrom[e],In(),window.setTimeout(()=>t?.onClose?.(),120),Cg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Be.dismiss(t));},pause:e=>{if(te.paused.has(e))return;let t=te.expiry.get(e);t!=null&&te.remaining.set(e,Math.max(0,t-Date.now())),te.paused.add(e),Lr(e);},resume:e=>{if(!te.paused.has(e))return;te.paused.delete(e);let t=te.displayed.find(o=>o.id===e)??te.queue.find(o=>o.id===e),n=te.remaining.get(e);t&&Hr(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Be.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Be.resume(e.id);},promise:(e,t,n={})=>{let o=Be(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Be.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Be.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ye.max=e.max),e.position&&(ye.position=e.position),e.gutter!=null&&(ye.gutter=e.gutter),e.zIndex!=null&&(ye.zIndex=e.zIndex),e.duration!==void 0&&(ye.duration=e.duration),e.showDismiss&&(ye.showDismiss=e.showDismiss),e.styles&&(ye.styles={...ye.styles,...e.styles}),e.renderer!==void 0&&(ye.renderer=e.renderer),e.bareRenderer!==void 0&&(ye.bareRenderer=e.bareRenderer);}});function Eg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ye.showDismiss}function Sg(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var Ig=css({display:"flex",alignItems:"flex-start",gap:10}),nc=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),kg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Ag=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Mg=fe.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=V(),o=ye.position.startsWith("bottom"),r=fe.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=fe.useMemo(()=>({position:"fixed",zIndex:ye.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Sg(ye.position),...ye.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,c)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,u=c>0?ye.gutter:0,m={toast:a,close:Be.dismiss,pause:Be.pause,resume:Be.resume},{bg:h,fg:f,border:T}=wg(n,a.status),M={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:xg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:h,color:f,cursor:a.onClick?"pointer":"default",border:T?`1px solid ${T}`:"1px solid transparent"},y=typeof ye.styles.surface=="function"?ye.styles.surface(a):ye.styles.surface??{},x=Eg(a.showDismiss),g={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(g[d]={opacity:0,pointerEvents:"none"},g[p]={opacity:1,pointerEvents:"auto"}):x==="always"?g[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(g[d]={display:"none"});let C=css({...M,...y,...g}),P=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...ye.styles.close??{}}),R;if(a.bare&&a.render){let E=typeof a.render=="function"?a.render(m):a.render;R=jsx("div",{style:{pointerEvents:"auto"},onClick:k=>a.onClick?.(a.id,k),children:E});}else if(ye.bareRenderer&&ye.renderer){let E=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:k=>a.onClick?.(a.id,k),children:E});}else {let E;ye.renderer?E=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer:a.render&&!a.bare?E=typeof a.render=="function"?a.render(m):a.render:E=jsxs(Fragment,{children:[jsxs("div",{css:Ig,children:[a.startIcon&&jsx("div",{css:nc,children:a.startIcon}),jsx("div",{css:kg,children:a.content}),a.endIcon&&jsx("div",{css:nc,children:a.endIcon})]}),a.action&&jsx("div",{css:Ag,children:a.action})]}),R=jsxs("div",{css:C,onClick:k=>a.onClick?.(a.id,k),children:[E,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:P,onClick:k=>{k.stopPropagation(),Be.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Fg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Fg=fe.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:c,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:bg});},[l]);let u={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:a!=null?typeof a=="number"?`${a}px`:a:"none",...ye.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),g=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:g}}).then(()=>Be.dismiss(n));},onMouseEnter:c?()=>Be.pause(n):void 0,onMouseLeave:c?()=>Be.resume(n):void 0,children:i})}),oc=false;(function(){oc||(oc=true,rc());})();var eb=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},ic=createContext(null),lc=()=>{let e=useContext(ic);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},tb=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),M=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),g=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([M,y,x,g]),C=useId(),P=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(ic.Provider,{value:P,children:e})},nb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=lc(),c=fe.isValidElement(t),i=c&&typeof t.type=="string";if(e&&c&&i){let l=t,u="ref"in l?l.ref:void 0,m=s({...l.props,"aria-describedby":a,ref:eb(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return fe.cloneElement(l,{...m,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},ob=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:c,getFloatingProps:i,placement:l,id:u,autoWidth:m,allowArrow:h,arrowRef:f}=lc(),T=V(),M=l.split("-")[0]||"top",x=M==="bottom"?{opacity:0,y:-8,scale:.98}:M==="top"?{opacity:0,y:8,scale:.98}:M==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},g=x,d=M==="bottom"?"center top":M==="top"?"center bottom":M==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),P=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[M];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:g,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:P?.x!=null?`${P.x}px`:void 0,top:P?.y!=null?`${P.y}px`:void 0,[R]:"-3px"}})]})})})};function ib(){let e=V();return jsx(Global,{styles:css`
|
|
21
21
|
*,*::before,*::after{box-sizing:border-box}
|
|
22
22
|
|
|
23
23
|
body{
|