plainframe-ui 0.1.50 → 0.1.53

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 CHANGED
@@ -1,8 +1,8 @@
1
- import de,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,Children,memo,useSyncExternalStore,useLayoutEffect}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var ha={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},ya={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},xa={sm:32,md:36,lg:40,border:"1px"},va={fonts:{sans:"system-ui, -apple-system, Segoe UI, Roboto, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},sizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px","6xl":"60px"}},jr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#C6C6C6",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Vr={0:"#0c0c0c",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ga={mono:{0:"#FFFFFF",50:"#FAFAFA",100:"#F2F2F2",200:"#E6E6E6",300:"#D1D1D1",400:"#8A8A8A",500:"#2A2A2A",600:"#1A1A1A",700:"#121212",800:"#0B0B0B",900:"#000000"},danger:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},success:{0:"#FFFFFF",50:"#EEFFF3",100:"#D7FFE8",200:"#d6ffe7ff",300:"#8EF5BB",400:"#5BEA9A",500:"#0FD45D",600:"#00C853",700:"#109C47",800:"#0E8242",900:"#064D2B"},warning:{0:"#FFFFFF",50:"#FFF7EB",100:"#FFEFC6",200:"#FFE094",300:"#FFC552",400:"#FFB83A",500:"#FFA414",600:"#FF9F0A",700:"#D97500",800:"#AF5E00",900:"#6E3600"},info:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},red:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},amber:{0:"#FFFFFF",50:"#FFF3EA",100:"#FFE3D1",200:"#FFC7A6",300:"#FFAC80",400:"#FF874D",500:"#FF6C1F",600:"#FF5A00",700:"#D24500",800:"#B63C00",900:"#6F2300"},orange:{0:"#FFFFFF",50:"#FFF4EB",100:"#FFE6CC",200:"#FFCE9E",300:"#FFAE66",400:"#FF8B33",500:"#FF7310",600:"#FF6B00",700:"#CC4400",800:"#AF3F00",900:"#6B2400"},yellow:{0:"#FFFFFF",50:"#FFFAE6",100:"#FFF2BF",200:"#FFE780",300:"#FFDB3D",400:"#FFD000",500:"#FFE03F",600:"#FFD60A",700:"#B38600",800:"#8E6D00",900:"#534300"},lime:{0:"#FFFFFF",50:"#F6FFE8",100:"#E7FFC2",200:"#CCFF83",300:"#A8FA3D",400:"#8BE11C",500:"#87DE10",600:"#7ACC00",700:"#4A8C00",800:"#3B7100",900:"#224300"},green:{0:"#FFFFFF",50:"#F0FFF5",100:"#DBFFE9",200:"#BDF7CF",300:"#8FE7A8",400:"#5BD57D",500:"#1DAE52",600:"#16A34A",700:"#168A40",800:"#136A34",900:"#0B3D1F"},teal:{0:"#FFFFFF",50:"#EDFFFB",100:"#D2FFF4",200:"#A6FAEA",300:"#74EEDC",400:"#41DECB",500:"#00CFAA",600:"#00BFA5",700:"#0C8C7F",800:"#0B786C",900:"#084741"},cyan:{0:"#FFFFFF",50:"#EFFFFF",100:"#D4FCFF",200:"#AFF5FD",300:"#7FE8F6",400:"#45D3EB",500:"#09C6E7",600:"#00B8D9",700:"#0A7C92",800:"#0B6E81",900:"#0A4250"},blue:{0:"#FFFFFF",50:"#EFF6FF",100:"#DBE8FF",200:"#B8D3FF",300:"#90BAFF",400:"#5E97FF",500:"#406FFF",600:"#2F66FF",700:"#2452DE",800:"#2248C8",900:"#172C80"},indigo:{0:"#FFFFFF",50:"#EEF2FF",100:"#E0E6FF",200:"#C5D0FF",300:"#A3B5FF",400:"#879CFF",500:"#707AF5",600:"#5A63F3",700:"#4951DA",800:"#3E40BF",900:"#2A2A82"},purple:{0:"#FFFFFF",50:"#F4F0FF",100:"#E8DBFF",200:"#D2B8FF",300:"#B590FF",400:"#996AF5",500:"#7A52F1",600:"#6B3CF0",700:"#592FBE",800:"#4D27A3",900:"#2F1767"},magenta:{0:"#FFFFFF",50:"#FFF0FE",100:"#FCE0FF",200:"#F7BCFF",300:"#F393FD",400:"#E85FF8",500:"#C645D6",600:"#C026D3",700:"#951CAB",800:"#801790",900:"#4C0C59"},pink:{0:"#FFFFFF",50:"#FFF0F7",100:"#FFE0F0",200:"#FFC0E2",300:"#FF9ACE",400:"#FF6CB3",500:"#ED5CA2",600:"#EC4899",700:"#AB236F",800:"#96205D",900:"#5A1238"},rose:{0:"#FFFFFF",50:"#FFF0F3",100:"#FFE1E9",200:"#FFC1D3",300:"#FF98B8",400:"#FF6B98",500:"#EE4278",600:"#E52E69",700:"#B52156",800:"#991A43",900:"#5B0F28"}},ba={mono:{0:"#0B0B0C",50:"#0F0F10",100:"#151515",200:"#1B1B1C",300:"#232323",400:"#DADADA",500:"#E0E0E0",600:"#EDEDED",700:"#F5F5F5",800:"#FCFCFC",900:"#FFFFFF"},danger:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},success:{0:"#06150B",50:"#0A1B10",100:"#0E2416",200:"#11301C",300:"#143B21",400:"#16502C",500:"#22D85A",600:"#00C853",700:"#2FE976",800:"#7FF1AE",900:"#D6FADF"},warning:{0:"#150E05",50:"#1C1408",100:"#261B0B",200:"#31240E",300:"#3D2C12",400:"#583C16",500:"#FFA61A",600:"#FF9F0A",700:"#FFB347",800:"#FFD089",900:"#FFF0C9"},info:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},red:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},amber:{0:"#150D07",50:"#1C120A",100:"#26180E",200:"#311F12",300:"#3E2716",400:"#59361C",500:"#FF6A1E",600:"#FF5A00",700:"#FF8747",800:"#FFB98A",900:"#FFE2CC"},orange:{0:"#140D07",50:"#1B120A",100:"#25190D",200:"#302010",300:"#3B2813",400:"#553817",500:"#FF7F22",600:"#FF6B00",700:"#FF9247",800:"#FFBE8A",900:"#FFE1CC"},yellow:{0:"#141303",50:"#1B1906",100:"#25210A",200:"#2F2A0D",300:"#383212",400:"#524717",500:"#FFE042",600:"#FFD60A",700:"#FFE457",800:"#FFF194",900:"#FFF8CF"},lime:{0:"#0C1306",50:"#101A08",100:"#14210B",200:"#1A2B0F",300:"#203614",400:"#2A4A1A",500:"#86E21A",600:"#7ACC00",700:"#9EEA3B",800:"#C9F57F",900:"#EAFCC4"},green:{0:"#07140C",50:"#0B1B11",100:"#0E2416",200:"#112C1B",300:"#143722",400:"#17502F",500:"#20BF55",600:"#16A34A",700:"#39C964",800:"#86E5A5",900:"#D4F6E1"},teal:{0:"#081815",50:"#0B1F1C",100:"#0F2824",200:"#13322E",300:"#173E39",400:"#14584F",500:"#14CEBD",600:"#00BFA5",700:"#2CD6C6",800:"#7FEAE3",900:"#CFF7F3"},cyan:{0:"#07171C",50:"#0A1E24",100:"#0E2830",200:"#11333D",300:"#153E4A",400:"#165B6A",500:"#20CBE6",600:"#00B8D9",700:"#3FD2E9",800:"#93EBF6",900:"#D5F7FC"},blue:{0:"#081421",50:"#0A1829",100:"#0E2139",200:"#112A4B",300:"#153660",400:"#184A86",500:"#4A78FF",600:"#2F66FF",700:"#5A8AFF",800:"#A7C3FF",900:"#D9E7FF"},indigo:{0:"#0B1023",50:"#0E162C",100:"#141F3F",200:"#1C2A56",300:"#24366E",400:"#2F4894",500:"#707CF6",600:"#5A63F3",700:"#7D86FF",800:"#B5C0FF",900:"#E0E6FF"},purple:{0:"#100B1F",50:"#130E26",100:"#1A1638",200:"#231F4E",300:"#2E2A67",400:"#3C388D",500:"#8256F3",600:"#6B3CF0",700:"#8B66FA",800:"#C1B0FF",900:"#E4DCFF"},magenta:{0:"#160A18",50:"#1C0C21",100:"#25102E",200:"#321544",300:"#421A5C",400:"#58247C",500:"#CB44DB",600:"#C026D3",700:"#D960EB",800:"#F0B5FA",900:"#F9E4FE"},pink:{0:"#170911",50:"#1D0C18",100:"#271220",200:"#371830",300:"#462042",400:"#622C5C",500:"#F067AE",600:"#EC4899",700:"#F679BB",800:"#FFC2E1",900:"#FFE6F3"},rose:{0:"#17090E",50:"#1F0C13",100:"#2A121B",200:"#3A1B28",300:"#4B2636",400:"#673449",500:"#EE457B",600:"#E52E69",700:"#FF558A",800:"#FFA9C6",900:"#FFE0EA"}},Ca=e=>({...e,red:e.danger,error:e.danger,green:e.success,success:e.success,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,teal:e.teal,cyan:e.cyan,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),Yn=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),yc=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],Ra=e=>yc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:ha,radius:ya,componentHeights:xa,typography:va,neutral:jr,palette:{...Ca(ga),primary:ga.mono},surface:Yn("light",jr),text:{...Ko(jr),onColors:{primary:"#FFFFFF",...Ra({yellow:"#000000"})}}},Ta={spacing:ha,radius:ya,componentHeights:xa,typography:va,neutral:Vr,palette:{...Ca(ba),primary:ba.mono},surface:Yn("dark",Vr),text:{..._o(Vr),onColors:{primary:"#000000",...Ra({yellow:"#000000",lime:"#000000"})}}};function Ea(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>n.delete(o))}}var ka={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},Jn=e=>ka[e]??e;function Qt(e){let t={...e};return Object.entries(ka).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Ma=de.createContext(null),Fa=de.createContext(null),Aa=de.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=de.createContext({setPrimary:e=>{}}),Da=de.createContext(null);function j(){return useTheme()}function Cc(){let e=de.useContext(Ma);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=de.useContext(Aa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Rc(){let e=de.useContext(Fa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=de.useContext(Pa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function cb(e){let t=de.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Cc(),{primary:o}=Rc(),r=de.useMemo(()=>{let s=n==="light"?t.light:t.dark,i=s.palette[Jn(o)]??s.palette.primary,u=Qt(s.text.onColors)[Jn(o)]??qr(i[600]);return {...s,palette:{...s.palette,primary:i},text:{...s.text,onColors:{...Qt(s.text.onColors),primary:u,[Jn(o)]:u,[o]:u}}}},[t,n,o]);return e?e(r):r}function Vo(e,t){if(!t)return e;let n={...e.palette};if(t.palette)for(let o of Object.keys(t.palette)){let r=t.palette[o];r&&(n[o]={...e.palette[o]??{},...r});}return {...e,spacing:{...e.spacing,...t.spacing??{}},radius:{...e.radius,...t.radius??{}},componentHeights:{...e.componentHeights,...t.componentHeights??{}},typography:{fonts:{...e.typography.fonts,...t.typography?.fonts??{}},sizes:{...e.typography.sizes,...t.typography?.sizes??{}}},palette:n,neutral:t.neutral?{...e.neutral,...t.neutral}:e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}}function qr(e){let t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16),s=u=>{let a=u/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function Sa(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Ur(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Gr(e,t,n){let o=[],r=a=>a.startsWith("var(")?a.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():a;o.push(`--pf-font-sans:${r(e.typography.fonts.sans)};`),o.push(`--pf-font-mono:${r(e.typography.fonts.mono)};`),o.push(`--pf-text-primary:${e.text.primary};`),o.push(`--pf-text-secondary:${e.text.secondary};`),o.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([a,l])=>o.push(`--pf-text-on-${a}:${l};`)),Object.entries(e.spacing).forEach(([a,l])=>o.push(`--pf-space-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([a,l])=>o.push(`--pf-radius-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([a,l])=>o.push(`--pf-fontSize-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([a,l])=>o.push(`--pf-cmph-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([a,l])=>o.push(`--pf-neutral-${a}:${l};`)),o.push(`--pf-surface-appBg:${e.surface.appBg};`),o.push(`--pf-surface-panelBg:${e.surface.panelBg};`),o.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),o.push(`--pf-surface-panelHover:${e.surface.panelHover};`),o.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),o.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),o.push(`--pf-surface-border:${e.surface.border};`),o.push("--pf-focus-main:var(--pf-neutral-400);"),o.push(n==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([a,l])=>{Object.entries(l).forEach(([c,d])=>{o.push(`--pf-palette-${a}-${c}:${d};`);});});let s="300";Object.keys(e.palette).forEach(a=>{o.push(`--pf-focus-${a}-main: var(--pf-palette-${a}-${s});`),o.push(`--pf-focus-${a}-soft: transparent;`);});let i=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(a=>o.push(`--pf-primary-${a}:var(--pf-palette-${i}-${a});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let u=e.text.onColors[i]??(()=>{let l=(e.palette[i]?.[600]??e.palette.primary[600]).replace("#",""),c=parseInt(l.slice(0,2),16),d=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=I=>{let x=I/255;return x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4)};return .2126*f(c)+.7152*f(d)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${u};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return Gr(e,t,n).join("")}var Xr=e=>{for(let t=e.style.length-1;t>=0;t--){let n=e.style.item(t);n&&n.startsWith("--pf-")&&e.style.removeProperty(n);}},Ia=(e,t)=>{Xr(e);for(let n of t){let o=n.indexOf(":");if(o===-1)continue;let r=n.slice(0,o).trim(),s=n.slice(o+1).trim();s.endsWith(";")&&(s=s.slice(0,-1)),r&&e.style.setProperty(r,s);}},qo=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");},Na=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,i=t?.primaryKey??"mono",a=useRef((()=>{if(!s)try{let b=JSON.parse(localStorage.getItem(o)||"null");if(b?.mode==="light"||b?.mode==="dark")return b.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),l=de.useMemo(()=>Ea(a.current),[]),c=de.useMemo(()=>Ea(i),[i]),d=useRef(null),h=useRef(0),f=useRef(r??"__root__");de.useLayoutEffect(()=>{let b=0,y=d.current;for(;y&&y!==document.body;)y.hasAttribute("data-pfui-scope")&&b++,y=y.parentElement;h.current=b;},[r]);let R=useMemo(()=>{let b=Vo(jo,t),y=Vo(b,t?.light),P=t?.light?.primaryKey??i,H=Jn(P),L=y.palette.primary??y.palette[H]??y.palette.mono,E=Qt({...Ko(y.neutral).onColors,...y.text.onColors}),S=E[H]??qr(L[600]),z=t?.surface||t?.light?.surface?y.surface:Yn("light",y.neutral),K={...t?.text||t?.light?.text?y.text:Ko(y.neutral),onColors:Qt({...E,primary:S,[H]:S})};return {...y,palette:{...y.palette,primary:L},surface:z,text:K}},[t,i]),I=useMemo(()=>{let b=Vo(Ta,t),y=Vo(b,t?.dark),P=t?.dark?.primaryKey??i,H=Jn(P),L=y.palette.primary??y.palette[H]??y.palette.mono,E=Qt({..._o(y.neutral).onColors,...y.text.onColors}),S=E[H]??qr(L[600]),z=t?.surface||t?.dark?.surface?y.surface:Yn("dark",y.neutral),K={...t?.text||t?.dark?.text?y.text:_o(y.neutral),onColors:Qt({...E,primary:S,[H]:S})};return {...y,palette:{...y.palette,primary:L},surface:z,text:K}},[t,i]),x=useRef(null),C=useRef(null),g=de.useInsertionEffect||de.useLayoutEffect,p=de.useRef(false),m=useCallback(()=>{let b=Ur(r);Sa(C,s?`pfui-guard-${r}`:"pfui-guard-root"),C.current.textContent=`${b} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{C.current.textContent="";});},[r,s]);g(()=>{Sa(x,s?`pfui-vars-${r}`:"pfui-vars-root");let b=t?.light?.primaryKey??t?.primaryKey??i,y=t?.dark?.primaryKey??t?.primaryKey??i,P=Ur(r),H=Uo(R,b,"light"),L=Uo(I,y,"dark");x.current.textContent=`${P}.pf-light{${H}}
1
+ import de,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,Children,memo,useSyncExternalStore,useLayoutEffect}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var ha={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},ya={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},xa={sm:32,md:36,lg:40,border:"1px"},va={fonts:{sans:"system-ui, -apple-system, Segoe UI, Roboto, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},sizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px","6xl":"60px"}},jr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#C6C6C6",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Vr={0:"#0c0c0c",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ga={mono:{0:"#FFFFFF",50:"#FAFAFA",100:"#F2F2F2",200:"#E6E6E6",300:"#D1D1D1",400:"#8A8A8A",500:"#2A2A2A",600:"#1A1A1A",700:"#121212",800:"#0B0B0B",900:"#000000"},danger:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},success:{0:"#FFFFFF",50:"#EEFFF3",100:"#D7FFE8",200:"#d6ffe7ff",300:"#8EF5BB",400:"#5BEA9A",500:"#0FD45D",600:"#00C853",700:"#109C47",800:"#0E8242",900:"#064D2B"},warning:{0:"#FFFFFF",50:"#FFF7EB",100:"#FFEFC6",200:"#FFE094",300:"#FFC552",400:"#FFB83A",500:"#FFA414",600:"#FF9F0A",700:"#D97500",800:"#AF5E00",900:"#6E3600"},info:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},red:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},amber:{0:"#FFFFFF",50:"#FFF3EA",100:"#FFE3D1",200:"#FFC7A6",300:"#FFAC80",400:"#FF874D",500:"#FF6C1F",600:"#FF5A00",700:"#D24500",800:"#B63C00",900:"#6F2300"},orange:{0:"#FFFFFF",50:"#FFF4EB",100:"#FFE6CC",200:"#FFCE9E",300:"#FFAE66",400:"#FF8B33",500:"#FF7310",600:"#FF6B00",700:"#CC4400",800:"#AF3F00",900:"#6B2400"},yellow:{0:"#FFFFFF",50:"#FFFAE6",100:"#FFF2BF",200:"#FFE780",300:"#FFDB3D",400:"#FFD000",500:"#FFE03F",600:"#FFD60A",700:"#B38600",800:"#8E6D00",900:"#534300"},lime:{0:"#FFFFFF",50:"#F6FFE8",100:"#E7FFC2",200:"#CCFF83",300:"#A8FA3D",400:"#8BE11C",500:"#87DE10",600:"#7ACC00",700:"#4A8C00",800:"#3B7100",900:"#224300"},green:{0:"#FFFFFF",50:"#F0FFF5",100:"#DBFFE9",200:"#BDF7CF",300:"#8FE7A8",400:"#5BD57D",500:"#1DAE52",600:"#16A34A",700:"#168A40",800:"#136A34",900:"#0B3D1F"},teal:{0:"#FFFFFF",50:"#EDFFFB",100:"#D2FFF4",200:"#A6FAEA",300:"#74EEDC",400:"#41DECB",500:"#00CFAA",600:"#00BFA5",700:"#0C8C7F",800:"#0B786C",900:"#084741"},cyan:{0:"#FFFFFF",50:"#EFFFFF",100:"#D4FCFF",200:"#AFF5FD",300:"#7FE8F6",400:"#45D3EB",500:"#09C6E7",600:"#00B8D9",700:"#0A7C92",800:"#0B6E81",900:"#0A4250"},blue:{0:"#FFFFFF",50:"#EFF6FF",100:"#DBE8FF",200:"#B8D3FF",300:"#90BAFF",400:"#5E97FF",500:"#406FFF",600:"#2F66FF",700:"#2452DE",800:"#2248C8",900:"#172C80"},indigo:{0:"#FFFFFF",50:"#EEF2FF",100:"#E0E6FF",200:"#C5D0FF",300:"#A3B5FF",400:"#879CFF",500:"#707AF5",600:"#5A63F3",700:"#4951DA",800:"#3E40BF",900:"#2A2A82"},purple:{0:"#FFFFFF",50:"#F4F0FF",100:"#E8DBFF",200:"#D2B8FF",300:"#B590FF",400:"#996AF5",500:"#7A52F1",600:"#6B3CF0",700:"#592FBE",800:"#4D27A3",900:"#2F1767"},magenta:{0:"#FFFFFF",50:"#FFF0FE",100:"#FCE0FF",200:"#F7BCFF",300:"#F393FD",400:"#E85FF8",500:"#C645D6",600:"#C026D3",700:"#951CAB",800:"#801790",900:"#4C0C59"},pink:{0:"#FFFFFF",50:"#FFF0F7",100:"#FFE0F0",200:"#FFC0E2",300:"#FF9ACE",400:"#FF6CB3",500:"#ED5CA2",600:"#EC4899",700:"#AB236F",800:"#96205D",900:"#5A1238"},rose:{0:"#FFFFFF",50:"#FFF0F3",100:"#FFE1E9",200:"#FFC1D3",300:"#FF98B8",400:"#FF6B98",500:"#EE4278",600:"#E52E69",700:"#B52156",800:"#991A43",900:"#5B0F28"}},ba={mono:{0:"#0B0B0C",50:"#0F0F10",100:"#151515",200:"#1B1B1C",300:"#232323",400:"#DADADA",500:"#E0E0E0",600:"#EDEDED",700:"#F5F5F5",800:"#FCFCFC",900:"#FFFFFF"},danger:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},success:{0:"#06150B",50:"#0A1B10",100:"#0E2416",200:"#11301C",300:"#143B21",400:"#16502C",500:"#22D85A",600:"#00C853",700:"#2FE976",800:"#7FF1AE",900:"#D6FADF"},warning:{0:"#150E05",50:"#1C1408",100:"#261B0B",200:"#31240E",300:"#3D2C12",400:"#583C16",500:"#FFA61A",600:"#FF9F0A",700:"#FFB347",800:"#FFD089",900:"#FFF0C9"},info:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},red:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},amber:{0:"#150D07",50:"#1C120A",100:"#26180E",200:"#311F12",300:"#3E2716",400:"#59361C",500:"#FF6A1E",600:"#FF5A00",700:"#FF8747",800:"#FFB98A",900:"#FFE2CC"},orange:{0:"#140D07",50:"#1B120A",100:"#25190D",200:"#302010",300:"#3B2813",400:"#553817",500:"#FF7F22",600:"#FF6B00",700:"#FF9247",800:"#FFBE8A",900:"#FFE1CC"},yellow:{0:"#141303",50:"#1B1906",100:"#25210A",200:"#2F2A0D",300:"#383212",400:"#524717",500:"#FFE042",600:"#FFD60A",700:"#FFE457",800:"#FFF194",900:"#FFF8CF"},lime:{0:"#0C1306",50:"#101A08",100:"#14210B",200:"#1A2B0F",300:"#203614",400:"#2A4A1A",500:"#86E21A",600:"#7ACC00",700:"#9EEA3B",800:"#C9F57F",900:"#EAFCC4"},green:{0:"#07140C",50:"#0B1B11",100:"#0E2416",200:"#112C1B",300:"#143722",400:"#17502F",500:"#20BF55",600:"#16A34A",700:"#39C964",800:"#86E5A5",900:"#D4F6E1"},teal:{0:"#081815",50:"#0B1F1C",100:"#0F2824",200:"#13322E",300:"#173E39",400:"#14584F",500:"#14CEBD",600:"#00BFA5",700:"#2CD6C6",800:"#7FEAE3",900:"#CFF7F3"},cyan:{0:"#07171C",50:"#0A1E24",100:"#0E2830",200:"#11333D",300:"#153E4A",400:"#165B6A",500:"#20CBE6",600:"#00B8D9",700:"#3FD2E9",800:"#93EBF6",900:"#D5F7FC"},blue:{0:"#081421",50:"#0A1829",100:"#0E2139",200:"#112A4B",300:"#153660",400:"#184A86",500:"#4A78FF",600:"#2F66FF",700:"#5A8AFF",800:"#A7C3FF",900:"#D9E7FF"},indigo:{0:"#0B1023",50:"#0E162C",100:"#141F3F",200:"#1C2A56",300:"#24366E",400:"#2F4894",500:"#707CF6",600:"#5A63F3",700:"#7D86FF",800:"#B5C0FF",900:"#E0E6FF"},purple:{0:"#100B1F",50:"#130E26",100:"#1A1638",200:"#231F4E",300:"#2E2A67",400:"#3C388D",500:"#8256F3",600:"#6B3CF0",700:"#8B66FA",800:"#C1B0FF",900:"#E4DCFF"},magenta:{0:"#160A18",50:"#1C0C21",100:"#25102E",200:"#321544",300:"#421A5C",400:"#58247C",500:"#CB44DB",600:"#C026D3",700:"#D960EB",800:"#F0B5FA",900:"#F9E4FE"},pink:{0:"#170911",50:"#1D0C18",100:"#271220",200:"#371830",300:"#462042",400:"#622C5C",500:"#F067AE",600:"#EC4899",700:"#F679BB",800:"#FFC2E1",900:"#FFE6F3"},rose:{0:"#17090E",50:"#1F0C13",100:"#2A121B",200:"#3A1B28",300:"#4B2636",400:"#673449",500:"#EE457B",600:"#E52E69",700:"#FF558A",800:"#FFA9C6",900:"#FFE0EA"}},Ca=e=>({...e,red:e.danger,error:e.danger,green:e.success,success:e.success,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,teal:e.teal,cyan:e.cyan,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),Jn=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),yc=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],Ra=e=>yc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:ha,radius:ya,componentHeights:xa,typography:va,neutral:jr,palette:{...Ca(ga),primary:ga.mono},surface:Jn("light",jr),text:{...Ko(jr),onColors:{primary:"#FFFFFF",...Ra({yellow:"#000000"})}}},Ta={spacing:ha,radius:ya,componentHeights:xa,typography:va,neutral:Vr,palette:{...Ca(ba),primary:ba.mono},surface:Jn("dark",Vr),text:{..._o(Vr),onColors:{primary:"#FFFFFF",...Ra({yellow:"#000000"})}}};function Ea(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>n.delete(o))}}var ka={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ct=e=>ka[e]??e;function tn(e){let t={...e};return Object.entries(ka).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Ma=de.createContext(null),Fa=de.createContext(null),Aa=de.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=de.createContext({setPrimary:e=>{}}),Da=de.createContext(null);function j(){return useTheme()}function Cc(){let e=de.useContext(Ma);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=de.useContext(Aa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Rc(){let e=de.useContext(Fa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=de.useContext(Pa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function cb(e){let t=de.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Cc(),{primary:o}=Rc(),r=de.useMemo(()=>{let s=n==="light"?t.light:t.dark,i=s.palette[ct(o)]??s.palette.primary,u=tn(s.text.onColors)[ct(o)]??qr(i[600]);return {...s,palette:{...s.palette,primary:i},text:{...s.text,onColors:{...tn(s.text.onColors),primary:u,[ct(o)]:u,[o]:u}}}},[t,n,o]);return e?e(r):r}function Vo(e,t){if(!t)return e;let n={...e.palette};if(t.palette)for(let o of Object.keys(t.palette)){let r=t.palette[o];r&&(n[o]={...e.palette[o]??{},...r});}return {...e,spacing:{...e.spacing,...t.spacing??{}},radius:{...e.radius,...t.radius??{}},componentHeights:{...e.componentHeights,...t.componentHeights??{}},typography:{fonts:{...e.typography.fonts,...t.typography?.fonts??{}},sizes:{...e.typography.sizes,...t.typography?.sizes??{}}},palette:n,neutral:t.neutral?{...e.neutral,...t.neutral}:e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}}function qr(e){let t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16),s=u=>{let a=u/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function Sa(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Ur(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Gr(e,t,n){let o=[],r=a=>a.startsWith("var(")?a.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():a;o.push(`--pf-font-sans:${r(e.typography.fonts.sans)};`),o.push(`--pf-font-mono:${r(e.typography.fonts.mono)};`),o.push(`--pf-text-primary:${e.text.primary};`),o.push(`--pf-text-secondary:${e.text.secondary};`),o.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([a,l])=>o.push(`--pf-text-on-${a}:${l};`)),Object.entries(e.spacing).forEach(([a,l])=>o.push(`--pf-space-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([a,l])=>o.push(`--pf-radius-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([a,l])=>o.push(`--pf-fontSize-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([a,l])=>o.push(`--pf-cmph-${a}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([a,l])=>o.push(`--pf-neutral-${a}:${l};`)),o.push(`--pf-surface-appBg:${e.surface.appBg};`),o.push(`--pf-surface-panelBg:${e.surface.panelBg};`),o.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),o.push(`--pf-surface-panelHover:${e.surface.panelHover};`),o.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),o.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),o.push(`--pf-surface-border:${e.surface.border};`),o.push("--pf-focus-main:var(--pf-neutral-400);"),o.push(n==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([a,l])=>{Object.entries(l).forEach(([c,p])=>{o.push(`--pf-palette-${a}-${c}:${p};`);});});let s="300";Object.keys(e.palette).forEach(a=>{o.push(`--pf-focus-${a}-main: var(--pf-palette-${a}-${s});`),o.push(`--pf-focus-${a}-soft: transparent;`);});let i=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(a=>o.push(`--pf-primary-${a}:var(--pf-palette-${i}-${a});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let u=e.text.onColors[i]??(()=>{let l=(e.palette[i]?.[600]??e.palette.primary[600]).replace("#",""),c=parseInt(l.slice(0,2),16),p=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=I=>{let x=I/255;return x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4)};return .2126*f(c)+.7152*f(p)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${u};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return Gr(e,t,n).join("")}var Xr=e=>{for(let t=e.style.length-1;t>=0;t--){let n=e.style.item(t);n&&n.startsWith("--pf-")&&e.style.removeProperty(n);}},Ia=(e,t)=>{Xr(e);for(let n of t){let o=n.indexOf(":");if(o===-1)continue;let r=n.slice(0,o).trim(),s=n.slice(o+1).trim();s.endsWith(";")&&(s=s.slice(0,-1)),r&&e.style.setProperty(r,s);}},qo=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");},Na=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,i=t?.primaryKey??"mono",a=useRef((()=>{if(!s)try{let b=JSON.parse(localStorage.getItem(o)||"null");if(b?.mode==="light"||b?.mode==="dark")return b.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),l=de.useMemo(()=>Ea(a.current),[]),c=de.useMemo(()=>Ea(i),[]);de.useLayoutEffect(()=>{c.get()!==i&&c.set(i);},[i,c]);let p=useRef(null),h=useRef(0),f=useRef(r??"__root__");de.useLayoutEffect(()=>{let b=0,y=p.current;for(;y&&y!==document.body;)y.hasAttribute("data-pfui-scope")&&b++,y=y.parentElement;h.current=b;},[r]);let R=useMemo(()=>{let b=Vo(jo,t),y=Vo(b,t?.light),P=t?.light?.primaryKey??i,H=ct(P),L=y.palette.primary??y.palette[H]??y.palette.mono,E=tn({...Ko(y.neutral).onColors,...y.text.onColors}),S=E[H]??qr(L[600]),z=t?.surface||t?.light?.surface?y.surface:Jn("light",y.neutral),K={...t?.text||t?.light?.text?y.text:Ko(y.neutral),onColors:tn({...E,primary:S,[H]:S})};return {...y,palette:{...y.palette,primary:L},surface:z,text:K}},[t,i]),I=useMemo(()=>{let b=Vo(Ta,t),y=Vo(b,t?.dark),P=t?.dark?.primaryKey??i,H=ct(P),L=y.palette.primary??y.palette[H]??y.palette.mono,E=tn({..._o(y.neutral).onColors,...y.text.onColors}),S=E[H]??qr(L[600]),z=t?.surface||t?.dark?.surface?y.surface:Jn("dark",y.neutral),K={...t?.text||t?.dark?.text?y.text:_o(y.neutral),onColors:tn({...E,primary:S,[H]:S})};return {...y,palette:{...y.palette,primary:L},surface:z,text:K}},[t,i]),x=useRef(null),C=useRef(null),g=de.useInsertionEffect||de.useLayoutEffect,d=useCallback(()=>{let b=Ur(r);Sa(C,s?`pfui-guard-${r}`:"pfui-guard-root"),C.current.textContent=`${b} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{C.current.textContent="";});},[r,s]);g(()=>{Sa(x,s?`pfui-vars-${r}`:"pfui-vars-root");let b=t?.light?.primaryKey??t?.primaryKey??i,y=t?.dark?.primaryKey??t?.primaryKey??i,P=Ur(r),H=Uo(R,ct(b),"light"),L=Uo(I,ct(y),"dark");x.current.textContent=`${P}.pf-light{${H}}
2
2
  ${P}.pf-dark{${L}}`+(s?`
3
- ${P}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[R,I,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,i]),de.useLayoutEffect(()=>{if(!p.current){p.current=true;let b=s?d.current:document.documentElement;b&&(Xr(b),qo(b,a.current),b.setAttribute("data-pfui-mode",a.current),b.setAttribute("data-pfui-primary",c.get()),l.set(a.current));}},[s,l,c]);let v=useCallback(()=>{window.__pfuiActiveScope={id:f.current,depth:h.current,ts:Date.now()};},[]),D=useCallback(()=>{let b=s?d.current:document.documentElement,y={capture:true},P=()=>v();return b?.addEventListener("pointerdown",P,y),b?.addEventListener("mouseenter",P,y),b?.addEventListener("focusin",P,y),b?.addEventListener("keydown",P,y),()=>{b?.removeEventListener("pointerdown",P,y),b?.removeEventListener("mouseenter",P,y),b?.removeEventListener("focusin",P,y),b?.removeEventListener("keydown",P,y);}},[s,v]),T=useCallback(b=>{let y=window.__pfuiActiveScope,P=y&&Date.now()-y.ts<1500;if(!y||!P||y.id!==f.current)return;let H=l.get(),L=c.get(),S=Gr(H==="light"?R:I,L,H);Ia(b,S),qo(b,H),b.setAttribute("data-pfui-portal-owner",f.current),b.setAttribute("data-pfui-mode",H),b.setAttribute("data-pfui-primary",L);},[l,c,R,I]),w=b=>{if(b.getAttribute("data-floating-ui-portal")==="true"||b.getAttribute("data-radix-portal")==="true"||b.getAttribute("data-portal")==="true")return true;let y=b.getAttribute("role");if(y==="tooltip"||y==="dialog")return true;let P=window.getComputedStyle(b);return P.position==="fixed"||P.position==="absolute"},F=useCallback(()=>{let b=new MutationObserver(y=>{for(let P of y)P.addedNodes.forEach(H=>{H instanceof HTMLElement&&(w(H)&&T(H),H.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(L=>T(L)));});});return b.observe(document.body,{childList:true,subtree:true}),()=>b.disconnect()},[T]);de.useEffect(()=>{let b=D(),y=F();return ()=>{b(),y();}},[D,F]);let B=useCallback(b=>{let y=s?d.current:document.documentElement;y&&(Xr(y),qo(y,b),y.setAttribute("data-pfui-mode",b),y.setAttribute("data-pfui-primary",c.get()));},[s,c]),W=useCallback(b=>{let y=c.get(),H=Gr(b==="light"?R:I,y,b);document.querySelectorAll(`[data-pfui-portal-owner="${f.current}"]`).forEach(L=>{Ia(L,H),qo(L,b),L.setAttribute("data-pfui-mode",b),L.setAttribute("data-pfui-primary",y);});},[R,I,c]);de.useLayoutEffect(()=>{W(l.get());},[W,R,I,l]);let O=useCallback(b=>{if(l.get()!==b&&(m(),l.set(b),B(b),W(b),!s))try{let y=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...y,mode:b}));}catch{}},[l,s,o,m,B,W]),k=useCallback(()=>O(l.get()==="light"?"dark":"light"),[O,l]),A=useCallback(b=>{c.set(b);let y=Ur(r),P=Uo(R,b,"light"),H=Uo(I,b,"dark");x.current&&(x.current.textContent=`${y}.pf-light{${P}}
3
+ ${P}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[R,I,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,i]);let m=useRef(false);de.useLayoutEffect(()=>{if(m.current)return;m.current=true;let b=s?p.current:document.documentElement;b&&(Xr(b),qo(b,a.current),b.setAttribute("data-pfui-mode",a.current),b.setAttribute("data-pfui-primary",c.get()),l.set(a.current));},[s,l,c]);let v=useCallback(()=>{window.__pfuiActiveScope={id:f.current,depth:h.current,ts:Date.now()};},[]),D=useCallback(()=>{let b=s?p.current:document.documentElement,y={capture:true},P=()=>v();return b?.addEventListener("pointerdown",P,y),b?.addEventListener("mouseenter",P,y),b?.addEventListener("focusin",P,y),b?.addEventListener("keydown",P,y),()=>{b?.removeEventListener("pointerdown",P,y),b?.removeEventListener("mouseenter",P,y),b?.removeEventListener("focusin",P,y),b?.removeEventListener("keydown",P,y);}},[s,v]),T=useCallback(b=>{let y=window.__pfuiActiveScope,P=y&&Date.now()-y.ts<1500;if(!y||!P||y.id!==f.current)return;let H=l.get(),L=c.get(),S=Gr(H==="light"?R:I,ct(L),H);Ia(b,S),qo(b,H),b.setAttribute("data-pfui-portal-owner",f.current),b.setAttribute("data-pfui-mode",H),b.setAttribute("data-pfui-primary",L);},[l,c,R,I]),w=b=>{if(b.getAttribute("data-floating-ui-portal")==="true"||b.getAttribute("data-radix-portal")==="true"||b.getAttribute("data-portal")==="true")return true;let y=b.getAttribute("role");if(y==="tooltip"||y==="dialog")return true;let P=window.getComputedStyle(b);return P.position==="fixed"||P.position==="absolute"},F=useCallback(()=>{let b=new MutationObserver(y=>{for(let P of y)P.addedNodes.forEach(H=>{H instanceof HTMLElement&&(w(H)&&T(H),H.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(L=>T(L)));});});return b.observe(document.body,{childList:true,subtree:true}),()=>b.disconnect()},[T]);de.useEffect(()=>{let b=D(),y=F();return ()=>{b(),y();}},[D,F]);let B=useCallback(b=>{let y=s?p.current:document.documentElement;y&&(Xr(y),qo(y,b),y.setAttribute("data-pfui-mode",b),y.setAttribute("data-pfui-primary",c.get()));},[s,c]),W=useCallback(b=>{let y=ct(c.get()),H=Gr(b==="light"?R:I,y,b);document.querySelectorAll(`[data-pfui-portal-owner="${f.current}"]`).forEach(L=>{Ia(L,H),qo(L,b),L.setAttribute("data-pfui-mode",b),L.setAttribute("data-pfui-primary",y);});},[R,I,c]);de.useLayoutEffect(()=>{W(l.get());},[W,R,I,i,l]);let O=useCallback(b=>{if(l.get()!==b&&(d(),l.set(b),B(b),W(b),!s))try{let y=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...y,mode:b}));}catch{}},[l,s,o,d,B,W]),k=useCallback(()=>O(l.get()==="light"?"dark":"light"),[O,l]),A=useCallback(b=>{c.set(b);let y=Ur(r),P=Uo(R,ct(b),"light"),H=Uo(I,ct(b),"dark");x.current&&(x.current.textContent=`${y}.pf-light{${P}}
4
4
  ${y}.pf-dark{${H}}`+(s?`
5
- ${y}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),m();let L=l.get();if(B(L),W(L),!s)try{let E=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...E,primary:b}));}catch{}},[R,I,r,s,l,c,m,B,W]),M=jsx(Da.Provider,{value:{light:R,dark:I},children:jsx(Ma.Provider,{value:l,children:jsx(Fa.Provider,{value:c,children:jsx(Aa.Provider,{value:{setMode:O,toggleMode:k},children:jsx(Pa.Provider,{value:{setPrimary:A},children:jsx(ThemeProvider,{theme:Tc(R),children:e})})})})})});return s?jsx("div",{ref:d,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:M}):jsx("div",{ref:d,children:M})};function Tc(e){let t=(l,c)=>Object.fromEntries(Object.keys(l).map(d=>[d,c(d)])),n=t(e.spacing,l=>`var(--pf-space-${l})`),o=t(e.radius,l=>`var(--pf-radius-${l})`),r=t(e.typography.sizes,l=>`var(--pf-fontSize-${l})`),s=t(e.componentHeights,l=>`var(--pf-cmph-${l})`),i={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},u=t(e.neutral,l=>`var(--pf-neutral-${l})`),a={};return Object.keys(e.palette).forEach(l=>{a[l]={},Object.keys(e.palette[l]).forEach(c=>{a[l][c]=`var(--pf-palette-${l}-${c})`;});}),a.primary=Object.fromEntries(["0","50","100","200","300","400","500","600","700","800","900"].map(l=>[l,`var(--pf-primary-${l})`])),{...e,spacing:n,radius:o,componentHeights:s,typography:{fonts:i,sizes:r},neutral:u,palette:a,surface:{appBg:"var(--pf-surface-appBg)",panelBg:"var(--pf-surface-panelBg)",subtleBg:"var(--pf-surface-subtleBg)",panelHover:"var(--pf-surface-panelHover)",subtleHover:"var(--pf-surface-subtleHover)",overlayBg:"var(--pf-surface-overlayBg)",border:"var(--pf-surface-border)"},text:{primary:"var(--pf-text-primary)",secondary:"var(--pf-text-secondary)",muted:"var(--pf-text-muted)",onColors:Object.fromEntries(Object.keys(Qt(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var wc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=wc(e,t);if(n==="neutral")return {soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"};let o=e?.palette?.[n];return o?{soft:o[300]??"transparent",main:o[600]??o[500]??"currentColor"}:{soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"}};function he(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,i=t?.offset??0,u=t?.mode==="always"?"&:focus":"&:focus-visible",a={transition:"box-shadow .16s ease, border-color 0s ease, outline-color 0s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{boxShadow:"none !important"}};return a[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:i,zIndex:1e4},css(a)}}function Xo(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,i=t?.offset??0,u=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",a={position:"relative",transition:"box-shadow .16s ease, border-color 0s ease, outline-color 0s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{boxShadow:"none !important"}};return a[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:i,zIndex:1e3},css(a)}}var za=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Oa=e=>{let t=e.type;return t?.__PFUI_SLOT||t?.displayName||t?.name||""},Qr=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:i},u)=>{let a=j(),l=a.typography.sizes.sm,c=20,d=10,h=a.spacing.lg,f=a.spacing.md,R=Number(a.componentHeights?.md),I=a.text,x=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:R,padding:`${f} ${h}`,gap:d,fontSize:l,color:I.primary}),C=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),g=css({marginRight:0,marginLeft:-2,lineHeight:0,color:a.text.secondary}),p=css({marginLeft:5,marginRight:-2,lineHeight:0,color:a.text.secondary});return jsxs("div",{ref:u,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[x,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[g,i],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:c,height:c}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:C,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[p,i],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:c,height:c}})})]})});Qr.__PFUI_SLOT="AccordionSummary";Qr.displayName="AccordionSummary";var es=({children:e,className:t,css:n})=>{let o=j(),r=o.typography.sizes.sm,s=o.spacing.lg,i="0.15rem",u=o.spacing.md,a=css({padding:`${i} ${s} ${u} ${s}`,fontSize:r,boxSizing:"border-box",minHeight:0});return jsx("div",{className:["plainframe-ui-accordion-details",t||""].join(" ").trim(),css:[a,n],tabIndex:-1,children:e})};es.__PFUI_SLOT="AccordionDetails";es.displayName="AccordionDetails";var Wa=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:s=false,width:i,fullWidth:u=false,css:a,children:l})=>{let c=j(),d=useId(),h=useId(),f=c.radius?.md,R=c.text,I=c.componentHeights?.border??1,x=za(I)??"1px",C=e!==void 0,[g,p]=useState(!!t),m=C?!!e:g,v=he(),[D,T]=useState(0),[w,F]=useState(false),B=useRef(null),W=useRef(null),O=useRef(null),k=()=>{if(!m)return;let N=document.activeElement;W.current?.contains(N)&&O.current?.focus();},A=()=>{s||(k(),C?n?.(!e):p(N=>{let U=!N;return n?.(U),U}));},M=de.Children.toArray(l).filter(N=>isValidElement(N)),b=M.findIndex(N=>Oa(N)==="AccordionSummary"),y=M.findIndex(N=>Oa(N)==="AccordionDetails");b===-1&&M.length&&(b=0),y===-1&&(y=M.findIndex((N,U)=>U!==b),y===-1&&M.length>=2&&(y=1));let P=M[b]??null,H=M[y]??null,L=r==="subtle"?c.surface.subtleBg:r==="outlined"?c.surface.panelBg:"transparent",E=css({backgroundColor:L,color:R.primary,borderRadius:f,border:r==="outlined"?`${x} solid ${c.surface.border}`:"none",outline:"none",marginBottom:c.spacing.sm,maxWidth:i!=null?za(i):void 0,width:u?"100%":i!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let N=B.current;N&&T(N.scrollHeight);},[m,l]),useEffect(()=>{let N=B.current;if(!N)return;let U=new ResizeObserver(()=>T(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{D>0&&!w&&F(true);},[D,w]),useLayoutEffect(()=>{if(!m&&W.current){let N=document.activeElement;W.current.contains(N)&&O.current?.focus();}},[m]),useLayoutEffect(()=>{let N=W.current;if(!N)return;let U=Array.from(N.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));m?(U.forEach(G=>{let se=G.dataset.accordionTabindex;se!=null&&(se===""?G.removeAttribute("tabindex"):G.tabIndex=Number(se),delete G.dataset.accordionTabindex);}),N.removeAttribute("inert")):(U.forEach(G=>{G.dataset.accordionTabindex==null&&(G.dataset.accordionTabindex=G.hasAttribute("tabindex")?G.getAttribute("tabindex")??"":""),G.tabIndex=-1;}),N.setAttribute("inert",""));},[m]);let S=css({maxHeight:m?D||"none":0,overflow:m&&!w?"visible":"hidden",transition:w?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:w?"max-height":void 0}),z=css({opacity:m?1:0,transform:m?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),$=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:m?"rotate(180deg)":"rotate(0deg)"}}),K=P&&cloneElement(P,{...typeof P.props=="object"&&P.props?P.props:{},className:[P.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=H;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":m?"true":"false","data-disabled":s?"true":"false",css:[v(),E,a],tabIndex:s?-1:0,ref:O,role:"button","aria-expanded":m,"aria-controls":d,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==O.current||A();},onKeyDown:N=>{s||document.activeElement===O.current&&N.target===O.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),A());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),$],children:K}),jsx("div",{id:d,"aria-hidden":!m,className:"plainframe-ui-accordion-details-clip",css:S,tabIndex:-1,ref:W,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:B,className:"plainframe-ui-accordion-details-inner",css:z,children:_})})]})};Wa.displayName="Accordion";var Hc=e=>isValidElement(e),Lc=e=>Hc(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Lc(e)==="Accordion",Bc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,$c=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,ja=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:i,disabled:u=false,width:a,fullWidth:l=false,className:c,role:d="group",css:h})=>{let f=j(),R=useRef(null),I=Children.toArray(e),x=I.filter(_a),C=x.length,g=o&&r!==void 0,[p,m]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let A=0;A<x.length;A++){let M=x[A].props;if(M.open||M.defaultOpen)return A}return null}),v=o?g?r??null:p:null,D=$c(f.componentHeights?.border,1),T=f.surface.border,w=f.radius.md,F=n,B=F==="outlined";useEffect(()=>{let A=R.current;if(!A)return;let M=b=>{if(b.key!=="ArrowDown"&&b.key!=="ArrowUp"&&b.key!=="Home"&&b.key!=="End")return;let P=Array.from(A.querySelectorAll(".plainframe-ui-accordion")).filter(S=>S.getAttribute("data-disabled")!=="true");if(P.length===0)return;let H=document.activeElement,L=P.findIndex(S=>S.contains(H));if(L===-1)return;b.preventDefault();let E=L;b.key==="ArrowDown"?E=(L+1)%P.length:b.key==="ArrowUp"?E=(L-1+P.length)%P.length:b.key==="Home"?E=0:b.key==="End"&&(E=P.length-1),P[E]?.focus();};return A.addEventListener("keydown",M),()=>A.removeEventListener("keydown",M)},[C]);let W=css({display:"flex",flexDirection:"column",maxWidth:a!=null?Bc(a):void 0,width:l?"100%":a!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&B?`${D} solid ${T}`:"none",borderRadius:t&&B?w:void 0,background:t&&B?f.surface.panelBg:"transparent"}),O=0,k=[];return I.forEach((A,M)=>{if(!_a(A)){k.push(A);return}let b=A.props,y=O++,P=y===0,H=y===C-1,L=u||!!b.disabled,E=F??b.variant,S=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:P?w:0,borderTopRightRadius:P?w:0,borderBottomLeftRadius:H?w:0,borderBottomRightRadius:H?w:0}):css({width:"100%",marginBottom:0}),z=!P&&C>1&&t?css({borderTop:`${D} solid ${T}`}):null,$=B?css({border:"1px solid transparent"}):null,K={variant:E,disabled:L,width:"100%",css:[b.css,S,$,z],className:[b.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=b.onChange,N=v===y;K.open=N,K.defaultOpen=void 0,K.onChange=U=>{let G=U?y:null;g||m(G),i?.(G),_?.(U);};}k.push(cloneElement(A,{...b,...K,key:A?.key??M}));}),jsx("div",{ref:R,role:d,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",c||""].join(" ").trim(),css:[W,h],children:k})};ja.displayName="AccordionGroup";var zt=e=>typeof e=="number"?`${e}px`:e,Ua=({children:e,open:t=true,anchorOrigin:n={horizontal:"center",vertical:"bottom"},direction:o="horizontal",padding:r="sm",gap:s="xs",radius:i="lg",offset:u=0,offsetX:a=0,offsetY:l=0,elevated:c=true,unstyled:d=false,fullWidth:h=false,width:f,height:R,role:I="toolbar","aria-label":x,onClose:C})=>{let g=j(),p=useRef(null),m=useRef(null),v=useRef(false),D=useRef(t),T=n.horizontal??"center",w=n.vertical??"bottom",F=E=>typeof E=="string"?g.spacing[E]??E:E,B=E=>typeof E=="string"?g.radius[E]??E:E,W=zt(F(u)),O=zt(F(a)),k=zt(F(l)),A={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:T==="left"?"flex-start":T==="right"?"flex-end":"center",alignItems:w==="top"?"flex-start":w==="bottom"?"flex-end":"center"},M=()=>`${T==="left"?"left":T==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,b=()=>w==="top"||w==="bottom"?`translateY(${w==="bottom"?100:-100}px) scale(0.98)`:w==="center"?T==="left"?"translateX(-100px) scale(0.98)":T==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",y=()=>w==="center"&&T==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",P=24,H={margin:P,marginTop:w==="top"?`calc(${P}px + ${W} + ${k})`:P,marginBottom:w==="bottom"?`calc(${P}px + ${W} + ${k})`:P,marginLeft:T==="left"?`calc(${P}px + ${W} + ${O})`:P,marginRight:T==="right"?`calc(${P}px + ${W} + ${O})`:P,padding:d?0:zt(F(r)),background:d?"transparent":g.surface.panelBg,border:d?"none":`1px solid ${g.surface.border}`,borderRadius:d?0:zt(B(i)),boxShadow:d||!c?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:zt(F(s)),transformOrigin:M(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?zt(f):"auto",height:R?zt(R):"auto",maxWidth:h?"100%":"none"},L=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let E=p.current;if(!E)return;let S=b(),z=y();if(!v.current){v.current=true,D.current=t,E.style.opacity=t?"1":"0",E.style.transform=t?z:S;return}if(D.current===t){E.style.opacity=t?"1":"0",E.style.transform=t?z:S;return}D.current=t,m.current&&m.current.cancel();let $=t?[{opacity:0,transform:S},{opacity:1,transform:z}]:[{opacity:1,transform:z},{opacity:0,transform:S}];return m.current=E.animate($,{duration:250,easing:"ease",fill:"forwards"}),()=>{m.current&&m.current.cancel();}},[t,T,w]),useEffect(()=>{if(!t||!C)return;let E=S=>{S.key==="Escape"&&C();};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[t,C]),jsx("div",{css:A,children:jsx("div",{ref:p,css:L,style:H,role:I,"aria-label":x,"aria-hidden":!t,...!t&&{inert:true},children:e})})};Ua.displayName="ActionBar";var Ga=(e,t,n)=>Math.min(n,Math.max(t,e)),ts=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qa=1,jc=keyframes`100% { transform: rotate(360deg); }`,Vc=keyframes`
5
+ ${y}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),d();let L=l.get();if(B(L),W(L),!s)try{let E=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...E,primary:b}));}catch{}},[R,I,r,s,l,c,d,B,W]),M=jsx(Da.Provider,{value:{light:R,dark:I},children:jsx(Ma.Provider,{value:l,children:jsx(Fa.Provider,{value:c,children:jsx(Aa.Provider,{value:{setMode:O,toggleMode:k},children:jsx(Pa.Provider,{value:{setPrimary:A},children:jsx(ThemeProvider,{theme:Tc(R),children:e})})})})})});return s?jsx("div",{ref:p,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:M}):jsx("div",{ref:p,children:M})};function Tc(e){let t=(l,c)=>Object.fromEntries(Object.keys(l).map(p=>[p,c(p)])),n=t(e.spacing,l=>`var(--pf-space-${l})`),o=t(e.radius,l=>`var(--pf-radius-${l})`),r=t(e.typography.sizes,l=>`var(--pf-fontSize-${l})`),s=t(e.componentHeights,l=>`var(--pf-cmph-${l})`),i={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},u=t(e.neutral,l=>`var(--pf-neutral-${l})`),a={};return Object.keys(e.palette).forEach(l=>{a[l]={},Object.keys(e.palette[l]).forEach(c=>{a[l][c]=`var(--pf-palette-${l}-${c})`;});}),a.primary=Object.fromEntries(["0","50","100","200","300","400","500","600","700","800","900"].map(l=>[l,`var(--pf-primary-${l})`])),{...e,spacing:n,radius:o,componentHeights:s,typography:{fonts:i,sizes:r},neutral:u,palette:a,surface:{appBg:"var(--pf-surface-appBg)",panelBg:"var(--pf-surface-panelBg)",subtleBg:"var(--pf-surface-subtleBg)",panelHover:"var(--pf-surface-panelHover)",subtleHover:"var(--pf-surface-subtleHover)",overlayBg:"var(--pf-surface-overlayBg)",border:"var(--pf-surface-border)"},text:{primary:"var(--pf-text-primary)",secondary:"var(--pf-text-secondary)",muted:"var(--pf-text-muted)",onColors:Object.fromEntries(Object.keys(tn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var wc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=wc(e,t);if(n==="neutral")return {soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"};let o=e?.palette?.[n];return o?{soft:o[300]??"transparent",main:o[600]??o[500]??"currentColor"}:{soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"}};function he(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,i=t?.offset??0,u=t?.mode==="always"?"&:focus":"&:focus-visible",a={transition:"box-shadow .16s ease, border-color 0s ease, outline-color 0s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{boxShadow:"none !important"}};return a[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:i,zIndex:1e4},css(a)}}function Xo(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,i=t?.offset??0,u=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",a={position:"relative",transition:"box-shadow .16s ease, border-color 0s ease, outline-color 0s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{boxShadow:"none !important"}};return a[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:i,zIndex:1e3},css(a)}}var za=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Oa=e=>{let t=e.type;return t?.__PFUI_SLOT||t?.displayName||t?.name||""},Qr=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:i},u)=>{let a=j(),l=a.typography.sizes.sm,c=20,p=10,h=a.spacing.lg,f=a.spacing.md,R=Number(a.componentHeights?.md),I=a.text,x=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:R,padding:`${f} ${h}`,gap:p,fontSize:l,color:I.primary}),C=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),g=css({marginRight:0,marginLeft:-2,lineHeight:0,color:a.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:a.text.secondary});return jsxs("div",{ref:u,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[x,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[g,i],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:c,height:c}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:C,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,i],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:c,height:c}})})]})});Qr.__PFUI_SLOT="AccordionSummary";Qr.displayName="AccordionSummary";var es=({children:e,className:t,css:n})=>{let o=j(),r=o.typography.sizes.sm,s=o.spacing.lg,i="0.15rem",u=o.spacing.md,a=css({padding:`${i} ${s} ${u} ${s}`,fontSize:r,boxSizing:"border-box",minHeight:0});return jsx("div",{className:["plainframe-ui-accordion-details",t||""].join(" ").trim(),css:[a,n],tabIndex:-1,children:e})};es.__PFUI_SLOT="AccordionDetails";es.displayName="AccordionDetails";var Wa=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:s=false,width:i,fullWidth:u=false,css:a,children:l})=>{let c=j(),p=useId(),h=useId(),f=c.radius?.md,R=c.text,I=c.componentHeights?.border??1,x=za(I)??"1px",C=e!==void 0,[g,d]=useState(!!t),m=C?!!e:g,v=he(),[D,T]=useState(0),[w,F]=useState(false),B=useRef(null),W=useRef(null),O=useRef(null),k=()=>{if(!m)return;let N=document.activeElement;W.current?.contains(N)&&O.current?.focus();},A=()=>{s||(k(),C?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},M=de.Children.toArray(l).filter(N=>isValidElement(N)),b=M.findIndex(N=>Oa(N)==="AccordionSummary"),y=M.findIndex(N=>Oa(N)==="AccordionDetails");b===-1&&M.length&&(b=0),y===-1&&(y=M.findIndex((N,U)=>U!==b),y===-1&&M.length>=2&&(y=1));let P=M[b]??null,H=M[y]??null,L=r==="subtle"?c.surface.subtleBg:r==="outlined"?c.surface.panelBg:"transparent",E=css({backgroundColor:L,color:R.primary,borderRadius:f,border:r==="outlined"?`${x} solid ${c.surface.border}`:"none",outline:"none",marginBottom:c.spacing.sm,maxWidth:i!=null?za(i):void 0,width:u?"100%":i!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let N=B.current;N&&T(N.scrollHeight);},[m,l]),useEffect(()=>{let N=B.current;if(!N)return;let U=new ResizeObserver(()=>T(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{D>0&&!w&&F(true);},[D,w]),useLayoutEffect(()=>{if(!m&&W.current){let N=document.activeElement;W.current.contains(N)&&O.current?.focus();}},[m]),useLayoutEffect(()=>{let N=W.current;if(!N)return;let U=Array.from(N.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));m?(U.forEach(G=>{let se=G.dataset.accordionTabindex;se!=null&&(se===""?G.removeAttribute("tabindex"):G.tabIndex=Number(se),delete G.dataset.accordionTabindex);}),N.removeAttribute("inert")):(U.forEach(G=>{G.dataset.accordionTabindex==null&&(G.dataset.accordionTabindex=G.hasAttribute("tabindex")?G.getAttribute("tabindex")??"":""),G.tabIndex=-1;}),N.setAttribute("inert",""));},[m]);let S=css({maxHeight:m?D||"none":0,overflow:m&&!w?"visible":"hidden",transition:w?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:w?"max-height":void 0}),z=css({opacity:m?1:0,transform:m?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),$=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:m?"rotate(180deg)":"rotate(0deg)"}}),K=P&&cloneElement(P,{...typeof P.props=="object"&&P.props?P.props:{},className:[P.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=H;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":m?"true":"false","data-disabled":s?"true":"false",css:[v(),E,a],tabIndex:s?-1:0,ref:O,role:"button","aria-expanded":m,"aria-controls":p,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==O.current||A();},onKeyDown:N=>{s||document.activeElement===O.current&&N.target===O.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),A());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),$],children:K}),jsx("div",{id:p,"aria-hidden":!m,className:"plainframe-ui-accordion-details-clip",css:S,tabIndex:-1,ref:W,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:B,className:"plainframe-ui-accordion-details-inner",css:z,children:_})})]})};Wa.displayName="Accordion";var Hc=e=>isValidElement(e),Lc=e=>Hc(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Lc(e)==="Accordion",Bc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,$c=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,ja=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:i,disabled:u=false,width:a,fullWidth:l=false,className:c,role:p="group",css:h})=>{let f=j(),R=useRef(null),I=Children.toArray(e),x=I.filter(_a),C=x.length,g=o&&r!==void 0,[d,m]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let A=0;A<x.length;A++){let M=x[A].props;if(M.open||M.defaultOpen)return A}return null}),v=o?g?r??null:d:null,D=$c(f.componentHeights?.border,1),T=f.surface.border,w=f.radius.md,F=n,B=F==="outlined";useEffect(()=>{let A=R.current;if(!A)return;let M=b=>{if(b.key!=="ArrowDown"&&b.key!=="ArrowUp"&&b.key!=="Home"&&b.key!=="End")return;let P=Array.from(A.querySelectorAll(".plainframe-ui-accordion")).filter(S=>S.getAttribute("data-disabled")!=="true");if(P.length===0)return;let H=document.activeElement,L=P.findIndex(S=>S.contains(H));if(L===-1)return;b.preventDefault();let E=L;b.key==="ArrowDown"?E=(L+1)%P.length:b.key==="ArrowUp"?E=(L-1+P.length)%P.length:b.key==="Home"?E=0:b.key==="End"&&(E=P.length-1),P[E]?.focus();};return A.addEventListener("keydown",M),()=>A.removeEventListener("keydown",M)},[C]);let W=css({display:"flex",flexDirection:"column",maxWidth:a!=null?Bc(a):void 0,width:l?"100%":a!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&B?`${D} solid ${T}`:"none",borderRadius:t&&B?w:void 0,background:t&&B?f.surface.panelBg:"transparent"}),O=0,k=[];return I.forEach((A,M)=>{if(!_a(A)){k.push(A);return}let b=A.props,y=O++,P=y===0,H=y===C-1,L=u||!!b.disabled,E=F??b.variant,S=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:P?w:0,borderTopRightRadius:P?w:0,borderBottomLeftRadius:H?w:0,borderBottomRightRadius:H?w:0}):css({width:"100%",marginBottom:0}),z=!P&&C>1&&t?css({borderTop:`${D} solid ${T}`}):null,$=B?css({border:"1px solid transparent"}):null,K={variant:E,disabled:L,width:"100%",css:[b.css,S,$,z],className:[b.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=b.onChange,N=v===y;K.open=N,K.defaultOpen=void 0,K.onChange=U=>{let G=U?y:null;g||m(G),i?.(G),_?.(U);};}k.push(cloneElement(A,{...b,...K,key:A?.key??M}));}),jsx("div",{ref:R,role:p,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",c||""].join(" ").trim(),css:[W,h],children:k})};ja.displayName="AccordionGroup";var Ot=e=>typeof e=="number"?`${e}px`:e,Ua=({children:e,open:t=true,anchorOrigin:n={horizontal:"center",vertical:"bottom"},direction:o="horizontal",padding:r="sm",gap:s="xs",radius:i="lg",offset:u=0,offsetX:a=0,offsetY:l=0,elevated:c=true,unstyled:p=false,fullWidth:h=false,width:f,height:R,role:I="toolbar","aria-label":x,onClose:C})=>{let g=j(),d=useRef(null),m=useRef(null),v=useRef(false),D=useRef(t),T=n.horizontal??"center",w=n.vertical??"bottom",F=E=>typeof E=="string"?g.spacing[E]??E:E,B=E=>typeof E=="string"?g.radius[E]??E:E,W=Ot(F(u)),O=Ot(F(a)),k=Ot(F(l)),A={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:T==="left"?"flex-start":T==="right"?"flex-end":"center",alignItems:w==="top"?"flex-start":w==="bottom"?"flex-end":"center"},M=()=>`${T==="left"?"left":T==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,b=()=>w==="top"||w==="bottom"?`translateY(${w==="bottom"?100:-100}px) scale(0.98)`:w==="center"?T==="left"?"translateX(-100px) scale(0.98)":T==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",y=()=>w==="center"&&T==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",P=24,H={margin:P,marginTop:w==="top"?`calc(${P}px + ${W} + ${k})`:P,marginBottom:w==="bottom"?`calc(${P}px + ${W} + ${k})`:P,marginLeft:T==="left"?`calc(${P}px + ${W} + ${O})`:P,marginRight:T==="right"?`calc(${P}px + ${W} + ${O})`:P,padding:p?0:Ot(F(r)),background:p?"transparent":g.surface.panelBg,border:p?"none":`1px solid ${g.surface.border}`,borderRadius:p?0:Ot(B(i)),boxShadow:p||!c?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Ot(F(s)),transformOrigin:M(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Ot(f):"auto",height:R?Ot(R):"auto",maxWidth:h?"100%":"none"},L=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let E=d.current;if(!E)return;let S=b(),z=y();if(!v.current){v.current=true,D.current=t,E.style.opacity=t?"1":"0",E.style.transform=t?z:S;return}if(D.current===t){E.style.opacity=t?"1":"0",E.style.transform=t?z:S;return}D.current=t,m.current&&m.current.cancel();let $=t?[{opacity:0,transform:S},{opacity:1,transform:z}]:[{opacity:1,transform:z},{opacity:0,transform:S}];return m.current=E.animate($,{duration:250,easing:"ease",fill:"forwards"}),()=>{m.current&&m.current.cancel();}},[t,T,w]),useEffect(()=>{if(!t||!C)return;let E=S=>{S.key==="Escape"&&C();};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[t,C]),jsx("div",{css:A,children:jsx("div",{ref:d,css:L,style:H,role:I,"aria-label":x,"aria-hidden":!t,...!t&&{inert:true},children:e})})};Ua.displayName="ActionBar";var Ga=(e,t,n)=>Math.min(n,Math.max(t,e)),ts=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qa=1,jc=keyframes`100% { transform: rotate(360deg); }`,Vc=keyframes`
6
6
  0% { left: -35%; right: 100%; }
7
7
  60% { left: 100%; right: -90%; }
8
8
  100% { left: 100%; right: -90%; }
@@ -10,14 +10,14 @@ ${y}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),m()
10
10
  0% { left: -200%; right: 100%; }
11
11
  60% { left: 107%; right: -8%; }
12
12
  100% { left: 107%; right: -8%; }
13
- `,qc=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("),Gc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Xc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(qc(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]&&Gc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let i=e.palette[r];if(i&&i[s]!=null)return i[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var Qn=de.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:i,spinDuration:u=.75,wrapperCss:a,trackCss:l,barCss:c,circleCss:d,"aria-label":h})=>{let f=j(),R=typeof t=="number",I=Math.max(o-n,1),x=R?Ga(t,n,o):void 0,C=R?(x-n)/I*100:void 0,g=Xc(f,r),p=f.surface.subtleBg,m=f.radius?.md;return e==="circular"?jsx(Jc,{size:s,active:g,isDeterminate:R,percent:C,spinDuration:u,wrapperCss:a,trackCss:l,circleCss:d,ariaLabel:h,thickness:i}):jsx(Yc,{thickness:i,active:g,track:p,radius:m,isDeterminate:R,percent:C,wrapperCss:a,trackCss:l,barCss:c,ariaLabel:h,min:n,max:o,value:x})}),Yc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:i,trackCss:u,barCss:a,ariaLabel:l,min:c,max:d,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),R=css([{display:"inline-block",width:"100%"},...Array.isArray(i)?i:i?[i]:[]]),I=css([{position:"relative",width:"100%",height:ts(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(u)?u:u?[u]:[]]),x=r?Math.max(s??0,qa):qa,C=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${x/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(a)?a:a?[a]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},p=css([{...g,left:"-35%",right:"100%",animation:`${Vc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(a)?a:a?[a]:[]]),m=css([{...g,left:"-200%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(a)?a:a?[a]:[]]),v=r?{role:"progressbar","aria-valuemin":c,"aria-valuemax":d,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(v["aria-label"]=l),jsx("span",{css:R,...v,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:I,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:C}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:p}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:m})]})})})},Jc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:i,trackCss:u,circleCss:a,ariaLabel:l})=>{let c=j(),d=40,h=(d-t)/2,f=2*Math.PI*h,I=`${(o?Ga((r??0)/100,.01,1):.7)*f} ${f}`,x=css([{display:"inline-block",width:ts(e,`${c.componentHeights.md}`),height:ts(e,`${c.componentHeights.md}`)},...Array.isArray(i)?i:i?[i]:[]]),C=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(u)?u:u?[u]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:I,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(a)?a:a?[a]:[]]),p=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(p["aria-label"]=l),jsx("span",{css:x,className:"plainframe-ui-progress-circular",...p,children:jsx("svg",{css:C,viewBox:`0 0 ${d} ${d}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:d/2,cy:d/2,r:h,strokeWidth:t,css:g})})})};var Ja=createContext(null),Za=()=>{let e=useContext(Ja);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},iu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),lu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),cu=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}}),Qa=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:i="100%",size:u="md",loading:a=false,css:l,children:c,...d},h){let f=j(),R=useId(),I=useId(),x=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(u)?A[u]:A.md},[u,f.typography,f.radius,f.spacing]),C=f.palette??{},g=f.neutral??{},p=useMemo(()=>{let M=(S=>S==="danger"?C.danger??C.error??g:S==="warning"?C.warning??g:S==="success"?C.success??g:S==="info"?C.info??C.primary??g:g)(t),b=M?.[50]??g[50],y=M?.[300]??g[300],P=M?.[600]??M?.[500]??g[600],H=M?.[700]??P,L=M?.[800]??f.text?.primary??"#000",E=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:P,fg:E,border:void 0,iconColor:E}:n==="outlined"?{bg:b,fg:L,border:`1px solid ${y}`,iconColor:L}:n==="ghost"?{bg:"transparent",fg:H,border:"none",iconColor:H}:{bg:b,fg:L,border:void 0,iconColor:H}},[t,n,g,C,f.text]),m=t==="danger"||t==="warning"?"alert":"status",v=useMemo(()=>a?jsx(Qn,{variant:"circular",color:p.iconColor,size:x.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):jsx(Info,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor})),[a,o,t,x.iconSize,p.iconColor]),D=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${x.paddingY} ${x.paddingX}`,gap:x.gap,borderRadius:x.radius,backgroundColor:p.bg,color:p.fg,border:p.border,fontSize:x.fontSize,fontWeight:500,maxWidth:typeof i=="number"?`${i}px`:i,width:"100%"}),[p.bg,p.border,p.fg,x.fontSize,x.gap,x.paddingX,x.paddingY,x.radius,i]),T=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:x.gap,minWidth:0,flex:1}),[x.gap]),w=useMemo(()=>[lu,{color:p.iconColor}],[p.iconColor]),F=useMemo(()=>css({display:"flex",alignItems:"center",gap:x.gap,marginLeft:x.gap,flex:"0 0 auto"}),[x.gap]),B=useMemo(()=>[cu,{color:p.fg}],[p.fg]),W=useMemo(()=>({fg:p.fg,iconColor:p.iconColor,s:x,titleId:R,descId:I}),[p.fg,p.iconColor,x,R,I]),O=de.Children.toArray(c).some(A=>de.isValidElement(A)&&A.type===rs),k=de.Children.toArray(c).some(A=>de.isValidElement(A)&&A.type===ss);return jsx(Ja.Provider,{value:W,children:jsxs("div",{ref:h,role:m,"aria-live":m==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":a,"aria-labelledby":O?R:void 0,"aria-describedby":k?I:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[D,l],...d,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:T,children:[v&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:v}),jsx("div",{className:"plainframe-ui-alert-content",css:iu,children:c})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:F,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:a,className:"plainframe-ui-alert-close",css:B,children:r??jsx(X,{strokeWidth:2,size:x.iconSize-2})})})]})})});Qa.displayName="Alert";var rs=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:i,titleId:u}=Za(),a=useMemo(()=>css({color:s,fontWeight:i.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,i.titleWeight]);return jsx("span",{ref:r,id:u,className:"plainframe-ui-alert-title",css:[a,n],...o,children:t})});rs.displayName="AlertTitle";var ss=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:i}=Za(),u=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:i,className:"plainframe-ui-alert-desc",css:[u,n],...o,children:t})});ss.displayName="AlertDescription";var as=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,_t=e=>e==null?[]:Array.isArray(e)?e:[e],jt=(...e)=>css(e.filter(Boolean));function ti(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 Zo=de.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:i,helperText:u,disabled:a=false,fullWidth:l=false,width:c=250,size:d="md",variant:h="subtle",rounded:f=false,startIcon:R,endIcon:I,togglePasswordVisible:x=false,showClear:C,type:g="text",step:p,focusRingMode:m="always",className:v,wrapperCss:D,inputCss:T,labelCss:w,helperRowCss:F,helperTextCss:B,startIconCss:W,endIconCss:O,css:k,onBlur:A,onFocus:M,onKeyDown:b,autoFocus:y,name:P,id:H,tabIndex:L,autoComplete:E,readOnly:S,required:z,maxLength:$,onSurfaceClick:K},_){let N=j(),U=Xo(),G=useId(),se=useMemo(()=>{let ce={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}},Te=["sm","md","lg"].includes(d)?d:"md";return ce[Te]},[d,N]),V=N.neutral,Y=N.text,le=g==="number",ue=g==="password",pe=n!==void 0,[Me,Ce]=useState(o),ve=pe?n:Me,we=useCallback(ce=>{pe||Ce(ce),r?.(ce);},[pe,r]),Re=/^-?\d*(?:[.,]\d*)?$/,Z=le&&(p!=null&&String(p).includes(".")||/[.,]/.test(ve??"")),ie=le?Z?"decimal":"numeric":void 0,be=le?Z?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,X$1=useCallback(ce=>{(ce===""||Re.test(ce))&&we(ce);},[we]),ye=a?V[200]:i&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:i&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",Q=N.componentHeights.border,ne=h==="outlined"?`${Q} solid ${i?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%":c!=null?as(c):void 0,flex:"0 0 auto",fontWeight:500}),me=useMemo(()=>jt({fontSize:se.labelFont,fontWeight:500,color:i?N.palette.danger?.[700]??Y.primary:a?V[500]:Y.primary,marginBottom:4,display:"inline-block"},..._t(w)),[se.labelFont,i,a,V,Y,N.palette.danger,w]),Ae=useMemo(()=>jt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${as(se.paddingY)} ${as(se.paddingX)}`,background:ye,border:ne,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:a?"not-allowed":"text",opacity:a?.65:1,transition:"box-shadow .18s, border-color .16s"},..._t(D),..._t(k)),[N,se.minHeight,se.paddingX,se.paddingY,ye,ne,f,a,D,k]),He=useMemo(()=>jt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:a?V[500]:i?N.palette.danger?.[800]??Y.primary:Y.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:a?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:i?N.palette.danger?.[700]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${i?N.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${ye} inset !important`,transition:"opacity 99999s ease-out",caretColor:i?N.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},..._t(T)),[se.fontSize,a,V,Y,i,N.palette.danger,le,ye,T]),J=useMemo(()=>jt({display:"inline-flex",alignItems:"center",color:i?N.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},..._t(W)),[i,N.palette.danger,Y.secondary,W]),oe=useMemo(()=>jt({display:"inline-flex",alignItems:"center",color:i?N.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},..._t(O)),[i,N.palette.danger,Y.secondary,a,O]),re=useMemo(()=>jt({minHeight:16,fontSize:se.helperFont,color:i?N.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},..._t(F)),[se.helperFont,i,N.palette.danger,Y.secondary,F]),Ve=useMemo(()=>jt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},..._t(B)),[B]),Le=useRef(null),wt=useCallback(ce=>{Le.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),Un=useCallback(ce=>{let Te=ce.target.value;if(le){X$1(Te);return}$&&Te.length>$||we(Te);},[le,$,we,X$1]),[Ke,xn]=useState(false),it=useCallback(()=>{a||xn(ce=>!ce);},[a]),vn=useCallback(()=>{a||(we(""),Le.current?.focus());},[a,we]),Et=useMemo(()=>{let ce=se.fontSize;if(typeof ce=="number")return ce;let Te=parseFloat(String(ce));return Number.isFinite(Te)?Te:16},[se.fontSize]),Cn=useMemo(()=>R?jsx("span",{css:J,children:ti(R,Et)}):null,[R,J,Et]),qn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),Po=useMemo(()=>{let ce=[];if(ue&&x){let lt=Ke?jsx(Eye,{strokeWidth:2.5,size:Et}):jsx(EyeOff,{strokeWidth:2.5,size:Et});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Xn=>Xn.preventDefault(),onClick:Xn=>{Xn.stopPropagation(),it();},tabIndex:-1,"aria-label":Ke?"Hide password":"Show password",disabled:a,children:lt},"pw-toggle"));}C&&ve&&ve.length>0&&!a&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:lt=>lt.preventDefault(),onClick:lt=>{lt.stopPropagation(),vn();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:Et})},"clear"));let Te=I?jsx("span",{css:oe,children:ti(I,Et)},"user-end"):null,Ze=ce.length>0,Fe=!!Te;return !Ze&&!Fe?null:!Ze&&Fe?Te:Ze&&!Fe?ce.length===1?ce[0]:jsx("span",{css:qn,children:ce}):jsxs("span",{css:qn,children:[ce,Te]})},[ue,x,Ke,Et,oe,qn,a,C,ve,I,it,vn]),Do=u!=null?`${H??G}-help`:void 0,Gn=H??G,Ue=useCallback(ce=>{if(a)return;ce.stopPropagation();let Te=Le.current;if(!Te)return;let Ze=ce.target;if(!(Te.contains(Ze)||Ze.closest("button,[role='button']"))){if(document.activeElement===Te){ce.preventDefault();return}ce.preventDefault();}},[a]),ut=useCallback(ce=>{if(a)return;let Te=Le.current;if(Te&&(K?.(ce),document.activeElement!==Te)){Te.focus({preventScroll:true});try{let Ze=Te.value?.length??0;Te.setSelectionRange?.(Ze,Ze);}catch{}}},[a,K]);return jsxs("div",{className:["plainframe-ui-textfield",v||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Gn,className:"plainframe-ui-textfield-label",css:me,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:m!=="none",color:i?"danger":void 0}),Ae],onPointerDownCapture:Ue,onClick:ut,"aria-invalid":!!i||void 0,children:[Cn,jsx("input",{ref:wt,id:Gn,className:"plainframe-ui-textfield-input",css:He,type:ue?Ke?"text":"password":g==="number"?"text":g,inputMode:ie,pattern:be,value:ve,maxLength:le?void 0:$,onChange:le?ce=>X$1(ce.target.value):Un,placeholder:s||"",disabled:a,onBlur:A,onFocus:M,onKeyDown:b,autoFocus:y,name:P,tabIndex:L,autoComplete:E,readOnly:S,required:z,"aria-invalid":!!i||void 0,"aria-describedby":Do}),Po]}),u!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Do,className:"plainframe-ui-textfield-helper-text",css:Ve,children:u})})]})}));Zo.displayName="TextField";var Qo=de.createContext("ghost"),ft=de.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:i,css:u,children:a,label:l,allItemsTabbable:c=false,...d},h){let f=j(),[R,I]=useState(false),x=useRef(null),C=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",p=s?void 0:css({background:g,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":C,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"}}),m=n==="sm",v=useMemo(()=>({isKeyboardNav:R,setIsKeyboardNav:I}),[R]),D=useMemo(()=>({allItemsTabbable:c}),[c]),T=useCallback(M=>Array.from(M.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"]')!==M)return false;let y=window.getComputedStyle(b);return y.display!=="none"&&y.visibility!=="hidden"}),[]),w=useCallback(M=>{M.removeAttribute("data-keyboard-nav"),M.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),I(false);},[]),F=useRef(false),B=useCallback(M=>{if(M.target!==M.currentTarget)return;if(F.current){F.current=false;return}let b=M.currentTarget,y=T(b);y.length>0&&(I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),y[0].setAttribute("data-highlighted",""),y[0].focus({preventScroll:true}));},[T]),W=useCallback(M=>{let b=M.currentTarget,y=T(b);if(y.length===0)return;if(M.key==="Tab"){F.current=true,b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),I(false),b.tabIndex=-1,requestAnimationFrame(()=>{b.tabIndex=0,F.current=false;});return}let P=b.querySelector("[data-highlighted]"),H=b.querySelector("[data-hovered]"),L=P||H,E=L?y.indexOf(L):-1;if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach($=>$.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach($=>$.removeAttribute("data-hovered")),E===-1&&(E=M.key==="ArrowDown"?-1:y.length);let S=M.key==="ArrowDown"?1:-1,z=(E+S+y.length)%y.length;y[z].setAttribute("data-highlighted",""),y[z].focus({preventScroll:true});return}if(M.key==="Home"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(S=>S.removeAttribute("data-hovered")),y[0].setAttribute("data-highlighted",""),y[0].focus({preventScroll:true});return}if(M.key==="End"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(S=>S.removeAttribute("data-hovered")),y[y.length-1].setAttribute("data-highlighted",""),y[y.length-1].focus({preventScroll:true});return}if(M.key==="Escape"){M.preventDefault(),b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),I(false),b.blur();return}},[T]),O=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&w(b);},[w]),k=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&w(b);},[w]),A=useCallback(M=>{x.current=M,typeof h=="function"?h(M):h&&(h.current=M);},[h]);return jsx(eo.Provider,{value:v,children:jsx(to.Provider,{value:D,children:jsx(ft.Provider,{value:m,children:jsx(Qo.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":R?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",i||""].join(" ").trim(),css:[p,u],onFocus:B,onKeyDown:W,onPointerMove:O,onPointerDown:k,...d,children:a})]})})})})})});ai.displayName="Menu";var li=createContext(null),nr=()=>{let e=useContext(li);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function $u(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ro=(...e)=>t=>{for(let n of e)$u(n,t);},ls=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zu=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]);},er=(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}},Ou=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:i})=>{let[u,a]=useState(!!t),l=e??u,c=x=>{e===void 0&&a(x),n?.(x);},d=useRef(null),h=useRef(null),f=(x=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>c(false),x);},R=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};zu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let x=C=>{if(C.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let p=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(T=>{let w=window.getComputedStyle(T);return w.display!=="none"&&w.visibility!=="hidden"});if(p.length===0)return;let m=p[0],v=p[p.length-1],D=document.activeElement;C.shiftKey&&D===m?(C.preventDefault(),v.focus()):!C.shiftKey&&D===v&&(C.preventDefault(),m.focus());};return document.addEventListener("keydown",x,true),()=>document.removeEventListener("keydown",x,true)},[s,l]);let I=useMemo(()=>({open:l,setOpen:c,triggerOn:o,referenceRef:d,scheduleClose:f,cancelClose:R}),[l,o]);return jsx(li.Provider,{value:I,children:i})},ci=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:i,referenceRef:u,scheduleClose:a,cancelClose:l}=nr(),c=de.Children.only(t),d=c.props||{},h=ro(u,o,c.ref),f=i==="click"?{onClick:I=>{I.stopPropagation(),s(!r),d.onClick?.(I);}}:{onMouseEnter:I=>{l(),r||s(true),d.onMouseEnter?.(I);},onMouseLeave:I=>{a(),d.onMouseLeave?.(I);}},R={"aria-haspopup":"dialog","aria-expanded":r};if(e){let I=c.props?.css;return de.cloneElement(c,{...f,...R,ref:h,css:[I,n].filter(Boolean)})}return de.createElement("button",{ref:h,type:"button",css:[n],...f,...R,children:c})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=nr(),i=de.Children.only(o),u=ro(s,r,i.ref);if(e){let l=i.props?.css;return de.cloneElement(i,{ref:u,css:[l,n].filter(Boolean)})}let a=css({display:"inline-block",width:ls(t),verticalAlign:"middle",...n});return jsx("span",{ref:u,css:a,children:i})});ui.displayName="PopoverAnchor";function Wu(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,i=n==="left"?"start":n==="right"?"end":"center";return i==="center"?s:`${s}-${i}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var di=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:i,height:u,padding:a,paddingX:l,paddingY:c,radius:d="lg",css:h,...f},R)=>{let{open:I,setOpen:x,triggerOn:C,referenceRef:g,scheduleClose:p,cancelClose:m}=nr(),v=j(),D=Wu(e),{refs:T,x:w,y:F,strategy:B,context:W}=useFloating({open:I,onOpenChange:x,whileElementsMounted:autoUpdate,placement:D,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&T.setReference(g.current);},[T,g]);let O=useDismiss(W,{outsidePressEvent:"pointerdown",escapeKey:true}),k=useRole(W,{role:"dialog"}),{getFloatingProps:A}=useInteractions([O,k]),[M]=W.placement.split("-"),b=M,y=`${b==="left"?"right":b==="right"?"left":"center"} ${b==="top"?"bottom":b==="bottom"?"top":"center"}`,P=8,H=b==="top"?{y:P}:b==="bottom"?{y:-P}:b==="left"?{x:P}:{x:-P},L={initial:{opacity:0,scale:.96,...H},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...H},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"}}},E=v.surface.panelBg,S=v.text.primary,z=`${v.componentHeights.border} solid ${v.surface.border}`,$=er(a,v.spacing),K=er(l,v.spacing),_=er(c,v.spacing),N={};$&&(N.padding=$),K&&(N.paddingInline=K),_&&(N.paddingBlock=_);let U=er(d,v.radius)??v.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:B,top:F??0,left:w??0,zIndex:1e3,transformOrigin:y,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ls(i)??"fit-content",height:ls(u)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),V=r?css({}):css({background:E,color:S,border:z,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof v.spacing?.sm=="number"?`${v.spacing.sm}px ${v.spacing.md}px`:`${v.spacing?.sm??"0.5rem"} ${v.spacing?.md??"1rem"}`}}),Y=C==="hover"?{onMouseEnter:m,onMouseLeave:()=>p()}:{},le=ro(T.setFloating,R),ue=jsx(motion.div,{className:"plainframe-ui-popover",...A({...f,ref:le,...Y}),...L,css:[se,V,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:I?ue:null})})});di.displayName="PopoverContent";var Ku=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var ps=de.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:i,className:u,css:a,trackCss:l,thumbCss:c,labelCss:d,...h},f){let R=j(),I=he(),x={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}},C={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[p,m]=useState(n),v=g?!!t:p,[D,T]=useState(false);useEffect(()=>{if(r)return;T(true);let K=setTimeout(()=>T(false),C.pressMs);return ()=>clearTimeout(K)},[v,r]);let w=["sm","md","lg"].includes(s)?s:"md",F=x[w],B=`${C.slideMs}ms ${C.easing}`,W=R.palette?.primary?.[600]??R.neutral[900],O=R.neutral[300],k=v?W:O,A=v?R.text.onColors.primary:"#ffffff",{trackW:M,trackH:b,thumb:y}=F,P=(b-y)/2,H=css({display:"inline-flex",alignItems:"center",gap:F.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:R.spacing.xs,borderRadius:R.radius.sm,outline:"none"}),L=css({position:"relative",width:M,height:b,backgroundColor:k,borderRadius:R.radius.xl,transition:`background-color ${B}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),E=css({position:"absolute",top:P,left:v?M-y-P:P,width:y,height:y,backgroundColor:A,borderRadius:R.radius.xl,transition:`left ${B}, transform ${B}, background-color 0.25s ease`,transform:D?"scaleX(1.2)":"scaleX(1)",transformOrigin:v?"right center":"left center"}),S=css({fontSize:R.typography.sizes.sm,fontWeight:500,color:r?R.text.muted:R.text.primary}),z=()=>{if(r)return;let K=!v;g||m(K),o?.(K);};return jsxs("label",{ref:f,role:"switch","aria-checked":v,"aria-disabled":r||void 0,"data-checked":v?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:z,onKeyDown:K=>{r||(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),z());},className:["plainframe-ui-switch",u||""].join(" ").trim(),css:[H,I({color:v?"primary":"neutral"}),a],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[L,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[E,c]})}),i!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[S,d],children:i})]})}));var Yu=(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},rr=de.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:i,rounded:u=false,checkedIcon:a,color:l="primary",css:c,boxCss:d,checkCss:h,labelCss:f,descriptionCss:R,className:I,...x},C)=>{let g=j(),p=he(),m=typeof e=="boolean",[v,D]=useState(t),T=m?e:v,w=r==="sm"||r==="lg"?r:"md",F=useMemo(()=>Yu(g,w),[g,w]),{checkedBg:B,checkColor:W,borderCol:O,hoverBg:k,gapPx:A}=useMemo(()=>{let K=g.palette||{},_=g.neutral||{},N=g.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(K,l)?(U=K[l]||K.primary||_,G=l):(U=K.primary||_,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],V=N[G]??N.primary??g.text?.onColors?.primary??g.text.primary,Y=typeof F.gap=="number"?F.gap+2:F.gap;return {checkedBg:se,checkColor:V,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:Y}},[F.gap,l,g]),M=useMemo(()=>css({display:"inline-flex",alignItems:s&&i?"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:O,backgroundColor:k},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:B,outlineColor:B,"--pfui-bleed":B},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:B,backgroundColor:B,"--pfui-bleed":B},".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)"}}),[O,B,i,o,A,k,s,g.radius.sm,g.spacing.xs]),b=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),y=useMemo(()=>css({width:F.box,height:F.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${F.borderWidth} solid ${O}`,outlineOffset:`-${F.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:u?g.radius.full:F.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"}),[F.box,F.borderRadius,F.borderWidth,O,u,g.radius.full]),P=useMemo(()=>({w:Math.round(F.box*F.iconRatioW),h:Math.round(F.box*F.iconRatioH)}),[F.box,F.iconRatioH,F.iconRatioW]),H=useMemo(()=>css({width:P.w,height:P.h,transition:"opacity .14s ease, transform .14s ease",color:W,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[W,P.h,P.w]),L=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),E=useMemo(()=>css({fontSize:F.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[F.labelFont,g.text.primary]),S=useMemo(()=>css({fontSize:F.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&i?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[F.labelFont,i,s,g.spacing.xs,g.text.secondary]),z=useCallback(()=>{o||(m?n?.(!T):D(K=>{let _=!K;return n?.(_),_}));},[o,m,T,n]),$=useCallback(K=>{o||(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),z());},[o,z]);return jsxs("label",{ref:C,role:"checkbox","aria-checked":T,"aria-disabled":o||void 0,"data-state":T?"checked":"unchecked",className:["plainframe-ui-checkbox",I||""].join(" ").trim(),css:[M,p({color:T?"primary":"neutral"}),c,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:$,children:[jsx("input",{type:"checkbox",checked:T,onChange:z,disabled:o,css:b,...x,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[y,d],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[H,h],children:T&&(a||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:W,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||i)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:L,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[E,f],children:s}),i&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[S,R],children:i})]})]})}));rr.displayName="Checkbox";var Qu=()=>useContext(sn),ed=()=>useContext(to),td=()=>useContext(lr),on=null,bi=(e,t=35)=>{on!==null&&window.clearTimeout(on),on=window.setTimeout(()=>{e(),on=null;},t);},so=()=>{on!==null&&(window.clearTimeout(on),on=null);},kt=de.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:i,className:u,css:a,startIcon:l,endIcon:c,selected:d=false,active:h,meta:f,__index:R,__skipListReg:I,...x},C){let g=Qu(),p=td(),m=ir(),v=io(),D=ed(),T=j(),F=!!useContext(ft),B=x["data-subtrigger"]!==void 0,W=B&&c===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):c,k=typeof o=="number"?o:o===false?0:0,A=useContext(Qo),M=A==="subtle"?T.surface?.subtleHover??T.neutral[100]:T.surface?.subtleBg??T.neutral[100],b=useMemo(()=>css({width:"100%",borderRadius:T.radius.md,padding:`${T.spacing.sm} ${T.spacing.sm}`,paddingLeft:k>0?`calc(${T.spacing.md} + (${T.spacing.xl} * ${k}))`:T.spacing.md,minHeight:F?T.componentHeights.sm:T.componentHeights.md,display:"flex",alignItems:"center",gap:T.spacing.sm,fontWeight:500,fontSize:T.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?T.palette.danger[800]:T.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?T.palette.danger[50]:M},"&[data-highlighted]":t?{}:{background:n?T.palette.danger[50]:M},"&[data-active]":t?{}:{background:n?T.palette.danger[50]:M},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?T.palette.danger[50]:M},"[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:T.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[T,F,k,t,n,M]),y=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"}}),[]),P=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:T.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:T.text.secondary}),[T.text.secondary,T.spacing.sm]),H=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:T.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[T.palette.primary]),L=[];F&&L.push({minHeight:T.componentHeights.sm,paddingLeft:T.spacing.sm,paddingRight:T.spacing.xs,paddingTop:T.spacing.xs,paddingBottom:T.spacing.xs});let E=()=>{s?.(),r&&!B&&p?.closeAll();},S=($,K)=>{let _=$.closest('[role="menu"]');if(!_)return;let N=Array.from(_.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(Y=>{if(Y.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(Y);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf($),G=U>=0?U:0,se=K(N.length,G),V=N[se];V&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),V.setAttribute("data-highlighted",""),V.focus(),g&&R!=null&&g.setActiveIndex(se));},z=t?-1:D?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:z,ref:$=>{if(g&&!I){let K=g.listRef.current;$&&(R!=null?K[R]=$:K.includes($)||K.push($));}typeof C=="function"?C($):C&&"current"in C&&(C.current=$);},onMouseMove:$=>{if($.currentTarget.hasAttribute("data-hovered"))return;let K=!!$.currentTarget.closest("[data-submenu-content]");!B&&m&&!K&&bi(m.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");}),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&g&&R!=null&&g.setActiveIndex(R),!t&&!D?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onMouseEnter:$=>{if(B)so();else {let N=!!$.currentTarget.closest("[data-submenu-content]");m&&!N&&bi(m.closeAllSubMenus);}$.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");})),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');!t&&g&&R!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),v&&v.setIsKeyboardNav(false)),g.setActiveIndex(R)),!t&&!D?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:$=>{if(t)return;let K=$.currentTarget;if($.key==="Tab"&&g&&!D?.allItemsTabbable){$.preventDefault();return}if($.key==="Tab"&&!g){let _=K.closest('[role="menu"]');if(_){_.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=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}v&&v.setIsKeyboardNav(false);return}if($.key==="Enter"||$.key===" "||$.key==="ArrowRight"){B||$.key!=="ArrowRight"&&($.preventDefault(),$.stopPropagation(),E());return}if($.key==="ArrowLeft"&&K.closest('[role="menu"]')?.closest("[data-submenu-content]")){$.preventDefault(),$.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(V=>V.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(V=>V.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if($.key==="Escape"){$.preventDefault(),$.stopPropagation(),p?.closeAll(),K.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if($.key==="ArrowDown"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),v&&v.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,(N,U)=>(U+1)%N);return}if($.key==="ArrowUp"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),v&&v.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,(N,U)=>(U-1+N)%N);return}if($.key==="Home"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,()=>0);return}if($.key==="End"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,N=>N-1);return}},className:["plainframe-ui-menu-item",u||""].join(" ").trim(),css:css(...[b,...L,a].flat()),...x,onClick:$=>{t||($.currentTarget.removeAttribute("data-highlighted"),E());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:y,children:l}),i,(f!=null||W||d)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:P,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:T.typography.sizes.sm,color:T.text.secondary,whiteSpace:"nowrap"}),children:f}):null,W,d&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:H,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=de.createContext(null),fs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),i=e!==void 0,u=i?e:r,a=useRef(u);a.current=u;let l=useRef(n);l.current=n;let c=useCallback(h=>{let f=a.current,I=f.some(x=>Object.is(x,h))?f.filter(x=>!Object.is(x,h)):[...f,h];i||s(I),l.current?.(I);},[i]),d=useMemo(()=>({values:u,toggle:c}),[u,c]);return jsx(yi.Provider,{value:d,children:o})},ao=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:i,disabled:u=false,css:a,className:l,startIcon:c,endIcon:d,...h},f){let R=useContext(yi),I=!!R&&r!==void 0,x=!I&&t!==void 0,[C,g]=useState(()=>I?R.values.some(O=>Object.is(O,r)):!!n),p=I?R.values.some(O=>Object.is(O,r)):x?!!t:C,m=j(),D=!!useContext(ft),T=()=>{if(!u)if(I)R.toggle(r);else {let O=!p;x||g(O),o?.(O);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:D?-1:-3,borderRadius:m.radius.xs,transition:"background-color .12s ease"}),F=css({pointerEvents:"none"}),B=useCallback(O=>{O&&(O.querySelectorAll("[tabindex]").forEach(k=>{k.tabIndex=-1;}),O.querySelectorAll('input, button, a, [role="checkbox"]').forEach(k=>{k.tabIndex=-1;}));},[]),W=jsxs(Fragment,{children:[jsx("span",{ref:B,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:w,"aria-hidden":"true",children:jsx(rr,{size:"sm",checked:p,css:F})}),c]});return jsx(kt,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:i,role:"menuitemcheckbox","aria-checked":p,closeOnSelect:false,onSelect:T,disabled:u,startIcon:W,endIcon:d,css:a,selected:false,children:s})});ao.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:i=false,css:u,switchSize:a="md",switchCss:l,startIcon:c,className:d,...h},f){let R=t!==void 0,[I,x]=useState(!!n),C=R?!!t:I,p=!!useContext(ft),m=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),v=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:p?2:void 0}),D=()=>{if(i)return;let w=!C;R||x(w),o?.(w);},T=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(kt,{...h,className:["plainframe-ui-menu-switch-item",d||""].join(" ").trim(),ref:f,__index:s,disabled:i,closeOnSelect:false,onSelect:D,css:u,selected:false,children:[c&&jsx("span",{className:"plainframe-ui-menu-item-start",css:T,children:c}),jsx("span",{"data-label":true,css:m,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:v,children:jsx(ps,{checked:C,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:a})})]})});xi.displayName="MenuSwitchItem";var vi=de.createContext(null),Ci=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),i=e??r,u=l=>{e!==void 0||s(l),n?.(l);},a=useMemo(()=>({value:i,onChange:u}),[i]);return jsx(vi.Provider,{value:a,children:o})};Ci.displayName="MenuRadioGroup";var nd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:i,...u},a){let l=useContext(vi),c=l?.value===t,d=j(),h=css({width:d.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:d.palette.primary[600],transform:c?"scale(1)":"scale(0.4)",opacity:c?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),R=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(kt,{...u,className:["plainframe-ui-menu-radio-item",i||""].join(" ").trim(),ref:a,__index:o,role:"menuitemradio","aria-checked":c,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:R,children:n})]})}),rn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:i,wrap:u=false,color:a="primary",...l},c){let d=j(),f=!!useContext(ft),R=a==="primary"?d.text.primary:a==="secondary"?d.text.secondary:d.palette[a]?.[700]??d.text.primary,I=css({display:"flex",alignItems:"center",padding:f?`${d.spacing.sm} ${d.spacing.md}`:`${d.spacing.sm} ${d.spacing.md}`,fontSize:d.typography.sizes.sm,color:R,fontWeight:500,...t?{paddingLeft:`calc(${d.spacing.lg} * 2)`}:null,gap:d.spacing.xs}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:u?"normal":"nowrap"}),C=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:c,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(I,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:C,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:x,children:r}),i&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:i})]})});rn.displayName="MenuLabel";var od=({className:e,css:t,variant:n="full",...o})=>{let r=j(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,i=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)"}),u=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?i:n==="middle"?u:a;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var gs=ro,lo=0,cr=null,ur=null,bd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function hd(){if(!(typeof document>"u")){if(lo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=bd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}lo+=1;}}function yd(){if(!(typeof document>"u")&&(lo>0&&(lo-=1),lo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var sn=createContext(null),dr=()=>{let e=useContext(sn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},co=createContext(null),xd=()=>useContext(co),eo=createContext(null),io=()=>useContext(eo),Ti=createContext(null),ir=()=>useContext(Ti),wi=createContext(false),vd=()=>useContext(wi),to=createContext({allItemsTabbable:true}),lr=de.createContext(null),bs=()=>useContext(lr);function Cd(){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 Rd=()=>xd()?.activeIndex??null,Ei=0,An=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:i})=>{let[u,a]=useState(!!t),l=e??u,c=useCallback(A=>{e===void 0&&a(A),n?.(A);},[e,n]),d=useRef(`pfui-menu-${++Ei}`),h=useRef(null),f=useRef([]),R=useRef(null),[I,x]=useState(null),[C,g]=useState(false);useEffect(()=>{l||(x(null),f.current=[],g(false));},[l]);let p=useRef(null),m=useCallback((A,M)=>{if(o!=="hover")return;window.clearTimeout(p.current??0);let b=M??20;p.current=window.setTimeout(()=>c(A),b);},[o,c]),v=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null);},[]);useEffect(()=>()=>v(),[v]),useEffect(()=>{if(!(!r||!l))return hd(),()=>yd()},[l,r]);let D=bs(),[T]=useState(()=>D??Cd()),w=useRef(new Set),F=useMemo(()=>({registerSubMenu:A=>(w.current.add(A),()=>w.current.delete(A)),closeAllSubMenus:()=>{w.current.forEach(A=>A());}}),[]),B=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:h,listRef:f,floatingRef:R,setActiveIndex:x,scheduleSubmenuHover:m,clearSubmenuHover:v,menuId:d.current}),[l,c,o,x,m,v]),W=useMemo(()=>({activeIndex:I,setActiveIndex:x}),[I,x]),O=useMemo(()=>({isKeyboardNav:C,setIsKeyboardNav:g}),[C]),k=s==="sm";return jsx(lr.Provider,{value:T,children:jsx(ft.Provider,{value:k,children:jsx(eo.Provider,{value:O,children:jsx(Ti.Provider,{value:F,children:jsx(co.Provider,{value:W,children:jsx(sn.Provider,{value:B,children:i})})})})})})};An.displayName="DropdownMenu";var Pn=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},i)=>{let{open:u,setOpen:a,trigger:l,referenceRef:c,listRef:d,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:R,floatingRef:I,menuId:x}=dr(),C=io(),g=ir(),p=!!e&&isValidElement(t),m=p?t:null,v=m&&m.props&&typeof m.props=="object"&&"onKeyDown"in m.props?m.props.onKeyDown:void 0,D=m&&m.props&&typeof m.props=="object"&&"onClick"in m.props?m.props.onClick:void 0,{onKeyDown:T,onClick:w,...F}=s,B=useMemo(()=>gs(i,p&&isValidElement(t)&&"ref"in t?t.ref:void 0,c),[i,p,t,c]),W=useCallback(()=>d.current.filter(Boolean),[d]),O=useCallback(y=>{let P=W();requestAnimationFrame(()=>P[y]?.focus());},[W]),k=useCallback(y=>{if(y.key==="Tab"&&u){y.preventDefault(),C?.setIsKeyboardNav(true);let P=I?.current;if(P){P.setAttribute("data-keyboard-nav","");let H=P.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])');H&&(document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),H.setAttribute("data-highlighted",""),H.focus());}return}if(y.key==="ArrowRight"&&u){let P=document.querySelector("[data-subtrigger][data-hovered]");if(P){y.preventDefault(),y.stopPropagation(),C?.setIsKeyboardNav(true),P.removeAttribute("data-hovered"),P.setAttribute("data-highlighted",""),P.focus(),requestAnimationFrame(()=>{let H=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});P.dispatchEvent(H);});return}}if(y.key==="ArrowDown"||y.key==="ArrowUp"){if(C?.setIsKeyboardNav(true),!u){y.preventDefault(),a(true),requestAnimationFrame(()=>{let P=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(P){P.setAttribute("data-keyboard-nav","");let H=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let E=L.closest("[data-submenu-content]");if(E&&E!==P)return false;let S=window.getComputedStyle(L);return S.display!=="none"&&S.visibility!=="hidden"});if(H.length>0){let L=y.key==="ArrowDown"?0:H.length-1;h(L),H[L]?.setAttribute("data-highlighted",""),H[L]?.focus();}}}),v?.(y),T?.(y);return}if(u){y.preventDefault();let P=document.querySelectorAll("[data-hovered]");for(let L of Array.from(P))if(L.closest("[data-submenu-content]")){let S=L.closest('[role="menu"]');if(S){S.setAttribute("data-keyboard-nav","");let z=Array.from(S.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(K=>{if(K.closest('[role="menu"]')!==S)return false;let _=window.getComputedStyle(K);return _.display!=="none"&&_.visibility!=="hidden"}),$=z.indexOf(L);if(document.querySelectorAll("[data-highlighted]").forEach(K=>K.removeAttribute("data-highlighted")),L.removeAttribute("data-hovered"),$!==-1&&z.length>0){let K=y.key==="ArrowDown"?1:-1,_=($+K+z.length)%z.length;z[_]?.setAttribute("data-highlighted",""),z[_]?.focus();}return}}let H=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(H){H.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let L=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(E=>{if(E.closest('[role="menu"]')!==H)return false;let S=window.getComputedStyle(E);return S.display!=="none"&&S.visibility!=="hidden"});if(L.length>0){let E=H.querySelector("[data-highlighted]"),S=H.querySelector("[data-hovered]"),z=-1;E?z=L.indexOf(E):S&&(z=L.indexOf(S)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),S&&S.removeAttribute("data-hovered"),z===-1&&(z=y.key==="ArrowDown"?-1:L.length);let $=y.key==="ArrowDown"?1:-1,K=(z+$+L.length)%L.length;h(K),L[K]?.setAttribute("data-highlighted",""),L[K]?.focus();}}v?.(y),T?.(y);return}}if((y.key==="Enter"||y.key===" ")&&!u){y.preventDefault(),C?.setIsKeyboardNav(true),a(true),requestAnimationFrame(()=>{let P=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(P){P.setAttribute("data-keyboard-nav","");let H=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let E=L.closest("[data-submenu-content]");if(E&&E!==P)return false;let S=window.getComputedStyle(L);return S.display!=="none"&&S.visibility!=="hidden"});H.length>0&&(h(0),H[0]?.setAttribute("data-highlighted",""),H[0]?.focus());}}),v?.(y),T?.(y);return}v?.(y),T?.(y);},[u,a,h,v,T,W,O,d,C,x,I,g]),A=useCallback(y=>{l==="click"&&((y.nativeEvent.composedPath?.()??[]).some(E=>{let S=E;if(!S||!("tagName"in S))return false;let z=String(S.tagName).toUpperCase();if(z==="INPUT"||z==="TEXTAREA"||"isContentEditable"in S&&S.isContentEditable)return true;let $="getAttribute"in S?S.getAttribute("role"):null;return $==="textbox"||$==="combobox"})||(y.stopPropagation(),a(!u))),D?.(y),w?.(y);},[l,u,a,D,w]),M=l==="hover"?{onMouseEnter:()=>{R(),a(true);},onMouseLeave:()=>{f(false);}}:{},b=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(p&&m){let y=m.props,P=y.css,H=typeof y.className=="string"?y.className:void 0,L=typeof y.tabIndex=="number"?y.tabIndex:0,E={ref:B,tabIndex:L,className:[H,o].filter(Boolean).join(" ")||void 0,css:[P,b,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,onClick:A,onKeyDown:k,...M,...F};return cloneElement(m,E)}return jsx("button",{ref:B,className:o,css:[css({display:"inline-block"}),b,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":u,onClick:A,onKeyDown:k,...M,...F,children:t})});Pn.displayName="DropdownMenuTrigger";var cn=de.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:i=false,width:u,height:a,maxHeight:l,unstyled:c=false,closeOnBlur:d=false,allItemsTabbable:h=false,className:f,css:R,children:I,exitPlacement:x,animateOnBusClose:C=true,gap:g,ignoreOutsidePressRefs:p,disableOutsidePressDismiss:m=false,returnFocus:v=false,...D},T)=>{let{open:w,setOpen:F,referenceRef:B,clearSubmenuHover:W,setActiveIndex:O,floatingRef:k,menuId:A}=dr(),M=j(),b=bs(),y=io();useEffect(()=>{if(!b)return;let J=b.registerCloser(()=>F(false));return ()=>{J&&J();}},[b,F]);let P=typeof o=="string"?parseFloat(o):o,H=typeof r=="string"?parseFloat(r):r,L=typeof s=="string"?parseFloat(s):s,E=`${t}${n==="center"?"":`-${n}`}`,S=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),re=Math.round(J.y);return {x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0,toJSON:()=>({x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0})}},contextElement:void 0}),[]),z=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let J=e;return S({x:J.x,y:J.y})},[e,S]),{refs:$,x:K,y:_,strategy:N,context:U,update:G}=useFloating({open:w,onOpenChange:F,placement:E,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:P??0,crossAxis:H??0}),flip({padding:L??8}),shift({padding:L??8}),size({apply({rects:J,elements:oe}){let re=oe.floating;re.style.boxSizing="border-box",a!=null?re.style.height=typeof a=="number"?`${a}px`:String(a):re.style.removeProperty("height"),u!=null?re.style.width=typeof u=="number"?`${u}px`:String(u):i?re.style.width=`${Math.round(J.reference.width)}px`:re.style.width="200px",l!=null?re.style.maxHeight=typeof l=="number"?`${l}px`:String(l):re.style.removeProperty("max-height");}})]});useEffect(()=>{z?$.setReference(z):B.current&&$.setReference(B.current);},[$,z,B]),useEffect(()=>{if(!w)return;let J=z||B.current,oe=$.floating.current;if(!(!J||!oe))return autoUpdate(J,oe,G)},[w,z,B,$,G]),useEffect(()=>{G();},[G,i,u,a,l]),useEffect(()=>{w&&!h&&O(0);},[w,h,O]),useEffect(()=>{if(!d||!w)return;let J=()=>{let oe=document.activeElement,re=B.current,Ve=$.floating.current;oe&&(re?.contains(oe)||Ve?.contains(oe)||F(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[d,w,F,B,$.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:m?false:J=>{if(p?.length){let oe=J.target;for(let re of p)if(re.current?.contains(oe))return false}return true}}),V=useRole(U,{role:"menu"}),{getFloatingProps:Y}=useInteractions([se,V]),le=useRef(false);useEffect(()=>{w?le.current=true:le.current&&B.current&&v&&(b?.isBusClosingRef.current||requestAnimationFrame(()=>{B.current?.focus();}));},[w,B,b,v]);let ue=typeof M.spacing.xs=="number"?`${M.spacing.xs}px`:String(M.spacing.xs),pe=g===void 0?void 0:typeof g=="number"?g:M.spacing[g]??g,Me=c?void 0:css({boxSizing:"border-box",background:M.surface.panelBg,border:`${M.componentHeights.border} solid ${M.surface.border}`,borderRadius:M.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ue,padding:"var(--pfui-panel-pad)",color:M.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:pe,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,ve=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let re=J.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return J;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Ce+=1,cloneElement(J,{__index:Ce,key:J.key??Ce});if(re==="DropdownMenuTrigger"){let Le=J.props.children;return cloneElement(J,{children:de.Children.map(Le,ve)})}if(re==="DropdownMenuSubTrigger"){Ce+=1;let Le=Ce;return cloneElement(J,{__index:Le,key:J.key??Le})}let Ve=J.props.children;return Ve==null?J:cloneElement(J,{children:de.Children.map(Ve,ve)})},we=de.Children.map(I,ve),Z=U.placement.split("-")[0]||"bottom",ie=Z==="bottom"?"center top":Z==="top"?"center bottom":Z==="left"?"right center":"left center",be=Z==="bottom"?{opacity:0,y:-8,scale:.96}:Z==="top"?{opacity:0,y:8,scale:.96}:Z==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},X=x??Z,ye=X==="bottom"?{opacity:0,y:-8,scale:.96}:X==="top"?{opacity:0,y:8,scale:.96}:X==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ne=!!b?.isBusClosingRef.current&&!C?{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:_??0,left:K??0,zIndex:1e3,transformOrigin:ie}),me=useCallback(J=>{if(J.key==="Tab"){J.preventDefault();return}if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),y?.setIsKeyboardNav(true);let oe=J.currentTarget;oe.setAttribute("data-keyboard-nav","");let re=Array.from(oe.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(Ve=>{if(Ve.closest('[role="menu"]')!==oe)return false;let Le=window.getComputedStyle(Ve);return Le.display!=="none"&&Le.visibility!=="hidden"});if(re.length>0){let Ve=oe.querySelector("[data-highlighted]"),Le=oe.querySelector("[data-hovered]"),wt=-1;Ve?wt=re.indexOf(Ve):Le&&(wt=re.indexOf(Le)),document.querySelectorAll("[data-highlighted]").forEach(xn=>xn.removeAttribute("data-highlighted")),Le&&Le.removeAttribute("data-hovered"),wt===-1&&(wt=J.key==="ArrowDown"?-1:re.length);let Un=J.key==="ArrowDown"?1:-1,Ke=(wt+Un+re.length)%re.length;O(Ke),re[Ke]?.setAttribute("data-highlighted",""),re[Ke]?.focus();}}},[y,O]),Ae=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),y?.isKeyboardNav&&y.setIsKeyboardNav(false);},[y]),He=useCallback(J=>{J.removeAttribute("data-keyboard-nav"),J.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),y?.isKeyboardNav&&y.setIsKeyboardNav(false);},[y]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(to.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...Y({...D,ref:gs(T,$.setFloating,J=>{k&&(k.current=J);})}),"data-menu-id":A,"data-keyboard-nav":y?.isKeyboardNav?"":void 0,className:f,css:[Me,ae,R],initial:be,animate:{opacity:1,x:0,y:0,scale:1},exit:ye,transition:ne,onPointerMove:J=>He(J.currentTarget),onPointerDown:J=>He(J.currentTarget),onKeyDown:me,onMouseMove:Ae,onMouseEnter:()=>{W(),b?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:we})}):null})})});cn.displayName="DropdownMenuContent";var Si=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let i=vd(),[u,a]=useState(!!t),l=e??u,c=useCallback(k=>{e===void 0&&a(k),n?.(k);},[e,n]),d=useRef(null),h=useRef(false),f=useCallback((k,A)=>{if(o!=="hover")return;window.clearTimeout(d.current??0),h.current=k;let M=A??20;d.current=window.setTimeout(()=>{h.current=false,c(k);},M);},[o,c]),R=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null,h.current=false);},[]);useEffect(()=>()=>R(),[R]);let I=ir();useEffect(()=>{if(!I)return;let k=()=>{R(),c(false);};return I.registerSubMenu(k)},[I,c,R]);let x=useRef(`pfui-submenu-${++Ei}`),C=useRef(null),g=useRef([]),p=useRef(null),[m,v]=useState(null),[D,T]=useState(false);useEffect(()=>{l||(v(null),g.current=[],T(false));},[l]);let w=useContext(ft),F=r??w,B=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:C,listRef:g,floatingRef:p,setActiveIndex:v,scheduleSubmenuHover:f,clearSubmenuHover:R,pendingOpenRef:h,menuId:x.current}),[l,c,o,v,f,R]),W=useMemo(()=>({activeIndex:m,setActiveIndex:v}),[m,v]),O=useMemo(()=>({isKeyboardNav:D,setIsKeyboardNav:T}),[D]);return i?(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:de.Children.map(s,k=>{if(!isValidElement(k))return k;let A=k.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:k})})):jsx(wi.Provider,{value:true,children:jsx(ft.Provider,{value:F,children:jsx(co.Provider,{value:W,children:jsx(eo.Provider,{value:O,children:jsx(sn.Provider,{value:B,children:s})})})})})};Si.displayName="DropdownMenuSub";var Ii=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},i)=>{let{open:u,setOpen:a,trigger:l,referenceRef:c,scheduleSubmenuHover:d,clearSubmenuHover:h,pendingOpenRef:f,menuId:R}=dr(),I=io(),x=useCallback(k=>{k&&(k.__pfuiCloseSubmenu=()=>a(false));},[a]),C=!!e&&isValidElement(t),g=C?t:null,p=g?.props,m=p?.onKeyDown,v=p?.onClick,{onKeyDown:D,onClick:T,...w}=s,F=useMemo(()=>gs(i,C&&isValidElement(t)&&"ref"in t?t.ref:void 0,c,x),[i,C,t,c,x]),B=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,W=useCallback(k=>{if(k.key==="Tab"){k.preventDefault();return}let A=k.currentTarget,M=b=>{I?.setIsKeyboardNav(true);let y=A.closest("[data-menu-id]");if(!y)return;y.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted"));let P=Array.from(y.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(S=>{if(S.closest("[data-menu-id]")!==y)return false;let z=window.getComputedStyle(S);return z.display!=="none"&&z.visibility!=="hidden"});if(!P.length)return;let H=P.indexOf(A),L=H>=0?H:0,E=b==="next"?(L+1)%P.length:(L-1+P.length)%P.length;P[E]?.setAttribute("data-highlighted",""),P[E]?.focus();};if(k.key==="ArrowDown"){k.preventDefault(),k.stopPropagation(),u&&a(false),M("next");return}if(k.key==="ArrowUp"){k.preventDefault(),k.stopPropagation(),u&&a(false),M("prev");return}if(k.key==="ArrowRight"||k.key==="Enter"||k.key===" "){k.preventDefault(),k.stopPropagation(),I?.setIsKeyboardNav(true);let b=k.currentTarget;a(true),requestAnimationFrame(()=>{let y=R?document.querySelector(`[data-menu-id="${R}"]`):document.querySelector("[data-submenu-content]");if(y){y.setAttribute("data-keyboard-nav",""),b.removeAttribute("data-highlighted"),b.removeAttribute("data-hovered");let P=y.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])');P&&(P.setAttribute("data-highlighted",""),P.focus());}});return}if(k.key==="ArrowLeft"){k.preventDefault(),k.stopPropagation(),u&&a(false);let b=A.closest("[data-menu-id]");b&&b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(y=>y.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(y=>y.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),I&&I.setIsKeyboardNav(true);return}if(k.key==="Escape"){k.preventDefault(),k.stopPropagation(),m?.(k);return}m?.(k),D?.(k);},[u,a,m,D,c,I,R]),O=l==="hover"?{onMouseEnter:k=>{let A=k.currentTarget;so(),h(),document.querySelectorAll("[data-hovered]").forEach(b=>b.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let M=A.closest("[data-menu-id]");M?.hasAttribute("data-keyboard-nav")&&M.removeAttribute("data-keyboard-nav"),I&&I.setIsKeyboardNav(false),u||d(true,90);},onMouseMove:k=>{let A=k.currentTarget;so(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(M=>M.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(M=>M.removeAttribute("data-highlighted")),A.setAttribute("data-hovered","")),!u&&!f?.current&&d(true,90);},onMouseLeave:()=>{d(false,60);}}:{onClick:k=>{k.stopPropagation(),a(!u),v?.(k),T?.(k);}};if(C&&g){let k=p?.css,A=typeof p?.className=="string"?p.className:void 0,M=typeof p?.tabIndex=="number"?p.tabIndex:0,b={ref:F,tabIndex:M,className:[A,o].filter(Boolean).join(" ")||void 0,css:[k,B,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",__skipListReg:true,onKeyDown:W,onFocus:y=>{if(y.target.hasAttribute("data-highlighted")){let P=y.target.closest("[data-menu-id]");P&&!P.hasAttribute("data-keyboard-nav")&&(P.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}p&&"onFocus"in p&&typeof p.onFocus=="function"&&p.onFocus(y);},...O,...w};return cloneElement(g,b)}return jsx("div",{ref:F,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),B,r],"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",onKeyDown:W,onFocus:k=>{if(k.currentTarget.hasAttribute("data-highlighted")){let A=k.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}},...O,...w,children:t})});Ii.displayName="DropdownMenuSubTrigger";var ki=de.forwardRef((e,t)=>{let n=bs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=dr(),i=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(cn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:i,"data-submenu-content":"",anchor:o.current,onMouseEnter:u=>{r(),n?.clearAllHover(),so(),e.onMouseEnter?.(u);},onMouseLeave:u=>{s(false,60),e.onMouseLeave?.(u);}})});ki.displayName="DropdownMenuSubContent";var pr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ed=css({display:"inline"}),Fi=css({display:"inline",fontWeight:700}),Sd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Id=css({display:"flex",alignItems:"center",gap:4}),kd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Ai=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Md=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Fd=()=>{},Ad=e=>e,Pd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Dd=e=>{e.preventDefault(),e.stopPropagation();},Nd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Hd=e=>{e.preventDefault(),e.stopPropagation();},Pi=de.memo(({onCapture:e})=>{let t=useContext(sn),n=useContext(co),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Pi.displayName="CtxCapture";var hs=de.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:i,cls:u,closeOnSelect:a,pickSingle:l,handleItemKeyDown:c,handleItemMouseDown:d,descriptionColor:h})=>{let f=o(),R=useMemo(()=>{let C=String(e.title??e.value);return s?C:i(C)},[i,e.title,e.value,s]),I=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:kd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ai,children:R}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Md,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ai,children:R}),[R,e.description,h]),x=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let C=f.some(g=>Object.is(g,e.value));return s?jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:d,children:s(e,C)},e.value):jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:d,startIcon:e.startIcon,endIcon:e.endIcon,children:I},e.value)}return s?jsx(kt,{__index:t,onClick:x,onSelect:x,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:a,onMouseDown:d,selected:r,children:s(e,r)},e.value):jsx(kt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:x,onSelect:x,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:a,onMouseDown:d,selected:r,children:I},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));hs.displayName="AutocompleteRow";var Di=de.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:i,css:u,inputCss:a,containerCss:l,label:c,helperText:d,variant:h,startIcon:f,endIcon:R,size:I,disabled:x=false,error:C=false,showClear:g=false,open:p,onOpenChange:m,openOnFocus:v=false,openOnType:D=true,openOnClick:T=true,closeOnSelect:w=true,closeOnBlur:F=true,blurOnSelect:B=false,freeSolo:W=false,customValueLabel:O=false,maxHeight:k,maxItems:A,noResultsText:M="No Items Found",highlightTypedValue:b,typedValueHighlightCss:y,showNoResults:P=true,noResultsLabelCss:H,loadingLabelCss:L,loadItems:E,loading:S,loadingText:z="Loading\u2026",debounceMs:$=200,multiple:K=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:V,textFieldWrapperCss:Y,textFieldInputCss:le,textFieldLabelCss:ue,textFieldHelperRowCss:pe,textFieldHelperTextCss:Me,textFieldStartIconCss:Ce,textFieldEndIconCss:ve,menuContentCss:we})=>{let Z=j().text.secondary,[ie,be]=useState(""),X=typeof p=="boolean",[ye,Q]=useState(false),ne=X?p:ye,ae=useRef(null),me=useRef(null),Ae=useRef(null),He=useRef(null),J=useRef(false),oe=useRef(null),re=useRef(false),Ve=useRef(0),Le=useMemo(()=>[me],[]),[wt,Un]=useState(N??[]),Ke=_??wt,xn=useRef(Ke);xn.current=Ke;let[it,vn]=useState(null),Et=useRef(it);Et.current=it;let Cn=useCallback(()=>xn.current,[]),[qn,Po]=useState([]),[Do,Gn]=useState(false),Ue=typeof E=="function",ut=Ue?qn:e,ce=useRef(ut);ce.current=ut;let Te=!!S||Do&&Ue,Ze=useRef(m);useEffect(()=>{Ze.current=m;},[m]);let Fe=useCallback(q=>{X||Q(q),Ze.current?.(q);},[X]),lt=useRef(null);useEffect(()=>{if(!Ue)return;lt.current&&window.clearTimeout(lt.current);let q=ie;return lt.current=window.setTimeout(async()=>{Gn(true);try{let te=await E(q)||[];Po(Array.isArray(te)?te:[]);}catch{Po([]);}finally{Gn(false);}},Math.max(0,$)),()=>{lt.current&&window.clearTimeout(lt.current);}},[ie,Ue,E,$]);let Xn=useMemo(()=>{let q=pr(ie);return q?ut.some(te=>pr(te.title??te.value)===q):false},[ut,ie]),sa=W&&!!O&&ie.trim().length>0&&!Xn,ac=q=>{if(typeof O=="object"){let te=Object.prototype.hasOwnProperty.call(O,"prefix"),xe=Object.prototype.hasOwnProperty.call(O,"suffix");if(te||xe){let Ee=te?O.prefix??"":"",fe=xe?O.suffix??"":"";return `${Ee}${q}${fe}`}return `Add "${q}"`}return `Add "${q}"`},Br=useMemo(()=>{if(Ue)return ut;let q=pr(ie);if(!q)return ut;let te=[],xe=[];for(let Ee of ut){let fe=pr(Ee.title??Ee.value);fe.split(" ").some(qe=>qe.startsWith(q))?te.push(Ee):fe.includes(q)&&xe.push(Ee);}return te.length>0?te:xe},[ut,ie,Ue]),aa=useMemo(()=>{if(sa){let q=ie.trim();return [...Br,{value:q,title:ac(q),__pfui_free__:true}]}return Br},[Br,sa,ie]),Bt=useMemo(()=>{let q=[],te=new Map;for(let ot of aa){let qe=ot.group??"__ungrouped__";te.has(qe)||(te.set(qe,[]),q.push(qe)),te.get(qe).push(ot);}let Ee=typeof A=="number"?Math.max(0,A):1/0,fe=[];for(let ot of q){if(Ee<=0)break;let Zt=te.get(ot).slice(0,Ee);Zt.length>0&&(fe.push({label:ot==="__ungrouped__"?void 0:ot,items:Zt}),Ee-=Zt.length);}return fe},[aa,A]),Rn=useMemo(()=>Bt.reduce((q,te)=>(q.push(...te.items),q),[]),[Bt]),No=Rn.length>0,$r=!No&&!!P&&!Te&&ie.trim().length>0,Tn=Te||No||$r,Ho=Tn||Ue;useEffect(()=>{!Ue&&ne&&!Tn&&(re.current=true,Fe(false),setTimeout(()=>{re.current=false;},150));},[Ue,ne,Tn,Fe]);let zr=useRef(null),Or=useRef(false);useEffect(()=>{if(W&&!K){if(Or.current){Or.current=false;return}let q=ie.trim();if(zr.current===q)return;zr.current=q,t?.({value:q,title:q});}},[ie,W,K,t]);let Wr=useCallback(q=>{let te=ce.current,xe=new Map(te.map(fe=>[fe.value,fe])),Ee=q.map(fe=>xe.get(fe)??{value:fe,title:fe});U?.(Ee);},[U]),Lo=useCallback(q=>{let te=q.map(String);_||Un(te),Wr(te);},[_,Wr]),ia=useCallback(q=>{let xe=Ke.includes(q)?Ke.filter(Ee=>Ee!==q):[...Ke,q];Lo(xe);},[Ke,Lo]),Bo=useCallback(q=>{let te=ce.current.find(xe=>xe.value===q)??{value:q,title:q};te.disabled||(Or.current=true,zr.current=(te.title??te.value).trim(),vn(te),be(te.title??te.value),t?.(te),X||(w?(J.current=false,re.current=true,Q(false),Ze.current?.(false),setTimeout(()=>{re.current=false;},150)):J.current=true),!w&&Ae.current?.setActiveIndex&&Ae.current.setActiveIndex(null),B?(J.current=false,setTimeout(()=>{He.current&&ae.current?(He.current.tabIndex=0,He.current.focus(),He.current.blur(),He.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,X,w,B]),ic=useCallback(q=>{if(x)return;be(q);let te=!q.trim();K||(te?(vn(null),t?.(null)):W&&vn(null)),!X&&!te&&D&&!ne&&Fe(true);},[K,X,D,ne,Fe,x,W,t]),Qe=Pd,la=Fd,lc=Ad,ca=useMemo(()=>y?[Fi,y]:Fi,[y]),cc=useCallback(q=>{let te=ie.trim();if(!te||te.length<1)return q;let xe=te.toLowerCase(),fe=q.toLowerCase().indexOf(xe);return fe<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Ed,children:[q.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:ca,children:q.slice(fe,fe+te.length)}),q.slice(fe+te.length)]})},[ie,ca]),$o=b?cc:lc,uc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Dd,Oo=Nd,dc=useCallback(q=>{Ae.current=q;},[]),ua=useCallback(q=>{let te=Ae.current;if(!te)return;let xe=Rn.length;if(xe===0)return;let Ee=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(Ee){let qe=Ee.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),Zt=Ee.querySelector("[data-active]")||Ee.querySelector("[data-hovered]");Zt&&(fe=Array.from(qe).indexOf(Zt));}fe<0&&typeof te.activeIndex=="number"&&(fe=te.activeIndex);let ot=fe<0?q===1?0:xe-1:(fe+q+xe)%xe;te.setActiveIndex?.(ot),requestAnimationFrame(()=>{let qe=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!qe)return;qe.setAttribute("data-keyboard-nav",""),qe.querySelectorAll("[data-active]").forEach(_r=>_r.removeAttribute("data-active")),qe.querySelectorAll("[data-hovered]").forEach(_r=>_r.removeAttribute("data-hovered"));let Kr=qe.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[ot];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[Rn.length]),pc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(x||!Tn&&!Ue)return;q.preventDefault(),!ne&&!X&&Fe(true),ua(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(x)return;let te=Ae.current&&typeof Ae.current.activeIndex=="number"?Ae.current.activeIndex:-1,xe=te>=0&&te<Rn.length?Rn[te]:null;if(ne&&xe&&te>=0){q.preventDefault(),q.stopPropagation(),K?(ia(xe.value),w||requestAnimationFrame(()=>ae.current?.focus())):Bo(xe.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),ne&&!X&&(re.current=true,Fe(false),q.target.focus(),setTimeout(()=>{re.current=false;},150))):q.key==="Tab"&&ne&&!X&&Fe(false);},[Tn,Ue,ne,X,Rn,K,w,ua,ia,Bo,Fe,x]),mc=useCallback(()=>{x||re.current||v&&Ho&&(Ve.current=Date.now(),X||Fe(true));},[X,v,Ho,Fe,x]),fc=useCallback(()=>{if(J.current){J.current=false;return}F&&Fe(false),!W&&!K&&(it?be(it.title??it.value):ie.trim()&&be(""));},[F,W,K,it,ie,Fe]),da=useCallback(()=>{let q=[],te=0;return Bt.forEach((xe,Ee)=>{xe.label&&q.push(jsx(rn,{className:Qe("group-label"),children:xe.label},`g-${Ee}`)),xe.items.forEach(fe=>{q.push(jsx(hs,{item:fe,absIndex:te,multiple:true,getCurrentMulti:Cn,isSelected:false,renderItem:s,paint:$o,cls:Qe,closeOnSelect:false,pickSingle:la,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),jsx(fs,{values:Ke,onValuesChange:Lo,children:q},"multi-group")},[Bt,Qe,Cn,s,$o,Ke,Lo,la,Oo,zo,Z]),pa=useCallback(()=>{let q=[],te=0;return Bt.forEach((xe,Ee)=>{xe.label&&q.push(jsx(rn,{className:Qe("group-label"),children:xe.label},`g-${Ee}`)),xe.items.forEach(fe=>{let ot=it?.value===fe.value;q.push(jsx(hs,{item:fe,absIndex:te,multiple:false,getCurrentMulti:Cn,isSelected:ot,renderItem:s,paint:$o,cls:Qe,closeOnSelect:w,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),q},[Bt,Qe,it,Cn,s,$o,w,Bo,Oo,zo,Z]),gc=useMemo(()=>Te?jsx(rn,{css:L,className:Qe("label-loading"),children:z},"loading"):$r?jsx(rn,{css:H,className:Qe("label-empty"),children:M},"empty"):Bt.length===0?null:K?da():pa(),[Te,$r,Bt.length,Qe,z,M,K,da,pa]),Jt=ne?false:x||!Ue&&!No&&!P,ma=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(Jt||x)&&(X||(ne?(re.current=true,Fe(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{re.current=false;},150)):(Fe(true),queueMicrotask(()=>ae.current?.focus()))));},[ne,No,Ue,Fe,Jt,x,X]),fa=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:ne?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:Jt?"not-allowed":"pointer",userSelect:"none",opacity:Jt?.5:1}),[ne,Jt]),Wo=useMemo(()=>se?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[fa,V],"aria-disabled":Jt||void 0,onMouseDown:Hd,onClick:ma,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,fa,V,Jt,ma,G]),bc=useMemo(()=>R&&Wo?jsxs("span",{css:Id,children:[R,Wo]}):R??Wo,[R,Wo]),hc=useCallback(q=>{if(!(oe.current&&oe.current.contains(q.target)||re.current||x||Date.now()-Ve.current<300)){if(ne){!ie.trim()&&!X&&(re.current=true,Fe(false),setTimeout(()=>{re.current=false;},150));return}T&&Ho&&(!X||T)&&Fe(true);}},[ne,ie,T,Ho,Fe,x,X]);return jsx("div",{ref:me,className:Qe(""),css:[uc,l,u],children:jsxs(An,{open:x?false:ne,onOpenChange:x?void 0:Fe,children:[jsx(Pi,{onCapture:dc}),jsx(Pn,{asChild:true,children:jsx("span",{className:Qe("anchor"),css:Sd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:ae,className:Qe("input"),focusRingMode:i,value:ie,onChange:ic,onKeyDown:pc,onFocus:mc,onBlur:fc,onSurfaceClick:hc,placeholder:r,label:c,helperText:d,variant:h,startIcon:f,endIcon:bc,size:I,width:n,fullWidth:o,disabled:x,error:C,showClear:g,css:a,wrapperCss:Y,inputCss:le,labelCss:ue,helperRowCss:pe,helperTextCss:Me,startIconCss:Ce,endIconCss:ve}),jsx("span",{ref:He,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}}),Tn&&jsx(cn,{className:Qe("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof k=="number"?`${k}px`:k,css:we,ignoreOutsidePressRefs:Le,disableOutsidePressDismiss:X,returnFocus:!B,children:gc})]})})});Di.displayName="Autocomplete";var Od=["sm","md","lg"],Wd=(e,t)=>typeof e=="number"?e:Od.includes(e)?t.componentHeights[e]:t.componentHeights.md,Kd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},_d=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},jd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Ni=de.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:i,children:u,...a},l)=>{let c=j(),[d,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Wd(n,c),R=typeof f=="number"?f:Number.parseFloat(String(f))||0,I=R?Math.round(R*(R<=28?.55:.52)):void 0,x=r?c.radius.full:c.radius.md,C=Kd(c,o),g=_d(c,o),p=jd(u,t),m=css({width:f,height:f,borderRadius:x,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:d?"transparent":C,color:d?"inherit":g,boxSizing:"border-box",userSelect:"none"}),v=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),D=css({fontSize:I,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:[m,i],role:d?void 0:"img","aria-label":d?void 0:t,...a,children:d&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:v,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof u=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:D,children:u}):u||jsx("span",{className:"plainframe-ui-avatar-initials",css:D,children:p})})}));Ni.displayName="Avatar";var Hi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:i,extraLabelCss:u,outlineThickness:a=4,className:l})=>{let c=j(),d=he(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let T=(c.componentHeights&&c.componentHeights[n])??(c.spacing&&c.spacing[n]);return Hi(T??n)}return "32px"})(),R=Children.toArray(e).filter(Boolean),I=typeof t=="number"&&t>=0,x=I&&R.length>t?R.slice(0,t):R,C=I&&R.length>t?R.length-t:0,g=i==="panel"?c.surface.panelBg:i==="subtle"?c.surface.subtleBg:i??c.surface.appBg,p=Hi(a)??"4px",m=css({display:"flex",alignItems:"center"}),v=T=>css({marginLeft:T===0?0:o,zIndex:x.length-T,boxShadow:`0 0 0 ${p} ${g}`,backgroundColor:g,borderRadius:s?c.radius.full:c.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),D=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:[m,r,d()],children:[x.map((T,w)=>{if(!isValidElement(T))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:v(w),children:jsx("span",{css:D,children:T})},w);let F=T,B=F.props?.css,W=B==null?D:[D,B],O=cloneElement(F,{size:n,rounded:s,css:W,style:{...F.props?.style,width:"100%",height:"100%",objectFit:F.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:v(w),children:O},w)}),C>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:c.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:c.text.secondary}),u],"aria-label":`+${C} more`,children:["+",C]})]})};var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=(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"}},Jd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Zd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Qd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",ep=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),tp=de.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:i=99,showZero:u=false,visible:a=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:c="rectangular",children:d,animate:h=true,size:f,outline:R=false,outlineColor:I,className:x,badgeClassName:C,css:g,badgeCss:p,offsetX:m,offsetY:v})=>{let D=j(),T=s==="dot",w=f??(T?8:17),F=r??(T?0:10),{scale:B,onKey:W}=Yd(D,t),O=Jd(B),k=D.text?.onColors||{},A=Zd(D,k,W,n),M=Qd(e,i,s),b=ep(a,s,e,u),y=css({position:"relative",display:"inline-block"}),P=c==="circular"?T?"12.5%":"5%":T?"5%":"2.5%",H=$i(m??P),L=$i(v??P),E=l.vertical||"top",S=l.horizontal||"right",z={},$="0",K="0";E==="center"?(z.top="50%",K="-50%"):E==="top"?(z.top=L,K="-45%"):(z.bottom=L,K="45%"),S==="center"?(z.left="50%",$="-50%"):S==="right"?(z.right=H,$="45%"):(z.left=H,$="-45%");let _=b?1:.8,N=css({minWidth:T?w:w/2,height:w,background:O,color:A,fontSize:typeof F=="number"?`${F}px`:F,fontWeight:o,borderRadius:999,padding:T?0:`0 ${w/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",...R?{boxShadow:`0 0 0 2px ${I??D.surface?.appBg}`}:{},opacity:b?1:0,transform:`translate(${$}, ${K}) scale(${b?_:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...z});return jsxs("div",{className:["plainframe-ui-badge-wrapper",x||""].join(" ").trim(),css:[y,g],children:[d,jsx("span",{"aria-hidden":!b,className:["plainframe-ui-badge",C||""].join(" ").trim(),css:[N,p],children:M})]})});var ws=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:i,contentCss:u,overlayCss:a,children:l,transitionDuration:c=300,keepMounted:d=true,className:h,contentClassName:f,lockScroll:R=true,...I})=>{let x=j(),C=useMemo(()=>r??x.surface.overlayBg,[r,x.surface.overlayBg]),[g,p]=useState(e),[m,v]=useState(e),D=useRef(null),T=useRef(null),w=useRef(null);useEffect(()=>(D.current&&(clearTimeout(D.current),D.current=null),T.current!=null&&(cancelAnimationFrame(T.current),T.current=null),e?(p(true),T.current=requestAnimationFrame(()=>{v(true),T.current=null;})):(v(false),D.current=setTimeout(()=>{p(false),D.current=null;},c)),()=>{D.current&&(clearTimeout(D.current),D.current=null),T.current!=null&&(cancelAnimationFrame(T.current),T.current=null);}),[e,c]),useEffect(()=>{if(!R||!e)return;let A=document.body,M=A.style.overflow,b=A.style.paddingRight,y=window.innerWidth-document.documentElement.clientWidth,P=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",y>0&&(A.style.paddingRight=`${P+y}px`),()=>{A.style.overflow=M,A.style.paddingRight=b;}},[e,R]),useEffect(()=>{if(!m||!t)return;let A=M=>{M.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[m,t]);let F=A=>{if(!m||!t||!w.current)return;let M=A.target;M&&!w.current.contains(M)&&t();},B=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!d&&!g)return null;let W=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:m?"auto":"none",visibility:g?"visible":"hidden"}),O=css({position:"absolute",inset:0,background:C,backdropFilter:B?`blur(${B})`:void 0,WebkitBackdropFilter:B?`blur(${B})`:void 0,opacity:m?1:0,transition:`opacity ${c}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:m?"auto":"none"}),k=css({position:"relative",zIndex:1,pointerEvents:m?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[W,i],onPointerDown:F,...I,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[O,a],role:"presentation"}),jsx("div",{ref:w,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[k,u],children:l})]})};var br=()=>null;Object.defineProperty(br,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function ap(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 ip=de.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:i,separatorCss:u,hover:a=true,className:l,...c})=>{let d=j(),h=he(),f=de.useMemo(()=>de.Children.toArray(e).flatMap(p=>{if(!de.isValidElement(p))return [];let{type:m,props:v}=ap(p);if(!(m===br||typeof m=="function"&&"displayName"in m&&m.displayName===br.displayName))return [];let T=v;return [{href:T.href,disabled:T.disabled,node:T.children,className:T.className,css:T.css,onClick:T.onClick,startIcon:T.startIcon,endIcon:T.endIcon}]}),[e]),R=de.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:d.typography.sizes.sm,fontWeight:500,gap:d.spacing.xs,cursor:"default"}),[d]),I=de.useMemo(()=>css({margin:"0 0.15rem",color:d.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[d]),x=de.useCallback((p,m,v)=>{let D=p?d.text.primary:d.text.secondary,T=a&&m&&!v;return css({display:"inline-flex",alignItems:"center",gap:d.spacing.xs,color:D,cursor:m&&!v?"pointer":"default",textDecoration:"none",borderRadius:d.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":T?{textDecoration:"underline",color:d.text.primary}:{textDecoration:"none"}})},[d,a]),C=de.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=de.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[R,n],...c,children:f.map((p,m)=>{let v=m===f.length-1,D=!!p.href&&!p.disabled&&!v,T=["plainframe-ui-breadcrumb",v?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",D?"plainframe-ui-breadcrumb--link":"",p.className||""].join(" ").trim(),w=[x(v,D,p.disabled),o,v?r:s,D?i:void 0,h(),p.css],F=jsxs(Fragment,{children:[p.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:C,children:p.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:p.node}),p.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:C,children:p.endIcon})]});return jsxs(de.Fragment,{children:[m!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[I,u],children:t}),D?jsx("a",{href:p.href,onClick:p.onClick,tabIndex:0,"data-active":v?"true":"false","data-link":"true",className:T,css:w,children:F}):jsx("span",{"aria-current":v?"page":void 0,tabIndex:v?-1:0,"data-active":v?"true":"false","data-link":"false",className:T,css:w,children:F})]},m)})})});var Es=(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})},Ss=e=>typeof e=="number"?`${e}px`:e,Ki=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Ki(n)&&(t=true));}),t};function dp(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 pp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,i=r.danger||r.error||s,u=e.text.onColors||{},a=u.primary??o.onColors.primary,l=u.danger??a,c=(d,h,f)=>d&&d[h]||f;if(t==="primary"){let d=s,h=c(d,600,n[900])||c(d,500,n[900]),f=c(d,500,n[800])||c(d,600,n[800]);return {bg:h,fg:a,hoverBg:f,border:"none"}}if(t==="destructive"){let d=i,h=c(d,600,n[900])||c(d,500,n[900]),f=c(d,500,n[800])||c(d,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:i[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 _i=de.memo(de.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:i=false,loading:u=false,loadingIndicator:a,loadingPosition:l="center",children:c,className:d,hoverEffect:h=true,icon:f,onClick:R,css:I,...x},C)=>{let g=j(),p=he(),m=useMemo(()=>dp(g,t),[g,t]),v=useMemo(()=>pp(g,e),[g,e]),D=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Ki(c)&&de.Children.count(c)===1,[f,n,o,c]),T=m.iconSize,w=useMemo(()=>Es(n,T),[n,T]),F=useMemo(()=>Es(o,T),[o,T]),B=useMemo(()=>a??jsx(Qn,{color:v.fg,variant:"circular",size:14,thickness:5}),[a,v]),W=useMemo(()=>D?"center":l??"center",[D,l]),O=!!u&&W==="center",k=!!u&&W==="start",A=!!u&&W==="end",M=i||u,b=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:m.minHeight,lineHeight:1,fontWeight:600,cursor:M?"not-allowed":"pointer",opacity:M?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:m.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,m,r,g,M]),y=useMemo(()=>css({backgroundColor:v.bg,color:v.fg,border:v.border}),[v]),P=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:v.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!M?{":hover::before":{opacity:1}}:{}}),[v,h,M]),H=useMemo(()=>css(D&&!s?{width:"100%",height:"100%",maxWidth:m.minHeight,minWidth:m.minHeight,maxHeight:m.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Ss(m.iconSize)}:{fontSize:Ss(m.fontSize),padding:n||o?`${m.paddingY} ${m.paddingXIcon}`:`${m.paddingY} ${m.paddingX}`}),[D,s,m,n,o]),L=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Ss(g.spacing.sm),opacity:O?0:1,transition:"opacity 140ms ease"}),[g,O]),E=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),S=useMemo(()=>typeof m.iconSize=="number"?m.iconSize:Math.max(12,Math.round(parseFloat(String(m.iconSize))||16)),[m.iconSize]),z=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:S,minWidth:S,maxWidth:S,height:"1em"}),[S]),$=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),K=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:O?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[O]),_=useMemo(()=>()=>{if(D)return null;let G=!!n;return !G&&!k?null:jsxs("span",{css:z,"aria-hidden":u?true:void 0,children:[jsx("span",{css:$(!k),children:G?w||n:null}),jsx("span",{css:$(!!k),children:B})]})},[D,n,k,z,$,w,u,B]),N=useMemo(()=>()=>{if(D)return null;let G=!!o;return !G&&!A?null:jsxs("span",{css:z,"aria-hidden":u?true:void 0,children:[jsx("span",{css:$(!A),children:G?F||o:null}),jsx("span",{css:$(!!A),children:B})]})},[D,o,A,z,$,F,u,B]),U=!(i||u);return jsxs("button",{ref:C,type:"type"in x&&x.type?x.type:"button","data-variant":e,className:["plainframe-ui-button",d||""].join(" ").trim(),css:[b,p({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),y,P,H,I],onClick:U?R:void 0,disabled:i||void 0,tabIndex:u?-1:void 0,"aria-disabled":i||void 0,"aria-busy":u||void 0,...x,children:[jsxs("span",{className:"plainframe-ui-button-content",css:L,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:E,children:D?u?B:Es(c,m.iconSize):c}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:K,"aria-hidden":"true",children:O?B:null})]})}));_i.displayName="Button";var vr=e=>isValidElement(e),mp=e=>{let t=e.type;return t.displayName??t.name},Fs=(e,t)=>mp(e)===t,Ui=e=>Fs(e,"ButtonGroup"),qi=e=>Fs(e,"DropdownMenu"),ks=e=>Fs(e,"DropdownMenuTrigger"),Hn=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,fp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,gp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ms=(e,t)=>{if(!vr(e))return null;if(Ui(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ms(t?n[0]:n[n.length-1],t):null}if(qi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(ks);return o?Ms(o,t):null}if(ks(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Vi=(e,t)=>{if(!e)return false;let n=Ms(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return gp(o)},Gi=de.memo(de.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:i="md",rounded:u=false,gap:a,width:l,className:c,role:d="group",css:h,__clipLeft:f,__clipRight:R,...I},x){let C=j(),g=i==="sm"?C.radius.sm:C.radius.md,p=u?C.radius.full:g,m=o==="vertical",v=fp(C.componentHeights.border,1),D=C.surface.border,T=n&&!!f,w=n&&!!R,F=css({display:"flex",flexDirection:m?"column":"row",width:r?"100%":l!=null?Hn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Hn(a??C.spacing.sm)}),B=Children.toArray(t),O=B.filter(vr).length,k=0,A=false,M=[];for(let b of B){if(!vr(b)){M.push(b);continue}let y=k===0,P=k===O-1,H=b.props??{},L=H.disabled??s,E=H.size??i,S=0,z=0,$=0,K=0;n&&(m?(S=y?T?0:p:0,z=y?w?0:p:0,K=P?T?0:p:0,$=P?w?0:p:0):(S=y?T?0:p:0,K=y?T?0:p:0,z=P?w?0:p:0,$=P?w?0:p:0));let _=Vi(b,"left"),N=Vi(b,"right"),se=n&&!y&&!(A&&_)&&!(A||_)?css({[m?"borderTop":"borderLeft"]:`${v} solid ${D}`}):null,V=n&&!y&&A&&_?css(m?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:Hn(S),borderTopRightRadius:Hn(z),borderBottomRightRadius:Hn($),borderBottomLeftRadius:Hn(K)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ue=css([Y,se,V,le]);if(!qi(b)){let ve=H.css,we=[H.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Re=Ui(b)&&n?{__clipLeft:!y,__clipRight:!P}:{},Z=cloneElement(b,{...H,disabled:L,size:E,className:we,css:[ve,ue],...Re});M.push(Z),A=N,k+=1;continue}let pe=H.children,Me=Children.map(pe,ve=>{if(!vr(ve)||!ks(ve))return ve;let we=ve.props,Re=[we.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(ve,{...we,css:[we.css,ue],className:Re,disabled:L,size:E})}),Ce=cloneElement(b,{...H,children:Me});M.push(Ce),A=N,k+=1;}return jsx("div",{ref:x,role:d,"aria-orientation":m?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",c||""].join(" ").trim(),css:[F,h],...I,children:M})}));Gi.displayName="ButtonGroup";var Cr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Cr(n?.[e]??e)}}},Rp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Cr(n?.[e]??e)}}},Tp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},wp=(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},Ln=de.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:i,hoverable:u,selectable:a,selected:l,defaultSelected:c,onSelectedChange:d,width:h,height:f,onClick:R,onKeyDown:I,role:x,tabIndex:C,...g},p){let m=j(),v=m.surface??{},[D,T]=useState(!!c),w=l!=null,F=w?!!l:D,B=useMemo(()=>Tp(o,m),[o,m]),W=useMemo(()=>wp(o,m,B),[o,m,B]),O=W,k=useMemo(()=>Cp(r,m),[r,m]),A=useMemo(()=>Rp(s,m),[s,m]),M=!!u||!!a,b=useMemo(()=>css({backgroundColor:B,padding:k,borderRadius:A,border:o==="outlined"?`${m.componentHeights?.border??"1px"} solid ${v.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Cr(h),height:Cr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:M?"pointer":void 0,...M?{"&:hover":{backgroundColor:W}}:{},'&[data-selected="true"]':{backgroundColor:O},...M?{'&[data-selected="true"]:hover':{backgroundColor:O}}:{}}),[B,k,A,o,m.componentHeights,v.border,h,f,M,W,O]),y=useCallback(()=>{if(!a)return;let E=!F;w||T(E),d?.(E);},[w,d,a,F]),P=useCallback(E=>{a&&y(),R?.(E);},[a,y,R]),H=useCallback(E=>{a&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),y()),I?.(E);},[a,y,I]),L=he();return jsx("div",{ref:p,"data-variant":o,"data-selected":a&&F?"true":void 0,"aria-pressed":a?F:void 0,className:["plainframe-ui-container",i||""].join(" ").trim(),css:[L(),b,n],onClick:P,onKeyDown:H,role:a?x??"button":x,tabIndex:a?C??0:C,...g,children:t})}));Ln.displayName="Container";var Sp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ps(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 Sp(o)}return e}}}function go(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ds(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ip(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 bo(e,t,n,o){let r=Ps(t,e),s=Ps(n,e),i=Ps(o,e),u={};return r&&!s&&!i&&(u.padding=r),s&&(u.paddingLeft=s,u.paddingRight=s),i&&(u.paddingTop=i,u.paddingBottom=i),u}function Xi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Yi=de.createContext("horizontal"),Ns=()=>de.useContext(Yi),Ji=de.memo(de.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:i,selected:u,defaultSelected:a,onSelectedChange:l,width:c="100%",height:d,gap:h,direction:f="horizontal",className:R,onClick:I,...x},C)=>{let g=j(),p=he(),m=f==="vertical",v=css({position:"relative",display:"flex",flexDirection:m?"column":"row",gap:Ip(h,g),alignItems:m?"stretch":"center",transition:"all .16s ease"});return jsx(Yi.Provider,{value:f,children:jsx(Ln,{ref:C,variant:n,padding:o,radius:r,hoverable:s,selectable:i,selected:u,defaultSelected:a,onSelectedChange:l,width:c,height:d,className:["plainframe-ui-card",R||""].join(" ").trim(),css:[p(),v,t],onClick:I,tabIndex:I?0:void 0,...x,children:e})})}));Ji.displayName="Card";var kp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,...u})=>{let a=j(),c=Ns()==="vertical",d=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:go(o),textAlign:Ds(o),...c?{width:"100%"}:{flex:1,minWidth:0},...bo(a,r,s,i)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[d,t],...u,children:e})}),Mp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,...u})=>{let a=j(),c=Ns()==="vertical",d=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...c?{width:"100%"}:{},...bo(a,r,s,i)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[d,t],...u,children:e})}),Fp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,...u})=>{let a=j(),c=Ns()==="vertical",d=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...c?{width:"100%"}:{},gap:a.spacing.xs,color:a.text.secondary,...bo(a,r,s,i)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[d,t],...u,children:e})}),Ap=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,weight:u,size:a,color:l,...c})=>{let d=j(),h=css({fontWeight:u??500,fontSize:a??(d.typography?.sizes?.sm!==void 0?d.typography.sizes.sm:"1rem"),color:Xi(d,l)??d.text?.primary,textAlign:Ds(o),...bo(d,r,s,i),display:"flex",alignItems:"center",gap:d.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[h,t],...c,children:e})}),Pp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,weight:u,size:a,color:l,...c})=>{let d=j(),h=css({fontWeight:u??400,fontSize:a??(d.typography?.sizes?.sm!==void 0?d.typography.sizes.sm:"0.875rem"),color:Xi(d,l)??d.text?.secondary,marginTop:d.spacing?.xxs??2,textAlign:Ds(o),...bo(d,r,s,i)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...c,children:e})});var Qi=e=>isValidElement(e),Lp=e=>Qi(e)?e.type?.displayName||e.type?.name:void 0,Zi=e=>Lp(e)==="Card",Bp=e=>typeof e=="number"?`${e}px`:e,el=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:i,role:u="group",css:a})=>{let l=j(),c=r==="vertical",d=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:c?"column":"row",width:typeof o=="string"||typeof o=="number"?Bp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},R=Children.toArray(e),x=R.filter(Zi).length,C=0,g=R.map((p,m)=>{if(!Zi(p)||!Qi(p))return p;let v=p.props,D=C++,T=D===0,w=D===x-1,F=s??v.variant,B=t?c?{borderTopLeftRadius:T?v.radius:0,borderTopRightRadius:T?v.radius:0,borderBottomLeftRadius:w?v.radius:0,borderBottomRightRadius:w?v.radius:0}:{borderTopLeftRadius:T?v.radius:0,borderBottomLeftRadius:T?v.radius:0,borderTopRightRadius:w?v.radius:0,borderBottomRightRadius:w?v.radius:0}:void 0,W=t&&!T?c?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,O=F==="subtle"&&x>1&&!T?c?{borderTop:`${d} solid ${h}`}:{borderLeft:`${d} solid ${h}`}:null,A=[B,W,O,t?{width:"100%"}:{width:"100%",marginBottom:c?0:void 0,marginRight:c?void 0:0}].filter(Boolean),M=[v.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(p,{...v,variant:F??v.variant,css:[v.css,...A],className:M,key:typeof p=="object"&&"key"in p?p.key:m})});return jsx("div",{role:u,"aria-orientation":c?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",i||""].join(" ").trim(),css:[f,a],children:g})};el.displayName="CardGroup";var Pe=e=>typeof e=="number"?`${e}px`:e,nl=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&nl(n)&&(t=true));}),t},Wp=(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"},ol=de.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:i,endIcon:u,size:a="md",onClick:l,onDelete:c,deleteIcon:d,disabled:h,cursor:f,className:R,css:I},x){let C=j(),g=he(),p=["sm","md","lg"].includes(a)?a:"md",m=useMemo(()=>Wp(C,p),[C,p]),v=!!l&&!h,D=h?"not-allowed":f||(v?"pointer":"inherit"),T=String(C.componentHeights?.border??"1px"),w=useMemo(()=>{let G=C.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,C.palette]),F=useCallback(G=>{let se=C.palette;return (w==="neutral"?C.neutral[G]:se[w]?.[G])??se.primary?.[G]},[w,C.neutral,C.palette]),B=useMemo(()=>w==="neutral"?C.neutral[100]:F(50),[w,F,C.neutral]),W=useMemo(()=>w==="neutral"?C.text.secondary:F(800),[w,F,C.text.secondary]),O=useMemo(()=>w==="neutral"?C.neutral[100]:F(50),[w,F,C.neutral]),k=useMemo(()=>w==="neutral"?C.text.secondary:F(800),[w,F,C.text.secondary]),A=useMemo(()=>w==="neutral"?C.neutral[400]:F(300),[w,F,C.neutral]),M=useMemo(()=>w==="neutral"?C.surface.subtleBg:F(600),[w,F,C.surface.subtleBg]),b=useMemo(()=>(C.text.onColors??{})[w]??(w==="neutral"?C.neutral[900]:C.neutral[0]??"#fff"),[w,C.text.onColors,C.neutral]),y="transparent",P=useMemo(()=>w==="neutral"?C.text.secondary:F(700)??C.text.primary,[w,F,C.text.primary,C.text.secondary]),H=useMemo(()=>!i&&!u&&t!=null&&!nl(t)&&de.Children.count(t)===1,[i,u,t]),L=useMemo(()=>o==="filled"?css({backgroundColor:M,color:b,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:O,color:k,border:"none",boxShadow:`inset 0 0 0 ${T} ${A}`}):o==="ghost"?css({backgroundColor:y,color:P,border:"none",boxShadow:"none"}):css({backgroundColor:B,color:W,border:"none",boxShadow:"none"}),[M,b,P,O,k,A,B,W,T,o]),E=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Pe(m.gap),padding:o==="ghost"?0:H||t==null?Pe(m.soloPadding):`${Pe(m.paddingY)} ${Pe(m.paddingX)}`,borderRadius:s?C.radius.full:m.radius,fontWeight:600,cursor:D,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...H?{lineHeight:1,minWidth:`calc(${Pe(m.iconSize)} + ${Pe(m.soloPadding)} * 2)`,minHeight:`calc(${Pe(m.iconSize)} + ${Pe(m.soloPadding)} * 2)`,justifyContent:"center"}:null}),[m,D,t,h,H,s,C.radius.full,o]),S=useMemo(()=>css({fontSize:Pe(H?m.iconSize:m.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:H?Pe(m.iconSize):void 0,height:H?Pe(m.iconSize):void 0,display:H?"block":void 0}}),[m.fontSize,m.iconSize,H]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Pe(m.iconSize),lineHeight:0,"& > svg":{width:Pe(m.iconSize),height:Pe(m.iconSize),display:"block"}}),[m.iconSize]),$=useMemo(()=>css({marginRight:H||t==null?0:Pe(m.gap),marginLeft:H||t==null?0:Pe(m.iconOffset)}),[m.gap,m.iconOffset,t,H]),K=useMemo(()=>css({marginLeft:H||t==null?0:Pe(m.gap),marginRight:H||t==null?0:Pe(s?m.iconOffsetRounded:m.iconOffset)}),[m.gap,m.iconOffset,m.iconOffsetRounded,t,H,s]),_=useMemo(()=>css({marginRight:s?0:Pe(m.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:Pe(m.iconSize),borderRadius:C.radius.xs}),[m.iconOffset,m.iconSize,h,s,C.radius.xs]),N=useCallback(G=>{v&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[v,l]),U=useMemo(()=>jsx(X,{css:{width:m.iconSize,height:m.iconSize},strokeWidth:2.5}),[m.iconSize]);return jsxs("div",{ref:x,className:["plainframe-ui-chip",v?"plainframe-ui-chip-clickable":"",R||""].join(" ").trim(),css:[E,L,v?g({color:r??"primary"}):null,I],onClick:v?l:void 0,onKeyDown:N,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":w,"data-size":a,"data-icon-only":H||void 0,children:[i&&jsx("span",{css:[z,$],className:"plainframe-ui-chip-icon-left",children:i}),t!=null&&jsx("span",{css:[S,n],className:"plainframe-ui-chip-label",children:t}),u&&jsx("span",{css:[z,K],className:"plainframe-ui-chip-icon-right",children:u}),c&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||c?.();},css:[_,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:d||U})]})}));ol.displayName="Chip";var Vp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Up=de.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:i,variant:u,error:a,disabled:l,ringEnabled:c,focusRingMode:d,placeholder:h,separator:f,gapPx:R}){let I=he(),x=r.neutral,C=r.text,g=r.componentHeights.border,p=useRef([]),[m,v]=useState(0),D=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),T=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let H=h.slice(0,o).split("");for(;H.length<o;)H.push("");return H},[h,o]),w=useMemo(()=>{let H=r.componentHeights[s];return `calc(${typeof H=="number"?`${H}px`:H} * 1.5)`},[r.componentHeights,s]),F=l?x[200]:a&&u==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:a&&u==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:u==="subtle"?r.surface.subtleBg:u==="outlined"?r.surface.panelBg:"transparent",B=u==="outlined"?`${g} solid ${a?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",W=H=>css({width:w,height:w,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:F,border:B,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:i.codeFontSize,fontWeight:600,color:l?x[500]:a?r.palette.danger?.[800]??C.primary:C.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:a?r.palette.danger?.[800]??C.primary:C.primary,"&::placeholder":{color:a?r.palette.danger?.[700]??C.secondary:C.secondary,opacity:.85}},c?I({enabled:true,disabled:l,mode:d==="always"?"always":"visible",color:a?"danger":void 0}):void 0,H?css({}):null),O=css({display:"flex",gap:R,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),k=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:C.secondary,userSelect:"none"}),A=H=>H.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),M=useCallback(H=>{let L=Math.max(0,Math.min(o-1,H));v(L),p.current[L]?.focus();},[o]),b=useCallback((H,L)=>{let E=A(L).slice(0,1),S=[...D];S[H]=E,n(S.join("")),E&&H<o-1&&M(H+1);},[D,o,n,M]),y=useCallback((H,L)=>{if(L.key==="Backspace")if(!D[H]&&H>0){let E=[...D];E[H-1]="",n(E.join("")),M(H-1),L.preventDefault();return}else {let E=[...D];E[H]="",n(E.join(""));return}if(L.key==="ArrowLeft"&&H>0){L.preventDefault(),M(H-1);return}if(L.key==="ArrowRight"&&H<o-1){L.preventDefault(),M(H+1);return}if(L.key==="Home"){L.preventDefault(),M(0);return}if(L.key==="End"){L.preventDefault(),M(o-1);return}},[D,o,n,M]),P=useCallback(H=>{let L=A(H.clipboardData.getData("text")).slice(0,o);L&&(n(L),requestAnimationFrame(()=>{let E=Math.min(L.length,o-1);M(E);}),H.preventDefault());},[o,n,M]);return jsx("div",{className:"plainframe-ui-code-boxes",css:O,children:Array.from({length:o}).map((H,L)=>jsxs(de.Fragment,{children:[jsx("input",{ref:E=>{p.current[L]=E;},type:"text",inputMode:"text",maxLength:1,value:D[L]||"",placeholder:D[L]?"":T[L]||"",disabled:l,onChange:E=>b(L,E.target.value),onKeyDown:E=>y(L,E),onFocus:()=>v(L),onPaste:L===0?P:void 0,className:"plainframe-ui-code-box",css:W(L===m),"aria-label":`Code character ${L+1}`,tabIndex:L===m?0:-1}),f&&L<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:k,children:f}):null]},L))})}),qp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:i,helperText:u,disabled:a=false,gap:l,size:c="md",variant:d="subtle",length:h=4,focusRingMode:f="always",className:R,wrapperCss:I,labelCss:x,helperRowCss:C,helperTextCss:g,css:p})=>{let m=j(),v=useId(),D=useMemo(()=>({sm:{labelFont:m.typography.sizes.xs,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.sm,paddingY:0,paddingX:m.spacing.md,codeFontSize:21},md:{labelFont:m.typography.sizes.sm,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.md,paddingY:0,paddingX:m.spacing.md,codeFontSize:24},lg:{labelFont:m.typography.sizes.md,helperFont:m.typography.sizes.sm,minHeight:m.componentHeights.lg,paddingY:0,paddingX:m.spacing.md,codeFontSize:28}}),[m]),T=["sm","md","lg"].includes(c)?c:"md",w=D[T],F=m.neutral,B=m.text,W=t!=null,[O,k]=useState(n),A=W?t:O,M=$=>{W||k($),o?.($);},b=Math.max(2,Math.min(h,10)),y=m.spacing.sm,P=Vp(l??y)??"0px",H=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:a?"not-allowed":"auto"},...Array.isArray(I)?I:I?[I]:[]),L=css({fontSize:w.labelFont,fontWeight:500,color:i?m.palette.danger?.[700]??B.primary:a?F[500]:B.primary,marginBottom:4,display:"block",cursor:a?"not-allowed":"auto"},...Array.isArray(x)?x:x?[x]:[]),E=css({display:"flex",alignItems:"center",justifyContent:"center",gap:P,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(p)?p:p?[p]:[]),S=css({minHeight:16,fontSize:w.helperFont,color:i?m.palette.danger?.[700]??B.secondary:B.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(C)?C:C?[C]:[]),z=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:i?m.palette.danger?.[700]??B.primary:a?F[500]:B.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",R||""].join(" ").trim(),css:H,children:[e&&jsx("span",{id:v,className:"plainframe-ui-codefield-label",css:L,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:E,role:"group","aria-labelledby":e?v:void 0,tabIndex:-1,children:jsx(Up,{value:A||"",onChange:M,len:b,theme:m,sizeKey:T,s:{codeFontSize:w.codeFontSize},variant:d,error:!!i,disabled:a,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:P})}),u!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:S,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:z,children:u})})]})};var ll=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 ""},Ls=e=>{if(!e||typeof e!="object")return false;let t=ll(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(Ls):Ls(o)},Xp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let i=de.useRef(null),[u,a]=de.useState(false),l=de.useCallback(S=>{a(S),o?.(S);},[o]),c=de.useCallback(()=>l(false),[l]),d=de.useRef({x:0,y:0}),h=de.useRef(null),f=de.useRef(null),R=de.useCallback(()=>{f.current=null;let S=h.current;if(!S)return;let z=Math.round(d.current.x),$=Math.round(d.current.y);S.style.transform=`translate3d(${z}px, ${$}px, 0)`;},[]),I=de.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(R));},[R]);de.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let x=de.useMemo(()=>({getBoundingClientRect:()=>{let S=Math.round(d.current.x),z=Math.round(d.current.y);return {x:S,y:z,left:S,top:z,right:S,bottom:z,width:0,height:0,toJSON:()=>({x:S,y:z})}}}),[]),C=de.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=de.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${C.current}"]`):null,[]),p=de.useRef(null),m=de.useRef(null),v=de.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),D=de.useCallback(()=>{m.current!=null&&clearTimeout(m.current),m.current=null;},[]),T=de.useCallback(()=>{D(),m.current=window.setTimeout(()=>l(false),0);},[D,l]),w=de.useCallback(()=>{let S=i.current?.getBoundingClientRect();return S?{x:S.left+S.width/2,y:S.top+S.height/2}:{x:0,y:0}},[]),F=de.useCallback((S,z)=>{d.current={x:S,y:z},I(),l(true);},[I,l]),B=typeof t=="function"?t({close:c}):t,W=Ls(B),O=S=>{if(!de.isValidElement(S))return S;let z=ll(S),$=S,K=$.props.children,_=K==null?K:Array.isArray(K)?K.map(N=>de.isValidElement(N)?O(N):N):de.isValidElement(K)?O(K):K;if(z==="DropdownMenu"){let N=$.props.onOpenChange;return de.cloneElement($,{...$.props,open:u,onOpenChange:U=>{N?.(U),l(U);},children:_})}if(z==="DropdownMenuContent"){let N=$.props.onMouseEnter,U=$.props.onMouseLeave;return de.cloneElement($,{...$.props,anchor:x,"data-cz-id":C.current,onMouseEnter:G=>{D(),N?.(G);},onMouseLeave:G=>{T(),U?.(G);},children:_})}return _===K?$:de.cloneElement($,{...$.props,children:_})},k=W?O(B):B,A=de.useCallback(S=>{S.preventDefault(),F(S.clientX,S.clientY);},[F]),M=de.useCallback(S=>{n==="contextmenu"&&A(S);},[n,A]),b=de.useCallback(S=>{n==="dblclick"&&A(S);},[n,A]),y=de.useCallback(S=>{n==="click"&&A(S);},[n,A]),P=de.useCallback(S=>{if(n!=="hover")return;v(),D();let z=r==="center"?w():{x:S.clientX,y:S.clientY};p.current=window.setTimeout(()=>{let $=z.x+(r==="cursor"?s:0),K=z.y+(r==="cursor"?s:0);F($,K);},0);},[n,r,s,w,F,v,D]),H=de.useCallback(S=>{n==="hover"&&u&&r==="cursor"&&!W&&(d.current={x:S.clientX+s,y:S.clientY+s},I());},[n,u,r,W,s,I]),L=de.useCallback(()=>{n==="hover"&&(v(),T());},[n,v,T]);de.useEffect(()=>{if(n!=="hover")return;let S=()=>{if(!u)return;let z=i.current?.matches(":hover"),$=g()?.matches?.(":hover");z||$?D():T();};return window.addEventListener("pointermove",S,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",S,{capture:true})},[u,n,g,D,T]),de.useEffect(()=>{let S=()=>{if(u)if(n==="hover"){let z=i.current?.matches(":hover"),$=g()?.matches?.(":hover");if(z||$?D():T(),r==="center"&&i.current){let K=w();d.current={x:K.x,y:K.y},I();}}else l(false);};return window.addEventListener("scroll",S,true),window.addEventListener("resize",S,true),()=>{window.removeEventListener("scroll",S,true),window.removeEventListener("resize",S,true);}},[u,n,r,w,I,l,D,T,g]),de.useEffect(()=>()=>{v(),D();},[v,D]);let E=({children:S})=>u?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(d.current.x)}px, ${Math.round(d.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&D(),onMouseLeave:()=>n==="hover"&&T(),children:S}):null;return jsxs("div",{ref:i,onContextMenu:M,onDoubleClick:b,onClick:y,onMouseEnter:P,onMouseMove:H,onMouseLeave:L,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,W?k:jsx(E,{children:k})]})};var $n=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Qp=de.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:i,middleMargin:u="5px",insetMargin:a="10px",chip:l=false,chipVariant:c="subtle",rounded:d=false,margin:h=10,css:f,labelCss:R,strokeCss:I,className:x,...C},g){let p=j(),{t:m,strokeColor:v,labelTextColor:D,chipSubtleBg:T,chipOutlinedBg:w,outerM:F,padX:B,verticalStrokeMargin:W}=useMemo(()=>{let b=typeof s=="number"?`${s}px`:s,y=p.surface.border,P=p.text.secondary,H=p.surface.subtleBg,L=p.surface.panelBg,E=$n(h,"10px"),S=o==="horizontal"?n==="middle"?$n(u):n==="inset"?$n(a,"0px"):"0":"0",z=o==="vertical"?n==="middle"?$n(u):n==="inset"?$n(a,"0px"):"0":"0";return {t:b,strokeColor:y,labelTextColor:P,chipSubtleBg:H,chipOutlinedBg:L,outerM:E,padX:S,verticalStrokeMargin:z}},[s,p,o,n,u,a,h]),O=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":m,minWidth:t?"max-content":m,marginLeft:F,marginRight:F}:{flexDirection:"row",width:i?$n(i):"100%",minWidth:0,paddingLeft:B,paddingRight:n==="middle"?B:"0",marginTop:F,marginBottom:F},...Array.isArray(f)?f:f?[f]:[]]),[o,t,m,F,i,B,n,f]),k=useMemo(()=>css([{background:v,borderRadius:d?p.radius.full:p.radius.xs},o==="vertical"?{width:m,minHeight:18,flex:1,marginTop:W,marginBottom:W}:{height:m,flex:1}]),[v,d,p.radius.full,p.radius.xs,o,m,W]),A=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?d?p.radius.full:`calc(${p.radius.sm} * 0.75)`:`calc(${p.radius.sm} * 0.75)`,color:D,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?c==="subtle"?{background:T,border:"none"}:{background:w,border:`${m} solid ${v}`}:{}},...Array.isArray(R)?R:R?[R]:[]]),[l,o,d,p.radius.full,p.radius.sm,D,c,T,w,m,v,R]),M=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[k,I]}),[k,I]);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",x||""].join(" ").trim(),css:O,...C,children:[t&&r!=="top"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="bottom"&&M,!t&&M]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",x||""].join(" ").trim(),css:O,...C,children:[t&&r!=="left"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="right"&&M,!t&&M]})}));var gl=de.createContext(null),bl=()=>{let e=useContext(gl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},hl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[i,u]=useState(!!n),a=t??i,l=useCallback(d=>{t===void 0&&u(d),o?.(d);},[t,o]),c=useMemo(()=>({open:a,setOpen:l,lockScroll:r,closeOnEscape:s}),[a,l,r,s]);return jsx(gl.Provider,{value:c,children:e})},nm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:i}=bl(),u=!!e&&de.isValidElement(t),a=useCallback(c=>{if(u){let d;de.isValidElement(t)&&(d=t.props.onClick),d?.(c);}r.onClick?.(c),c.defaultPrevented||i(true);},[u,t,r.onClick,i]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i(true)),u){let d;de.isValidElement(t)&&(d=t.props.onKeyDown),d?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,i]);if(u){let c=t,d=c.props.css;return de.cloneElement(c,{...c.props||{},className:[c.props.className,n].filter(Boolean).join(" ")||void 0,css:[d,o].filter(Boolean),onClick:a,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:a,onKeyDown:l,...r,children:t})});nm.displayName="DrawerTrigger";var vo=0,yl="",xl="",om=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function rm(){if(!(typeof document>"u")){if(vo===0){let e=document.body;yl=e.style.overflow||"",xl=e.style.paddingRight||"";let t=om();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vo+=1;}}function sm(){if(!(typeof document>"u")&&(vo>0&&(vo-=1),vo===0)){let e=document.body;e.style.overflow=yl,e.style.paddingRight=xl;}}var am=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,vl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:i=10,radius:u,backdropBlur:a=true,backdropBlurDepth:l,closeOnClickAway:c=true,transitionMs:d,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:R=.2,className:I,css:x,...C},g){let p=j(),{open:m,setOpen:v,lockScroll:D,closeOnEscape:T}=bl();useEffect(()=>{if(!(!D||!m))return rm(),()=>sm()},[m,D]);let w=useMemo(()=>am(i,0),[i]),F=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),B=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),W=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[n,r,s,w]),O=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[o,r,s,w]),k=useMemo(()=>{let V=String(p.radius.lg);switch(r){case "left":return `0 ${V} ${V} 0`;case "right":return `${V} 0 0 ${V}`;case "top":return `0 0 ${V} ${V}`;default:return `${V} ${V} 0 0`}},[r,p.radius.lg]),A=useMemo(()=>u??(s==="inset"?p.radius.lg:k),[u,s,p.radius.lg,k]),M=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:w,bottom:r==="top"?void 0:w,left:r==="right"?void 0:w,right:r==="left"?void 0:w}:{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,w]),b=useRef(null),y=useCallback(()=>{let V=b.current;if(!V)return 1;let Y=V.getBoundingClientRect();return F==="x"?Y.width:Y.height},[F]),P=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),H=useMemo(()=>({duration:(d??280)/1e3,ease:[.22,1,.36,1]}),[d]),L=useMemo(()=>B*1.1,[B]),E=useMemo(()=>F==="x"?{x:`${L*100}%`,y:0}:{y:`${L*100}%`,x:0},[F,L]),S=useMemo(()=>css({position:"fixed",zIndex:1100,...M,width:W,height:O,backgroundColor:p.surface.panelBg,borderRadius:A,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:m?"auto":"none",touchAction:F==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[M,W,O,p.surface,A,m,F]),z=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:p.surface.overlayBg,transition:"all .3s ease",...a?{backdropFilter:`blur(${l??"2px"})`}:null}),[a,l,p.surface]),$=useCallback(()=>{c&&v(false);},[c,v]),K=useMemo(()=>F==="x"?{left:B===-1?R:0,right:B===1?R:0}:{top:B===-1?R:0,bottom:B===1?R:0},[F,B,R]),_=useMemo(()=>F==="x"?{left:0,right:0}:{top:0,bottom:0},[F]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((V,Y)=>{let le=F==="x"?Y.offset.x:Y.offset.y,ue=F==="x"?Y.velocity.x:Y.velocity.y,pe=B*le>0,Me=Math.abs(le)>=y()*N,Ce=B*ue>f;pe&&(Me||Ce)&&v(false);},[F,B,y,N,f,v]),G=useRef(null);useEffect(()=>{if(!m)return;G.current=document.activeElement;let V=setTimeout(()=>{let ue=b.current;if(!ue)return;let pe=ue.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');pe.length>0?pe[0].focus():ue.focus();},100),Y=ue=>{let pe=b.current;if(!pe||!ue.target)return;let Me=ue.target;if(!pe.contains(Me)){ue.preventDefault();let Ce=pe.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():pe.focus();}},le=ue=>{ue.key==="Escape"&&T&&(ue.stopPropagation(),v(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",le),()=>{clearTimeout(V),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[m,v,T]);let{...se}=C;return jsx(AnimatePresence,{children:m?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:z,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:d?H:{duration:.18,ease:"linear"},onClick:$},"overlay"),jsx(motion.div,{ref:V=>{b.current=V,typeof g=="function"?g(V):g&&(g.current=V);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",I||""].join(" ").trim(),css:[S,x],drag:F,dragConstraints:_,dragElastic:K,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...E,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...E,opacity:.98},transition:d?H:P,...se,children:t},"panel")]}):null})});vl.displayName="DrawerContent";var im=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:i,children:u,...a},l){let c=t!==void 0?t:n,d=o!==void 0?o:r,h=c!==void 0,[f,R]=useState(!!d),I=h?!!c:f,x=useCallback(C=>{h||R(C),C||i?.(),s?.(C);},[h,i,s]);return jsx(hl,{open:I,onOpenChange:x,children:jsx(vl,{ref:l,...a,children:u})})});im.displayName="DrawerLegacy";var Os=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:i,blur:u=false})=>{let a={opacity:o?1:0,filter:u?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=d=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),d?.(h);};if(s&&isValidElement(e)){let d=e,h=d.props.css,f=Array.isArray(h)?[...h,a]:h?[h,a]:[a],R=["plainframe-ui-transition-fade",d.props.className||"",i||""].join(" ").trim(),I=d.props.onTransitionEnd;return cloneElement(d,{...d.props,css:f,className:R,onTransitionEnd:l(I)})}let c=css(a);return jsx("div",{className:["plainframe-ui-transition-fade",i||""].join(" ").trim(),css:c,onTransitionEnd:l(),children:e})};var Cl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rl=de.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:i,width:u,height:a,...l})=>{let c=j(),d=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:c.spacing[t]??t,f=css({display:"flex",flexDirection:d,gap:h,justifyContent:n,alignItems:o,maxWidth:Cl(u),width:u?"100%":void 0,maxHeight:Cl(a),height:a?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:i})});Rl.displayName="Flex";var Ws=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:i,asChild:u=false,className:a})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},c=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&i?.(),h?.(f);};if(u&&isValidElement(e)){let h=e,f=h.props.css,R=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=h.props.onTransitionEnd,x=["plainframe-ui-transition-grow",h.props.className||"",a||""].join(" ").trim();return cloneElement(h,{...h.props,css:R,className:x,onTransitionEnd:c(I)})}let d=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",a||""].join(" ").trim(),css:d,onTransitionEnd:c(),children:e})};var Tl={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"}},Rm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Tm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},zn=de.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:i,align:u="left",textTransform:a="none",whiteSpace:l="normal",decoration:c="none",decorationStyle:d="solid",decorationThickness:h=1,decorationColor:f,italic:R,className:I,style:x,as:C})=>{let g=j(),p=Tl[e]??Tl.body,m=C??Tm[e]??"span",v=A=>A==null?p.size:typeof A=="number"?A:g?.typography?.sizes?.[A]??A,D=v(o)??v(p.size),T=r??p.weight,w=s??p.lh,F=i??p.ls,B=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",W=f??g.surface.border,O=css({boxSizing:"border-box",display:u==="left"?"inline":"block",textAlign:u==="left"?void 0:u,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:D,fontWeight:T,lineHeight:w,letterSpacing:F,color:B,textTransform:a,whiteSpace:l,fontStyle:R?"italic":"normal",margin:0,padding:0}),k=c==="none"?css({textDecoration:"none"}):css({textDecorationLine:c,textDecorationStyle:d,textDecorationColor:W,textDecorationThickness:Rm(h),textDecorationSkipInk:"auto"});return jsx(m,{className:[`pfui-typo-${e}`,I||""].join(" ").trim(),css:[O,k],style:x,"data-variant":e,children:t})});zn.displayName="Typography";var Vs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sm=(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 Vs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},El=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:i=false,hoverEffect:u="none",label:a,labelAlign:l="center",aspectRatio:c,loading:d="lazy",decoding:h="async",fetchPriority:f,srcSet:R,sizes:I,placeholder:x,blurDataURL:C,placeholderColor:g="#f1f1f1",fallbackSrc:p,className:m,css:v,onClick:D,onLoad:T,onError:w,...F},B){let[W,O]=useState(false),[k,A]=useState(false),[M,b]=useState(false),y=j(),P=Sm(s,y)??"0px",H=a?"figure":"div",L=css({display:"flex",flexDirection:"column",gap:a?y.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${P})`}),E=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${P})`,maxWidth:o?Vs(o):"100%",maxHeight:r?Vs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:c,boxShadow:i?"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:W&&(u==="rotate"||u==="scale-rotate")?"rotate(3deg)":"none",cursor:D?"pointer":void 0}),S=css({position:"absolute",inset:0,background:x==="color"?g:void 0,backgroundImage:x==="blur"&&C?`url(${C})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:x==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:M?0:1,pointerEvents:"none"}),z=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:W&&(u==="scale"||u==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(H,{className:["plainframe-ui-image",m||""].join(" ").trim(),css:[L,v],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:E,onMouseEnter:()=>O(true),onMouseLeave:()=>O(false),onClick:D,children:[!M&&x&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:S}),jsx("img",{ref:B,className:"plainframe-ui-image-img",css:z,src:k&&p?p:t,alt:n,srcSet:R,sizes:I,loading:d,decoding:h,fetchPriority:f,onLoad:$=>{b(true),T?.($);},onError:$=>{A(true),w?.($);},...F})]}),a&&jsx(zn,{as:"figcaption",variant:"caption",align:l,children:a})]})});El.displayName="Image";var Sl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Fm=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}},Am=e=>e*Math.PI/180,Pm=(e,t,n)=>{let o=Math.abs(Am(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 Dm(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 Nm=(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,Il=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Hm={sm:150,md:200,lg:260,xl:340},Lm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Bm(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 Lm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var $m=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:i="none",hovering:u,maxItems:a=3,shadow:l=false,cursor:c,outline:d,outlineColor:h,outlineWidth:f=3,outlineOffset:R=0,radius:I="md",label:x,labelAlign:C="center",css:g,className:p,...m}){let v=j(),D=Fm(r)??4/5,T=typeof o=="string"?o:void 0,w=typeof o=="number"?o:T&&/px$/.test(T)?parseFloat(T):Hm[s],F=Math.max(1,w/D),W=Children.toArray(t).filter(isValidElement).slice(0,a),O=W.length,k=Dm(n,O),A=W.map((V,Y)=>Nm(n,O,Y)),M=V=>F*.6*A[V],b=V=>M(V)*D,y=0,P=0;for(let V=0;V<O;V++){let Y=b(V),le=M(V),ue=Math.max(Math.abs(k.base.ang[V]??0),Math.abs(k.exp.ang[V]??0)),pe=Math.max(Math.abs(k.base.dx[V]??0),Math.abs(k.exp.dx[V]??0)),Me=Math.max(Math.abs(k.base.dy[V]??0),Math.abs(k.exp.dy[V]??0)),Ce=i==="expand"?kl[V]??1.08:i==="reveal"?Il[V]??1.03:1,ve=Pm(Y,le,ue),we=ve.w*Ce,Re=ve.h*Ce,Z=pe/100*Y*Ce,ie=Me/100*le*Ce;y=Math.max(y,we/2+Z),P=Math.max(P,Re/2+ie);}let H=Math.max(1,2*y),L=Math.max(1,2*P),E=Math.min(1,w/H,F/L),S=u===void 0?"pointer":"controlled",z=u?"true":void 0,$=css({display:"flex",flexDirection:"column",cursor:c||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:x?v.spacing.xs:0}),K=css({position:"relative",width:Sl(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:Sl(F)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${H}px`,height:`${L}px`,transform:`translate(-50%, -50%) scale(${E})`,transformOrigin:"center center"}),N=Bm(I,v)??"0px",U=V=>{let Y=n==="fan"?`rotate(${k.base.ang[V]}deg) translate(${k.base.dx[V]}%, ${k.base.dy[V]}%)`:n==="slide"?`translate(${k.base.dx[V]}%, ${k.base.dy[V]}%) rotate(${k.base.ang[V]}deg)`:n==="domino"?`translate(0%, ${k.base.dy[V]}%)`:`translate(${k.base.dx[V]}%, ${k.base.dy[V]}%) rotate(${k.base.ang[V]}deg)`,le=n==="fan"?`rotate(${k.exp.ang[V]}deg) translate(${k.exp.dx[V]}%, ${k.exp.dy[V]}%)`:n==="slide"?`translate(${k.exp.dx[V]}%, ${k.exp.dy[V]}%) rotate(${k.exp.ang[V]}deg)`:n==="domino"?`translate(0%, ${k.exp.dy[V]}%)`:`translate(${k.exp.dx[V]}%, ${k.exp.dy[V]}%) rotate(${k.exp.ang[V]}deg)`,ue=i==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,pe=i==="expand"?`${le} scale(${kl[V]??1.06})`:i==="reveal"?`${Y} scale(${Il[V]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ue}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&V===1?10:V+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:d?`${f}px solid ${h??v.surface.appBg}`:void 0,outlineOffset:d?R:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${pe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${pe}`}})},G=V=>css({width:`${b(V)}px`,aspectRatio:`${D}`,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(x?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",p||""].join(" ").trim(),"data-hover-mode":S,"data-hovered":z,css:[$,g],tabIndex:-1,...m,children:[jsx("div",{className:"plainframe-ui-image-stack",css:K,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:W.map((V,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(Y),children:V})},Y))})}),x&&jsx(zn,{as:"figcaption",variant:"caption",align:C,children:x})]})});var Ml=e=>typeof e=="number"?`${e}px`:e,Fl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Wm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Ml(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Ml(n)}return e}function Km(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var _m=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:i=false,symbolBoost:u=2,css:a,className:l="plainframe-ui-kbd",...c},d){let h=j(),f=he(),R=Fl[o]??Fl.sm,I=Wm(r,h),x={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},C=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${R.h}px !important`,paddingInline:n==="ghost"?0:`${R.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${R.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:i?"uppercase":"none",borderRadius:I,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:x.txt}}),p=css({"&&":{background:"transparent",color:x.txt,border:"none",boxShadow:"none"}}),m=css({"&&":{background:h.surface.panelBg,color:x.txt,border:`1px solid ${x.br}`,boxShadow:`inset 0 1px 0 ${x.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),v=n==="subtle"?g:n==="ghost"?p:m,T=s&&u>0&&Km(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${R.font+u}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:d,className:l,css:[f(),C,v,a],...c,children:T})});var qm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Us=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:i=false,className:u,distance:a})=>{let c=qm(a,t==="left"||t==="right"?"100vw":"100vh"),d=t==="left"?`-${c}`:t==="right"?c:"0",h=t==="up"?c:t==="down"?`-${c}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${d}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},R=x=>C=>{C.target===C.currentTarget&&C.propertyName==="transform"&&s?.(),x?.(C);};if(i&&isValidElement(e)){let x=e,C=x.props.css,g=Array.isArray(C)?[...C,f]:C?[C,f]:[f],p=["plainframe-ui-transition-slide",x.props.className||"",u||""].join(" ").trim(),m=x.props.onTransitionEnd;return cloneElement(x,{...x.props,css:g,className:p,onTransitionEnd:R(m)})}let I=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",u||""].join(" ").trim(),css:I,onTransitionEnd:R(),children:e})};var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Nl=de.createContext(null),Hl=()=>{let e=useContext(Nl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Qm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[i,u]=useState(!!n),a=t??i,l=useCallback(d=>{t===void 0&&u(d),o?.(d);},[t,o]);useEffect(()=>{if(!a||!s)return;let d=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",d,true),()=>window.removeEventListener("keydown",d,true)},[a,s,l]);let c=useMemo(()=>({open:a,setOpen:l,lockScroll:r,closeOnEscape:s}),[a,l,r,s]);return jsx(Nl.Provider,{value:c,children:e})},Ll=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:i}=Hl(),u=!!e&&de.isValidElement(t),a=useCallback(c=>{if(u){let d;de.isValidElement(t)&&(d=t.props.onClick),d?.(c);}r.onClick?.(c),c.defaultPrevented||i(true);},[u,t,r.onClick,i]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i(true)),u){let d;de.isValidElement(t)&&(d=t.props.onKeyDown),d?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,i]);if(u){let c=t,d=c.props.css;return de.cloneElement(c,{...c.props||{},className:[c.props.className,n].filter(Boolean).join(" ")||void 0,css:[d,o].filter(Boolean),"aria-haspopup":"dialog",onClick:a,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:a,onKeyDown:l,...r,children:t})});Ll.displayName="ModalTrigger";var Bl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:i=true,backdropBlur:u=true,backdropBlurDepth:a=5,closeOnClickAway:l=true,transitionVariant:c="fade",direction:d="up",transitionDuration:h=300,containerCss:f,backdropCss:R,className:I,...x},C)=>{let g=j(),{open:p,setOpen:m,lockScroll:v}=Hl(),D=de.useRef(null),T=de.useRef(null);de.useEffect(()=>{if(!p)return;T.current=document.activeElement;let k=setTimeout(()=>{let M=D.current;if(!M)return;let b=M.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');b.length>0?b[0].focus():M.focus();},100),A=M=>{let b=D.current;if(!b||!M.target)return;let y=M.target;if(!b.contains(y)){M.preventDefault();let P=b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');P.length>0?P[0].focus():b.focus();}};return document.addEventListener("focusin",A,true),()=>{clearTimeout(k),document.removeEventListener("focusin",A,true),T.current&&typeof T.current.focus=="function"&&T.current.focus();}},[p]);let w=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),F=css({width:"100%",height:qs(o),maxWidth:t==="inset"?`min(${qs(n)||"100%"}, calc(100% - ${w} * 2))`:qs(n),maxHeight:t==="inset"?`calc(100% - ${w} * 2)`:"100%",margin:t==="inset"?w:void 0}),B=jsx(Ln,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",I||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[F,f],ref:k=>{D.current=k,typeof C=="function"?C(k):C&&(C.current=k);},...x,children:e}),W=c==="none"?B:c==="slide"?jsx(Us,{on:p,direction:d,duration:h,children:B}):c==="grow"?jsx(Ws,{initialScale:.75,on:p,duration:h,children:B}):jsx(Os,{on:p,duration:h,children:B});if(!i)return jsx(Fragment,{children:W});let O=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(ws,{on:p,blur:u,blurDepth:a,onClickAway:l?()=>m(false):void 0,css:[O,R].filter(Boolean),contentCss:O,lockScroll:v,children:W})});Bl.displayName="ModalContent";var lf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:i=false,showFirstLast:u=false,loop:a=false,variant:l="subtle",gap:c,className:d,css:h})=>{let f=j(),R=he(),I=t!==void 0,[x,C]=useState(n),g=Math.max(1,e),p=Sr(I?t:x,1,g),m=useCallback(E=>{let S=Sr(E,1,g);I||C(S),o?.(S);},[I,g,o]),v=useMemo(()=>cf({count:g,page:p,siblingCount:r,boundaryCount:s}),[g,p,r,s]),D=f.palette?.primary?.[600],T=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,F=f.text?.primary??"#111",B=l==="subtle"?f.surface?.subtleBg:"transparent",W=css({display:"inline-flex",alignItems:"center",gap:c??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:B,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),O=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:F,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:i?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),k=css({width:28,minWidth:28,height:28,padding:0}),A=(E=false)=>css([O,R({color:E?"primary":"neutral"}),l==="outlined"?E?{background:D,color:f.text.onColors.primary,borderColor:D}:{background:"transparent",borderColor:T,":hover":{background:w}}:l==="ghost"?E?{background:D,color:f.text.onColors.primary}:{":hover":{background:w}}:E?{background:D,color:f.text.onColors.primary,borderColor:D}:{":hover":{background:w}}]),M=useCallback(()=>m(1),[m]),b=useCallback(()=>m(g),[m,g]),y=useCallback(()=>{p===1?a&&m(g):m(p-1);},[p,a,g,m]),P=useCallback(()=>{p===g?a&&m(1):m(p+1);},[p,a,g,m]),H=i||p===1&&!a,L=i||p===g&&!a;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",d||""].join(" ").trim(),css:W,onKeyDown:E=>{i||(E.key==="ArrowLeft"&&(E.preventDefault(),y()),E.key==="ArrowRight"&&(E.preventDefault(),P()),E.key==="Home"&&(E.preventDefault(),M()),E.key==="End"&&(E.preventDefault(),b()));},children:[u&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":H,disabled:H,css:[A(false),k],onClick:M,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":H,disabled:H,css:[A(false),k],onClick:y,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),v.map((E,S)=>typeof E=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":E===p?`Page ${E}, current page`:`Go to page ${E}`,"aria-current":E===p?"page":void 0,css:A(E===p),onClick:()=>m(E),children:E},E):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([O,R(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${S}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":L,disabled:L,css:[A(false),k],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),u&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":L,disabled:L,css:[A(false),k],onClick:b,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function cf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Er(1,e);let s=Er(1,Math.min(o,e)),i=Er(Math.max(e-o+1,o+1),e),u=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),a=Sr(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],c=d=>{let h=l[l.length-1];h!==d&&(h==="ellipsis"&&d==="ellipsis"||l.push(d));};return s.forEach(c),u>o+2?c("ellipsis"):o+1<u&&c(o+1),Er(u,a).forEach(c),a<e-o-1?c("ellipsis"):e-o>a&&c(e-o),i.forEach(c),l}function Er(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var mf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,ff=de.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let i=j(),u=i.surface.border,a=css({display:"inline-block",boxSizing:"border-box",maxWidth:mf(n,"fit-content"),width:"100%",padding:`0 ${i.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:a,children:e})});var Wl=createContext(null),yf=()=>{let e=useContext(Wl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},xf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},vf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:i="filled",className:u,children:a,anchorOrigin:l,css:c})=>{let d=j(),h=e!==void 0&&n!==void 0,[f,R]=useState(t),I=h?e:f,x=useRef([]),[C,g]=useState(0),p=()=>g(A=>A+1),m=useCallback(A=>{h||R(A),n?.(A);},[h,n]),v=useCallback(A=>(x.current.push(A),p(),x.current.length-1),[]),D=useCallback((A,M)=>{let b=x.current[A];b&&(x.current[A]={...b,...M},p());},[]),T=()=>x.current.map((A,M)=>({it:A,i:M})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),w=useCallback((A,M)=>{let b=T();if(!b.length)return;let y=Math.max(0,b.indexOf(A)),P=b[(y+M+b.length)%b.length],H=x.current[P]?.ref;if(H){H.focus();let L=x.current[P]?.value;L!==void 0&&m(L);}},[m]),F=useCallback(A=>{let M=T();if(!M.length)return;let b=A==="first"?M[0]:M[M.length-1],y=x.current[b]?.ref;if(y){y.focus();let P=x.current[b]?.value;P!==void 0&&m(P);}},[m]),B=useMemo(()=>{let A=x.current.filter(b=>b.ref&&!b.disabled);return A.length?A.some(b=>b.value===I)?I:A[0]?.value:void 0},[I,C]),W=useMemo(()=>({selected:I,setSelected:m,disabled:o,size:r,direction:s,variant:i,register:v,update:D,moveFocusBy:w,moveToEdge:F,focusValue:B,theme:d,anchorOrigin:xf(l)}),[I,m,o,r,s,i,v,D,w,F,B,d,l]),O=css({width:"fit-content"}),k=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:d.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:u??"plainframe-ui-radio-group",css:[O,c],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:k,children:jsx(Wl.Provider,{value:W,children:a})})})},Cf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:i,disabled:u,size:a,register:l,update:c,moveFocusBy:d,moveToEdge:h,theme:f,variant:R,focusValue:I,anchorOrigin:x}=yf(),C=u||t,g=s===e,p=["sm","md","lg"].includes(a)?a:"md",m=p==="sm"?16:p==="lg"?24:20,v=K=>f.palette?.primary?.[K],D=v(600),T=v(100),w=f.neutral[300],F=f.palette.primary[300],B=f.text.onColors?.primary??f.neutral[0],W="transparent",O=F,k=B;R==="soft"?(W=T,O=null,k=D):R==="outlined"?(W=v(50),O=F,k=D):(W=f.neutral[200],O="transparent",k=B),g&&(R==="outlined"?(W=T,O=F,k=D):R==="filled"?(W=D,O=null,k=B):(W=T,O=null,k=D));let A=R==="filled"?w:f.palette.primary[100],M=useRef(null),b=useRef(-1);useEffect(()=>{b.current=l({ref:M.current,value:e,disabled:!!C});},[l]),useEffect(()=>{c(b.current,{ref:M.current,value:e,disabled:!!C});},[c,C,e]);let y=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:x.vertical==="center"?f.spacing.sm:0,rowGap:x.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:C?.5:1,borderRadius:f.radius.md,cursor:C?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":C||g?{}:{background:A,boxShadow:R==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${F}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),P=css({width:m,height:m,minWidth:m,minHeight:m,borderRadius:f.radius.full,background:W,boxShadow:O?`inset 0 0 0 ${f.componentHeights.border} ${O}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),H=css({width:g?m*.45:0,height:g?m*.45:0,borderRadius:f.radius.full,background:g?k:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),L=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),E=(()=>{let K=x.horizontal,_=x.vertical;return _==="center"?{col:K==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),z=!C&&I===e?0:-1,$=he();return jsxs("button",{ref:M,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":C||void 0,disabled:C,tabIndex:z,onClick:()=>{C||i(e);},onKeyDown:K=>{C||(K.key==="Enter"||K.key===" "?(K.preventDefault(),i(e)):K.key==="ArrowRight"||K.key==="ArrowDown"?(K.preventDefault(),d(b.current,1)):K.key==="ArrowLeft"||K.key==="ArrowUp"?(K.preventDefault(),d(b.current,-1)):K.key==="Home"?(K.preventDefault(),h("first")):K.key==="End"&&(K.preventDefault(),h("last")));},css:[y,$({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[P,css({gridColumn:E.col,gridRow:E.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:H})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:L,children:o})]})};var Sf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:i,asChild:u=false,className:a})=>{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"},c=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&i?.(),h?.(f);};if(u&&isValidElement(e)){let h=e,f=h.props.css,R=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=["plainframe-ui-transition-rotate",h.props.className||"",a||""].join(" ").trim(),x=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:R,className:I,onTransitionEnd:c(x)})}let d=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",a||""].join(" ").trim(),css:d,onTransitionEnd:c(),children:e})};var Js=e=>null;Js.displayName="SelectItem";var Io=(...e)=>e.filter(Boolean).flat();function Ys(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Ys(n,t);return}if(de.isValidElement(e)){if(e.type===Js){t.push(e);return}if(e.type===de.Fragment){Ys(e.props.children,t);return}}}}var _l=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:i,multiple:u=false,disabled:a=false,size:l="md",variant:c="subtle",fullWidth:d,width:h=200,menuAlign:f="left",menuWidth:R,menuMaxHeight:I=280,wrapperCss:x,labelCss:C,triggerCss:g,menuCss:p,optionCss:m,children:v,className:D,menuSize:T="md",triggerRender:w})=>{let F=j(),B=he(),W=de.useId(),O=`${W}-label`,k=`${W}-menu`,A={sm:{minHeight:F.componentHeights.sm,radius:F.radius.sm},md:{minHeight:F.componentHeights.md,radius:F.radius.md},lg:{minHeight:F.componentHeights.lg,radius:F.radius.md}},M=A[l]||A.md,[b,y]=de.useState(false),P=Z=>y(!!Z),H=typeof e<"u",L=u||Array.isArray(e)||Array.isArray(t),[E,S]=de.useState(()=>typeof t<"u"?t:L?[]:void 0),z=H?e:E,$=Z=>{H||S(Z),n?.(Z);},K=[];Ys(v,K);let _=K.map((Z,ie)=>{let be=Z.props,X=typeof be.children=="string"||typeof be.children=="number"?String(be.children):void 0;return {key:Z.key??ie,value:be.value,startIcon:be.startIcon,endIcon:be.endIcon,node:be.children,labelText:X}}),N=Z=>L?(Array.isArray(z)?z:[]).some(be=>Object.is(be,Z)):Object.is(z,Z),U=de.useMemo(()=>{if(L){let ie=Array.isArray(z)?z:[];return _.filter(X=>ie.some(ye=>Object.is(ye,X.value))).map(X=>X.labelText??X.node)}let Z=_.find(ie=>Object.is(ie.value,z));if(Z)return Z.labelText??Z.node},[z,L,_]),G=Z=>{a||(Object.is(Z,z)||$(Z),P(false));},se=Z=>{if(a)return;let ie=Array.isArray(z)?z:[],X=ie.some(ye=>Object.is(ye,Z))?ie.filter(ye=>!Object.is(ye,Z)):[...ie,Z];$(X);},V={position:"relative",width:d?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},Y={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:M.radius,minHeight:M.minHeight,fontSize:F.typography.sizes.sm,padding:`0 ${typeof F.spacing.sm=="number"?`${F.spacing.sm}px`:F.spacing.sm} 0 ${typeof F.spacing.md=="number"?`${F.spacing.md}px`:F.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:a?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:F.text.primary,background:"transparent",whiteSpace:"nowrap"},le=c==="subtle"?{background:F.surface.subtleBg}:c==="outlined"?{background:F.surface.panelBg,border:`1px solid ${F.surface.border}`}:{background:"transparent"},ue={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Me={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Ce=jsx(ChevronsUpDown,{size:16,css:css({color:F.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),ve=()=>{if(w)return w(U);if(Array.isArray(U)){let ie=U.map(X=>typeof X=="string"?X:"").filter(Boolean),be=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:be,children:be})]})}let Z=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:typeof Z=="string"?Z:void 0,children:Z})]})},we={left:"start",center:"center",right:"end"},Re=Z=>{a||(Z.key==="ArrowDown"||Z.key==="ArrowUp"||Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),P(true));};return jsxs("div",{css:Io(V,x),className:["plainframe-ui-select-wrapper",D||""].join(" ").trim(),children:[o&&jsx("div",{id:O,className:"plainframe-ui-select-label",css:Io({marginBottom:6,fontSize:F.typography.sizes.sm,fontWeight:500,color:F.text.secondary},C),children:o}),jsxs(An,{size:T,open:b,onOpenChange:P,children:[jsx(Pn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:a,"aria-haspopup":"menu","aria-expanded":b||void 0,"aria-controls":k,"aria-labelledby":o?O:void 0,onKeyDown:Re,onClick:()=>P(!b),className:"plainframe-ui-select-trigger",css:Io(css(Y),css(le),g,B()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ue),children:ve()}),i??Ce]})}),jsx(cn,{id:k,gap:"xs",align:we[f],sameWidth:R==null,width:R??h,className:"plainframe-ui-select-menu",css:Io({maxHeight:typeof I=="number"?`${I}px`:I,overflowY:"auto"},p),children:_.map((Z,ie)=>{let be=N(Z.value);return jsx(kt,{startIcon:Z.startIcon,endIcon:Z.endIcon,selected:be,disabled:a,closeOnSelect:!L,onSelect:()=>L?se(Z.value):G(Z.value),css:Io(m),className:"plainframe-ui-select-option",children:Z.node},Z.key??ie)})})]})]})};_l.displayName="Select";var Zs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ff=keyframes`
13
+ `,qc=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("),Gc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Xc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(qc(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]&&Gc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let i=e.palette[r];if(i&&i[s]!=null)return i[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var Qn=de.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:i,spinDuration:u=.75,wrapperCss:a,trackCss:l,barCss:c,circleCss:p,"aria-label":h})=>{let f=j(),R=typeof t=="number",I=Math.max(o-n,1),x=R?Ga(t,n,o):void 0,C=R?(x-n)/I*100:void 0,g=Xc(f,r),d=f.surface.subtleBg,m=f.radius?.md;return e==="circular"?jsx(Jc,{size:s,active:g,isDeterminate:R,percent:C,spinDuration:u,wrapperCss:a,trackCss:l,circleCss:p,ariaLabel:h,thickness:i}):jsx(Yc,{thickness:i,active:g,track:d,radius:m,isDeterminate:R,percent:C,wrapperCss:a,trackCss:l,barCss:c,ariaLabel:h,min:n,max:o,value:x})}),Yc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:i,trackCss:u,barCss:a,ariaLabel:l,min:c,max:p,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),R=css([{display:"inline-block",width:"100%"},...Array.isArray(i)?i:i?[i]:[]]),I=css([{position:"relative",width:"100%",height:ts(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(u)?u:u?[u]:[]]),x=r?Math.max(s??0,qa):qa,C=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${x/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(a)?a:a?[a]:[]]),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:`${Vc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(a)?a:a?[a]:[]]),m=css([{...g,left:"-200%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(a)?a:a?[a]:[]]),v=r?{role:"progressbar","aria-valuemin":c,"aria-valuemax":p,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(v["aria-label"]=l),jsx("span",{css:R,...v,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:I,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:C}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:m})]})})})},Jc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:i,trackCss:u,circleCss:a,ariaLabel:l})=>{let c=j(),p=40,h=(p-t)/2,f=2*Math.PI*h,I=`${(o?Ga((r??0)/100,.01,1):.7)*f} ${f}`,x=css([{display:"inline-block",width:ts(e,`${c.componentHeights.md}`),height:ts(e,`${c.componentHeights.md}`)},...Array.isArray(i)?i:i?[i]:[]]),C=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(u)?u:u?[u]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:I,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(a)?a:a?[a]:[]]),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:x,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:C,viewBox:`0 0 ${p} ${p}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:p/2,cy:p/2,r:h,strokeWidth:t,css:g})})})};var Ja=createContext(null),Za=()=>{let e=useContext(Ja);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},iu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),lu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),cu=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}}),Qa=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:i="100%",size:u="md",loading:a=false,css:l,children:c,...p},h){let f=j(),R=useId(),I=useId(),x=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(u)?A[u]:A.md},[u,f.typography,f.radius,f.spacing]),C=f.palette??{},g=f.neutral??{},d=useMemo(()=>{let M=(S=>S==="danger"?C.danger??C.error??g:S==="warning"?C.warning??g:S==="success"?C.success??g:S==="info"?C.info??C.primary??g:g)(t),b=M?.[50]??g[50],y=M?.[300]??g[300],P=M?.[600]??M?.[500]??g[600],H=M?.[700]??P,L=M?.[800]??f.text?.primary??"#000",E=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:P,fg:E,border:void 0,iconColor:E}:n==="outlined"?{bg:b,fg:L,border:`1px solid ${y}`,iconColor:L}:n==="ghost"?{bg:"transparent",fg:H,border:"none",iconColor:H}:{bg:b,fg:L,border:void 0,iconColor:H}},[t,n,g,C,f.text]),m=t==="danger"||t==="warning"?"alert":"status",v=useMemo(()=>a?jsx(Qn,{variant:"circular",color:d.iconColor,size:x.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:x.iconSize,height:x.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:x.iconSize,height:x.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:x.iconSize,height:x.iconSize},color:d.iconColor}):jsx(Info,{css:{width:x.iconSize,height:x.iconSize},color:d.iconColor})),[a,o,t,x.iconSize,d.iconColor]),D=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${x.paddingY} ${x.paddingX}`,gap:x.gap,borderRadius:x.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:x.fontSize,fontWeight:500,maxWidth:typeof i=="number"?`${i}px`:i,width:"100%"}),[d.bg,d.border,d.fg,x.fontSize,x.gap,x.paddingX,x.paddingY,x.radius,i]),T=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:x.gap,minWidth:0,flex:1}),[x.gap]),w=useMemo(()=>[lu,{color:d.iconColor}],[d.iconColor]),F=useMemo(()=>css({display:"flex",alignItems:"center",gap:x.gap,marginLeft:x.gap,flex:"0 0 auto"}),[x.gap]),B=useMemo(()=>[cu,{color:d.fg}],[d.fg]),W=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:x,titleId:R,descId:I}),[d.fg,d.iconColor,x,R,I]),O=de.Children.toArray(c).some(A=>de.isValidElement(A)&&A.type===rs),k=de.Children.toArray(c).some(A=>de.isValidElement(A)&&A.type===ss);return jsx(Ja.Provider,{value:W,children:jsxs("div",{ref:h,role:m,"aria-live":m==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":a,"aria-labelledby":O?R:void 0,"aria-describedby":k?I:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[D,l],...p,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:T,children:[v&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:v}),jsx("div",{className:"plainframe-ui-alert-content",css:iu,children:c})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:F,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:a,className:"plainframe-ui-alert-close",css:B,children:r??jsx(X,{strokeWidth:2,size:x.iconSize-2})})})]})})});Qa.displayName="Alert";var rs=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:i,titleId:u}=Za(),a=useMemo(()=>css({color:s,fontWeight:i.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,i.titleWeight]);return jsx("span",{ref:r,id:u,className:"plainframe-ui-alert-title",css:[a,n],...o,children:t})});rs.displayName="AlertTitle";var ss=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:i}=Za(),u=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:i,className:"plainframe-ui-alert-desc",css:[u,n],...o,children:t})});ss.displayName="AlertDescription";var as=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,jt=e=>e==null?[]:Array.isArray(e)?e:[e],Vt=(...e)=>css(e.filter(Boolean));function ti(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 Zo=de.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:i,helperText:u,disabled:a=false,fullWidth:l=false,width:c=250,size:p="md",variant:h="subtle",rounded:f=false,startIcon:R,endIcon:I,togglePasswordVisible:x=false,showClear:C,type:g="text",step:d,focusRingMode:m="always",className:v,wrapperCss:D,inputCss:T,labelCss:w,helperRowCss:F,helperTextCss:B,startIconCss:W,endIconCss:O,css:k,onBlur:A,onFocus:M,onKeyDown:b,autoFocus:y,name:P,id:H,tabIndex:L,autoComplete:E,readOnly:S,required:z,maxLength:$,onSurfaceClick:K},_){let N=j(),U=Xo(),G=useId(),se=useMemo(()=>{let ce={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}},Te=["sm","md","lg"].includes(p)?p:"md";return ce[Te]},[p,N]),V=N.neutral,Y=N.text,le=g==="number",ue=g==="password",pe=n!==void 0,[Me,Ce]=useState(o),ve=pe?n:Me,we=useCallback(ce=>{pe||Ce(ce),r?.(ce);},[pe,r]),Re=/^-?\d*(?:[.,]\d*)?$/,Z=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(ve??"")),ie=le?Z?"decimal":"numeric":void 0,be=le?Z?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,X$1=useCallback(ce=>{(ce===""||Re.test(ce))&&we(ce);},[we]),ye=a?V[200]:i&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:i&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",Q=N.componentHeights.border,ne=h==="outlined"?`${Q} solid ${i?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Vt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":c!=null?as(c):void 0,flex:"0 0 auto",fontWeight:500}),me=useMemo(()=>Vt({fontSize:se.labelFont,fontWeight:500,color:i?N.palette.danger?.[700]??Y.primary:a?V[500]:Y.primary,marginBottom:4,display:"inline-block"},...jt(w)),[se.labelFont,i,a,V,Y,N.palette.danger,w]),Ae=useMemo(()=>Vt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${as(se.paddingY)} ${as(se.paddingX)}`,background:ye,border:ne,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:a?"not-allowed":"text",opacity:a?.65:1,transition:"box-shadow .18s, border-color .16s"},...jt(D),...jt(k)),[N,se.minHeight,se.paddingX,se.paddingY,ye,ne,f,a,D,k]),He=useMemo(()=>Vt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:a?V[500]:i?N.palette.danger?.[800]??Y.primary:Y.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:a?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:i?N.palette.danger?.[700]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${i?N.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${ye} inset !important`,transition:"opacity 99999s ease-out",caretColor:i?N.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...jt(T)),[se.fontSize,a,V,Y,i,N.palette.danger,le,ye,T]),J=useMemo(()=>Vt({display:"inline-flex",alignItems:"center",color:i?N.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},...jt(W)),[i,N.palette.danger,Y.secondary,W]),oe=useMemo(()=>Vt({display:"inline-flex",alignItems:"center",color:i?N.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...jt(O)),[i,N.palette.danger,Y.secondary,a,O]),re=useMemo(()=>Vt({minHeight:16,fontSize:se.helperFont,color:i?N.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...jt(F)),[se.helperFont,i,N.palette.danger,Y.secondary,F]),Ve=useMemo(()=>Vt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...jt(B)),[B]),Le=useRef(null),Et=useCallback(ce=>{Le.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),qn=useCallback(ce=>{let Te=ce.target.value;if(le){X$1(Te);return}$&&Te.length>$||we(Te);},[le,$,we,X$1]),[Ke,Cn]=useState(false),it=useCallback(()=>{a||Cn(ce=>!ce);},[a]),Rn=useCallback(()=>{a||(we(""),Le.current?.focus());},[a,we]),St=useMemo(()=>{let ce=se.fontSize;if(typeof ce=="number")return ce;let Te=parseFloat(String(ce));return Number.isFinite(Te)?Te:16},[se.fontSize]),Tn=useMemo(()=>R?jsx("span",{css:J,children:ti(R,St)}):null,[R,J,St]),Gn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),Po=useMemo(()=>{let ce=[];if(ue&&x){let lt=Ke?jsx(Eye,{strokeWidth:2.5,size:St}):jsx(EyeOff,{strokeWidth:2.5,size:St});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Yn=>Yn.preventDefault(),onClick:Yn=>{Yn.stopPropagation(),it();},tabIndex:-1,"aria-label":Ke?"Hide password":"Show password",disabled:a,children:lt},"pw-toggle"));}C&&ve&&ve.length>0&&!a&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:lt=>lt.preventDefault(),onClick:lt=>{lt.stopPropagation(),Rn();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:St})},"clear"));let Te=I?jsx("span",{css:oe,children:ti(I,St)},"user-end"):null,Ze=ce.length>0,Fe=!!Te;return !Ze&&!Fe?null:!Ze&&Fe?Te:Ze&&!Fe?ce.length===1?ce[0]:jsx("span",{css:Gn,children:ce}):jsxs("span",{css:Gn,children:[ce,Te]})},[ue,x,Ke,St,oe,Gn,a,C,ve,I,it,Rn]),Do=u!=null?`${H??G}-help`:void 0,Xn=H??G,Ue=useCallback(ce=>{if(a)return;ce.stopPropagation();let Te=Le.current;if(!Te)return;let Ze=ce.target;if(!(Te.contains(Ze)||Ze.closest("button,[role='button']"))){if(document.activeElement===Te){ce.preventDefault();return}ce.preventDefault();}},[a]),dt=useCallback(ce=>{if(a)return;let Te=Le.current;if(Te&&(K?.(ce),document.activeElement!==Te)){Te.focus({preventScroll:true});try{let Ze=Te.value?.length??0;Te.setSelectionRange?.(Ze,Ze);}catch{}}},[a,K]);return jsxs("div",{className:["plainframe-ui-textfield",v||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Xn,className:"plainframe-ui-textfield-label",css:me,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:m!=="none",color:i?"danger":void 0}),Ae],onPointerDownCapture:Ue,onClick:dt,"aria-invalid":!!i||void 0,children:[Tn,jsx("input",{ref:Et,id:Xn,className:"plainframe-ui-textfield-input",css:He,type:ue?Ke?"text":"password":g==="number"?"text":g,inputMode:ie,pattern:be,value:ve,maxLength:le?void 0:$,onChange:le?ce=>X$1(ce.target.value):qn,placeholder:s||"",disabled:a,onBlur:A,onFocus:M,onKeyDown:b,autoFocus:y,name:P,tabIndex:L,autoComplete:E,readOnly:S,required:z,"aria-invalid":!!i||void 0,"aria-describedby":Do}),Po]}),u!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Do,className:"plainframe-ui-textfield-helper-text",css:Ve,children:u})})]})}));Zo.displayName="TextField";var Qo=de.createContext("ghost"),gt=de.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:i,css:u,children:a,label:l,allItemsTabbable:c=false,...p},h){let f=j(),[R,I]=useState(false),x=useRef(null),C=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":C,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"}}),m=n==="sm",v=useMemo(()=>({isKeyboardNav:R,setIsKeyboardNav:I}),[R]),D=useMemo(()=>({allItemsTabbable:c}),[c]),T=useCallback(M=>Array.from(M.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"]')!==M)return false;let y=window.getComputedStyle(b);return y.display!=="none"&&y.visibility!=="hidden"}),[]),w=useCallback(M=>{M.removeAttribute("data-keyboard-nav"),M.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),I(false);},[]),F=useRef(false),B=useCallback(M=>{if(M.target!==M.currentTarget)return;if(F.current){F.current=false;return}let b=M.currentTarget,y=T(b);y.length>0&&(I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),y[0].setAttribute("data-highlighted",""),y[0].focus({preventScroll:true}));},[T]),W=useCallback(M=>{let b=M.currentTarget,y=T(b);if(y.length===0)return;if(M.key==="Tab"){F.current=true,b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),I(false),b.tabIndex=-1,requestAnimationFrame(()=>{b.tabIndex=0,F.current=false;});return}let P=b.querySelector("[data-highlighted]"),H=b.querySelector("[data-hovered]"),L=P||H,E=L?y.indexOf(L):-1;if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach($=>$.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach($=>$.removeAttribute("data-hovered")),E===-1&&(E=M.key==="ArrowDown"?-1:y.length);let S=M.key==="ArrowDown"?1:-1,z=(E+S+y.length)%y.length;y[z].setAttribute("data-highlighted",""),y[z].focus({preventScroll:true});return}if(M.key==="Home"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(S=>S.removeAttribute("data-hovered")),y[0].setAttribute("data-highlighted",""),y[0].focus({preventScroll:true});return}if(M.key==="End"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(S=>S.removeAttribute("data-hovered")),y[y.length-1].setAttribute("data-highlighted",""),y[y.length-1].focus({preventScroll:true});return}if(M.key==="Escape"){M.preventDefault(),b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),I(false),b.blur();return}},[T]),O=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&w(b);},[w]),k=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&w(b);},[w]),A=useCallback(M=>{x.current=M,typeof h=="function"?h(M):h&&(h.current=M);},[h]);return jsx(eo.Provider,{value:v,children:jsx(to.Provider,{value:D,children:jsx(gt.Provider,{value:m,children:jsx(Qo.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":R?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",i||""].join(" ").trim(),css:[d,u],onFocus:B,onKeyDown:W,onPointerMove:O,onPointerDown:k,...p,children:a})]})})})})})});ai.displayName="Menu";var li=createContext(null),nr=()=>{let e=useContext(li);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function $u(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ro=(...e)=>t=>{for(let n of e)$u(n,t);},ls=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zu=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]);},er=(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}},Ou=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:i})=>{let[u,a]=useState(!!t),l=e??u,c=x=>{e===void 0&&a(x),n?.(x);},p=useRef(null),h=useRef(null),f=(x=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>c(false),x);},R=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};zu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let x=C=>{if(C.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(T=>{let w=window.getComputedStyle(T);return w.display!=="none"&&w.visibility!=="hidden"});if(d.length===0)return;let m=d[0],v=d[d.length-1],D=document.activeElement;C.shiftKey&&D===m?(C.preventDefault(),v.focus()):!C.shiftKey&&D===v&&(C.preventDefault(),m.focus());};return document.addEventListener("keydown",x,true),()=>document.removeEventListener("keydown",x,true)},[s,l]);let I=useMemo(()=>({open:l,setOpen:c,triggerOn:o,referenceRef:p,scheduleClose:f,cancelClose:R}),[l,o]);return jsx(li.Provider,{value:I,children:i})},ci=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:i,referenceRef:u,scheduleClose:a,cancelClose:l}=nr(),c=de.Children.only(t),p=c.props||{},h=ro(u,o,c.ref),f=i==="click"?{onClick:I=>{I.stopPropagation(),s(!r),p.onClick?.(I);}}:{onMouseEnter:I=>{l(),r||s(true),p.onMouseEnter?.(I);},onMouseLeave:I=>{a(),p.onMouseLeave?.(I);}},R={"aria-haspopup":"dialog","aria-expanded":r};if(e){let I=c.props?.css;return de.cloneElement(c,{...f,...R,ref:h,css:[I,n].filter(Boolean)})}return de.createElement("button",{ref:h,type:"button",css:[n],...f,...R,children:c})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=nr(),i=de.Children.only(o),u=ro(s,r,i.ref);if(e){let l=i.props?.css;return de.cloneElement(i,{ref:u,css:[l,n].filter(Boolean)})}let a=css({display:"inline-block",width:ls(t),verticalAlign:"middle",...n});return jsx("span",{ref:u,css:a,children:i})});ui.displayName="PopoverAnchor";function Wu(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,i=n==="left"?"start":n==="right"?"end":"center";return i==="center"?s:`${s}-${i}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var di=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:i,height:u,padding:a,paddingX:l,paddingY:c,radius:p="lg",css:h,...f},R)=>{let{open:I,setOpen:x,triggerOn:C,referenceRef:g,scheduleClose:d,cancelClose:m}=nr(),v=j(),D=Wu(e),{refs:T,x:w,y:F,strategy:B,context:W}=useFloating({open:I,onOpenChange:x,whileElementsMounted:autoUpdate,placement:D,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&T.setReference(g.current);},[T,g]);let O=useDismiss(W,{outsidePressEvent:"pointerdown",escapeKey:true}),k=useRole(W,{role:"dialog"}),{getFloatingProps:A}=useInteractions([O,k]),[M]=W.placement.split("-"),b=M,y=`${b==="left"?"right":b==="right"?"left":"center"} ${b==="top"?"bottom":b==="bottom"?"top":"center"}`,P=8,H=b==="top"?{y:P}:b==="bottom"?{y:-P}:b==="left"?{x:P}:{x:-P},L={initial:{opacity:0,scale:.96,...H},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...H},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"}}},E=v.surface.panelBg,S=v.text.primary,z=`${v.componentHeights.border} solid ${v.surface.border}`,$=er(a,v.spacing),K=er(l,v.spacing),_=er(c,v.spacing),N={};$&&(N.padding=$),K&&(N.paddingInline=K),_&&(N.paddingBlock=_);let U=er(p,v.radius)??v.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:B,top:F??0,left:w??0,zIndex:1e3,transformOrigin:y,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ls(i)??"fit-content",height:ls(u)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),V=r?css({}):css({background:E,color:S,border:z,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof v.spacing?.sm=="number"?`${v.spacing.sm}px ${v.spacing.md}px`:`${v.spacing?.sm??"0.5rem"} ${v.spacing?.md??"1rem"}`}}),Y=C==="hover"?{onMouseEnter:m,onMouseLeave:()=>d()}:{},le=ro(T.setFloating,R),ue=jsx(motion.div,{className:"plainframe-ui-popover",...A({...f,ref:le,...Y}),...L,css:[se,V,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:I?ue:null})})});di.displayName="PopoverContent";var Ku=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var ps=de.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:i,className:u,css:a,trackCss:l,thumbCss:c,labelCss:p,...h},f){let R=j(),I=he(),x={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}},C={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[d,m]=useState(n),v=g?!!t:d,[D,T]=useState(false);useEffect(()=>{if(r)return;T(true);let K=setTimeout(()=>T(false),C.pressMs);return ()=>clearTimeout(K)},[v,r]);let w=["sm","md","lg"].includes(s)?s:"md",F=x[w],B=`${C.slideMs}ms ${C.easing}`,W=R.palette?.primary?.[600]??R.neutral[900],O=R.neutral[300],k=v?W:O,A=v?R.text.onColors.primary:"#ffffff",{trackW:M,trackH:b,thumb:y}=F,P=(b-y)/2,H=css({display:"inline-flex",alignItems:"center",gap:F.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:R.spacing.xs,borderRadius:R.radius.sm,outline:"none"}),L=css({position:"relative",width:M,height:b,backgroundColor:k,borderRadius:R.radius.xl,transition:`background-color ${B}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),E=css({position:"absolute",top:P,left:v?M-y-P:P,width:y,height:y,backgroundColor:A,borderRadius:R.radius.xl,transition:`left ${B}, transform ${B}, background-color 0.25s ease`,transform:D?"scaleX(1.2)":"scaleX(1)",transformOrigin:v?"right center":"left center"}),S=css({fontSize:R.typography.sizes.sm,fontWeight:500,color:r?R.text.muted:R.text.primary}),z=()=>{if(r)return;let K=!v;g||m(K),o?.(K);};return jsxs("label",{ref:f,role:"switch","aria-checked":v,"aria-disabled":r||void 0,"data-checked":v?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:z,onKeyDown:K=>{r||(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),z());},className:["plainframe-ui-switch",u||""].join(" ").trim(),css:[H,I({color:v?"primary":"neutral"}),a],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[L,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[E,c]})}),i!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[S,p],children:i})]})}));var Yu=(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},rr=de.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:i,rounded:u=false,checkedIcon:a,color:l="primary",css:c,boxCss:p,checkCss:h,labelCss:f,descriptionCss:R,className:I,...x},C)=>{let g=j(),d=he(),m=typeof e=="boolean",[v,D]=useState(t),T=m?e:v,w=r==="sm"||r==="lg"?r:"md",F=useMemo(()=>Yu(g,w),[g,w]),{checkedBg:B,checkColor:W,borderCol:O,hoverBg:k,gapPx:A}=useMemo(()=>{let K=g.palette||{},_=g.neutral||{},N=g.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(K,l)?(U=K[l]||K.primary||_,G=l):(U=K.primary||_,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],V=N[G]??N.primary??g.text?.onColors?.primary??g.text.primary,Y=typeof F.gap=="number"?F.gap+2:F.gap;return {checkedBg:se,checkColor:V,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:Y}},[F.gap,l,g]),M=useMemo(()=>css({display:"inline-flex",alignItems:s&&i?"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:O,backgroundColor:k},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:B,outlineColor:B,"--pfui-bleed":B},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:B,backgroundColor:B,"--pfui-bleed":B},".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)"}}),[O,B,i,o,A,k,s,g.radius.sm,g.spacing.xs]),b=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),y=useMemo(()=>css({width:F.box,height:F.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${F.borderWidth} solid ${O}`,outlineOffset:`-${F.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:u?g.radius.full:F.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"}),[F.box,F.borderRadius,F.borderWidth,O,u,g.radius.full]),P=useMemo(()=>({w:Math.round(F.box*F.iconRatioW),h:Math.round(F.box*F.iconRatioH)}),[F.box,F.iconRatioH,F.iconRatioW]),H=useMemo(()=>css({width:P.w,height:P.h,transition:"opacity .14s ease, transform .14s ease",color:W,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[W,P.h,P.w]),L=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),E=useMemo(()=>css({fontSize:F.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[F.labelFont,g.text.primary]),S=useMemo(()=>css({fontSize:F.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&i?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[F.labelFont,i,s,g.spacing.xs,g.text.secondary]),z=useCallback(()=>{o||(m?n?.(!T):D(K=>{let _=!K;return n?.(_),_}));},[o,m,T,n]),$=useCallback(K=>{o||(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),z());},[o,z]);return jsxs("label",{ref:C,role:"checkbox","aria-checked":T,"aria-disabled":o||void 0,"data-state":T?"checked":"unchecked",className:["plainframe-ui-checkbox",I||""].join(" ").trim(),css:[M,d({color:T?"primary":"neutral"}),c,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:$,children:[jsx("input",{type:"checkbox",checked:T,onChange:z,disabled:o,css:b,...x,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[y,p],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[H,h],children:T&&(a||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:W,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||i)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:L,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[E,f],children:s}),i&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[S,R],children:i})]})]})}));rr.displayName="Checkbox";var Qu=()=>useContext(ln),ed=()=>useContext(to),td=()=>useContext(lr),sn=null,bi=(e,t=35)=>{sn!==null&&window.clearTimeout(sn),sn=window.setTimeout(()=>{e(),sn=null;},t);},so=()=>{sn!==null&&(window.clearTimeout(sn),sn=null);},Mt=de.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:i,className:u,css:a,startIcon:l,endIcon:c,selected:p=false,active:h,meta:f,__index:R,__skipListReg:I,...x},C){let g=Qu(),d=td(),m=ir(),v=io(),D=ed(),T=j(),F=!!useContext(gt),B=x["data-subtrigger"]!==void 0,W=B&&c===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):c,k=typeof o=="number"?o:o===false?0:0,A=useContext(Qo),M=A==="subtle"?T.surface?.subtleHover??T.neutral[100]:T.surface?.subtleBg??T.neutral[100],b=useMemo(()=>css({width:"100%",borderRadius:T.radius.md,padding:`${T.spacing.sm} ${T.spacing.sm}`,paddingLeft:k>0?`calc(${T.spacing.md} + (${T.spacing.xl} * ${k}))`:T.spacing.md,minHeight:F?T.componentHeights.sm:T.componentHeights.md,display:"flex",alignItems:"center",gap:T.spacing.sm,fontWeight:500,fontSize:T.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?T.palette.danger[800]:T.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?T.palette.danger[50]:M},"&[data-highlighted]":t?{}:{background:n?T.palette.danger[50]:M},"&[data-active]":t?{}:{background:n?T.palette.danger[50]:M},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?T.palette.danger[50]:M},"[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:T.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[T,F,k,t,n,M]),y=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"}}),[]),P=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:T.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:T.text.secondary}),[T.text.secondary,T.spacing.sm]),H=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:T.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[T.palette.primary]),L=[];F&&L.push({minHeight:T.componentHeights.sm,paddingLeft:T.spacing.sm,paddingRight:T.spacing.xs,paddingTop:T.spacing.xs,paddingBottom:T.spacing.xs});let E=()=>{s?.(),r&&!B&&d?.closeAll();},S=($,K)=>{let _=$.closest('[role="menu"]');if(!_)return;let N=Array.from(_.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(Y=>{if(Y.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(Y);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf($),G=U>=0?U:0,se=K(N.length,G),V=N[se];V&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),V.setAttribute("data-highlighted",""),V.focus(),g&&R!=null&&g.setActiveIndex(se));},z=t?-1:D?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:z,ref:$=>{if(g&&!I){let K=g.listRef.current;$&&(R!=null?K[R]=$:K.includes($)||K.push($));}typeof C=="function"?C($):C&&"current"in C&&(C.current=$);},onMouseMove:$=>{if($.currentTarget.hasAttribute("data-hovered"))return;let K=!!$.currentTarget.closest("[data-submenu-content]");!B&&m&&!K&&bi(m.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");}),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&g&&R!=null&&g.setActiveIndex(R),!t&&!D?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onMouseEnter:$=>{if(B)so();else {let N=!!$.currentTarget.closest("[data-submenu-content]");m&&!N&&bi(m.closeAllSubMenus);}$.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");})),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');!t&&g&&R!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),v&&v.setIsKeyboardNav(false)),g.setActiveIndex(R)),!t&&!D?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:$=>{if(t)return;let K=$.currentTarget;if($.key==="Tab"&&g&&!D?.allItemsTabbable){$.preventDefault();return}if($.key==="Tab"&&!g){let _=K.closest('[role="menu"]');if(_){_.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=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}v&&v.setIsKeyboardNav(false);return}if($.key==="Enter"||$.key===" "||$.key==="ArrowRight"){B||$.key!=="ArrowRight"&&($.preventDefault(),$.stopPropagation(),E());return}if($.key==="ArrowLeft"&&K.closest('[role="menu"]')?.closest("[data-submenu-content]")){$.preventDefault(),$.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(V=>V.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(V=>V.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if($.key==="Escape"){$.preventDefault(),$.stopPropagation(),d?.closeAll(),K.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if($.key==="ArrowDown"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),v&&v.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,(N,U)=>(U+1)%N);return}if($.key==="ArrowUp"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),v&&v.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,(N,U)=>(U-1+N)%N);return}if($.key==="Home"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,()=>0);return}if($.key==="End"){$.preventDefault(),$.stopPropagation();let _=K.closest("[data-menu-id]")||K.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),S(K,N=>N-1);return}},className:["plainframe-ui-menu-item",u||""].join(" ").trim(),css:css(...[b,...L,a].flat()),...x,onClick:$=>{t||($.currentTarget.removeAttribute("data-highlighted"),E());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:y,children:l}),i,(f!=null||W||p)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:P,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:T.typography.sizes.sm,color:T.text.secondary,whiteSpace:"nowrap"}),children:f}):null,W,p&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:H,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=de.createContext(null),fs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),i=e!==void 0,u=i?e:r,a=useRef(u);a.current=u;let l=useRef(n);l.current=n;let c=useCallback(h=>{let f=a.current,I=f.some(x=>Object.is(x,h))?f.filter(x=>!Object.is(x,h)):[...f,h];i||s(I),l.current?.(I);},[i]),p=useMemo(()=>({values:u,toggle:c}),[u,c]);return jsx(yi.Provider,{value:p,children:o})},ao=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:i,disabled:u=false,css:a,className:l,startIcon:c,endIcon:p,...h},f){let R=useContext(yi),I=!!R&&r!==void 0,x=!I&&t!==void 0,[C,g]=useState(()=>I?R.values.some(O=>Object.is(O,r)):!!n),d=I?R.values.some(O=>Object.is(O,r)):x?!!t:C,m=j(),D=!!useContext(gt),T=()=>{if(!u)if(I)R.toggle(r);else {let O=!d;x||g(O),o?.(O);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:D?-1:-3,borderRadius:m.radius.xs,transition:"background-color .12s ease"}),F=css({pointerEvents:"none"}),B=useCallback(O=>{O&&(O.querySelectorAll("[tabindex]").forEach(k=>{k.tabIndex=-1;}),O.querySelectorAll('input, button, a, [role="checkbox"]').forEach(k=>{k.tabIndex=-1;}));},[]),W=jsxs(Fragment,{children:[jsx("span",{ref:B,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:w,"aria-hidden":"true",children:jsx(rr,{size:"sm",checked:d,css:F})}),c]});return jsx(Mt,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:i,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:T,disabled:u,startIcon:W,endIcon:p,css:a,selected:false,children:s})});ao.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:i=false,css:u,switchSize:a="md",switchCss:l,startIcon:c,className:p,...h},f){let R=t!==void 0,[I,x]=useState(!!n),C=R?!!t:I,d=!!useContext(gt),m=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),v=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),D=()=>{if(i)return;let w=!C;R||x(w),o?.(w);},T=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(Mt,{...h,className:["plainframe-ui-menu-switch-item",p||""].join(" ").trim(),ref:f,__index:s,disabled:i,closeOnSelect:false,onSelect:D,css:u,selected:false,children:[c&&jsx("span",{className:"plainframe-ui-menu-item-start",css:T,children:c}),jsx("span",{"data-label":true,css:m,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:v,children:jsx(ps,{checked:C,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:a})})]})});xi.displayName="MenuSwitchItem";var vi=de.createContext(null),Ci=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),i=e??r,u=l=>{e!==void 0||s(l),n?.(l);},a=useMemo(()=>({value:i,onChange:u}),[i]);return jsx(vi.Provider,{value:a,children:o})};Ci.displayName="MenuRadioGroup";var nd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:i,...u},a){let l=useContext(vi),c=l?.value===t,p=j(),h=css({width:p.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:p.palette.primary[600],transform:c?"scale(1)":"scale(0.4)",opacity:c?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),R=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Mt,{...u,className:["plainframe-ui-menu-radio-item",i||""].join(" ").trim(),ref:a,__index:o,role:"menuitemradio","aria-checked":c,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:R,children:n})]})}),an=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:i,wrap:u=false,color:a="primary",...l},c){let p=j(),f=!!useContext(gt),R=a==="primary"?p.text.primary:a==="secondary"?p.text.secondary:p.palette[a]?.[700]??p.text.primary,I=css({display:"flex",alignItems:"center",padding:f?`${p.spacing.sm} ${p.spacing.md}`:`${p.spacing.sm} ${p.spacing.md}`,fontSize:p.typography.sizes.sm,color:R,fontWeight:500,...t?{paddingLeft:`calc(${p.spacing.lg} * 2)`}:null,gap:p.spacing.xs}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:u?"normal":"nowrap"}),C=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:c,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(I,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:C,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:x,children:r}),i&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:i})]})});an.displayName="MenuLabel";var od=({className:e,css:t,variant:n="full",...o})=>{let r=j(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,i=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)"}),u=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?i:n==="middle"?u:a;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var gs=ro,lo=0,cr=null,ur=null,bd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function hd(){if(!(typeof document>"u")){if(lo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=bd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}lo+=1;}}function yd(){if(!(typeof document>"u")&&(lo>0&&(lo-=1),lo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var ln=createContext(null),dr=()=>{let e=useContext(ln);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},co=createContext(null),xd=()=>useContext(co),eo=createContext(null),io=()=>useContext(eo),Ti=createContext(null),ir=()=>useContext(Ti),wi=createContext(false),vd=()=>useContext(wi),to=createContext({allItemsTabbable:true}),lr=de.createContext(null),bs=()=>useContext(lr);function Cd(){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 Rd=()=>xd()?.activeIndex??null,Ei=0,Pn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:i})=>{let[u,a]=useState(!!t),l=e??u,c=useCallback(A=>{e===void 0&&a(A),n?.(A);},[e,n]),p=useRef(`pfui-menu-${++Ei}`),h=useRef(null),f=useRef([]),R=useRef(null),[I,x]=useState(null),[C,g]=useState(false);useEffect(()=>{l||(x(null),f.current=[],g(false));},[l]);let d=useRef(null),m=useCallback((A,M)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let b=M??20;d.current=window.setTimeout(()=>c(A),b);},[o,c]),v=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>v(),[v]),useEffect(()=>{if(!(!r||!l))return hd(),()=>yd()},[l,r]);let D=bs(),[T]=useState(()=>D??Cd()),w=useRef(new Set),F=useMemo(()=>({registerSubMenu:A=>(w.current.add(A),()=>w.current.delete(A)),closeAllSubMenus:()=>{w.current.forEach(A=>A());}}),[]),B=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:h,listRef:f,floatingRef:R,setActiveIndex:x,scheduleSubmenuHover:m,clearSubmenuHover:v,menuId:p.current}),[l,c,o,x,m,v]),W=useMemo(()=>({activeIndex:I,setActiveIndex:x}),[I,x]),O=useMemo(()=>({isKeyboardNav:C,setIsKeyboardNav:g}),[C]),k=s==="sm";return jsx(lr.Provider,{value:T,children:jsx(gt.Provider,{value:k,children:jsx(eo.Provider,{value:O,children:jsx(Ti.Provider,{value:F,children:jsx(co.Provider,{value:W,children:jsx(ln.Provider,{value:B,children:i})})})})})})};Pn.displayName="DropdownMenu";var Dn=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},i)=>{let{open:u,setOpen:a,trigger:l,referenceRef:c,listRef:p,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:R,floatingRef:I,menuId:x}=dr(),C=io(),g=ir(),d=!!e&&isValidElement(t),m=d?t:null,v=m&&m.props&&typeof m.props=="object"&&"onKeyDown"in m.props?m.props.onKeyDown:void 0,D=m&&m.props&&typeof m.props=="object"&&"onClick"in m.props?m.props.onClick:void 0,{onKeyDown:T,onClick:w,...F}=s,B=useMemo(()=>gs(i,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,c),[i,d,t,c]),W=useCallback(()=>p.current.filter(Boolean),[p]),O=useCallback(y=>{let P=W();requestAnimationFrame(()=>P[y]?.focus());},[W]),k=useCallback(y=>{if(y.key==="Tab"&&u){y.preventDefault(),C?.setIsKeyboardNav(true);let P=I?.current;if(P){P.setAttribute("data-keyboard-nav","");let H=P.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])');H&&(document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),H.setAttribute("data-highlighted",""),H.focus());}return}if(y.key==="ArrowRight"&&u){let P=document.querySelector("[data-subtrigger][data-hovered]");if(P){y.preventDefault(),y.stopPropagation(),C?.setIsKeyboardNav(true),P.removeAttribute("data-hovered"),P.setAttribute("data-highlighted",""),P.focus(),requestAnimationFrame(()=>{let H=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});P.dispatchEvent(H);});return}}if(y.key==="ArrowDown"||y.key==="ArrowUp"){if(C?.setIsKeyboardNav(true),!u){y.preventDefault(),a(true),requestAnimationFrame(()=>{let P=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(P){P.setAttribute("data-keyboard-nav","");let H=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let E=L.closest("[data-submenu-content]");if(E&&E!==P)return false;let S=window.getComputedStyle(L);return S.display!=="none"&&S.visibility!=="hidden"});if(H.length>0){let L=y.key==="ArrowDown"?0:H.length-1;h(L),H[L]?.setAttribute("data-highlighted",""),H[L]?.focus();}}}),v?.(y),T?.(y);return}if(u){y.preventDefault();let P=document.querySelectorAll("[data-hovered]");for(let L of Array.from(P))if(L.closest("[data-submenu-content]")){let S=L.closest('[role="menu"]');if(S){S.setAttribute("data-keyboard-nav","");let z=Array.from(S.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(K=>{if(K.closest('[role="menu"]')!==S)return false;let _=window.getComputedStyle(K);return _.display!=="none"&&_.visibility!=="hidden"}),$=z.indexOf(L);if(document.querySelectorAll("[data-highlighted]").forEach(K=>K.removeAttribute("data-highlighted")),L.removeAttribute("data-hovered"),$!==-1&&z.length>0){let K=y.key==="ArrowDown"?1:-1,_=($+K+z.length)%z.length;z[_]?.setAttribute("data-highlighted",""),z[_]?.focus();}return}}let H=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(H){H.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let L=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(E=>{if(E.closest('[role="menu"]')!==H)return false;let S=window.getComputedStyle(E);return S.display!=="none"&&S.visibility!=="hidden"});if(L.length>0){let E=H.querySelector("[data-highlighted]"),S=H.querySelector("[data-hovered]"),z=-1;E?z=L.indexOf(E):S&&(z=L.indexOf(S)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),S&&S.removeAttribute("data-hovered"),z===-1&&(z=y.key==="ArrowDown"?-1:L.length);let $=y.key==="ArrowDown"?1:-1,K=(z+$+L.length)%L.length;h(K),L[K]?.setAttribute("data-highlighted",""),L[K]?.focus();}}v?.(y),T?.(y);return}}if((y.key==="Enter"||y.key===" ")&&!u){y.preventDefault(),C?.setIsKeyboardNav(true),a(true),requestAnimationFrame(()=>{let P=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(P){P.setAttribute("data-keyboard-nav","");let H=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let E=L.closest("[data-submenu-content]");if(E&&E!==P)return false;let S=window.getComputedStyle(L);return S.display!=="none"&&S.visibility!=="hidden"});H.length>0&&(h(0),H[0]?.setAttribute("data-highlighted",""),H[0]?.focus());}}),v?.(y),T?.(y);return}v?.(y),T?.(y);},[u,a,h,v,T,W,O,p,C,x,I,g]),A=useCallback(y=>{l==="click"&&((y.nativeEvent.composedPath?.()??[]).some(E=>{let S=E;if(!S||!("tagName"in S))return false;let z=String(S.tagName).toUpperCase();if(z==="INPUT"||z==="TEXTAREA"||"isContentEditable"in S&&S.isContentEditable)return true;let $="getAttribute"in S?S.getAttribute("role"):null;return $==="textbox"||$==="combobox"})||(y.stopPropagation(),a(!u))),D?.(y),w?.(y);},[l,u,a,D,w]),M=l==="hover"?{onMouseEnter:()=>{R(),a(true);},onMouseLeave:()=>{f(false);}}:{},b=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&m){let y=m.props,P=y.css,H=typeof y.className=="string"?y.className:void 0,L=typeof y.tabIndex=="number"?y.tabIndex:0,E={ref:B,tabIndex:L,className:[H,o].filter(Boolean).join(" ")||void 0,css:[P,b,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,onClick:A,onKeyDown:k,...M,...F};return cloneElement(m,E)}return jsx("button",{ref:B,className:o,css:[css({display:"inline-block"}),b,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":u,onClick:A,onKeyDown:k,...M,...F,children:t})});Dn.displayName="DropdownMenuTrigger";var dn=de.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:i=false,width:u,height:a,maxHeight:l,unstyled:c=false,closeOnBlur:p=false,allItemsTabbable:h=false,className:f,css:R,children:I,exitPlacement:x,animateOnBusClose:C=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:m=false,returnFocus:v=false,...D},T)=>{let{open:w,setOpen:F,referenceRef:B,clearSubmenuHover:W,setActiveIndex:O,floatingRef:k,menuId:A}=dr(),M=j(),b=bs(),y=io();useEffect(()=>{if(!b)return;let J=b.registerCloser(()=>F(false));return ()=>{J&&J();}},[b,F]);let P=typeof o=="string"?parseFloat(o):o,H=typeof r=="string"?parseFloat(r):r,L=typeof s=="string"?parseFloat(s):s,E=`${t}${n==="center"?"":`-${n}`}`,S=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),re=Math.round(J.y);return {x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0,toJSON:()=>({x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0})}},contextElement:void 0}),[]),z=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let J=e;return S({x:J.x,y:J.y})},[e,S]),{refs:$,x:K,y:_,strategy:N,context:U,update:G}=useFloating({open:w,onOpenChange:F,placement:E,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:P??0,crossAxis:H??0}),flip({padding:L??8}),shift({padding:L??8}),size({apply({rects:J,elements:oe}){let re=oe.floating;re.style.boxSizing="border-box",a!=null?re.style.height=typeof a=="number"?`${a}px`:String(a):re.style.removeProperty("height"),u!=null?re.style.width=typeof u=="number"?`${u}px`:String(u):i?re.style.width=`${Math.round(J.reference.width)}px`:re.style.width="200px",l!=null?re.style.maxHeight=typeof l=="number"?`${l}px`:String(l):re.style.removeProperty("max-height");}})]});useEffect(()=>{z?$.setReference(z):B.current&&$.setReference(B.current);},[$,z,B]),useEffect(()=>{if(!w)return;let J=z||B.current,oe=$.floating.current;if(!(!J||!oe))return autoUpdate(J,oe,G)},[w,z,B,$,G]),useEffect(()=>{G();},[G,i,u,a,l]),useEffect(()=>{w&&!h&&O(0);},[w,h,O]),useEffect(()=>{if(!p||!w)return;let J=()=>{let oe=document.activeElement,re=B.current,Ve=$.floating.current;oe&&(re?.contains(oe)||Ve?.contains(oe)||F(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[p,w,F,B,$.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:m?false:J=>{if(d?.length){let oe=J.target;for(let re of d)if(re.current?.contains(oe))return false}return true}}),V=useRole(U,{role:"menu"}),{getFloatingProps:Y}=useInteractions([se,V]),le=useRef(false);useEffect(()=>{w?le.current=true:le.current&&B.current&&v&&(b?.isBusClosingRef.current||requestAnimationFrame(()=>{B.current?.focus();}));},[w,B,b,v]);let ue=typeof M.spacing.xs=="number"?`${M.spacing.xs}px`:String(M.spacing.xs),pe=g===void 0?void 0:typeof g=="number"?g:M.spacing[g]??g,Me=c?void 0:css({boxSizing:"border-box",background:M.surface.panelBg,border:`${M.componentHeights.border} solid ${M.surface.border}`,borderRadius:M.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ue,padding:"var(--pfui-panel-pad)",color:M.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:pe,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,ve=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let re=J.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return J;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Ce+=1,cloneElement(J,{__index:Ce,key:J.key??Ce});if(re==="DropdownMenuTrigger"){let Le=J.props.children;return cloneElement(J,{children:de.Children.map(Le,ve)})}if(re==="DropdownMenuSubTrigger"){Ce+=1;let Le=Ce;return cloneElement(J,{__index:Le,key:J.key??Le})}let Ve=J.props.children;return Ve==null?J:cloneElement(J,{children:de.Children.map(Ve,ve)})},we=de.Children.map(I,ve),Z=U.placement.split("-")[0]||"bottom",ie=Z==="bottom"?"center top":Z==="top"?"center bottom":Z==="left"?"right center":"left center",be=Z==="bottom"?{opacity:0,y:-8,scale:.96}:Z==="top"?{opacity:0,y:8,scale:.96}:Z==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},X=x??Z,ye=X==="bottom"?{opacity:0,y:-8,scale:.96}:X==="top"?{opacity:0,y:8,scale:.96}:X==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ne=!!b?.isBusClosingRef.current&&!C?{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:_??0,left:K??0,zIndex:1e3,transformOrigin:ie}),me=useCallback(J=>{if(J.key==="Tab"){J.preventDefault();return}if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),y?.setIsKeyboardNav(true);let oe=J.currentTarget;oe.setAttribute("data-keyboard-nav","");let re=Array.from(oe.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(Ve=>{if(Ve.closest('[role="menu"]')!==oe)return false;let Le=window.getComputedStyle(Ve);return Le.display!=="none"&&Le.visibility!=="hidden"});if(re.length>0){let Ve=oe.querySelector("[data-highlighted]"),Le=oe.querySelector("[data-hovered]"),Et=-1;Ve?Et=re.indexOf(Ve):Le&&(Et=re.indexOf(Le)),document.querySelectorAll("[data-highlighted]").forEach(Cn=>Cn.removeAttribute("data-highlighted")),Le&&Le.removeAttribute("data-hovered"),Et===-1&&(Et=J.key==="ArrowDown"?-1:re.length);let qn=J.key==="ArrowDown"?1:-1,Ke=(Et+qn+re.length)%re.length;O(Ke),re[Ke]?.setAttribute("data-highlighted",""),re[Ke]?.focus();}}},[y,O]),Ae=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),y?.isKeyboardNav&&y.setIsKeyboardNav(false);},[y]),He=useCallback(J=>{J.removeAttribute("data-keyboard-nav"),J.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),y?.isKeyboardNav&&y.setIsKeyboardNav(false);},[y]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(to.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...Y({...D,ref:gs(T,$.setFloating,J=>{k&&(k.current=J);})}),"data-menu-id":A,"data-keyboard-nav":y?.isKeyboardNav?"":void 0,className:f,css:[Me,ae,R],initial:be,animate:{opacity:1,x:0,y:0,scale:1},exit:ye,transition:ne,onPointerMove:J=>He(J.currentTarget),onPointerDown:J=>He(J.currentTarget),onKeyDown:me,onMouseMove:Ae,onMouseEnter:()=>{W(),b?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:we})}):null})})});dn.displayName="DropdownMenuContent";var Si=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let i=vd(),[u,a]=useState(!!t),l=e??u,c=useCallback(k=>{e===void 0&&a(k),n?.(k);},[e,n]),p=useRef(null),h=useRef(false),f=useCallback((k,A)=>{if(o!=="hover")return;window.clearTimeout(p.current??0),h.current=k;let M=A??20;p.current=window.setTimeout(()=>{h.current=false,c(k);},M);},[o,c]),R=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null,h.current=false);},[]);useEffect(()=>()=>R(),[R]);let I=ir();useEffect(()=>{if(!I)return;let k=()=>{R(),c(false);};return I.registerSubMenu(k)},[I,c,R]);let x=useRef(`pfui-submenu-${++Ei}`),C=useRef(null),g=useRef([]),d=useRef(null),[m,v]=useState(null),[D,T]=useState(false);useEffect(()=>{l||(v(null),g.current=[],T(false));},[l]);let w=useContext(gt),F=r??w,B=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:C,listRef:g,floatingRef:d,setActiveIndex:v,scheduleSubmenuHover:f,clearSubmenuHover:R,pendingOpenRef:h,menuId:x.current}),[l,c,o,v,f,R]),W=useMemo(()=>({activeIndex:m,setActiveIndex:v}),[m,v]),O=useMemo(()=>({isKeyboardNav:D,setIsKeyboardNav:T}),[D]);return i?(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:de.Children.map(s,k=>{if(!isValidElement(k))return k;let A=k.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:k})})):jsx(wi.Provider,{value:true,children:jsx(gt.Provider,{value:F,children:jsx(co.Provider,{value:W,children:jsx(eo.Provider,{value:O,children:jsx(ln.Provider,{value:B,children:s})})})})})};Si.displayName="DropdownMenuSub";var Ii=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},i)=>{let{open:u,setOpen:a,trigger:l,referenceRef:c,scheduleSubmenuHover:p,clearSubmenuHover:h,pendingOpenRef:f,menuId:R}=dr(),I=io(),x=useCallback(k=>{k&&(k.__pfuiCloseSubmenu=()=>a(false));},[a]),C=!!e&&isValidElement(t),g=C?t:null,d=g?.props,m=d?.onKeyDown,v=d?.onClick,{onKeyDown:D,onClick:T,...w}=s,F=useMemo(()=>gs(i,C&&isValidElement(t)&&"ref"in t?t.ref:void 0,c,x),[i,C,t,c,x]),B=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,W=useCallback(k=>{if(k.key==="Tab"){k.preventDefault();return}let A=k.currentTarget,M=b=>{I?.setIsKeyboardNav(true);let y=A.closest("[data-menu-id]");if(!y)return;y.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted"));let P=Array.from(y.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(S=>{if(S.closest("[data-menu-id]")!==y)return false;let z=window.getComputedStyle(S);return z.display!=="none"&&z.visibility!=="hidden"});if(!P.length)return;let H=P.indexOf(A),L=H>=0?H:0,E=b==="next"?(L+1)%P.length:(L-1+P.length)%P.length;P[E]?.setAttribute("data-highlighted",""),P[E]?.focus();};if(k.key==="ArrowDown"){k.preventDefault(),k.stopPropagation(),u&&a(false),M("next");return}if(k.key==="ArrowUp"){k.preventDefault(),k.stopPropagation(),u&&a(false),M("prev");return}if(k.key==="ArrowRight"||k.key==="Enter"||k.key===" "){k.preventDefault(),k.stopPropagation(),I?.setIsKeyboardNav(true);let b=k.currentTarget;a(true),requestAnimationFrame(()=>{let y=R?document.querySelector(`[data-menu-id="${R}"]`):document.querySelector("[data-submenu-content]");if(y){y.setAttribute("data-keyboard-nav",""),b.removeAttribute("data-highlighted"),b.removeAttribute("data-hovered");let P=y.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])');P&&(P.setAttribute("data-highlighted",""),P.focus());}});return}if(k.key==="ArrowLeft"){k.preventDefault(),k.stopPropagation(),u&&a(false);let b=A.closest("[data-menu-id]");b&&b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(y=>y.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(y=>y.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),I&&I.setIsKeyboardNav(true);return}if(k.key==="Escape"){k.preventDefault(),k.stopPropagation(),m?.(k);return}m?.(k),D?.(k);},[u,a,m,D,c,I,R]),O=l==="hover"?{onMouseEnter:k=>{let A=k.currentTarget;so(),h(),document.querySelectorAll("[data-hovered]").forEach(b=>b.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let M=A.closest("[data-menu-id]");M?.hasAttribute("data-keyboard-nav")&&M.removeAttribute("data-keyboard-nav"),I&&I.setIsKeyboardNav(false),u||p(true,90);},onMouseMove:k=>{let A=k.currentTarget;so(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(M=>M.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(M=>M.removeAttribute("data-highlighted")),A.setAttribute("data-hovered","")),!u&&!f?.current&&p(true,90);},onMouseLeave:()=>{p(false,60);}}:{onClick:k=>{k.stopPropagation(),a(!u),v?.(k),T?.(k);}};if(C&&g){let k=d?.css,A=typeof d?.className=="string"?d.className:void 0,M=typeof d?.tabIndex=="number"?d.tabIndex:0,b={ref:F,tabIndex:M,className:[A,o].filter(Boolean).join(" ")||void 0,css:[k,B,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",__skipListReg:true,onKeyDown:W,onFocus:y=>{if(y.target.hasAttribute("data-highlighted")){let P=y.target.closest("[data-menu-id]");P&&!P.hasAttribute("data-keyboard-nav")&&(P.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(y);},...O,...w};return cloneElement(g,b)}return jsx("div",{ref:F,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),B,r],"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",onKeyDown:W,onFocus:k=>{if(k.currentTarget.hasAttribute("data-highlighted")){let A=k.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}},...O,...w,children:t})});Ii.displayName="DropdownMenuSubTrigger";var ki=de.forwardRef((e,t)=>{let n=bs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=dr(),i=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(dn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:i,"data-submenu-content":"",anchor:o.current,onMouseEnter:u=>{r(),n?.clearAllHover(),so(),e.onMouseEnter?.(u);},onMouseLeave:u=>{s(false,60),e.onMouseLeave?.(u);}})});ki.displayName="DropdownMenuSubContent";var pr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ed=css({display:"inline"}),Fi=css({display:"inline",fontWeight:700}),Sd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Id=css({display:"flex",alignItems:"center",gap:4}),kd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Ai=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Md=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Fd=()=>{},Ad=e=>e,Pd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Dd=e=>{e.preventDefault(),e.stopPropagation();},Nd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Hd=e=>{e.preventDefault(),e.stopPropagation();},Pi=de.memo(({onCapture:e})=>{let t=useContext(ln),n=useContext(co),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Pi.displayName="CtxCapture";var hs=de.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:i,cls:u,closeOnSelect:a,pickSingle:l,handleItemKeyDown:c,handleItemMouseDown:p,descriptionColor:h})=>{let f=o(),R=useMemo(()=>{let C=String(e.title??e.value);return s?C:i(C)},[i,e.title,e.value,s]),I=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:kd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ai,children:R}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Md,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ai,children:R}),[R,e.description,h]),x=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let C=f.some(g=>Object.is(g,e.value));return s?jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:p,children:s(e,C)},e.value):jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:p,startIcon:e.startIcon,endIcon:e.endIcon,children:I},e.value)}return s?jsx(Mt,{__index:t,onClick:x,onSelect:x,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:a,onMouseDown:p,selected:r,children:s(e,r)},e.value):jsx(Mt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:x,onSelect:x,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:a,onMouseDown:p,selected:r,children:I},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));hs.displayName="AutocompleteRow";var Di=de.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:i,css:u,inputCss:a,containerCss:l,label:c,helperText:p,variant:h,startIcon:f,endIcon:R,size:I,disabled:x=false,error:C=false,showClear:g=false,open:d,onOpenChange:m,openOnFocus:v=false,openOnType:D=true,openOnClick:T=true,closeOnSelect:w=true,closeOnBlur:F=true,blurOnSelect:B=false,freeSolo:W=false,customValueLabel:O=false,maxHeight:k,maxItems:A,noResultsText:M="No Items Found",highlightTypedValue:b,typedValueHighlightCss:y,showNoResults:P=true,noResultsLabelCss:H,loadingLabelCss:L,loadItems:E,loading:S,loadingText:z="Loading\u2026",debounceMs:$=200,multiple:K=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:V,textFieldWrapperCss:Y,textFieldInputCss:le,textFieldLabelCss:ue,textFieldHelperRowCss:pe,textFieldHelperTextCss:Me,textFieldStartIconCss:Ce,textFieldEndIconCss:ve,menuContentCss:we})=>{let Z=j().text.secondary,[ie,be]=useState(""),X=typeof d=="boolean",[ye,Q]=useState(false),ne=X?d:ye,ae=useRef(null),me=useRef(null),Ae=useRef(null),He=useRef(null),J=useRef(false),oe=useRef(null),re=useRef(false),Ve=useRef(0),Le=useMemo(()=>[me],[]),[Et,qn]=useState(N??[]),Ke=_??Et,Cn=useRef(Ke);Cn.current=Ke;let[it,Rn]=useState(null),St=useRef(it);St.current=it;let Tn=useCallback(()=>Cn.current,[]),[Gn,Po]=useState([]),[Do,Xn]=useState(false),Ue=typeof E=="function",dt=Ue?Gn:e,ce=useRef(dt);ce.current=dt;let Te=!!S||Do&&Ue,Ze=useRef(m);useEffect(()=>{Ze.current=m;},[m]);let Fe=useCallback(q=>{X||Q(q),Ze.current?.(q);},[X]),lt=useRef(null);useEffect(()=>{if(!Ue)return;lt.current&&window.clearTimeout(lt.current);let q=ie;return lt.current=window.setTimeout(async()=>{Xn(true);try{let te=await E(q)||[];Po(Array.isArray(te)?te:[]);}catch{Po([]);}finally{Xn(false);}},Math.max(0,$)),()=>{lt.current&&window.clearTimeout(lt.current);}},[ie,Ue,E,$]);let Yn=useMemo(()=>{let q=pr(ie);return q?dt.some(te=>pr(te.title??te.value)===q):false},[dt,ie]),sa=W&&!!O&&ie.trim().length>0&&!Yn,ac=q=>{if(typeof O=="object"){let te=Object.prototype.hasOwnProperty.call(O,"prefix"),xe=Object.prototype.hasOwnProperty.call(O,"suffix");if(te||xe){let Ee=te?O.prefix??"":"",fe=xe?O.suffix??"":"";return `${Ee}${q}${fe}`}return `Add "${q}"`}return `Add "${q}"`},Br=useMemo(()=>{if(Ue)return dt;let q=pr(ie);if(!q)return dt;let te=[],xe=[];for(let Ee of dt){let fe=pr(Ee.title??Ee.value);fe.split(" ").some(qe=>qe.startsWith(q))?te.push(Ee):fe.includes(q)&&xe.push(Ee);}return te.length>0?te:xe},[dt,ie,Ue]),aa=useMemo(()=>{if(sa){let q=ie.trim();return [...Br,{value:q,title:ac(q),__pfui_free__:true}]}return Br},[Br,sa,ie]),$t=useMemo(()=>{let q=[],te=new Map;for(let ot of aa){let qe=ot.group??"__ungrouped__";te.has(qe)||(te.set(qe,[]),q.push(qe)),te.get(qe).push(ot);}let Ee=typeof A=="number"?Math.max(0,A):1/0,fe=[];for(let ot of q){if(Ee<=0)break;let Qt=te.get(ot).slice(0,Ee);Qt.length>0&&(fe.push({label:ot==="__ungrouped__"?void 0:ot,items:Qt}),Ee-=Qt.length);}return fe},[aa,A]),wn=useMemo(()=>$t.reduce((q,te)=>(q.push(...te.items),q),[]),[$t]),No=wn.length>0,$r=!No&&!!P&&!Te&&ie.trim().length>0,En=Te||No||$r,Ho=En||Ue;useEffect(()=>{!Ue&&ne&&!En&&(re.current=true,Fe(false),setTimeout(()=>{re.current=false;},150));},[Ue,ne,En,Fe]);let zr=useRef(null),Or=useRef(false);useEffect(()=>{if(W&&!K){if(Or.current){Or.current=false;return}let q=ie.trim();if(zr.current===q)return;zr.current=q,t?.({value:q,title:q});}},[ie,W,K,t]);let Wr=useCallback(q=>{let te=ce.current,xe=new Map(te.map(fe=>[fe.value,fe])),Ee=q.map(fe=>xe.get(fe)??{value:fe,title:fe});U?.(Ee);},[U]),Lo=useCallback(q=>{let te=q.map(String);_||qn(te),Wr(te);},[_,Wr]),ia=useCallback(q=>{let xe=Ke.includes(q)?Ke.filter(Ee=>Ee!==q):[...Ke,q];Lo(xe);},[Ke,Lo]),Bo=useCallback(q=>{let te=ce.current.find(xe=>xe.value===q)??{value:q,title:q};te.disabled||(Or.current=true,zr.current=(te.title??te.value).trim(),Rn(te),be(te.title??te.value),t?.(te),X||(w?(J.current=false,re.current=true,Q(false),Ze.current?.(false),setTimeout(()=>{re.current=false;},150)):J.current=true),!w&&Ae.current?.setActiveIndex&&Ae.current.setActiveIndex(null),B?(J.current=false,setTimeout(()=>{He.current&&ae.current?(He.current.tabIndex=0,He.current.focus(),He.current.blur(),He.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,X,w,B]),ic=useCallback(q=>{if(x)return;be(q);let te=!q.trim();K||(te?(Rn(null),t?.(null)):W&&Rn(null)),!X&&!te&&D&&!ne&&Fe(true);},[K,X,D,ne,Fe,x,W,t]),Qe=Pd,la=Fd,lc=Ad,ca=useMemo(()=>y?[Fi,y]:Fi,[y]),cc=useCallback(q=>{let te=ie.trim();if(!te||te.length<1)return q;let xe=te.toLowerCase(),fe=q.toLowerCase().indexOf(xe);return fe<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Ed,children:[q.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:ca,children:q.slice(fe,fe+te.length)}),q.slice(fe+te.length)]})},[ie,ca]),$o=b?cc:lc,uc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Dd,Oo=Nd,dc=useCallback(q=>{Ae.current=q;},[]),ua=useCallback(q=>{let te=Ae.current;if(!te)return;let xe=wn.length;if(xe===0)return;let Ee=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(Ee){let qe=Ee.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),Qt=Ee.querySelector("[data-active]")||Ee.querySelector("[data-hovered]");Qt&&(fe=Array.from(qe).indexOf(Qt));}fe<0&&typeof te.activeIndex=="number"&&(fe=te.activeIndex);let ot=fe<0?q===1?0:xe-1:(fe+q+xe)%xe;te.setActiveIndex?.(ot),requestAnimationFrame(()=>{let qe=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!qe)return;qe.setAttribute("data-keyboard-nav",""),qe.querySelectorAll("[data-active]").forEach(_r=>_r.removeAttribute("data-active")),qe.querySelectorAll("[data-hovered]").forEach(_r=>_r.removeAttribute("data-hovered"));let Kr=qe.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[ot];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[wn.length]),pc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(x||!En&&!Ue)return;q.preventDefault(),!ne&&!X&&Fe(true),ua(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(x)return;let te=Ae.current&&typeof Ae.current.activeIndex=="number"?Ae.current.activeIndex:-1,xe=te>=0&&te<wn.length?wn[te]:null;if(ne&&xe&&te>=0){q.preventDefault(),q.stopPropagation(),K?(ia(xe.value),w||requestAnimationFrame(()=>ae.current?.focus())):Bo(xe.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),ne&&!X&&(re.current=true,Fe(false),q.target.focus(),setTimeout(()=>{re.current=false;},150))):q.key==="Tab"&&ne&&!X&&Fe(false);},[En,Ue,ne,X,wn,K,w,ua,ia,Bo,Fe,x]),mc=useCallback(()=>{x||re.current||v&&Ho&&(Ve.current=Date.now(),X||Fe(true));},[X,v,Ho,Fe,x]),fc=useCallback(()=>{if(J.current){J.current=false;return}F&&Fe(false),!W&&!K&&(it?be(it.title??it.value):ie.trim()&&be(""));},[F,W,K,it,ie,Fe]),da=useCallback(()=>{let q=[],te=0;return $t.forEach((xe,Ee)=>{xe.label&&q.push(jsx(an,{className:Qe("group-label"),children:xe.label},`g-${Ee}`)),xe.items.forEach(fe=>{q.push(jsx(hs,{item:fe,absIndex:te,multiple:true,getCurrentMulti:Tn,isSelected:false,renderItem:s,paint:$o,cls:Qe,closeOnSelect:false,pickSingle:la,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),jsx(fs,{values:Ke,onValuesChange:Lo,children:q},"multi-group")},[$t,Qe,Tn,s,$o,Ke,Lo,la,Oo,zo,Z]),pa=useCallback(()=>{let q=[],te=0;return $t.forEach((xe,Ee)=>{xe.label&&q.push(jsx(an,{className:Qe("group-label"),children:xe.label},`g-${Ee}`)),xe.items.forEach(fe=>{let ot=it?.value===fe.value;q.push(jsx(hs,{item:fe,absIndex:te,multiple:false,getCurrentMulti:Tn,isSelected:ot,renderItem:s,paint:$o,cls:Qe,closeOnSelect:w,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),q},[$t,Qe,it,Tn,s,$o,w,Bo,Oo,zo,Z]),gc=useMemo(()=>Te?jsx(an,{css:L,className:Qe("label-loading"),children:z},"loading"):$r?jsx(an,{css:H,className:Qe("label-empty"),children:M},"empty"):$t.length===0?null:K?da():pa(),[Te,$r,$t.length,Qe,z,M,K,da,pa]),Zt=ne?false:x||!Ue&&!No&&!P,ma=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(Zt||x)&&(X||(ne?(re.current=true,Fe(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{re.current=false;},150)):(Fe(true),queueMicrotask(()=>ae.current?.focus()))));},[ne,No,Ue,Fe,Zt,x,X]),fa=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:ne?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:Zt?"not-allowed":"pointer",userSelect:"none",opacity:Zt?.5:1}),[ne,Zt]),Wo=useMemo(()=>se?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[fa,V],"aria-disabled":Zt||void 0,onMouseDown:Hd,onClick:ma,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,fa,V,Zt,ma,G]),bc=useMemo(()=>R&&Wo?jsxs("span",{css:Id,children:[R,Wo]}):R??Wo,[R,Wo]),hc=useCallback(q=>{if(!(oe.current&&oe.current.contains(q.target)||re.current||x||Date.now()-Ve.current<300)){if(ne){!ie.trim()&&!X&&(re.current=true,Fe(false),setTimeout(()=>{re.current=false;},150));return}T&&Ho&&(!X||T)&&Fe(true);}},[ne,ie,T,Ho,Fe,x,X]);return jsx("div",{ref:me,className:Qe(""),css:[uc,l,u],children:jsxs(Pn,{open:x?false:ne,onOpenChange:x?void 0:Fe,children:[jsx(Pi,{onCapture:dc}),jsx(Dn,{asChild:true,children:jsx("span",{className:Qe("anchor"),css:Sd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:ae,className:Qe("input"),focusRingMode:i,value:ie,onChange:ic,onKeyDown:pc,onFocus:mc,onBlur:fc,onSurfaceClick:hc,placeholder:r,label:c,helperText:p,variant:h,startIcon:f,endIcon:bc,size:I,width:n,fullWidth:o,disabled:x,error:C,showClear:g,css:a,wrapperCss:Y,inputCss:le,labelCss:ue,helperRowCss:pe,helperTextCss:Me,startIconCss:Ce,endIconCss:ve}),jsx("span",{ref:He,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}}),En&&jsx(dn,{className:Qe("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof k=="number"?`${k}px`:k,css:we,ignoreOutsidePressRefs:Le,disableOutsidePressDismiss:X,returnFocus:!B,children:gc})]})})});Di.displayName="Autocomplete";var Od=["sm","md","lg"],Wd=(e,t)=>typeof e=="number"?e:Od.includes(e)?t.componentHeights[e]:t.componentHeights.md,Kd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},_d=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},jd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Ni=de.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:i,children:u,...a},l)=>{let c=j(),[p,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Wd(n,c),R=typeof f=="number"?f:Number.parseFloat(String(f))||0,I=R?Math.round(R*(R<=28?.55:.52)):void 0,x=r?c.radius.full:c.radius.md,C=Kd(c,o),g=_d(c,o),d=jd(u,t),m=css({width:f,height:f,borderRadius:x,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:p?"transparent":C,color:p?"inherit":g,boxSizing:"border-box",userSelect:"none"}),v=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),D=css({fontSize:I,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:[m,i],role:p?void 0:"img","aria-label":p?void 0:t,...a,children:p&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:v,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof u=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:D,children:u}):u||jsx("span",{className:"plainframe-ui-avatar-initials",css:D,children:d})})}));Ni.displayName="Avatar";var Hi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:i,extraLabelCss:u,outlineThickness:a=4,className:l})=>{let c=j(),p=he(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let T=(c.componentHeights&&c.componentHeights[n])??(c.spacing&&c.spacing[n]);return Hi(T??n)}return "32px"})(),R=Children.toArray(e).filter(Boolean),I=typeof t=="number"&&t>=0,x=I&&R.length>t?R.slice(0,t):R,C=I&&R.length>t?R.length-t:0,g=i==="panel"?c.surface.panelBg:i==="subtle"?c.surface.subtleBg:i??c.surface.appBg,d=Hi(a)??"4px",m=css({display:"flex",alignItems:"center"}),v=T=>css({marginLeft:T===0?0:o,zIndex:x.length-T,boxShadow:`0 0 0 ${d} ${g}`,backgroundColor:g,borderRadius:s?c.radius.full:c.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),D=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:[m,r,p()],children:[x.map((T,w)=>{if(!isValidElement(T))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:v(w),children:jsx("span",{css:D,children:T})},w);let F=T,B=F.props?.css,W=B==null?D:[D,B],O=cloneElement(F,{size:n,rounded:s,css:W,style:{...F.props?.style,width:"100%",height:"100%",objectFit:F.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:v(w),children:O},w)}),C>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:c.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:c.text.secondary}),u],"aria-label":`+${C} more`,children:["+",C]})]})};var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=(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"}},Jd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Zd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Qd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",ep=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),tp=de.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:i=99,showZero:u=false,visible:a=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:c="rectangular",children:p,animate:h=true,size:f,outline:R=false,outlineColor:I,className:x,badgeClassName:C,css:g,badgeCss:d,offsetX:m,offsetY:v})=>{let D=j(),T=s==="dot",w=f??(T?8:17),F=r??(T?0:10),{scale:B,onKey:W}=Yd(D,t),O=Jd(B),k=D.text?.onColors||{},A=Zd(D,k,W,n),M=Qd(e,i,s),b=ep(a,s,e,u),y=css({position:"relative",display:"inline-block"}),P=c==="circular"?T?"12.5%":"5%":T?"5%":"2.5%",H=$i(m??P),L=$i(v??P),E=l.vertical||"top",S=l.horizontal||"right",z={},$="0",K="0";E==="center"?(z.top="50%",K="-50%"):E==="top"?(z.top=L,K="-45%"):(z.bottom=L,K="45%"),S==="center"?(z.left="50%",$="-50%"):S==="right"?(z.right=H,$="45%"):(z.left=H,$="-45%");let _=b?1:.8,N=css({minWidth:T?w:w/2,height:w,background:O,color:A,fontSize:typeof F=="number"?`${F}px`:F,fontWeight:o,borderRadius:999,padding:T?0:`0 ${w/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",...R?{boxShadow:`0 0 0 2px ${I??D.surface?.appBg}`}:{},opacity:b?1:0,transform:`translate(${$}, ${K}) scale(${b?_:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...z});return jsxs("div",{className:["plainframe-ui-badge-wrapper",x||""].join(" ").trim(),css:[y,g],children:[p,jsx("span",{"aria-hidden":!b,className:["plainframe-ui-badge",C||""].join(" ").trim(),css:[N,d],children:M})]})});var ws=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:i,contentCss:u,overlayCss:a,children:l,transitionDuration:c=300,keepMounted:p=true,className:h,contentClassName:f,lockScroll:R=true,...I})=>{let x=j(),C=useMemo(()=>r??x.surface.overlayBg,[r,x.surface.overlayBg]),[g,d]=useState(e),[m,v]=useState(e),D=useRef(null),T=useRef(null),w=useRef(null);useEffect(()=>(D.current&&(clearTimeout(D.current),D.current=null),T.current!=null&&(cancelAnimationFrame(T.current),T.current=null),e?(d(true),T.current=requestAnimationFrame(()=>{v(true),T.current=null;})):(v(false),D.current=setTimeout(()=>{d(false),D.current=null;},c)),()=>{D.current&&(clearTimeout(D.current),D.current=null),T.current!=null&&(cancelAnimationFrame(T.current),T.current=null);}),[e,c]),useEffect(()=>{if(!R||!e)return;let A=document.body,M=A.style.overflow,b=A.style.paddingRight,y=window.innerWidth-document.documentElement.clientWidth,P=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",y>0&&(A.style.paddingRight=`${P+y}px`),()=>{A.style.overflow=M,A.style.paddingRight=b;}},[e,R]),useEffect(()=>{if(!m||!t)return;let A=M=>{M.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[m,t]);let F=A=>{if(!m||!t||!w.current)return;let M=A.target;M&&!w.current.contains(M)&&t();},B=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!p&&!g)return null;let W=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:m?"auto":"none",visibility:g?"visible":"hidden"}),O=css({position:"absolute",inset:0,background:C,backdropFilter:B?`blur(${B})`:void 0,WebkitBackdropFilter:B?`blur(${B})`:void 0,opacity:m?1:0,transition:`opacity ${c}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:m?"auto":"none"}),k=css({position:"relative",zIndex:1,pointerEvents:m?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[W,i],onPointerDown:F,...I,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[O,a],role:"presentation"}),jsx("div",{ref:w,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[k,u],children:l})]})};var br=()=>null;Object.defineProperty(br,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function ap(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 ip=de.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:i,separatorCss:u,hover:a=true,className:l,...c})=>{let p=j(),h=he(),f=de.useMemo(()=>de.Children.toArray(e).flatMap(d=>{if(!de.isValidElement(d))return [];let{type:m,props:v}=ap(d);if(!(m===br||typeof m=="function"&&"displayName"in m&&m.displayName===br.displayName))return [];let T=v;return [{href:T.href,disabled:T.disabled,node:T.children,className:T.className,css:T.css,onClick:T.onClick,startIcon:T.startIcon,endIcon:T.endIcon}]}),[e]),R=de.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:p.typography.sizes.sm,fontWeight:500,gap:p.spacing.xs,cursor:"default"}),[p]),I=de.useMemo(()=>css({margin:"0 0.15rem",color:p.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[p]),x=de.useCallback((d,m,v)=>{let D=d?p.text.primary:p.text.secondary,T=a&&m&&!v;return css({display:"inline-flex",alignItems:"center",gap:p.spacing.xs,color:D,cursor:m&&!v?"pointer":"default",textDecoration:"none",borderRadius:p.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":T?{textDecoration:"underline",color:p.text.primary}:{textDecoration:"none"}})},[p,a]),C=de.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=de.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[R,n],...c,children:f.map((d,m)=>{let v=m===f.length-1,D=!!d.href&&!d.disabled&&!v,T=["plainframe-ui-breadcrumb",v?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",D?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),w=[x(v,D,d.disabled),o,v?r:s,D?i:void 0,h(),d.css],F=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:C,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:C,children:d.endIcon})]});return jsxs(de.Fragment,{children:[m!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[I,u],children:t}),D?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":v?"true":"false","data-link":"true",className:T,css:w,children:F}):jsx("span",{"aria-current":v?"page":void 0,tabIndex:v?-1:0,"data-active":v?"true":"false","data-link":"false",className:T,css:w,children:F})]},m)})})});var Es=(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})},Ss=e=>typeof e=="number"?`${e}px`:e,Ki=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Ki(n)&&(t=true));}),t};function dp(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 pp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,i=r.danger||r.error||s,u=e.text.onColors||{},a=u.primary??o.onColors.primary,l=u.danger??a,c=(p,h,f)=>p&&p[h]||f;if(t==="primary"){let p=s,h=c(p,600,n[900])||c(p,500,n[900]),f=c(p,500,n[800])||c(p,600,n[800]);return {bg:h,fg:a,hoverBg:f,border:"none"}}if(t==="destructive"){let p=i,h=c(p,600,n[900])||c(p,500,n[900]),f=c(p,500,n[800])||c(p,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:i[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 _i=de.memo(de.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:i=false,loading:u=false,loadingIndicator:a,loadingPosition:l="center",children:c,className:p,hoverEffect:h=true,icon:f,onClick:R,css:I,...x},C)=>{let g=j(),d=he(),m=useMemo(()=>dp(g,t),[g,t]),v=useMemo(()=>pp(g,e),[g,e]),D=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Ki(c)&&de.Children.count(c)===1,[f,n,o,c]),T=m.iconSize,w=useMemo(()=>Es(n,T),[n,T]),F=useMemo(()=>Es(o,T),[o,T]),B=useMemo(()=>a??jsx(Qn,{color:v.fg,variant:"circular",size:14,thickness:5}),[a,v]),W=useMemo(()=>D?"center":l??"center",[D,l]),O=!!u&&W==="center",k=!!u&&W==="start",A=!!u&&W==="end",M=i||u,b=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:m.minHeight,lineHeight:1,fontWeight:600,cursor:M?"not-allowed":"pointer",opacity:M?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:m.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,m,r,g,M]),y=useMemo(()=>css({backgroundColor:v.bg,color:v.fg,border:v.border}),[v]),P=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:v.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!M?{":hover::before":{opacity:1}}:{}}),[v,h,M]),H=useMemo(()=>css(D&&!s?{width:"100%",height:"100%",maxWidth:m.minHeight,minWidth:m.minHeight,maxHeight:m.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Ss(m.iconSize)}:{fontSize:Ss(m.fontSize),padding:n||o?`${m.paddingY} ${m.paddingXIcon}`:`${m.paddingY} ${m.paddingX}`}),[D,s,m,n,o]),L=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Ss(g.spacing.sm),opacity:O?0:1,transition:"opacity 140ms ease"}),[g,O]),E=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),S=useMemo(()=>typeof m.iconSize=="number"?m.iconSize:Math.max(12,Math.round(parseFloat(String(m.iconSize))||16)),[m.iconSize]),z=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:S,minWidth:S,maxWidth:S,height:"1em"}),[S]),$=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),K=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:O?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[O]),_=useMemo(()=>()=>{if(D)return null;let G=!!n;return !G&&!k?null:jsxs("span",{css:z,"aria-hidden":u?true:void 0,children:[jsx("span",{css:$(!k),children:G?w||n:null}),jsx("span",{css:$(!!k),children:B})]})},[D,n,k,z,$,w,u,B]),N=useMemo(()=>()=>{if(D)return null;let G=!!o;return !G&&!A?null:jsxs("span",{css:z,"aria-hidden":u?true:void 0,children:[jsx("span",{css:$(!A),children:G?F||o:null}),jsx("span",{css:$(!!A),children:B})]})},[D,o,A,z,$,F,u,B]),U=!(i||u);return jsxs("button",{ref:C,type:"type"in x&&x.type?x.type:"button","data-variant":e,className:["plainframe-ui-button",p||""].join(" ").trim(),css:[b,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),y,P,H,I],onClick:U?R:void 0,disabled:i||void 0,tabIndex:u?-1:void 0,"aria-disabled":i||void 0,"aria-busy":u||void 0,...x,children:[jsxs("span",{className:"plainframe-ui-button-content",css:L,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:E,children:D?u?B:Es(c,m.iconSize):c}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:K,"aria-hidden":"true",children:O?B:null})]})}));_i.displayName="Button";var vr=e=>isValidElement(e),mp=e=>{let t=e.type;return t.displayName??t.name},Fs=(e,t)=>mp(e)===t,Ui=e=>Fs(e,"ButtonGroup"),qi=e=>Fs(e,"DropdownMenu"),ks=e=>Fs(e,"DropdownMenuTrigger"),Ln=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,fp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,gp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ms=(e,t)=>{if(!vr(e))return null;if(Ui(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ms(t?n[0]:n[n.length-1],t):null}if(qi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(ks);return o?Ms(o,t):null}if(ks(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Vi=(e,t)=>{if(!e)return false;let n=Ms(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return gp(o)},Gi=de.memo(de.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:i="md",rounded:u=false,gap:a,width:l,className:c,role:p="group",css:h,__clipLeft:f,__clipRight:R,...I},x){let C=j(),g=i==="sm"?C.radius.sm:C.radius.md,d=u?C.radius.full:g,m=o==="vertical",v=fp(C.componentHeights.border,1),D=C.surface.border,T=n&&!!f,w=n&&!!R,F=css({display:"flex",flexDirection:m?"column":"row",width:r?"100%":l!=null?Ln(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Ln(a??C.spacing.sm)}),B=Children.toArray(t),O=B.filter(vr).length,k=0,A=false,M=[];for(let b of B){if(!vr(b)){M.push(b);continue}let y=k===0,P=k===O-1,H=b.props??{},L=H.disabled??s,E=H.size??i,S=0,z=0,$=0,K=0;n&&(m?(S=y?T?0:d:0,z=y?w?0:d:0,K=P?T?0:d:0,$=P?w?0:d:0):(S=y?T?0:d:0,K=y?T?0:d:0,z=P?w?0:d:0,$=P?w?0:d:0));let _=Vi(b,"left"),N=Vi(b,"right"),se=n&&!y&&!(A&&_)&&!(A||_)?css({[m?"borderTop":"borderLeft"]:`${v} solid ${D}`}):null,V=n&&!y&&A&&_?css(m?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:Ln(S),borderTopRightRadius:Ln(z),borderBottomRightRadius:Ln($),borderBottomLeftRadius:Ln(K)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ue=css([Y,se,V,le]);if(!qi(b)){let ve=H.css,we=[H.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Re=Ui(b)&&n?{__clipLeft:!y,__clipRight:!P}:{},Z=cloneElement(b,{...H,disabled:L,size:E,className:we,css:[ve,ue],...Re});M.push(Z),A=N,k+=1;continue}let pe=H.children,Me=Children.map(pe,ve=>{if(!vr(ve)||!ks(ve))return ve;let we=ve.props,Re=[we.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(ve,{...we,css:[we.css,ue],className:Re,disabled:L,size:E})}),Ce=cloneElement(b,{...H,children:Me});M.push(Ce),A=N,k+=1;}return jsx("div",{ref:x,role:p,"aria-orientation":m?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",c||""].join(" ").trim(),css:[F,h],...I,children:M})}));Gi.displayName="ButtonGroup";var Cr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Cr(n?.[e]??e)}}},Rp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Cr(n?.[e]??e)}}},Tp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},wp=(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},Bn=de.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:i,hoverable:u,selectable:a,selected:l,defaultSelected:c,onSelectedChange:p,width:h,height:f,onClick:R,onKeyDown:I,role:x,tabIndex:C,...g},d){let m=j(),v=m.surface??{},[D,T]=useState(!!c),w=l!=null,F=w?!!l:D,B=useMemo(()=>Tp(o,m),[o,m]),W=useMemo(()=>wp(o,m,B),[o,m,B]),O=W,k=useMemo(()=>Cp(r,m),[r,m]),A=useMemo(()=>Rp(s,m),[s,m]),M=!!u||!!a,b=useMemo(()=>css({backgroundColor:B,padding:k,borderRadius:A,border:o==="outlined"?`${m.componentHeights?.border??"1px"} solid ${v.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Cr(h),height:Cr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:M?"pointer":void 0,...M?{"&:hover":{backgroundColor:W}}:{},'&[data-selected="true"]':{backgroundColor:O},...M?{'&[data-selected="true"]:hover':{backgroundColor:O}}:{}}),[B,k,A,o,m.componentHeights,v.border,h,f,M,W,O]),y=useCallback(()=>{if(!a)return;let E=!F;w||T(E),p?.(E);},[w,p,a,F]),P=useCallback(E=>{a&&y(),R?.(E);},[a,y,R]),H=useCallback(E=>{a&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),y()),I?.(E);},[a,y,I]),L=he();return jsx("div",{ref:d,"data-variant":o,"data-selected":a&&F?"true":void 0,"aria-pressed":a?F:void 0,className:["plainframe-ui-container",i||""].join(" ").trim(),css:[L(),b,n],onClick:P,onKeyDown:H,role:a?x??"button":x,tabIndex:a?C??0:C,...g,children:t})}));Bn.displayName="Container";var Sp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ps(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 Sp(o)}return e}}}function go(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ds(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ip(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 bo(e,t,n,o){let r=Ps(t,e),s=Ps(n,e),i=Ps(o,e),u={};return r&&!s&&!i&&(u.padding=r),s&&(u.paddingLeft=s,u.paddingRight=s),i&&(u.paddingTop=i,u.paddingBottom=i),u}function Xi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Yi=de.createContext("horizontal"),Ns=()=>de.useContext(Yi),Ji=de.memo(de.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:i,selected:u,defaultSelected:a,onSelectedChange:l,width:c="100%",height:p,gap:h,direction:f="horizontal",className:R,onClick:I,...x},C)=>{let g=j(),d=he(),m=f==="vertical",v=css({position:"relative",display:"flex",flexDirection:m?"column":"row",gap:Ip(h,g),alignItems:m?"stretch":"center",transition:"all .16s ease"});return jsx(Yi.Provider,{value:f,children:jsx(Bn,{ref:C,variant:n,padding:o,radius:r,hoverable:s,selectable:i,selected:u,defaultSelected:a,onSelectedChange:l,width:c,height:p,className:["plainframe-ui-card",R||""].join(" ").trim(),css:[d(),v,t],onClick:I,tabIndex:I?0:void 0,...x,children:e})})}));Ji.displayName="Card";var kp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,...u})=>{let a=j(),c=Ns()==="vertical",p=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:go(o),textAlign:Ds(o),...c?{width:"100%"}:{flex:1,minWidth:0},...bo(a,r,s,i)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[p,t],...u,children:e})}),Mp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,...u})=>{let a=j(),c=Ns()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...c?{width:"100%"}:{},...bo(a,r,s,i)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[p,t],...u,children:e})}),Fp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,...u})=>{let a=j(),c=Ns()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...c?{width:"100%"}:{},gap:a.spacing.xs,color:a.text.secondary,...bo(a,r,s,i)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[p,t],...u,children:e})}),Ap=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,weight:u,size:a,color:l,...c})=>{let p=j(),h=css({fontWeight:u??500,fontSize:a??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"1rem"),color:Xi(p,l)??p.text?.primary,textAlign:Ds(o),...bo(p,r,s,i),display:"flex",alignItems:"center",gap:p.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[h,t],...c,children:e})}),Pp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:i,weight:u,size:a,color:l,...c})=>{let p=j(),h=css({fontWeight:u??400,fontSize:a??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"0.875rem"),color:Xi(p,l)??p.text?.secondary,marginTop:p.spacing?.xxs??2,textAlign:Ds(o),...bo(p,r,s,i)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...c,children:e})});var Qi=e=>isValidElement(e),Lp=e=>Qi(e)?e.type?.displayName||e.type?.name:void 0,Zi=e=>Lp(e)==="Card",Bp=e=>typeof e=="number"?`${e}px`:e,el=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:i,role:u="group",css:a})=>{let l=j(),c=r==="vertical",p=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:c?"column":"row",width:typeof o=="string"||typeof o=="number"?Bp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},R=Children.toArray(e),x=R.filter(Zi).length,C=0,g=R.map((d,m)=>{if(!Zi(d)||!Qi(d))return d;let v=d.props,D=C++,T=D===0,w=D===x-1,F=s??v.variant,B=t?c?{borderTopLeftRadius:T?v.radius:0,borderTopRightRadius:T?v.radius:0,borderBottomLeftRadius:w?v.radius:0,borderBottomRightRadius:w?v.radius:0}:{borderTopLeftRadius:T?v.radius:0,borderBottomLeftRadius:T?v.radius:0,borderTopRightRadius:w?v.radius:0,borderBottomRightRadius:w?v.radius:0}:void 0,W=t&&!T?c?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,O=F==="subtle"&&x>1&&!T?c?{borderTop:`${p} solid ${h}`}:{borderLeft:`${p} solid ${h}`}:null,A=[B,W,O,t?{width:"100%"}:{width:"100%",marginBottom:c?0:void 0,marginRight:c?void 0:0}].filter(Boolean),M=[v.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...v,variant:F??v.variant,css:[v.css,...A],className:M,key:typeof d=="object"&&"key"in d?d.key:m})});return jsx("div",{role:u,"aria-orientation":c?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",i||""].join(" ").trim(),css:[f,a],children:g})};el.displayName="CardGroup";var Pe=e=>typeof e=="number"?`${e}px`:e,nl=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&nl(n)&&(t=true));}),t},Wp=(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"},ol=de.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:i,endIcon:u,size:a="md",onClick:l,onDelete:c,deleteIcon:p,disabled:h,cursor:f,className:R,css:I},x){let C=j(),g=he(),d=["sm","md","lg"].includes(a)?a:"md",m=useMemo(()=>Wp(C,d),[C,d]),v=!!l&&!h,D=h?"not-allowed":f||(v?"pointer":"inherit"),T=String(C.componentHeights?.border??"1px"),w=useMemo(()=>{let G=C.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,C.palette]),F=useCallback(G=>{let se=C.palette;return (w==="neutral"?C.neutral[G]:se[w]?.[G])??se.primary?.[G]},[w,C.neutral,C.palette]),B=useMemo(()=>w==="neutral"?C.neutral[100]:F(50),[w,F,C.neutral]),W=useMemo(()=>w==="neutral"?C.text.secondary:F(800),[w,F,C.text.secondary]),O=useMemo(()=>w==="neutral"?C.neutral[100]:F(50),[w,F,C.neutral]),k=useMemo(()=>w==="neutral"?C.text.secondary:F(800),[w,F,C.text.secondary]),A=useMemo(()=>w==="neutral"?C.neutral[400]:F(300),[w,F,C.neutral]),M=useMemo(()=>w==="neutral"?C.surface.subtleBg:F(600),[w,F,C.surface.subtleBg]),b=useMemo(()=>(C.text.onColors??{})[w]??(w==="neutral"?C.neutral[900]:C.neutral[0]??"#fff"),[w,C.text.onColors,C.neutral]),y="transparent",P=useMemo(()=>w==="neutral"?C.text.secondary:F(700)??C.text.primary,[w,F,C.text.primary,C.text.secondary]),H=useMemo(()=>!i&&!u&&t!=null&&!nl(t)&&de.Children.count(t)===1,[i,u,t]),L=useMemo(()=>o==="filled"?css({backgroundColor:M,color:b,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:O,color:k,border:"none",boxShadow:`inset 0 0 0 ${T} ${A}`}):o==="ghost"?css({backgroundColor:y,color:P,border:"none",boxShadow:"none"}):css({backgroundColor:B,color:W,border:"none",boxShadow:"none"}),[M,b,P,O,k,A,B,W,T,o]),E=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Pe(m.gap),padding:o==="ghost"?0:H||t==null?Pe(m.soloPadding):`${Pe(m.paddingY)} ${Pe(m.paddingX)}`,borderRadius:s?C.radius.full:m.radius,fontWeight:600,cursor:D,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...H?{lineHeight:1,minWidth:`calc(${Pe(m.iconSize)} + ${Pe(m.soloPadding)} * 2)`,minHeight:`calc(${Pe(m.iconSize)} + ${Pe(m.soloPadding)} * 2)`,justifyContent:"center"}:null}),[m,D,t,h,H,s,C.radius.full,o]),S=useMemo(()=>css({fontSize:Pe(H?m.iconSize:m.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:H?Pe(m.iconSize):void 0,height:H?Pe(m.iconSize):void 0,display:H?"block":void 0}}),[m.fontSize,m.iconSize,H]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Pe(m.iconSize),lineHeight:0,"& > svg":{width:Pe(m.iconSize),height:Pe(m.iconSize),display:"block"}}),[m.iconSize]),$=useMemo(()=>css({marginRight:H||t==null?0:Pe(m.gap),marginLeft:H||t==null?0:Pe(m.iconOffset)}),[m.gap,m.iconOffset,t,H]),K=useMemo(()=>css({marginLeft:H||t==null?0:Pe(m.gap),marginRight:H||t==null?0:Pe(s?m.iconOffsetRounded:m.iconOffset)}),[m.gap,m.iconOffset,m.iconOffsetRounded,t,H,s]),_=useMemo(()=>css({marginRight:s?0:Pe(m.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:Pe(m.iconSize),borderRadius:C.radius.xs}),[m.iconOffset,m.iconSize,h,s,C.radius.xs]),N=useCallback(G=>{v&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[v,l]),U=useMemo(()=>jsx(X,{css:{width:m.iconSize,height:m.iconSize},strokeWidth:2.5}),[m.iconSize]);return jsxs("div",{ref:x,className:["plainframe-ui-chip",v?"plainframe-ui-chip-clickable":"",R||""].join(" ").trim(),css:[E,L,v?g({color:r??"primary"}):null,I],onClick:v?l:void 0,onKeyDown:N,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":w,"data-size":a,"data-icon-only":H||void 0,children:[i&&jsx("span",{css:[z,$],className:"plainframe-ui-chip-icon-left",children:i}),t!=null&&jsx("span",{css:[S,n],className:"plainframe-ui-chip-label",children:t}),u&&jsx("span",{css:[z,K],className:"plainframe-ui-chip-icon-right",children:u}),c&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||c?.();},css:[_,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:p||U})]})}));ol.displayName="Chip";var Vp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Up=de.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:i,variant:u,error:a,disabled:l,ringEnabled:c,focusRingMode:p,placeholder:h,separator:f,gapPx:R}){let I=he(),x=r.neutral,C=r.text,g=r.componentHeights.border,d=useRef([]),[m,v]=useState(0),D=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),T=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let H=h.slice(0,o).split("");for(;H.length<o;)H.push("");return H},[h,o]),w=useMemo(()=>{let H=r.componentHeights[s];return `calc(${typeof H=="number"?`${H}px`:H} * 1.5)`},[r.componentHeights,s]),F=l?x[200]:a&&u==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:a&&u==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:u==="subtle"?r.surface.subtleBg:u==="outlined"?r.surface.panelBg:"transparent",B=u==="outlined"?`${g} solid ${a?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",W=H=>css({width:w,height:w,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:F,border:B,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:i.codeFontSize,fontWeight:600,color:l?x[500]:a?r.palette.danger?.[800]??C.primary:C.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:a?r.palette.danger?.[800]??C.primary:C.primary,"&::placeholder":{color:a?r.palette.danger?.[700]??C.secondary:C.secondary,opacity:.85}},c?I({enabled:true,disabled:l,mode:p==="always"?"always":"visible",color:a?"danger":void 0}):void 0,H?css({}):null),O=css({display:"flex",gap:R,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),k=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:C.secondary,userSelect:"none"}),A=H=>H.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),M=useCallback(H=>{let L=Math.max(0,Math.min(o-1,H));v(L),d.current[L]?.focus();},[o]),b=useCallback((H,L)=>{let E=A(L).slice(0,1),S=[...D];S[H]=E,n(S.join("")),E&&H<o-1&&M(H+1);},[D,o,n,M]),y=useCallback((H,L)=>{if(L.key==="Backspace")if(!D[H]&&H>0){let E=[...D];E[H-1]="",n(E.join("")),M(H-1),L.preventDefault();return}else {let E=[...D];E[H]="",n(E.join(""));return}if(L.key==="ArrowLeft"&&H>0){L.preventDefault(),M(H-1);return}if(L.key==="ArrowRight"&&H<o-1){L.preventDefault(),M(H+1);return}if(L.key==="Home"){L.preventDefault(),M(0);return}if(L.key==="End"){L.preventDefault(),M(o-1);return}},[D,o,n,M]),P=useCallback(H=>{let L=A(H.clipboardData.getData("text")).slice(0,o);L&&(n(L),requestAnimationFrame(()=>{let E=Math.min(L.length,o-1);M(E);}),H.preventDefault());},[o,n,M]);return jsx("div",{className:"plainframe-ui-code-boxes",css:O,children:Array.from({length:o}).map((H,L)=>jsxs(de.Fragment,{children:[jsx("input",{ref:E=>{d.current[L]=E;},type:"text",inputMode:"text",maxLength:1,value:D[L]||"",placeholder:D[L]?"":T[L]||"",disabled:l,onChange:E=>b(L,E.target.value),onKeyDown:E=>y(L,E),onFocus:()=>v(L),onPaste:L===0?P:void 0,className:"plainframe-ui-code-box",css:W(L===m),"aria-label":`Code character ${L+1}`,tabIndex:L===m?0:-1}),f&&L<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:k,children:f}):null]},L))})}),qp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:i,helperText:u,disabled:a=false,gap:l,size:c="md",variant:p="subtle",length:h=4,focusRingMode:f="always",className:R,wrapperCss:I,labelCss:x,helperRowCss:C,helperTextCss:g,css:d})=>{let m=j(),v=useId(),D=useMemo(()=>({sm:{labelFont:m.typography.sizes.xs,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.sm,paddingY:0,paddingX:m.spacing.md,codeFontSize:21},md:{labelFont:m.typography.sizes.sm,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.md,paddingY:0,paddingX:m.spacing.md,codeFontSize:24},lg:{labelFont:m.typography.sizes.md,helperFont:m.typography.sizes.sm,minHeight:m.componentHeights.lg,paddingY:0,paddingX:m.spacing.md,codeFontSize:28}}),[m]),T=["sm","md","lg"].includes(c)?c:"md",w=D[T],F=m.neutral,B=m.text,W=t!=null,[O,k]=useState(n),A=W?t:O,M=$=>{W||k($),o?.($);},b=Math.max(2,Math.min(h,10)),y=m.spacing.sm,P=Vp(l??y)??"0px",H=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:a?"not-allowed":"auto"},...Array.isArray(I)?I:I?[I]:[]),L=css({fontSize:w.labelFont,fontWeight:500,color:i?m.palette.danger?.[700]??B.primary:a?F[500]:B.primary,marginBottom:4,display:"block",cursor:a?"not-allowed":"auto"},...Array.isArray(x)?x:x?[x]:[]),E=css({display:"flex",alignItems:"center",justifyContent:"center",gap:P,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),S=css({minHeight:16,fontSize:w.helperFont,color:i?m.palette.danger?.[700]??B.secondary:B.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(C)?C:C?[C]:[]),z=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:i?m.palette.danger?.[700]??B.primary:a?F[500]:B.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",R||""].join(" ").trim(),css:H,children:[e&&jsx("span",{id:v,className:"plainframe-ui-codefield-label",css:L,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:E,role:"group","aria-labelledby":e?v:void 0,tabIndex:-1,children:jsx(Up,{value:A||"",onChange:M,len:b,theme:m,sizeKey:T,s:{codeFontSize:w.codeFontSize},variant:p,error:!!i,disabled:a,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:P})}),u!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:S,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:z,children:u})})]})};var ll=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 ""},Ls=e=>{if(!e||typeof e!="object")return false;let t=ll(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(Ls):Ls(o)},Xp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let i=de.useRef(null),[u,a]=de.useState(false),l=de.useCallback(S=>{a(S),o?.(S);},[o]),c=de.useCallback(()=>l(false),[l]),p=de.useRef({x:0,y:0}),h=de.useRef(null),f=de.useRef(null),R=de.useCallback(()=>{f.current=null;let S=h.current;if(!S)return;let z=Math.round(p.current.x),$=Math.round(p.current.y);S.style.transform=`translate3d(${z}px, ${$}px, 0)`;},[]),I=de.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(R));},[R]);de.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let x=de.useMemo(()=>({getBoundingClientRect:()=>{let S=Math.round(p.current.x),z=Math.round(p.current.y);return {x:S,y:z,left:S,top:z,right:S,bottom:z,width:0,height:0,toJSON:()=>({x:S,y:z})}}}),[]),C=de.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=de.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${C.current}"]`):null,[]),d=de.useRef(null),m=de.useRef(null),v=de.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),D=de.useCallback(()=>{m.current!=null&&clearTimeout(m.current),m.current=null;},[]),T=de.useCallback(()=>{D(),m.current=window.setTimeout(()=>l(false),0);},[D,l]),w=de.useCallback(()=>{let S=i.current?.getBoundingClientRect();return S?{x:S.left+S.width/2,y:S.top+S.height/2}:{x:0,y:0}},[]),F=de.useCallback((S,z)=>{p.current={x:S,y:z},I(),l(true);},[I,l]),B=typeof t=="function"?t({close:c}):t,W=Ls(B),O=S=>{if(!de.isValidElement(S))return S;let z=ll(S),$=S,K=$.props.children,_=K==null?K:Array.isArray(K)?K.map(N=>de.isValidElement(N)?O(N):N):de.isValidElement(K)?O(K):K;if(z==="DropdownMenu"){let N=$.props.onOpenChange;return de.cloneElement($,{...$.props,open:u,onOpenChange:U=>{N?.(U),l(U);},children:_})}if(z==="DropdownMenuContent"){let N=$.props.onMouseEnter,U=$.props.onMouseLeave;return de.cloneElement($,{...$.props,anchor:x,"data-cz-id":C.current,onMouseEnter:G=>{D(),N?.(G);},onMouseLeave:G=>{T(),U?.(G);},children:_})}return _===K?$:de.cloneElement($,{...$.props,children:_})},k=W?O(B):B,A=de.useCallback(S=>{S.preventDefault(),F(S.clientX,S.clientY);},[F]),M=de.useCallback(S=>{n==="contextmenu"&&A(S);},[n,A]),b=de.useCallback(S=>{n==="dblclick"&&A(S);},[n,A]),y=de.useCallback(S=>{n==="click"&&A(S);},[n,A]),P=de.useCallback(S=>{if(n!=="hover")return;v(),D();let z=r==="center"?w():{x:S.clientX,y:S.clientY};d.current=window.setTimeout(()=>{let $=z.x+(r==="cursor"?s:0),K=z.y+(r==="cursor"?s:0);F($,K);},0);},[n,r,s,w,F,v,D]),H=de.useCallback(S=>{n==="hover"&&u&&r==="cursor"&&!W&&(p.current={x:S.clientX+s,y:S.clientY+s},I());},[n,u,r,W,s,I]),L=de.useCallback(()=>{n==="hover"&&(v(),T());},[n,v,T]);de.useEffect(()=>{if(n!=="hover")return;let S=()=>{if(!u)return;let z=i.current?.matches(":hover"),$=g()?.matches?.(":hover");z||$?D():T();};return window.addEventListener("pointermove",S,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",S,{capture:true})},[u,n,g,D,T]),de.useEffect(()=>{let S=()=>{if(u)if(n==="hover"){let z=i.current?.matches(":hover"),$=g()?.matches?.(":hover");if(z||$?D():T(),r==="center"&&i.current){let K=w();p.current={x:K.x,y:K.y},I();}}else l(false);};return window.addEventListener("scroll",S,true),window.addEventListener("resize",S,true),()=>{window.removeEventListener("scroll",S,true),window.removeEventListener("resize",S,true);}},[u,n,r,w,I,l,D,T,g]),de.useEffect(()=>()=>{v(),D();},[v,D]);let E=({children:S})=>u?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(p.current.x)}px, ${Math.round(p.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&D(),onMouseLeave:()=>n==="hover"&&T(),children:S}):null;return jsxs("div",{ref:i,onContextMenu:M,onDoubleClick:b,onClick:y,onMouseEnter:P,onMouseMove:H,onMouseLeave:L,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,W?k:jsx(E,{children:k})]})};var zn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Qp=de.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:i,middleMargin:u="5px",insetMargin:a="10px",chip:l=false,chipVariant:c="subtle",rounded:p=false,margin:h=10,css:f,labelCss:R,strokeCss:I,className:x,...C},g){let d=j(),{t:m,strokeColor:v,labelTextColor:D,chipSubtleBg:T,chipOutlinedBg:w,outerM:F,padX:B,verticalStrokeMargin:W}=useMemo(()=>{let b=typeof s=="number"?`${s}px`:s,y=d.surface.border,P=d.text.secondary,H=d.surface.subtleBg,L=d.surface.panelBg,E=zn(h,"10px"),S=o==="horizontal"?n==="middle"?zn(u):n==="inset"?zn(a,"0px"):"0":"0",z=o==="vertical"?n==="middle"?zn(u):n==="inset"?zn(a,"0px"):"0":"0";return {t:b,strokeColor:y,labelTextColor:P,chipSubtleBg:H,chipOutlinedBg:L,outerM:E,padX:S,verticalStrokeMargin:z}},[s,d,o,n,u,a,h]),O=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":m,minWidth:t?"max-content":m,marginLeft:F,marginRight:F}:{flexDirection:"row",width:i?zn(i):"100%",minWidth:0,paddingLeft:B,paddingRight:n==="middle"?B:"0",marginTop:F,marginBottom:F},...Array.isArray(f)?f:f?[f]:[]]),[o,t,m,F,i,B,n,f]),k=useMemo(()=>css([{background:v,borderRadius:p?d.radius.full:d.radius.xs},o==="vertical"?{width:m,minHeight:18,flex:1,marginTop:W,marginBottom:W}:{height:m,flex:1}]),[v,p,d.radius.full,d.radius.xs,o,m,W]),A=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?p?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:D,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?c==="subtle"?{background:T,border:"none"}:{background:w,border:`${m} solid ${v}`}:{}},...Array.isArray(R)?R:R?[R]:[]]),[l,o,p,d.radius.full,d.radius.sm,D,c,T,w,m,v,R]),M=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[k,I]}),[k,I]);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",x||""].join(" ").trim(),css:O,...C,children:[t&&r!=="top"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="bottom"&&M,!t&&M]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",x||""].join(" ").trim(),css:O,...C,children:[t&&r!=="left"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="right"&&M,!t&&M]})}));var gl=de.createContext(null),bl=()=>{let e=useContext(gl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},hl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[i,u]=useState(!!n),a=t??i,l=useCallback(p=>{t===void 0&&u(p),o?.(p);},[t,o]),c=useMemo(()=>({open:a,setOpen:l,lockScroll:r,closeOnEscape:s}),[a,l,r,s]);return jsx(gl.Provider,{value:c,children:e})},nm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:i}=bl(),u=!!e&&de.isValidElement(t),a=useCallback(c=>{if(u){let p;de.isValidElement(t)&&(p=t.props.onClick),p?.(c);}r.onClick?.(c),c.defaultPrevented||i(true);},[u,t,r.onClick,i]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i(true)),u){let p;de.isValidElement(t)&&(p=t.props.onKeyDown),p?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,i]);if(u){let c=t,p=c.props.css;return de.cloneElement(c,{...c.props||{},className:[c.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,o].filter(Boolean),onClick:a,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:a,onKeyDown:l,...r,children:t})});nm.displayName="DrawerTrigger";var vo=0,yl="",xl="",om=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function rm(){if(!(typeof document>"u")){if(vo===0){let e=document.body;yl=e.style.overflow||"",xl=e.style.paddingRight||"";let t=om();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vo+=1;}}function sm(){if(!(typeof document>"u")&&(vo>0&&(vo-=1),vo===0)){let e=document.body;e.style.overflow=yl,e.style.paddingRight=xl;}}var am=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,vl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:i=10,radius:u,backdropBlur:a=true,backdropBlurDepth:l,closeOnClickAway:c=true,transitionMs:p,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:R=.2,className:I,css:x,...C},g){let d=j(),{open:m,setOpen:v,lockScroll:D,closeOnEscape:T}=bl();useEffect(()=>{if(!(!D||!m))return rm(),()=>sm()},[m,D]);let w=useMemo(()=>am(i,0),[i]),F=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),B=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),W=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[n,r,s,w]),O=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[o,r,s,w]),k=useMemo(()=>{let V=String(d.radius.lg);switch(r){case "left":return `0 ${V} ${V} 0`;case "right":return `${V} 0 0 ${V}`;case "top":return `0 0 ${V} ${V}`;default:return `${V} ${V} 0 0`}},[r,d.radius.lg]),A=useMemo(()=>u??(s==="inset"?d.radius.lg:k),[u,s,d.radius.lg,k]),M=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:w,bottom:r==="top"?void 0:w,left:r==="right"?void 0:w,right:r==="left"?void 0:w}:{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,w]),b=useRef(null),y=useCallback(()=>{let V=b.current;if(!V)return 1;let Y=V.getBoundingClientRect();return F==="x"?Y.width:Y.height},[F]),P=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),H=useMemo(()=>({duration:(p??280)/1e3,ease:[.22,1,.36,1]}),[p]),L=useMemo(()=>B*1.1,[B]),E=useMemo(()=>F==="x"?{x:`${L*100}%`,y:0}:{y:`${L*100}%`,x:0},[F,L]),S=useMemo(()=>css({position:"fixed",zIndex:1100,...M,width:W,height:O,backgroundColor:d.surface.panelBg,borderRadius:A,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:m?"auto":"none",touchAction:F==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[M,W,O,d.surface,A,m,F]),z=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...a?{backdropFilter:`blur(${l??"2px"})`}:null}),[a,l,d.surface]),$=useCallback(()=>{c&&v(false);},[c,v]),K=useMemo(()=>F==="x"?{left:B===-1?R:0,right:B===1?R:0}:{top:B===-1?R:0,bottom:B===1?R:0},[F,B,R]),_=useMemo(()=>F==="x"?{left:0,right:0}:{top:0,bottom:0},[F]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((V,Y)=>{let le=F==="x"?Y.offset.x:Y.offset.y,ue=F==="x"?Y.velocity.x:Y.velocity.y,pe=B*le>0,Me=Math.abs(le)>=y()*N,Ce=B*ue>f;pe&&(Me||Ce)&&v(false);},[F,B,y,N,f,v]),G=useRef(null);useEffect(()=>{if(!m)return;G.current=document.activeElement;let V=setTimeout(()=>{let ue=b.current;if(!ue)return;let pe=ue.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');pe.length>0?pe[0].focus():ue.focus();},100),Y=ue=>{let pe=b.current;if(!pe||!ue.target)return;let Me=ue.target;if(!pe.contains(Me)){ue.preventDefault();let Ce=pe.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():pe.focus();}},le=ue=>{ue.key==="Escape"&&T&&(ue.stopPropagation(),v(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",le),()=>{clearTimeout(V),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[m,v,T]);let{...se}=C;return jsx(AnimatePresence,{children:m?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:z,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:p?H:{duration:.18,ease:"linear"},onClick:$},"overlay"),jsx(motion.div,{ref:V=>{b.current=V,typeof g=="function"?g(V):g&&(g.current=V);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",I||""].join(" ").trim(),css:[S,x],drag:F,dragConstraints:_,dragElastic:K,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...E,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...E,opacity:.98},transition:p?H:P,...se,children:t},"panel")]}):null})});vl.displayName="DrawerContent";var im=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:i,children:u,...a},l){let c=t!==void 0?t:n,p=o!==void 0?o:r,h=c!==void 0,[f,R]=useState(!!p),I=h?!!c:f,x=useCallback(C=>{h||R(C),C||i?.(),s?.(C);},[h,i,s]);return jsx(hl,{open:I,onOpenChange:x,children:jsx(vl,{ref:l,...a,children:u})})});im.displayName="DrawerLegacy";var Os=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:i,blur:u=false})=>{let a={opacity:o?1:0,filter:u?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=p=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),p?.(h);};if(s&&isValidElement(e)){let p=e,h=p.props.css,f=Array.isArray(h)?[...h,a]:h?[h,a]:[a],R=["plainframe-ui-transition-fade",p.props.className||"",i||""].join(" ").trim(),I=p.props.onTransitionEnd;return cloneElement(p,{...p.props,css:f,className:R,onTransitionEnd:l(I)})}let c=css(a);return jsx("div",{className:["plainframe-ui-transition-fade",i||""].join(" ").trim(),css:c,onTransitionEnd:l(),children:e})};var Cl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rl=de.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:i,width:u,height:a,...l})=>{let c=j(),p=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:c.spacing[t]??t,f=css({display:"flex",flexDirection:p,gap:h,justifyContent:n,alignItems:o,maxWidth:Cl(u),width:u?"100%":void 0,maxHeight:Cl(a),height:a?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:i})});Rl.displayName="Flex";var Ws=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:i,asChild:u=false,className:a})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},c=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&i?.(),h?.(f);};if(u&&isValidElement(e)){let h=e,f=h.props.css,R=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=h.props.onTransitionEnd,x=["plainframe-ui-transition-grow",h.props.className||"",a||""].join(" ").trim();return cloneElement(h,{...h.props,css:R,className:x,onTransitionEnd:c(I)})}let p=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",a||""].join(" ").trim(),css:p,onTransitionEnd:c(),children:e})};var Tl={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"}},Rm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Tm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},On=de.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:i,align:u="left",textTransform:a="none",whiteSpace:l="normal",decoration:c="none",decorationStyle:p="solid",decorationThickness:h=1,decorationColor:f,italic:R,className:I,style:x,as:C})=>{let g=j(),d=Tl[e]??Tl.body,m=C??Tm[e]??"span",v=A=>A==null?d.size:typeof A=="number"?A:g?.typography?.sizes?.[A]??A,D=v(o)??v(d.size),T=r??d.weight,w=s??d.lh,F=i??d.ls,B=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",W=f??g.surface.border,O=css({boxSizing:"border-box",display:u==="left"?"inline":"block",textAlign:u==="left"?void 0:u,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:D,fontWeight:T,lineHeight:w,letterSpacing:F,color:B,textTransform:a,whiteSpace:l,fontStyle:R?"italic":"normal",margin:0,padding:0}),k=c==="none"?css({textDecoration:"none"}):css({textDecorationLine:c,textDecorationStyle:p,textDecorationColor:W,textDecorationThickness:Rm(h),textDecorationSkipInk:"auto"});return jsx(m,{className:[`pfui-typo-${e}`,I||""].join(" ").trim(),css:[O,k],style:x,"data-variant":e,children:t})});On.displayName="Typography";var Vs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sm=(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 Vs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},El=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:i=false,hoverEffect:u="none",label:a,labelAlign:l="center",aspectRatio:c,loading:p="lazy",decoding:h="async",fetchPriority:f,srcSet:R,sizes:I,placeholder:x,blurDataURL:C,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:m,css:v,onClick:D,onLoad:T,onError:w,...F},B){let[W,O]=useState(false),[k,A]=useState(false),[M,b]=useState(false),y=j(),P=Sm(s,y)??"0px",H=a?"figure":"div",L=css({display:"flex",flexDirection:"column",gap:a?y.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${P})`}),E=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${P})`,maxWidth:o?Vs(o):"100%",maxHeight:r?Vs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:c,boxShadow:i?"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:W&&(u==="rotate"||u==="scale-rotate")?"rotate(3deg)":"none",cursor:D?"pointer":void 0}),S=css({position:"absolute",inset:0,background:x==="color"?g:void 0,backgroundImage:x==="blur"&&C?`url(${C})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:x==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:M?0:1,pointerEvents:"none"}),z=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:W&&(u==="scale"||u==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(H,{className:["plainframe-ui-image",m||""].join(" ").trim(),css:[L,v],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:E,onMouseEnter:()=>O(true),onMouseLeave:()=>O(false),onClick:D,children:[!M&&x&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:S}),jsx("img",{ref:B,className:"plainframe-ui-image-img",css:z,src:k&&d?d:t,alt:n,srcSet:R,sizes:I,loading:p,decoding:h,fetchPriority:f,onLoad:$=>{b(true),T?.($);},onError:$=>{A(true),w?.($);},...F})]}),a&&jsx(On,{as:"figcaption",variant:"caption",align:l,children:a})]})});El.displayName="Image";var Sl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Fm=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}},Am=e=>e*Math.PI/180,Pm=(e,t,n)=>{let o=Math.abs(Am(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 Dm(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 Nm=(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,Il=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Hm={sm:150,md:200,lg:260,xl:340},Lm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Bm(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 Lm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var $m=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:i="none",hovering:u,maxItems:a=3,shadow:l=false,cursor:c,outline:p,outlineColor:h,outlineWidth:f=3,outlineOffset:R=0,radius:I="md",label:x,labelAlign:C="center",css:g,className:d,...m}){let v=j(),D=Fm(r)??4/5,T=typeof o=="string"?o:void 0,w=typeof o=="number"?o:T&&/px$/.test(T)?parseFloat(T):Hm[s],F=Math.max(1,w/D),W=Children.toArray(t).filter(isValidElement).slice(0,a),O=W.length,k=Dm(n,O),A=W.map((V,Y)=>Nm(n,O,Y)),M=V=>F*.6*A[V],b=V=>M(V)*D,y=0,P=0;for(let V=0;V<O;V++){let Y=b(V),le=M(V),ue=Math.max(Math.abs(k.base.ang[V]??0),Math.abs(k.exp.ang[V]??0)),pe=Math.max(Math.abs(k.base.dx[V]??0),Math.abs(k.exp.dx[V]??0)),Me=Math.max(Math.abs(k.base.dy[V]??0),Math.abs(k.exp.dy[V]??0)),Ce=i==="expand"?kl[V]??1.08:i==="reveal"?Il[V]??1.03:1,ve=Pm(Y,le,ue),we=ve.w*Ce,Re=ve.h*Ce,Z=pe/100*Y*Ce,ie=Me/100*le*Ce;y=Math.max(y,we/2+Z),P=Math.max(P,Re/2+ie);}let H=Math.max(1,2*y),L=Math.max(1,2*P),E=Math.min(1,w/H,F/L),S=u===void 0?"pointer":"controlled",z=u?"true":void 0,$=css({display:"flex",flexDirection:"column",cursor:c||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:x?v.spacing.xs:0}),K=css({position:"relative",width:Sl(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:Sl(F)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${H}px`,height:`${L}px`,transform:`translate(-50%, -50%) scale(${E})`,transformOrigin:"center center"}),N=Bm(I,v)??"0px",U=V=>{let Y=n==="fan"?`rotate(${k.base.ang[V]}deg) translate(${k.base.dx[V]}%, ${k.base.dy[V]}%)`:n==="slide"?`translate(${k.base.dx[V]}%, ${k.base.dy[V]}%) rotate(${k.base.ang[V]}deg)`:n==="domino"?`translate(0%, ${k.base.dy[V]}%)`:`translate(${k.base.dx[V]}%, ${k.base.dy[V]}%) rotate(${k.base.ang[V]}deg)`,le=n==="fan"?`rotate(${k.exp.ang[V]}deg) translate(${k.exp.dx[V]}%, ${k.exp.dy[V]}%)`:n==="slide"?`translate(${k.exp.dx[V]}%, ${k.exp.dy[V]}%) rotate(${k.exp.ang[V]}deg)`:n==="domino"?`translate(0%, ${k.exp.dy[V]}%)`:`translate(${k.exp.dx[V]}%, ${k.exp.dy[V]}%) rotate(${k.exp.ang[V]}deg)`,ue=i==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,pe=i==="expand"?`${le} scale(${kl[V]??1.06})`:i==="reveal"?`${Y} scale(${Il[V]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ue}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&V===1?10:V+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:p?`${f}px solid ${h??v.surface.appBg}`:void 0,outlineOffset:p?R:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${pe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${pe}`}})},G=V=>css({width:`${b(V)}px`,aspectRatio:`${D}`,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(x?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":S,"data-hovered":z,css:[$,g],tabIndex:-1,...m,children:[jsx("div",{className:"plainframe-ui-image-stack",css:K,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:W.map((V,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(Y),children:V})},Y))})}),x&&jsx(On,{as:"figcaption",variant:"caption",align:C,children:x})]})});var Ml=e=>typeof e=="number"?`${e}px`:e,Fl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Wm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Ml(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Ml(n)}return e}function Km(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var _m=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:i=false,symbolBoost:u=2,css:a,className:l="plainframe-ui-kbd",...c},p){let h=j(),f=he(),R=Fl[o]??Fl.sm,I=Wm(r,h),x={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},C=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${R.h}px !important`,paddingInline:n==="ghost"?0:`${R.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${R.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:i?"uppercase":"none",borderRadius:I,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:x.txt}}),d=css({"&&":{background:"transparent",color:x.txt,border:"none",boxShadow:"none"}}),m=css({"&&":{background:h.surface.panelBg,color:x.txt,border:`1px solid ${x.br}`,boxShadow:`inset 0 1px 0 ${x.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),v=n==="subtle"?g:n==="ghost"?d:m,T=s&&u>0&&Km(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${R.font+u}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:p,className:l,css:[f(),C,v,a],...c,children:T})});var qm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Us=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:i=false,className:u,distance:a})=>{let c=qm(a,t==="left"||t==="right"?"100vw":"100vh"),p=t==="left"?`-${c}`:t==="right"?c:"0",h=t==="up"?c:t==="down"?`-${c}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${p}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},R=x=>C=>{C.target===C.currentTarget&&C.propertyName==="transform"&&s?.(),x?.(C);};if(i&&isValidElement(e)){let x=e,C=x.props.css,g=Array.isArray(C)?[...C,f]:C?[C,f]:[f],d=["plainframe-ui-transition-slide",x.props.className||"",u||""].join(" ").trim(),m=x.props.onTransitionEnd;return cloneElement(x,{...x.props,css:g,className:d,onTransitionEnd:R(m)})}let I=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",u||""].join(" ").trim(),css:I,onTransitionEnd:R(),children:e})};var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Nl=de.createContext(null),Hl=()=>{let e=useContext(Nl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Qm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[i,u]=useState(!!n),a=t??i,l=useCallback(p=>{t===void 0&&u(p),o?.(p);},[t,o]);useEffect(()=>{if(!a||!s)return;let p=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",p,true),()=>window.removeEventListener("keydown",p,true)},[a,s,l]);let c=useMemo(()=>({open:a,setOpen:l,lockScroll:r,closeOnEscape:s}),[a,l,r,s]);return jsx(Nl.Provider,{value:c,children:e})},Ll=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:i}=Hl(),u=!!e&&de.isValidElement(t),a=useCallback(c=>{if(u){let p;de.isValidElement(t)&&(p=t.props.onClick),p?.(c);}r.onClick?.(c),c.defaultPrevented||i(true);},[u,t,r.onClick,i]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i(true)),u){let p;de.isValidElement(t)&&(p=t.props.onKeyDown),p?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,i]);if(u){let c=t,p=c.props.css;return de.cloneElement(c,{...c.props||{},className:[c.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,o].filter(Boolean),"aria-haspopup":"dialog",onClick:a,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:a,onKeyDown:l,...r,children:t})});Ll.displayName="ModalTrigger";var Bl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:i=true,backdropBlur:u=true,backdropBlurDepth:a=5,closeOnClickAway:l=true,transitionVariant:c="fade",direction:p="up",transitionDuration:h=300,containerCss:f,backdropCss:R,className:I,...x},C)=>{let g=j(),{open:d,setOpen:m,lockScroll:v}=Hl(),D=de.useRef(null),T=de.useRef(null);de.useEffect(()=>{if(!d)return;T.current=document.activeElement;let k=setTimeout(()=>{let M=D.current;if(!M)return;let b=M.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');b.length>0?b[0].focus():M.focus();},100),A=M=>{let b=D.current;if(!b||!M.target)return;let y=M.target;if(!b.contains(y)){M.preventDefault();let P=b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');P.length>0?P[0].focus():b.focus();}};return document.addEventListener("focusin",A,true),()=>{clearTimeout(k),document.removeEventListener("focusin",A,true),T.current&&typeof T.current.focus=="function"&&T.current.focus();}},[d]);let w=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),F=css({width:"100%",height:qs(o),maxWidth:t==="inset"?`min(${qs(n)||"100%"}, calc(100% - ${w} * 2))`:qs(n),maxHeight:t==="inset"?`calc(100% - ${w} * 2)`:"100%",margin:t==="inset"?w:void 0}),B=jsx(Bn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",I||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[F,f],ref:k=>{D.current=k,typeof C=="function"?C(k):C&&(C.current=k);},...x,children:e}),W=c==="none"?B:c==="slide"?jsx(Us,{on:d,direction:p,duration:h,children:B}):c==="grow"?jsx(Ws,{initialScale:.75,on:d,duration:h,children:B}):jsx(Os,{on:d,duration:h,children:B});if(!i)return jsx(Fragment,{children:W});let O=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(ws,{on:d,blur:u,blurDepth:a,onClickAway:l?()=>m(false):void 0,css:[O,R].filter(Boolean),contentCss:O,lockScroll:v,children:W})});Bl.displayName="ModalContent";var lf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:i=false,showFirstLast:u=false,loop:a=false,variant:l="subtle",gap:c,className:p,css:h})=>{let f=j(),R=he(),I=t!==void 0,[x,C]=useState(n),g=Math.max(1,e),d=Sr(I?t:x,1,g),m=useCallback(E=>{let S=Sr(E,1,g);I||C(S),o?.(S);},[I,g,o]),v=useMemo(()=>cf({count:g,page:d,siblingCount:r,boundaryCount:s}),[g,d,r,s]),D=f.palette?.primary?.[600],T=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,F=f.text?.primary??"#111",B=l==="subtle"?f.surface?.subtleBg:"transparent",W=css({display:"inline-flex",alignItems:"center",gap:c??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:B,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),O=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:F,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:i?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),k=css({width:28,minWidth:28,height:28,padding:0}),A=(E=false)=>css([O,R({color:E?"primary":"neutral"}),l==="outlined"?E?{background:D,color:f.text.onColors.primary,borderColor:D}:{background:"transparent",borderColor:T,":hover":{background:w}}:l==="ghost"?E?{background:D,color:f.text.onColors.primary}:{":hover":{background:w}}:E?{background:D,color:f.text.onColors.primary,borderColor:D}:{":hover":{background:w}}]),M=useCallback(()=>m(1),[m]),b=useCallback(()=>m(g),[m,g]),y=useCallback(()=>{d===1?a&&m(g):m(d-1);},[d,a,g,m]),P=useCallback(()=>{d===g?a&&m(1):m(d+1);},[d,a,g,m]),H=i||d===1&&!a,L=i||d===g&&!a;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",p||""].join(" ").trim(),css:W,onKeyDown:E=>{i||(E.key==="ArrowLeft"&&(E.preventDefault(),y()),E.key==="ArrowRight"&&(E.preventDefault(),P()),E.key==="Home"&&(E.preventDefault(),M()),E.key==="End"&&(E.preventDefault(),b()));},children:[u&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":H,disabled:H,css:[A(false),k],onClick:M,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":H,disabled:H,css:[A(false),k],onClick:y,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),v.map((E,S)=>typeof E=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":E===d?`Page ${E}, current page`:`Go to page ${E}`,"aria-current":E===d?"page":void 0,css:A(E===d),onClick:()=>m(E),children:E},E):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([O,R(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${S}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":L,disabled:L,css:[A(false),k],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),u&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":L,disabled:L,css:[A(false),k],onClick:b,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function cf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Er(1,e);let s=Er(1,Math.min(o,e)),i=Er(Math.max(e-o+1,o+1),e),u=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),a=Sr(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],c=p=>{let h=l[l.length-1];h!==p&&(h==="ellipsis"&&p==="ellipsis"||l.push(p));};return s.forEach(c),u>o+2?c("ellipsis"):o+1<u&&c(o+1),Er(u,a).forEach(c),a<e-o-1?c("ellipsis"):e-o>a&&c(e-o),i.forEach(c),l}function Er(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var mf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,ff=de.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let i=j(),u=i.surface.border,a=css({display:"inline-block",boxSizing:"border-box",maxWidth:mf(n,"fit-content"),width:"100%",padding:`0 ${i.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:a,children:e})});var Wl=createContext(null),yf=()=>{let e=useContext(Wl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},xf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},vf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:i="filled",className:u,children:a,anchorOrigin:l,css:c})=>{let p=j(),h=e!==void 0&&n!==void 0,[f,R]=useState(t),I=h?e:f,x=useRef([]),[C,g]=useState(0),d=()=>g(A=>A+1),m=useCallback(A=>{h||R(A),n?.(A);},[h,n]),v=useCallback(A=>(x.current.push(A),d(),x.current.length-1),[]),D=useCallback((A,M)=>{let b=x.current[A];b&&(x.current[A]={...b,...M},d());},[]),T=()=>x.current.map((A,M)=>({it:A,i:M})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),w=useCallback((A,M)=>{let b=T();if(!b.length)return;let y=Math.max(0,b.indexOf(A)),P=b[(y+M+b.length)%b.length],H=x.current[P]?.ref;if(H){H.focus();let L=x.current[P]?.value;L!==void 0&&m(L);}},[m]),F=useCallback(A=>{let M=T();if(!M.length)return;let b=A==="first"?M[0]:M[M.length-1],y=x.current[b]?.ref;if(y){y.focus();let P=x.current[b]?.value;P!==void 0&&m(P);}},[m]),B=useMemo(()=>{let A=x.current.filter(b=>b.ref&&!b.disabled);return A.length?A.some(b=>b.value===I)?I:A[0]?.value:void 0},[I,C]),W=useMemo(()=>({selected:I,setSelected:m,disabled:o,size:r,direction:s,variant:i,register:v,update:D,moveFocusBy:w,moveToEdge:F,focusValue:B,theme:p,anchorOrigin:xf(l)}),[I,m,o,r,s,i,v,D,w,F,B,p,l]),O=css({width:"fit-content"}),k=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:p.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:u??"plainframe-ui-radio-group",css:[O,c],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:k,children:jsx(Wl.Provider,{value:W,children:a})})})},Cf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:i,disabled:u,size:a,register:l,update:c,moveFocusBy:p,moveToEdge:h,theme:f,variant:R,focusValue:I,anchorOrigin:x}=yf(),C=u||t,g=s===e,d=["sm","md","lg"].includes(a)?a:"md",m=d==="sm"?16:d==="lg"?24:20,v=K=>f.palette?.primary?.[K],D=v(600),T=v(100),w=f.neutral[300],F=f.palette.primary[300],B=f.text.onColors?.primary??f.neutral[0],W="transparent",O=F,k=B;R==="soft"?(W=T,O=null,k=D):R==="outlined"?(W=v(50),O=F,k=D):(W=f.neutral[200],O="transparent",k=B),g&&(R==="outlined"?(W=T,O=F,k=D):R==="filled"?(W=D,O=null,k=B):(W=T,O=null,k=D));let A=R==="filled"?w:f.palette.primary[100],M=useRef(null),b=useRef(-1);useEffect(()=>{b.current=l({ref:M.current,value:e,disabled:!!C});},[l]),useEffect(()=>{c(b.current,{ref:M.current,value:e,disabled:!!C});},[c,C,e]);let y=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:x.vertical==="center"?f.spacing.sm:0,rowGap:x.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:C?.5:1,borderRadius:f.radius.md,cursor:C?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":C||g?{}:{background:A,boxShadow:R==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${F}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),P=css({width:m,height:m,minWidth:m,minHeight:m,borderRadius:f.radius.full,background:W,boxShadow:O?`inset 0 0 0 ${f.componentHeights.border} ${O}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),H=css({width:g?m*.45:0,height:g?m*.45:0,borderRadius:f.radius.full,background:g?k:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),L=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),E=(()=>{let K=x.horizontal,_=x.vertical;return _==="center"?{col:K==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),z=!C&&I===e?0:-1,$=he();return jsxs("button",{ref:M,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":C||void 0,disabled:C,tabIndex:z,onClick:()=>{C||i(e);},onKeyDown:K=>{C||(K.key==="Enter"||K.key===" "?(K.preventDefault(),i(e)):K.key==="ArrowRight"||K.key==="ArrowDown"?(K.preventDefault(),p(b.current,1)):K.key==="ArrowLeft"||K.key==="ArrowUp"?(K.preventDefault(),p(b.current,-1)):K.key==="Home"?(K.preventDefault(),h("first")):K.key==="End"&&(K.preventDefault(),h("last")));},css:[y,$({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[P,css({gridColumn:E.col,gridRow:E.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:H})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:L,children:o})]})};var Sf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:i,asChild:u=false,className:a})=>{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"},c=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&i?.(),h?.(f);};if(u&&isValidElement(e)){let h=e,f=h.props.css,R=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=["plainframe-ui-transition-rotate",h.props.className||"",a||""].join(" ").trim(),x=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:R,className:I,onTransitionEnd:c(x)})}let p=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",a||""].join(" ").trim(),css:p,onTransitionEnd:c(),children:e})};var Js=e=>null;Js.displayName="SelectItem";var Io=(...e)=>e.filter(Boolean).flat();function Ys(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Ys(n,t);return}if(de.isValidElement(e)){if(e.type===Js){t.push(e);return}if(e.type===de.Fragment){Ys(e.props.children,t);return}}}}var _l=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:i,multiple:u=false,disabled:a=false,size:l="md",variant:c="subtle",fullWidth:p,width:h=200,menuAlign:f="left",menuWidth:R,menuMaxHeight:I=280,wrapperCss:x,labelCss:C,triggerCss:g,menuCss:d,optionCss:m,children:v,className:D,menuSize:T="md",triggerRender:w})=>{let F=j(),B=he(),W=de.useId(),O=`${W}-label`,k=`${W}-menu`,A={sm:{minHeight:F.componentHeights.sm,radius:F.radius.sm},md:{minHeight:F.componentHeights.md,radius:F.radius.md},lg:{minHeight:F.componentHeights.lg,radius:F.radius.md}},M=A[l]||A.md,[b,y]=de.useState(false),P=Z=>y(!!Z),H=typeof e<"u",L=u||Array.isArray(e)||Array.isArray(t),[E,S]=de.useState(()=>typeof t<"u"?t:L?[]:void 0),z=H?e:E,$=Z=>{H||S(Z),n?.(Z);},K=[];Ys(v,K);let _=K.map((Z,ie)=>{let be=Z.props,X=typeof be.children=="string"||typeof be.children=="number"?String(be.children):void 0;return {key:Z.key??ie,value:be.value,startIcon:be.startIcon,endIcon:be.endIcon,node:be.children,labelText:X}}),N=Z=>L?(Array.isArray(z)?z:[]).some(be=>Object.is(be,Z)):Object.is(z,Z),U=de.useMemo(()=>{if(L){let ie=Array.isArray(z)?z:[];return _.filter(X=>ie.some(ye=>Object.is(ye,X.value))).map(X=>X.labelText??X.node)}let Z=_.find(ie=>Object.is(ie.value,z));if(Z)return Z.labelText??Z.node},[z,L,_]),G=Z=>{a||(Object.is(Z,z)||$(Z),P(false));},se=Z=>{if(a)return;let ie=Array.isArray(z)?z:[],X=ie.some(ye=>Object.is(ye,Z))?ie.filter(ye=>!Object.is(ye,Z)):[...ie,Z];$(X);},V={position:"relative",width:p?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},Y={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:M.radius,minHeight:M.minHeight,fontSize:F.typography.sizes.sm,padding:`0 ${typeof F.spacing.sm=="number"?`${F.spacing.sm}px`:F.spacing.sm} 0 ${typeof F.spacing.md=="number"?`${F.spacing.md}px`:F.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:a?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:F.text.primary,background:"transparent",whiteSpace:"nowrap"},le=c==="subtle"?{background:F.surface.subtleBg}:c==="outlined"?{background:F.surface.panelBg,border:`1px solid ${F.surface.border}`}:{background:"transparent"},ue={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Me={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Ce=jsx(ChevronsUpDown,{size:16,css:css({color:F.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),ve=()=>{if(w)return w(U);if(Array.isArray(U)){let ie=U.map(X=>typeof X=="string"?X:"").filter(Boolean),be=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:be,children:be})]})}let Z=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:typeof Z=="string"?Z:void 0,children:Z})]})},we={left:"start",center:"center",right:"end"},Re=Z=>{a||(Z.key==="ArrowDown"||Z.key==="ArrowUp"||Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),P(true));};return jsxs("div",{css:Io(V,x),className:["plainframe-ui-select-wrapper",D||""].join(" ").trim(),children:[o&&jsx("div",{id:O,className:"plainframe-ui-select-label",css:Io({marginBottom:6,fontSize:F.typography.sizes.sm,fontWeight:500,color:F.text.secondary},C),children:o}),jsxs(Pn,{size:T,open:b,onOpenChange:P,children:[jsx(Dn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:a,"aria-haspopup":"menu","aria-expanded":b||void 0,"aria-controls":k,"aria-labelledby":o?O:void 0,onKeyDown:Re,onClick:()=>P(!b),className:"plainframe-ui-select-trigger",css:Io(css(Y),css(le),g,B()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ue),children:ve()}),i??Ce]})}),jsx(dn,{id:k,gap:"xs",align:we[f],sameWidth:R==null,width:R??h,className:"plainframe-ui-select-menu",css:Io({maxHeight:typeof I=="number"?`${I}px`:I,overflowY:"auto"},d),children:_.map((Z,ie)=>{let be=N(Z.value);return jsx(Mt,{startIcon:Z.startIcon,endIcon:Z.endIcon,selected:be,disabled:a,closeOnSelect:!L,onSelect:()=>L?se(Z.value):G(Z.value),css:Io(m),className:"plainframe-ui-select-option",children:Z.node},Z.key??ie)})})]})]})};_l.displayName="Select";var Zs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ff=keyframes`
14
14
  0% { background-position: -200% 0; }
15
15
  100% { background-position: 200% 0; }
16
16
  `,Af=keyframes`
17
17
  0% { opacity: .6; }
18
18
  50% { opacity: 1; }
19
19
  100% { opacity: .6; }
20
- `,Pf=de.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:i,className:u,css:a})=>{let l=j(),c=l.surface.subtleBg,d=l.neutral[200],h=Zs(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":Zs(r,String(r)),height:s==null?"fit-content":Zs(s,String(s))}),R=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:c,willChange:"background-position, opacity"}),I=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${c} 25%, ${d} 50%, ${c} 75%)`,backgroundSize:"200% 100%",animation:`${Ff} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Af} 1.2s ease-in-out infinite`}):css({}),x=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",u||""].join(" ").trim(),css:[f,a],style:i,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[R,I]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:x,children:o})]})});var kr=8,Qs=20,_n=4,Gl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:i=false,rounded:u=false,showValue:a=false,showStepper:l=false,label:c,fullWidth:d=false,css:h,trackCss:f,thumbCss:R,direction:I="horizontal",className:x,...C})=>{let g=j(),p=I==="vertical",m=useRef(null),[v,D]=useState(false),[T,w]=useState(false),[F,B]=useState(false),W=e!==void 0,O=useCallback(X=>Math.min(r,Math.max(o,X)),[o,r]),k=useCallback(X=>O(Math.round((X-o)/s)*s+o),[o,s,O]),[A,M]=useState(()=>k(t??o)),b=W?k(e):A;useEffect(()=>{W||M(X=>k(X));},[o,r,s,W,k]);let y=g.palette.primary[600],P=g.surface.panelBg,H=g.neutral[500],L=useMemo(()=>{let X=r-o||1;return (b-o)/X*100},[b,o,r]),E=useCallback(X=>{W||M(X),n?.(X);},[W,n]),S=useCallback((X,ye)=>{let Q=m.current;if(!Q)return b;let ne=Q.getBoundingClientRect(),ae=p?(ne.bottom-ye)/ne.height:(X-ne.left)/ne.width;return ae=Math.max(0,Math.min(1,ae)),k(o+ae*(r-o))},[b,p,o,r,k]),z=useCallback(X=>{i||(X.currentTarget.setPointerCapture?.(X.pointerId),E(S(X.clientX,X.clientY)),D(true));},[i,E,S]),$=useCallback(X=>{i||(X.currentTarget.setPointerCapture?.(X.pointerId),D(true));},[i]),K=useCallback(X=>{!v||i||E(S(X.clientX,X.clientY));},[v,i,E,S]),_=useCallback(()=>D(false),[]);useEffect(()=>{if(v)return window.addEventListener("pointermove",K),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[v,K,_]);let N=useCallback(X=>{if(i)return;let ye=b;if(X.key==="ArrowRight"||X.key==="ArrowUp")ye=b+s;else if(X.key==="ArrowLeft"||X.key==="ArrowDown")ye=b-s;else if(X.key==="Home")ye=o;else if(X.key==="End")ye=r;else return;X.preventDefault(),E(k(ye));},[i,b,s,o,r,E,k]),U=v||T||F,G=(T||v)&&!i,se=`color-mix(in srgb, ${y} 25%, transparent)`,V=css({display:"flex",flexDirection:p?"row":"column",alignItems:"center",padding:p?"1rem":"1rem 0",width:p?"fit-content":d?"100%":350,height:p?250:"auto",boxSizing:"border-box"}),Y=css({marginBottom:p?0:4,marginRight:p?8:0,color:g.text.primary,userSelect:"none"}),le=css({position:"relative",width:p?kr:"100%",height:p?"100%":kr,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:i?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ue=css({position:"absolute",left:p?"50%":0,top:p?2:"50%",transform:p?"translateX(-50%)":"translateY(-50%)",width:p?kr:`calc(100% - ${_n*.5}px)`,height:p?`calc(100% - ${_n*.5}px)`:kr,display:"flex",flexDirection:p?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),pe=css({width:_n,height:_n,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),Me=css({position:"absolute",left:0,top:p?`calc(${100-L}% )`:0,bottom:0,width:p?"100%":`${L}%`,height:p?`${L}%`:"100%",backgroundColor:i?H:y,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:P,width:Qs,height:Qs,left:p?"50%":`calc(${L}% - ${Qs/2}px)`,bottom:p?`${L}%`:"auto",top:p?"auto":"50%",transform:p?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:u?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${i?H:y}`,cursor:i?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${v?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),ve=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:p?-7.5:-28,left:p?9:-7.5,pointerEvents:"none"}),we=css({position:"absolute",top:p?`calc(50% - ${_n*2.5}px)`:0,left:p?"auto":`calc(50% - ${_n*3}px)`,transform:p?"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:p?"50%":-2,left:p?-2.5:"50%",transform:p?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Re=h,Z=f,ie=R,be=Math.floor((r-o)/s)+1;return jsxs("div",{...C,role:"group","aria-label":c,className:["plainframe-ui-slider",x||""].join(" ").trim(),css:[V,Re],"data-orientation":p?"vertical":"horizontal",children:[c&&!p&&jsx("div",{className:"plainframe-ui-slider-label",css:Y,children:c}),jsxs("div",{ref:m,className:"plainframe-ui-slider-track",css:[le,Z],onPointerDown:z,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ue,children:Array.from({length:be}).map((X,ye)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:pe},ye))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Me}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":b,"aria-disabled":i||void 0,tabIndex:i?-1:0,onKeyDown:N,onPointerDown:$,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Ce,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:ve,initial:{opacity:0,scale:.9,y:p?0:4,x:p?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:p?0:4,x:p?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:we,initial:{opacity:0,y:p?0:4,x:p?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:p?0:4,x:p?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>B(true),onMouseLeave:()=>B(false),children:b})})}),null]})]}),c&&p&&jsx("div",{className:"plainframe-ui-slider-label",css:[Y,{marginLeft:8}],children:c})]})};Gl.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%"}),zf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Of=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"}),Wf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Kf=(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"}),_f=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),jf=(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"}}),Vf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Xl=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"}),Uf=(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}),qf=de.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:i,isActive:u,completed:a,disabled:l,connectorColor:c,showConnector:d,animate:h,separator:f,canGoToIndex:R,setSelected:I}){let x=j(),C=he(),{MAIN:g,ACTIVE_TEXT:p,ACTIVE_TEXT_OUTLINED:m,COMPLETE_BG:v,COMPLETE_FG:D,UPCOMING_BG_FILLED:T,UPCOMING_OUTLINE:w,UPCOMING_FG:F}=r,B="transparent",W=F,O=w;s==="subtle"?a?(B=v,W=D,O=v):u?(B=g,W=p,O=g):(B=T,W=F,O=T):a?(B=v,W=D,O=v):u?(B="transparent",W=m,O=g):(B="transparent",W=F,O=w);let k=n.label,A=n.icon??jsx("span",{css:Vf,children:typeof k=="number"?k:t+1}),M=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Of(i),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[jf(o,B,W,O,String(x.radius.full)),!l&&C({color:u?"primary":"neutral"})],onClick:()=>{!l&&R(t)&&I(n.value);},tabIndex:l?-1:0,"aria-current":u?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof k=="string"?k:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Xl(!a),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Xl(!!a),children:M})]}),k&&jsx("span",{className:"plainframe-ui-step-label",css:Uf(a||u,x.text.primary,x.text.secondary,String(x.radius.xs),Number(x.spacing.xs)),children:k})]}),d&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:_f,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Wf(x.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Kf(a?1:0,c,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),na=()=>null;na.displayName="PlainframeUIStep";var Gf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:i=false,color:u,activeBgColor:a,activeColor:l,completeBgColor:c,completeColor:d,separator:h,titlePosition:f="right",width:R,css:I,className:x,children:C,...g})=>{let p=j(),m=e==="outlined"?"outlined":"subtle",v=de.useMemo(()=>{let S=de.Children.toArray(C).filter(z=>de.isValidElement(z)&&z.type===na);return S.length?S.map((z,$)=>({index:$,...z.props})):[{value:1},{value:2},{value:3}]},[C]),D=de.useCallback((S,z)=>S?p.palette?.[S]??S:z,[p.palette]),T=de.useMemo(()=>({MAIN:String(D(a,typeof p.palette.primary[600]=="string"?p.palette.primary[600]:"")),ACTIVE_TEXT:String(D(l,typeof p.text.onColors?.primary=="string"?p.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(D(l,typeof p.text.primary=="string"?p.text.primary:"")),COMPLETE_BG:String(D(c,typeof p.palette.primary[600]=="string"?p.palette.primary[600]:"")),COMPLETE_FG:String(D(d,typeof p.text.onColors?.primary=="string"?p.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof p.neutral[100]=="string"?p.neutral[100]:""),UPCOMING_OUTLINE:String(typeof p.neutral[300]=="string"?p.neutral[300]:""),UPCOMING_FG:String(typeof p.text.secondary=="string"?p.text.secondary:"")}),[D,a,l,c,d,p.palette.primary,p.neutral,p.text]),w=de.useMemo(()=>{let S=D(u,p.palette.primary[600]);return typeof S=="string"?S:String(S)},[D,u,p.palette.primary]),[F,B]=de.useState(()=>v.some(z=>z?.value===n)?n:v[0]?.value),W=t!==void 0,O=W?t:F,{activeIndex:k,afterLast:A}=de.useMemo(()=>{let S=v.findIndex(z=>z.value===O);if(S!==-1)return {activeIndex:S,afterLast:false};if(typeof O=="number"){let z=Math.floor(O)-1;if(z>=v.length)return {activeIndex:v.length-1,afterLast:true};if(z>=0)return {activeIndex:z,afterLast:false}}return {activeIndex:0,afterLast:false}},[v,O]),M=de.useCallback(S=>{r||(W||B(S),o?.(S));},[r,W,o]),b=de.useCallback(S=>i||!!v[S]?.complete||(A?true:S<k),[i,v,A,k]),y=de.useCallback(S=>{if(r)return false;let z=v[S];if(!z||z.disabled)return false;if(typeof s=="boolean"){if(s===false&&S>k)return false}else if(typeof s=="function"&&!s(k,S))return false;return true},[r,v,s,k]),[P,H]=de.useState(false);de.useEffect(()=>{let S=requestAnimationFrame(()=>H(true));return ()=>cancelAnimationFrame(S)},[]);let L=de.useCallback(S=>{if(!v.length||r)return;let z=k;if(S.key==="ArrowRight")z=Math.min(v.length-1,k+1);else if(S.key==="ArrowLeft")z=Math.max(0,k-1);else if(S.key==="Home")z=0;else if(S.key==="End")z=v.length-1;else return;S.preventDefault(),y(z)&&M(v[z].value);},[v,r,k,y,M]),E=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",x||""].join(" ").trim(),css:[$f(R),I],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:L,css:zf,children:v.map((S,z)=>jsx(de.Fragment,{children:jsx(qf,{i:z,item:S,size:E,tokens:T,variant:m,titlePosition:f,isActive:!A&&z===k,completed:b(z),disabled:r||!!S.disabled,connectorColor:w,showConnector:z<v.length-1,animate:P,separator:h,canGoToIndex:y,setSelected:M})},String(S.value??z)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Ar=()=>null;Ar.displayName="PF.TabContent";function Yf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Jf=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:i,shadow:u=false,width:a,fullWidth:l=false,rounded:c=false,titlePosition:d="right",align:h,css:f,trackCss:R,thumbCss:I,activeTabCss:x,activeIndicatorCss:C})=>{let g=j(),p=he(),m=s==="vertical",v=l||a!=null,D=h??(m?"left":"center"),T={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:F}=de.useMemo(()=>{let Q=[],ne=[];return de.Children.forEach(e,ae=>{if(!de.isValidElement(ae))return;let{type:me,props:Ae}=Yf(ae),He=me===Fr||me?.displayName===Fr.displayName,J=me===Ar||me?.displayName===Ar.displayName;if(He){let oe=Ae;if(oe?.value===void 0)return;Q.push({value:oe.value,disabled:oe.disabled,node:oe.children,className:oe.className,css:oe.css,activeCss:oe.activeCss});}else if(J){let oe=Ae;if(oe?.value===void 0)return;ne.push({value:oe.value,node:oe.children,className:oe.className,css:oe.css});}}),{tabs:Q,contents:ne}},[e]),B=de.useMemo(()=>w.find(Q=>!Q.disabled)?.value,[w]),[W,O]=de.useState(()=>t!==void 0&&w.some(ne=>ne.value===t&&!ne.disabled)?t:B),k=n!==void 0,A=k?n:W,M=de.useRef(null),b=de.useRef([]),y=Math.max(0,w.findIndex(Q=>Q.value===A)),[P,H]=de.useState({left:0,top:0,width:0,height:0}),[L,E]=de.useState(false),[S,z]=de.useState(false),$=de.useCallback(()=>{let Q=M.current,ne=b.current[y];if(!Q||!ne)return;let ae=Q.getBoundingClientRect(),me=ne.getBoundingClientRect();H({left:me.left-ae.left,top:me.top-ae.top,width:me.width,height:me.height});},[y]);de.useLayoutEffect(()=>{$(),L||(E(true),requestAnimationFrame(()=>z(true)));},[$,L]),de.useEffect(()=>{let Q=new ResizeObserver(()=>$());M.current&&Q.observe(M.current);let ne=b.current[y];ne&&Q.observe(ne);let ae=()=>$();return window.addEventListener("resize",ae),()=>{Q.disconnect(),window.removeEventListener("resize",ae);}},[$,y]);let K=(Q,ne)=>{if(!w.length)return Q;let ae=Q;for(let me=0;me<w.length;me++)if(ae=(ae+ne+w.length)%w.length,!w[ae].disabled)return ae;return Q},_=Q=>{k||O(Q),o?.(Q);},N=Q=>{if(!w.length)return;let ne=y;if(Q.key===(m?"ArrowDown":"ArrowRight"))ne=K(y,1);else if(Q.key===(m?"ArrowUp":"ArrowLeft"))ne=K(y,-1);else if(Q.key==="Home")ne=w.findIndex(me=>!me.disabled);else if(Q.key==="End"){let me=[...w].reverse().findIndex(Ae=>!Ae.disabled);ne=me===-1?y:w.length-1-me;}else return;Q.preventDefault();let ae=w[ne]?.value;ae!==void 0&&_(ae),requestAnimationFrame(()=>b.current[ne]?.focus());},U=g.text.primary,G=g.text.secondary,se=g.neutral[500],V=r==="subtle"?g.surface.subtleBg:"transparent",Y=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",le=g.text.primary,ue=r==="subtle"||r==="ghost"||r==="underlined",pe=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":a==null?"auto":typeof a=="number"?`${a}px`:a}),Me=r==="subtle",Ce=css({position:"relative",display:v?"flex":"inline-flex",width:v?"100%":"auto",flexDirection:m?"column":"row",alignItems:m?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:Me?g.spacing.xs:0,background:V,borderRadius:r==="subtle"?c?m?g.radius.lg:g.radius.full:g.radius.lg:"none"}),ve=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:L?1:0,visibility:L?"visible":"hidden",transition:S?`${m?"top":"left"} .24s var(--pf-ease), ${m?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?c?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":Y,...m?{top:`${P.top}px`,height:`${P.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${P.left}px`,width:`${P.width}px`,top:g.spacing.xs,bottom:g.spacing.xs},boxShadow:u&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),we=css(r!=="underlined"?{}:m?{background:"transparent",top:`${P.top}px`,height:`${P.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${P.left}px`,width:`${P.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),Re=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")&&c?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...m?{width:v?"100%":"auto",flex:"0 0 auto",textAlign:D}:v?{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}}),Z=css({display:"inline-flex",alignItems:"center",justifyContent:m?T[D]:"center",gap:6,width:"100%",flexDirection:d==="top"?"column-reverse":d==="bottom"?"column":d==="left"?"row-reverse":"row"}),ie=css({marginTop:g.spacing.sm,width:"100%"}),be=de.useId(),X=new Map;F.forEach((Q,ne)=>X.set(Q.value,`${be}-panel-${ne}`));let ye=Q=>`${be}-tab-${Q}`;return jsxs("div",{className:["plainframe-ui-tabs",i||""].join(" ").trim(),css:[pe,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:M,role:"tablist","aria-orientation":m?"vertical":"horizontal",onKeyDown:N,css:[Ce,R],children:[ue&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[ve,we,I,C]}),w.map((Q,ne)=>{let ae=A===Q.value;return jsx("button",{ref:me=>{b.current[ne]=me;},role:"tab",id:ye(ne),"aria-selected":ae,"aria-controls":X.get(Q.value),"aria-disabled":Q.disabled||void 0,disabled:Q.disabled,tabIndex:Q.disabled?-1:ne===y?0:-1,className:["plainframe-ui-tab",Q.className||""].join(" ").trim(),onClick:()=>{Q.disabled||_(Q.value);},css:[Re,!Q.disabled&&p(),Q.css,ae?Q.activeCss??x:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Z,children:Q.node})},String(Q.value??ne))})]}),F.map((Q,ne)=>{let ae=Q.value===A;if(!ae)return null;let me=w.findIndex(He=>He.value===Q.value),Ae=me>=0?ye(me):void 0;return console.log("rendering panel for",Q.value,"active:",ae),jsx("div",{role:"tabpanel",id:X.get(Q.value),"aria-labelledby":Ae,className:["plainframe-ui-tab-panel",Q.className||""].join(" ").trim(),css:[ie,Q.css],children:Q.node},ne)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,hn=e=>e==null?[]:Array.isArray(e)?e:[e],Fo=(...e)=>css(e.filter(Boolean)),og=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:i,disabled:u=false,fullWidth:a=false,width:l=235,size:c="md",variant:d="subtle",rounded:h=false,rows:f=3,maxRows:R,maxLength:I,showCharCount:x,focusRingMode:C="always",resizable:g=false,className:p,wrapperCss:m,inputCss:v,labelCss:D,helperRowCss:T,helperTextCss:w,charCountCss:F,css:B,onBlur:W,onFocus:O,onKeyDown:k,autoFocus:A,name:M,id:b,tabIndex:y,autoComplete:P,readOnly:H,required:L})=>{let E=j(),S=Xo(),z=useId(),$=useMemo(()=>({sm:{fontSize:E.typography.sizes.sm,minHeight:E.componentHeights.sm,labelFont:E.typography.sizes.xs,helperFont:E.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:E.spacing.md},md:{fontSize:E.typography.sizes.sm,minHeight:E.componentHeights.md,labelFont:E.typography.sizes.sm,helperFont:E.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:E.spacing.md},lg:{fontSize:E.typography.sizes.sm,minHeight:E.componentHeights.lg,labelFont:E.typography.sizes.md,helperFont:E.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:E.spacing.md}}),[E]),K=["sm","md","lg"].includes(c)?c:"md",_=$[K],N=E.neutral,U=E.text,G=t!==void 0,[se,V]=useState(n),Y=G?t:se,le=useCallback(ae=>{G||V(ae),o?.(ae);},[G,o]),ue=useMemo(()=>u?N[200]:s&&d==="outlined"?E.palette.danger?.[50]??E.surface.panelBg:s&&d==="subtle"?E.palette.danger?.[50]??E.surface.subtleBg:d==="outlined"?E.surface.panelBg:d==="subtle"?E.surface.subtleBg:"transparent",[u,s,d,N,E.surface,E.palette.danger]),pe=E.componentHeights.border,Me=useMemo(()=>d==="outlined"?`${pe} solid ${s?E.palette.danger?.[300]??E.surface.border:E.surface.border}`:"none",[d,pe,s,E.palette.danger,E.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:a?"100%":l!=null?Mo(l):void 0,flex:"0 0 auto",fontWeight:500}),[a,l]),ve=useMemo(()=>Fo({fontSize:_.labelFont,fontWeight:500,color:s?E.palette.danger?.[700]??U.primary:u?N[500]:U.primary,marginBottom:4,display:"inline-block"},...hn(D)),[_.labelFont,s,u,N,U,E.palette.danger,D]),we=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:E.spacing.sm,padding:`${Mo(_.paddingY)} 0 ${Mo(_.paddingY)} ${Mo(_.paddingX)}`,background:ue,border:Me,borderRadius:h?E.radius.full:E.radius.md,minHeight:_.minHeight,width:"100%",cursor:u?"not-allowed":"text",opacity:u?.65:1,transition:"box-shadow .18s, border-color .16s"},...hn(m),...hn(B)],[E,_,ue,Me,pe,h,u,m,B]),Re=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,Z=useMemo(()=>Fo({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:u?N[500]:s?E.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Mo(_.paddingX),overflowY:"auto",minHeight:Re,"&::placeholder":{color:s?E.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?E.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${ue} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?E.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Re} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...hn(v)),[g,_,u,s,N,U,E.palette.danger,Re,ue,f,v]),ie=useMemo(()=>Fo({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...hn(T)),[T]),be=useMemo(()=>Fo({fontSize:_.helperFont,color:s?E.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...hn(w)),[_.helperFont,s,E.palette.danger,U,w]),X=useMemo(()=>Fo({fontSize:_.helperFont,color:I&&Y.length>I?E.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...hn(F)),[_.helperFont,I,Y.length,E.palette.danger,U,F]),ye=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=ye.current;if(!ae)return;if(g){let Ae=window.getComputedStyle(ae),He=parseFloat(Ae.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);return}(()=>{let Ae=window.getComputedStyle(ae),He=parseFloat(Ae.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);let re=R?He*R:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,re)}px`;})();},[Y,f,R,_.minHeight,g]);let Q=i!=null||x?`${b??z}-help`:void 0,ne=b??z;return jsxs("div",{className:["plainframe-ui-textarea",p||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:ne,className:"plainframe-ui-textarea-label",css:ve,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[S({enabled:C!=="none",disabled:u,color:s?"danger":void 0}),we],"aria-invalid":!!s||void 0,"aria-disabled":u||void 0,onClick:()=>!u&&ye.current?.focus(),children:jsx("textarea",{ref:ye,id:ne,className:"plainframe-ui-textarea-input",css:Z,rows:f,value:Y,onChange:ae=>{let me=ae.target.value;I&&me.length>I||le(me);},placeholder:r||"",disabled:u,onBlur:W,onFocus:O,onKeyDown:k,autoFocus:A,name:M,tabIndex:y,autoComplete:P,readOnly:H,required:L,"aria-invalid":!!s||void 0,"aria-describedby":Q})}),(i!=null||x&&I!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:Q,className:"plainframe-ui-textarea-helper-text",css:be,children:i}),x&&I!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:X,children:[Y.length,"/",I]})]})]})};var dg=jo,pg={type:"spring",stiffness:920,damping:100},Zl="__toast_root__",mg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Dr=(e,t)=>{for(let n of t){let o=mg(e,n);if(o!=null&&o!=="")return o}},ra=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function fg(e){let t=Dr(e,["radius.md","shape.borderRadius","radii.md"]),n=Dr(e,["spacing.lg","space.4","spacing.4"]),o=Dr(e,["spacing.md","space.3","spacing.3"]),r=Dr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:ra(t,16),padX:ra(n,14),padY:ra(o,12),shadow:String(r)}}var gg=fg(dg),Lt=null,jn=null,ge={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function tc(){typeof document>"u"||(Lt||(Lt=document.getElementById("toast-host"),Lt||(Lt=document.createElement("div"),Lt.id="toast-host",document.body.appendChild(Lt))),jn||(jn=Lt[Zl]??null,jn||(jn=createRoot(Lt),Lt[Zl]=jn,jn.render(jsx(Na,{children:jsx(Sg,{})})))));}var ee={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}};}},yn=()=>{ee.sync(),ee.notify();},bg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Nr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||ee.timers.has(e.id))return;let o=Date.now(),r=ee.remaining.get(e.id),s=r!=null?Math.max(0,r):n;ee.expiry.set(e.id,o+s);let i=window.setTimeout(()=>De.dismiss(e.id),s);ee.timers.set(e.id,i);}function Hr(e){let t=ee.timers.get(e);t&&(clearTimeout(t),ee.timers.delete(e));}function hg(){let e=false;for(;ee.displayed.length<ge.max&&ee.queue.length;){let t=ee.queue.shift();ee.displayed=[t,...ee.displayed],ee.enterFrom[t.id]="head",ee.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete ee.entering[t.id],yn();}),Nr(t);}e&&yn();}function yg(){if(ee.displayed.length<ge.max)return;let e=ee.displayed.filter(o=>!ee.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=ee.expiry.get(t.id);n!=null&&ee.remaining.set(t.id,Math.max(0,n-Date.now())),Hr(t.id),ee.exiting[t.id]=true,ee.displayed=ee.displayed.filter(o=>o.id!==t.id),delete ee.enterFrom[t.id],ee.queue.push(t),yn();}var xg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function vg(e,t){let n=xg(t),o=e,r=o.surface,s=o.text,i=r?.panelBg??"#fff",u=s?.primary??"#111",a=r?.border;if(n==="default"||n==="info")return {bg:i,fg:u,border:a};let l=s?.onColors??{},c=(d,h,f)=>{let R=o.colors,I=o.palette;return {bg:R?.[d]??I?.[d]?.[700]??h,fg:l?.[d]??f,border:"transparent"}};return n==="success"?c("success","#22C55E","#fff"):n==="warning"?c("warning","#F59E0B","#fff"):n==="error"?c("error","#EF4444","#fff"):{bg:i,fg:u,border:a}}var De=Object.assign((e,t)=>{tc();let n=a=>a!=null&&typeof a[Symbol.iterator]=="function",o=a=>!!a&&(typeof a=="object"||typeof a=="function")&&typeof a.then=="function",r;typeof e=="object"&&e!=null&&!de.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(de.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??bg(),i=a=>{let l=a.findIndex(h=>h.id===s);if(l===-1)return false;let c=a[l],d={...c,status:r.status??c.status,content:r.content??c.content,title:r.title??c.title,description:r.description??c.description,startIcon:r.startIcon??c.startIcon,endIcon:r.endIcon??c.endIcon,action:r.action??c.action,onClose:r.onClose??c.onClose,duration:r.duration===void 0?c.duration:r.duration,pauseOnHover:r.pauseOnHover??c.pauseOnHover,showDismiss:r.showDismiss??c.showDismiss,render:r.render??c.render,bare:r.bare??c.bare,onClick:r.onClick??c.onClick,width:r.width??c.width};return a[l]=d,Hr(s),ee.remaining.delete(s),ee.paused.has(s)||Nr(d),yn(),true};if(i(ee.displayed)||i(ee.queue))return s;let u={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?ge.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 ee.displayed.length>=ge.max&&yg(),ee.displayed=[...ee.displayed,u],ee.enterFrom[u.id]="tail",ee.entering[u.id]=true,requestAnimationFrame(()=>{delete ee.entering[u.id],yn();}),yn(),Nr(u),s},{success:(e,t={})=>De(e,{...t,status:"success"}),error:(e,t={})=>De(e,{...t,status:"error"}),warning:(e,t={})=>De(e,{...t,status:"warning"}),info:(e,t={})=>De(e,{...t,status:"info"}),custom:(e,t={})=>De(e,{...t}),update:(e,t)=>De({id:e,...t}),dismiss:e=>{if(!e){let n=ee.displayed.find(o=>!ee.exiting[o.id])?.id;n&&De.dismiss(n);return}Hr(e),ee.remaining.delete(e),ee.paused.delete(e),ee.exiting[e]=true;let t=ee.displayed.find(n=>n.id===e);ee.displayed=ee.displayed.filter(n=>n.id!==e),delete ee.enterFrom[e],yn(),window.setTimeout(()=>t?.onClose?.(),120),hg();},clear:()=>{[...ee.displayed.map(t=>t.id)].forEach(t=>De.dismiss(t));},pause:e=>{if(ee.paused.has(e))return;let t=ee.expiry.get(e);t!=null&&ee.remaining.set(e,Math.max(0,t-Date.now())),ee.paused.add(e),Hr(e);},resume:e=>{if(!ee.paused.has(e))return;ee.paused.delete(e);let t=ee.displayed.find(o=>o.id===e)??ee.queue.find(o=>o.id===e),n=ee.remaining.get(e);t&&Nr(t,n??void 0),ee.remaining.delete(e);},pauseLatest:()=>{let e=ee.displayed.at(-1);e&&De.pause(e.id);},resumeLatest:()=>{let e=ee.displayed.at(-1);e&&De.resume(e.id);},promise:(e,t,n={})=>{let o=De(t.loading,{...n,status:"info",duration:null});return e.then(r=>{De.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{De.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ge.max=e.max),e.position&&(ge.position=e.position),e.gutter!=null&&(ge.gutter=e.gutter),e.zIndex!=null&&(ge.zIndex=e.zIndex),e.duration!==void 0&&(ge.duration=e.duration),e.showDismiss&&(ge.showDismiss=e.showDismiss),e.styles&&(ge.styles={...ge.styles,...e.styles}),e.renderer!==void 0&&(ge.renderer=e.renderer),e.bareRenderer!==void 0&&(ge.bareRenderer=e.bareRenderer);}});function Cg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ge.showDismiss}function Rg(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 Tg=css({display:"flex",alignItems:"flex-start",gap:10}),Ql=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),wg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Eg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Sg=de.memo(function(){let t=useSyncExternalStore(ee.subscribe.bind(ee),()=>ee.snapshot,()=>ee.snapshot),n=j(),o=ge.position.startsWith("bottom"),r=de.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=de.useMemo(()=>({position:"fixed",zIndex:ge.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Rg(ge.position),...ge.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((i,u)=>{let a=t.enterFrom[i.id]||"tail",l=o?a==="head"?-16:16:a==="head"?16:-16,c=u>0?ge.gutter:0,d={toast:i,close:De.dismiss,pause:De.pause,resume:De.resume},{bg:h,fg:f,border:R}=vg(n,i.status),I={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:gg.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:i.onClick?"pointer":"default",border:R?`1px solid ${R}`:"1px solid transparent"},x=typeof ge.styles.surface=="function"?ge.styles.surface(i):ge.styles.surface??{},C=Cg(i.showDismiss),g={},p="& .plainframe-ui-toast-close",m="&:hover .plainframe-ui-toast-close";C==="hover"?(g[p]={opacity:0,pointerEvents:"none"},g[m]={opacity:1,pointerEvents:"auto"}):C==="always"?g[p]={opacity:1,pointerEvents:"auto"}:C==="never"&&(g[p]={display:"none"});let v=css({...I,...x,...g}),D=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",...ge.styles.close??{}}),T;if(i.bare&&i.render){let w=typeof i.render=="function"?i.render(d):i.render;T=jsx("div",{style:{pointerEvents:"auto"},onClick:F=>i.onClick?.(i.id,F),children:w});}else if(ge.bareRenderer&&ge.renderer){let w=typeof ge.renderer=="function"?ge.renderer(d):ge.renderer;T=jsx("div",{style:{pointerEvents:"auto"},onClick:F=>i.onClick?.(i.id,F),children:w});}else {let w;ge.renderer?w=typeof ge.renderer=="function"?ge.renderer(d):ge.renderer:i.render&&!i.bare?w=typeof i.render=="function"?i.render(d):i.render:w=jsxs(Fragment,{children:[jsxs("div",{css:Tg,children:[i.startIcon&&jsx("div",{css:Ql,children:i.startIcon}),jsx("div",{css:wg,children:i.content}),i.endIcon&&jsx("div",{css:Ql,children:i.endIcon})]}),i.action&&jsx("div",{css:Eg,children:i.action})]}),T=jsxs("div",{css:v,onClick:F=>i.onClick?.(i.id,F),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:D,onClick:F=>{F.stopPropagation(),De.dismiss(i.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Ig,{id:i.id,isBottom:o,mt:c,enterY:l,width:i.width,pauseOnHover:i.pauseOnHover!==false,children:T},i.id)})})})}),Ig=de.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:i,pauseOnHover:u,children:a}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:pg});},[l]);let c={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:i!=null?typeof i=="number"?`${i}px`:i:"none",...ge.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(c),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:(d,h)=>{let f=Math.abs(h.offset.x),R=Math.abs(h.velocity.x);if(!(f>60||R>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let C=(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:C,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:g}}).then(()=>De.dismiss(n));},onMouseEnter:u?()=>De.pause(n):void 0,onMouseLeave:u?()=>De.resume(n):void 0,children:a})}),ec=false;(function(){ec||(ec=true,tc());})();var Yg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},rc=createContext(null),sc=()=>{let e=useContext(rc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Jg=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:i=true,autoWidth:u=false,disableHoverListener:a=false})=>{let[l,c]=useState(!!o),d=n??l,h=T=>{n===void 0&&c(T),r?.(T);},f=useRef(null),R=useFloating({placement:t,open:d,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),i?arrow({element:f,padding:4}):void 0].filter(Boolean)}),I=useHover(R.context,{enabled:!a,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),x=useFocus(R.context),C=useDismiss(R.context,{escapeKey:true,outsidePress:true}),g=useRole(R.context,{role:"tooltip"}),{getReferenceProps:p,getFloatingProps:m}=useInteractions([I,x,C,g]),v=useId(),D=useMemo(()=>({open:d,setOpen:h,id:v,placement:R.placement,autoWidth:u,allowArrow:!!i,refs:R.refs,floatingStyles:R.floatingStyles,middlewareData:R.middlewareData,getReferenceProps:p,getFloatingProps:m,arrowRef:f}),[d,u,i,R.placement,R.refs,R.floatingStyles,R.middlewareData,p,m]);return jsx(rc.Provider,{value:D,children:e})},Zg=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:i}=sc(),u=de.isValidElement(t),a=u&&typeof t.type=="string";if(e&&u&&a){let l=t,c="ref"in l?l.ref:void 0,d=s({...l.props,"aria-describedby":i,ref:Yg(c,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return de.cloneElement(l,{...d,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":i}),children:t})},Qg=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:i,middlewareData:u,getFloatingProps:a,placement:l,id:c,autoWidth:d,allowArrow:h,arrowRef:f}=sc(),R=j(),I=l.split("-")[0]||"top",C=I==="bottom"?{opacity:0,y:-8,scale:.98}:I==="top"?{opacity:0,y:8,scale:.98}:I==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},g=C,p=I==="bottom"?"center top":I==="top"?"center bottom":I==="left"?"right center":"left center",m=css({zIndex:1300,backgroundColor:R.neutral[900],color:R.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:d?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:p}),v=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:R.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),D=u.arrow,T={top:"bottom",bottom:"top",left:"right",right:"left"}[I];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:c,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[m,n],style:i,initial:C,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"}},...a(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[v,o],style:{left:D?.x!=null?`${D.x}px`:void 0,top:D?.y!=null?`${D.y}px`:void 0,[T]:"-3px"}})]})})})};function ob(){let e=j();return jsx(Global,{styles:css`
20
+ `,Pf=de.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:i,className:u,css:a})=>{let l=j(),c=l.surface.subtleBg,p=l.neutral[200],h=Zs(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":Zs(r,String(r)),height:s==null?"fit-content":Zs(s,String(s))}),R=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:c,willChange:"background-position, opacity"}),I=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${c} 25%, ${p} 50%, ${c} 75%)`,backgroundSize:"200% 100%",animation:`${Ff} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Af} 1.2s ease-in-out infinite`}):css({}),x=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",u||""].join(" ").trim(),css:[f,a],style:i,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[R,I]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:x,children:o})]})});var kr=8,Qs=20,jn=4,Gl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:i=false,rounded:u=false,showValue:a=false,showStepper:l=false,label:c,fullWidth:p=false,css:h,trackCss:f,thumbCss:R,direction:I="horizontal",className:x,...C})=>{let g=j(),d=I==="vertical",m=useRef(null),[v,D]=useState(false),[T,w]=useState(false),[F,B]=useState(false),W=e!==void 0,O=useCallback(X=>Math.min(r,Math.max(o,X)),[o,r]),k=useCallback(X=>O(Math.round((X-o)/s)*s+o),[o,s,O]),[A,M]=useState(()=>k(t??o)),b=W?k(e):A;useEffect(()=>{W||M(X=>k(X));},[o,r,s,W,k]);let y=g.palette.primary[600],P=g.surface.panelBg,H=g.neutral[500],L=useMemo(()=>{let X=r-o||1;return (b-o)/X*100},[b,o,r]),E=useCallback(X=>{W||M(X),n?.(X);},[W,n]),S=useCallback((X,ye)=>{let Q=m.current;if(!Q)return b;let ne=Q.getBoundingClientRect(),ae=d?(ne.bottom-ye)/ne.height:(X-ne.left)/ne.width;return ae=Math.max(0,Math.min(1,ae)),k(o+ae*(r-o))},[b,d,o,r,k]),z=useCallback(X=>{i||(X.currentTarget.setPointerCapture?.(X.pointerId),E(S(X.clientX,X.clientY)),D(true));},[i,E,S]),$=useCallback(X=>{i||(X.currentTarget.setPointerCapture?.(X.pointerId),D(true));},[i]),K=useCallback(X=>{!v||i||E(S(X.clientX,X.clientY));},[v,i,E,S]),_=useCallback(()=>D(false),[]);useEffect(()=>{if(v)return window.addEventListener("pointermove",K),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",K),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[v,K,_]);let N=useCallback(X=>{if(i)return;let ye=b;if(X.key==="ArrowRight"||X.key==="ArrowUp")ye=b+s;else if(X.key==="ArrowLeft"||X.key==="ArrowDown")ye=b-s;else if(X.key==="Home")ye=o;else if(X.key==="End")ye=r;else return;X.preventDefault(),E(k(ye));},[i,b,s,o,r,E,k]),U=v||T||F,G=(T||v)&&!i,se=`color-mix(in srgb, ${y} 25%, transparent)`,V=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":p?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),Y=css({marginBottom:d?0:4,marginRight:d?8:0,color:g.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?kr:"100%",height:d?"100%":kr,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:i?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ue=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?kr:`calc(100% - ${jn*.5}px)`,height:d?`calc(100% - ${jn*.5}px)`:kr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),pe=css({width:jn,height:jn,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),Me=css({position:"absolute",left:0,top:d?`calc(${100-L}% )`:0,bottom:0,width:d?"100%":`${L}%`,height:d?`${L}%`:"100%",backgroundColor:i?H:y,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:P,width:Qs,height:Qs,left:d?"50%":`calc(${L}% - ${Qs/2}px)`,bottom:d?`${L}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:u?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${i?H:y}`,cursor:i?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${v?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),ve=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),we=css({position:"absolute",top:d?`calc(50% - ${jn*2.5}px)`:0,left:d?"auto":`calc(50% - ${jn*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)"}}),Re=h,Z=f,ie=R,be=Math.floor((r-o)/s)+1;return jsxs("div",{...C,role:"group","aria-label":c,className:["plainframe-ui-slider",x||""].join(" ").trim(),css:[V,Re],"data-orientation":d?"vertical":"horizontal",children:[c&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:Y,children:c}),jsxs("div",{ref:m,className:"plainframe-ui-slider-track",css:[le,Z],onPointerDown:z,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ue,children:Array.from({length:be}).map((X,ye)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:pe},ye))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Me}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":b,"aria-disabled":i||void 0,tabIndex:i?-1:0,onKeyDown:N,onPointerDown:$,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Ce,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:ve,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:we,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:()=>B(true),onMouseLeave:()=>B(false),children:b})})}),null]})]}),c&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[Y,{marginLeft:8}],children:c})]})};Gl.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%"}),zf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Of=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"}),Wf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Kf=(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"}),_f=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),jf=(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"}}),Vf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Xl=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"}),Uf=(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}),qf=de.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:i,isActive:u,completed:a,disabled:l,connectorColor:c,showConnector:p,animate:h,separator:f,canGoToIndex:R,setSelected:I}){let x=j(),C=he(),{MAIN:g,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:m,COMPLETE_BG:v,COMPLETE_FG:D,UPCOMING_BG_FILLED:T,UPCOMING_OUTLINE:w,UPCOMING_FG:F}=r,B="transparent",W=F,O=w;s==="subtle"?a?(B=v,W=D,O=v):u?(B=g,W=d,O=g):(B=T,W=F,O=T):a?(B=v,W=D,O=v):u?(B="transparent",W=m,O=g):(B="transparent",W=F,O=w);let k=n.label,A=n.icon??jsx("span",{css:Vf,children:typeof k=="number"?k:t+1}),M=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Of(i),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[jf(o,B,W,O,String(x.radius.full)),!l&&C({color:u?"primary":"neutral"})],onClick:()=>{!l&&R(t)&&I(n.value);},tabIndex:l?-1:0,"aria-current":u?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof k=="string"?k:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Xl(!a),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Xl(!!a),children:M})]}),k&&jsx("span",{className:"plainframe-ui-step-label",css:Uf(a||u,x.text.primary,x.text.secondary,String(x.radius.xs),Number(x.spacing.xs)),children:k})]}),p&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:_f,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Wf(x.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Kf(a?1:0,c,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),na=()=>null;na.displayName="PlainframeUIStep";var Gf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:i=false,color:u,activeBgColor:a,activeColor:l,completeBgColor:c,completeColor:p,separator:h,titlePosition:f="right",width:R,css:I,className:x,children:C,...g})=>{let d=j(),m=e==="outlined"?"outlined":"subtle",v=de.useMemo(()=>{let S=de.Children.toArray(C).filter(z=>de.isValidElement(z)&&z.type===na);return S.length?S.map((z,$)=>({index:$,...z.props})):[{value:1},{value:2},{value:3}]},[C]),D=de.useCallback((S,z)=>S?d.palette?.[S]??S:z,[d.palette]),T=de.useMemo(()=>({MAIN:String(D(a,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(D(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(D(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(D(c,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(D(p,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:"")}),[D,a,l,c,p,d.palette.primary,d.neutral,d.text]),w=de.useMemo(()=>{let S=D(u,d.palette.primary[600]);return typeof S=="string"?S:String(S)},[D,u,d.palette.primary]),[F,B]=de.useState(()=>v.some(z=>z?.value===n)?n:v[0]?.value),W=t!==void 0,O=W?t:F,{activeIndex:k,afterLast:A}=de.useMemo(()=>{let S=v.findIndex(z=>z.value===O);if(S!==-1)return {activeIndex:S,afterLast:false};if(typeof O=="number"){let z=Math.floor(O)-1;if(z>=v.length)return {activeIndex:v.length-1,afterLast:true};if(z>=0)return {activeIndex:z,afterLast:false}}return {activeIndex:0,afterLast:false}},[v,O]),M=de.useCallback(S=>{r||(W||B(S),o?.(S));},[r,W,o]),b=de.useCallback(S=>i||!!v[S]?.complete||(A?true:S<k),[i,v,A,k]),y=de.useCallback(S=>{if(r)return false;let z=v[S];if(!z||z.disabled)return false;if(typeof s=="boolean"){if(s===false&&S>k)return false}else if(typeof s=="function"&&!s(k,S))return false;return true},[r,v,s,k]),[P,H]=de.useState(false);de.useEffect(()=>{let S=requestAnimationFrame(()=>H(true));return ()=>cancelAnimationFrame(S)},[]);let L=de.useCallback(S=>{if(!v.length||r)return;let z=k;if(S.key==="ArrowRight")z=Math.min(v.length-1,k+1);else if(S.key==="ArrowLeft")z=Math.max(0,k-1);else if(S.key==="Home")z=0;else if(S.key==="End")z=v.length-1;else return;S.preventDefault(),y(z)&&M(v[z].value);},[v,r,k,y,M]),E=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",x||""].join(" ").trim(),css:[$f(R),I],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:L,css:zf,children:v.map((S,z)=>jsx(de.Fragment,{children:jsx(qf,{i:z,item:S,size:E,tokens:T,variant:m,titlePosition:f,isActive:!A&&z===k,completed:b(z),disabled:r||!!S.disabled,connectorColor:w,showConnector:z<v.length-1,animate:P,separator:h,canGoToIndex:y,setSelected:M})},String(S.value??z)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Ar=()=>null;Ar.displayName="PF.TabContent";function Yf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Jf=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:i,shadow:u=false,width:a,fullWidth:l=false,rounded:c=false,titlePosition:p="right",align:h,css:f,trackCss:R,thumbCss:I,activeTabCss:x,activeIndicatorCss:C})=>{let g=j(),d=he(),m=s==="vertical",v=l||a!=null,D=h??(m?"left":"center"),T={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:F}=de.useMemo(()=>{let Q=[],ne=[];return de.Children.forEach(e,ae=>{if(!de.isValidElement(ae))return;let{type:me,props:Ae}=Yf(ae),He=me===Fr||me?.displayName===Fr.displayName,J=me===Ar||me?.displayName===Ar.displayName;if(He){let oe=Ae;if(oe?.value===void 0)return;Q.push({value:oe.value,disabled:oe.disabled,node:oe.children,className:oe.className,css:oe.css,activeCss:oe.activeCss});}else if(J){let oe=Ae;if(oe?.value===void 0)return;ne.push({value:oe.value,node:oe.children,className:oe.className,css:oe.css});}}),{tabs:Q,contents:ne}},[e]),B=de.useMemo(()=>w.find(Q=>!Q.disabled)?.value,[w]),[W,O]=de.useState(()=>t!==void 0&&w.some(ne=>ne.value===t&&!ne.disabled)?t:B),k=n!==void 0,A=k?n:W,M=de.useRef(null),b=de.useRef([]),y=Math.max(0,w.findIndex(Q=>Q.value===A)),[P,H]=de.useState({left:0,top:0,width:0,height:0}),[L,E]=de.useState(false),[S,z]=de.useState(false),$=de.useCallback(()=>{let Q=M.current,ne=b.current[y];if(!Q||!ne)return;let ae=Q.getBoundingClientRect(),me=ne.getBoundingClientRect();H({left:me.left-ae.left,top:me.top-ae.top,width:me.width,height:me.height});},[y]);de.useLayoutEffect(()=>{$(),L||(E(true),requestAnimationFrame(()=>z(true)));},[$,L]),de.useEffect(()=>{let Q=new ResizeObserver(()=>$());M.current&&Q.observe(M.current);let ne=b.current[y];ne&&Q.observe(ne);let ae=()=>$();return window.addEventListener("resize",ae),()=>{Q.disconnect(),window.removeEventListener("resize",ae);}},[$,y]);let K=(Q,ne)=>{if(!w.length)return Q;let ae=Q;for(let me=0;me<w.length;me++)if(ae=(ae+ne+w.length)%w.length,!w[ae].disabled)return ae;return Q},_=Q=>{k||O(Q),o?.(Q);},N=Q=>{if(!w.length)return;let ne=y;if(Q.key===(m?"ArrowDown":"ArrowRight"))ne=K(y,1);else if(Q.key===(m?"ArrowUp":"ArrowLeft"))ne=K(y,-1);else if(Q.key==="Home")ne=w.findIndex(me=>!me.disabled);else if(Q.key==="End"){let me=[...w].reverse().findIndex(Ae=>!Ae.disabled);ne=me===-1?y:w.length-1-me;}else return;Q.preventDefault();let ae=w[ne]?.value;ae!==void 0&&_(ae),requestAnimationFrame(()=>b.current[ne]?.focus());},U=g.text.primary,G=g.text.secondary,se=g.neutral[500],V=r==="subtle"?g.surface.subtleBg:"transparent",Y=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",le=g.text.primary,ue=r==="subtle"||r==="ghost"||r==="underlined",pe=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":a==null?"auto":typeof a=="number"?`${a}px`:a}),Me=r==="subtle",Ce=css({position:"relative",display:v?"flex":"inline-flex",width:v?"100%":"auto",flexDirection:m?"column":"row",alignItems:m?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:Me?g.spacing.xs:0,background:V,borderRadius:r==="subtle"?c?m?g.radius.lg:g.radius.full:g.radius.lg:"none"}),ve=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:L?1:0,visibility:L?"visible":"hidden",transition:S?`${m?"top":"left"} .24s var(--pf-ease), ${m?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?c?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":Y,...m?{top:`${P.top}px`,height:`${P.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${P.left}px`,width:`${P.width}px`,top:g.spacing.xs,bottom:g.spacing.xs},boxShadow:u&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),we=css(r!=="underlined"?{}:m?{background:"transparent",top:`${P.top}px`,height:`${P.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${P.left}px`,width:`${P.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),Re=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")&&c?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...m?{width:v?"100%":"auto",flex:"0 0 auto",textAlign:D}:v?{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}}),Z=css({display:"inline-flex",alignItems:"center",justifyContent:m?T[D]:"center",gap:6,width:"100%",flexDirection:p==="top"?"column-reverse":p==="bottom"?"column":p==="left"?"row-reverse":"row"}),ie=css({marginTop:g.spacing.sm,width:"100%"}),be=de.useId(),X=new Map;F.forEach((Q,ne)=>X.set(Q.value,`${be}-panel-${ne}`));let ye=Q=>`${be}-tab-${Q}`;return jsxs("div",{className:["plainframe-ui-tabs",i||""].join(" ").trim(),css:[pe,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:M,role:"tablist","aria-orientation":m?"vertical":"horizontal",onKeyDown:N,css:[Ce,R],children:[ue&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[ve,we,I,C]}),w.map((Q,ne)=>{let ae=A===Q.value;return jsx("button",{ref:me=>{b.current[ne]=me;},role:"tab",id:ye(ne),"aria-selected":ae,"aria-controls":X.get(Q.value),"aria-disabled":Q.disabled||void 0,disabled:Q.disabled,tabIndex:Q.disabled?-1:ne===y?0:-1,className:["plainframe-ui-tab",Q.className||""].join(" ").trim(),onClick:()=>{Q.disabled||_(Q.value);},css:[Re,!Q.disabled&&d(),Q.css,ae?Q.activeCss??x:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Z,children:Q.node})},String(Q.value??ne))})]}),F.map((Q,ne)=>{let ae=Q.value===A;if(!ae)return null;let me=w.findIndex(He=>He.value===Q.value),Ae=me>=0?ye(me):void 0;return console.log("rendering panel for",Q.value,"active:",ae),jsx("div",{role:"tabpanel",id:X.get(Q.value),"aria-labelledby":Ae,className:["plainframe-ui-tab-panel",Q.className||""].join(" ").trim(),css:[ie,Q.css],children:Q.node},ne)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,xn=e=>e==null?[]:Array.isArray(e)?e:[e],Fo=(...e)=>css(e.filter(Boolean)),og=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:i,disabled:u=false,fullWidth:a=false,width:l=235,size:c="md",variant:p="subtle",rounded:h=false,rows:f=3,maxRows:R,maxLength:I,showCharCount:x,focusRingMode:C="always",resizable:g=false,className:d,wrapperCss:m,inputCss:v,labelCss:D,helperRowCss:T,helperTextCss:w,charCountCss:F,css:B,onBlur:W,onFocus:O,onKeyDown:k,autoFocus:A,name:M,id:b,tabIndex:y,autoComplete:P,readOnly:H,required:L})=>{let E=j(),S=Xo(),z=useId(),$=useMemo(()=>({sm:{fontSize:E.typography.sizes.sm,minHeight:E.componentHeights.sm,labelFont:E.typography.sizes.xs,helperFont:E.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:E.spacing.md},md:{fontSize:E.typography.sizes.sm,minHeight:E.componentHeights.md,labelFont:E.typography.sizes.sm,helperFont:E.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:E.spacing.md},lg:{fontSize:E.typography.sizes.sm,minHeight:E.componentHeights.lg,labelFont:E.typography.sizes.md,helperFont:E.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:E.spacing.md}}),[E]),K=["sm","md","lg"].includes(c)?c:"md",_=$[K],N=E.neutral,U=E.text,G=t!==void 0,[se,V]=useState(n),Y=G?t:se,le=useCallback(ae=>{G||V(ae),o?.(ae);},[G,o]),ue=useMemo(()=>u?N[200]:s&&p==="outlined"?E.palette.danger?.[50]??E.surface.panelBg:s&&p==="subtle"?E.palette.danger?.[50]??E.surface.subtleBg:p==="outlined"?E.surface.panelBg:p==="subtle"?E.surface.subtleBg:"transparent",[u,s,p,N,E.surface,E.palette.danger]),pe=E.componentHeights.border,Me=useMemo(()=>p==="outlined"?`${pe} solid ${s?E.palette.danger?.[300]??E.surface.border:E.surface.border}`:"none",[p,pe,s,E.palette.danger,E.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:a?"100%":l!=null?Mo(l):void 0,flex:"0 0 auto",fontWeight:500}),[a,l]),ve=useMemo(()=>Fo({fontSize:_.labelFont,fontWeight:500,color:s?E.palette.danger?.[700]??U.primary:u?N[500]:U.primary,marginBottom:4,display:"inline-block"},...xn(D)),[_.labelFont,s,u,N,U,E.palette.danger,D]),we=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:E.spacing.sm,padding:`${Mo(_.paddingY)} 0 ${Mo(_.paddingY)} ${Mo(_.paddingX)}`,background:ue,border:Me,borderRadius:h?E.radius.full:E.radius.md,minHeight:_.minHeight,width:"100%",cursor:u?"not-allowed":"text",opacity:u?.65:1,transition:"box-shadow .18s, border-color .16s"},...xn(m),...xn(B)],[E,_,ue,Me,pe,h,u,m,B]),Re=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,Z=useMemo(()=>Fo({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:u?N[500]:s?E.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Mo(_.paddingX),overflowY:"auto",minHeight:Re,"&::placeholder":{color:s?E.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?E.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${ue} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?E.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Re} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...xn(v)),[g,_,u,s,N,U,E.palette.danger,Re,ue,f,v]),ie=useMemo(()=>Fo({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...xn(T)),[T]),be=useMemo(()=>Fo({fontSize:_.helperFont,color:s?E.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...xn(w)),[_.helperFont,s,E.palette.danger,U,w]),X=useMemo(()=>Fo({fontSize:_.helperFont,color:I&&Y.length>I?E.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...xn(F)),[_.helperFont,I,Y.length,E.palette.danger,U,F]),ye=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=ye.current;if(!ae)return;if(g){let Ae=window.getComputedStyle(ae),He=parseFloat(Ae.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);return}(()=>{let Ae=window.getComputedStyle(ae),He=parseFloat(Ae.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);let re=R?He*R:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,re)}px`;})();},[Y,f,R,_.minHeight,g]);let Q=i!=null||x?`${b??z}-help`:void 0,ne=b??z;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:ne,className:"plainframe-ui-textarea-label",css:ve,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[S({enabled:C!=="none",disabled:u,color:s?"danger":void 0}),we],"aria-invalid":!!s||void 0,"aria-disabled":u||void 0,onClick:()=>!u&&ye.current?.focus(),children:jsx("textarea",{ref:ye,id:ne,className:"plainframe-ui-textarea-input",css:Z,rows:f,value:Y,onChange:ae=>{let me=ae.target.value;I&&me.length>I||le(me);},placeholder:r||"",disabled:u,onBlur:W,onFocus:O,onKeyDown:k,autoFocus:A,name:M,tabIndex:y,autoComplete:P,readOnly:H,required:L,"aria-invalid":!!s||void 0,"aria-describedby":Q})}),(i!=null||x&&I!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:Q,className:"plainframe-ui-textarea-helper-text",css:be,children:i}),x&&I!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:X,children:[Y.length,"/",I]})]})]})};var dg=jo,pg={type:"spring",stiffness:920,damping:100},Zl="__toast_root__",mg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Dr=(e,t)=>{for(let n of t){let o=mg(e,n);if(o!=null&&o!=="")return o}},ra=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function fg(e){let t=Dr(e,["radius.md","shape.borderRadius","radii.md"]),n=Dr(e,["spacing.lg","space.4","spacing.4"]),o=Dr(e,["spacing.md","space.3","spacing.3"]),r=Dr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:ra(t,16),padX:ra(n,14),padY:ra(o,12),shadow:String(r)}}var gg=fg(dg),Bt=null,Vn=null,ge={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function tc(){typeof document>"u"||(Bt||(Bt=document.getElementById("toast-host"),Bt||(Bt=document.createElement("div"),Bt.id="toast-host",document.body.appendChild(Bt))),Vn||(Vn=Bt[Zl]??null,Vn||(Vn=createRoot(Bt),Bt[Zl]=Vn,Vn.render(jsx(Na,{children:jsx(Sg,{})})))));}var ee={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}};}},vn=()=>{ee.sync(),ee.notify();},bg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Nr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||ee.timers.has(e.id))return;let o=Date.now(),r=ee.remaining.get(e.id),s=r!=null?Math.max(0,r):n;ee.expiry.set(e.id,o+s);let i=window.setTimeout(()=>De.dismiss(e.id),s);ee.timers.set(e.id,i);}function Hr(e){let t=ee.timers.get(e);t&&(clearTimeout(t),ee.timers.delete(e));}function hg(){let e=false;for(;ee.displayed.length<ge.max&&ee.queue.length;){let t=ee.queue.shift();ee.displayed=[t,...ee.displayed],ee.enterFrom[t.id]="head",ee.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete ee.entering[t.id],vn();}),Nr(t);}e&&vn();}function yg(){if(ee.displayed.length<ge.max)return;let e=ee.displayed.filter(o=>!ee.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=ee.expiry.get(t.id);n!=null&&ee.remaining.set(t.id,Math.max(0,n-Date.now())),Hr(t.id),ee.exiting[t.id]=true,ee.displayed=ee.displayed.filter(o=>o.id!==t.id),delete ee.enterFrom[t.id],ee.queue.push(t),vn();}var xg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function vg(e,t){let n=xg(t),o=e,r=o.surface,s=o.text,i=r?.panelBg??"#fff",u=s?.primary??"#111",a=r?.border;if(n==="default"||n==="info")return {bg:i,fg:u,border:a};let l=s?.onColors??{},c=(p,h,f)=>{let R=o.colors,I=o.palette;return {bg:R?.[p]??I?.[p]?.[700]??h,fg:l?.[p]??f,border:"transparent"}};return n==="success"?c("success","#22C55E","#fff"):n==="warning"?c("warning","#F59E0B","#fff"):n==="error"?c("error","#EF4444","#fff"):{bg:i,fg:u,border:a}}var De=Object.assign((e,t)=>{tc();let n=a=>a!=null&&typeof a[Symbol.iterator]=="function",o=a=>!!a&&(typeof a=="object"||typeof a=="function")&&typeof a.then=="function",r;typeof e=="object"&&e!=null&&!de.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(de.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??bg(),i=a=>{let l=a.findIndex(h=>h.id===s);if(l===-1)return false;let c=a[l],p={...c,status:r.status??c.status,content:r.content??c.content,title:r.title??c.title,description:r.description??c.description,startIcon:r.startIcon??c.startIcon,endIcon:r.endIcon??c.endIcon,action:r.action??c.action,onClose:r.onClose??c.onClose,duration:r.duration===void 0?c.duration:r.duration,pauseOnHover:r.pauseOnHover??c.pauseOnHover,showDismiss:r.showDismiss??c.showDismiss,render:r.render??c.render,bare:r.bare??c.bare,onClick:r.onClick??c.onClick,width:r.width??c.width};return a[l]=p,Hr(s),ee.remaining.delete(s),ee.paused.has(s)||Nr(p),vn(),true};if(i(ee.displayed)||i(ee.queue))return s;let u={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?ge.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 ee.displayed.length>=ge.max&&yg(),ee.displayed=[...ee.displayed,u],ee.enterFrom[u.id]="tail",ee.entering[u.id]=true,requestAnimationFrame(()=>{delete ee.entering[u.id],vn();}),vn(),Nr(u),s},{success:(e,t={})=>De(e,{...t,status:"success"}),error:(e,t={})=>De(e,{...t,status:"error"}),warning:(e,t={})=>De(e,{...t,status:"warning"}),info:(e,t={})=>De(e,{...t,status:"info"}),custom:(e,t={})=>De(e,{...t}),update:(e,t)=>De({id:e,...t}),dismiss:e=>{if(!e){let n=ee.displayed.find(o=>!ee.exiting[o.id])?.id;n&&De.dismiss(n);return}Hr(e),ee.remaining.delete(e),ee.paused.delete(e),ee.exiting[e]=true;let t=ee.displayed.find(n=>n.id===e);ee.displayed=ee.displayed.filter(n=>n.id!==e),delete ee.enterFrom[e],vn(),window.setTimeout(()=>t?.onClose?.(),120),hg();},clear:()=>{[...ee.displayed.map(t=>t.id)].forEach(t=>De.dismiss(t));},pause:e=>{if(ee.paused.has(e))return;let t=ee.expiry.get(e);t!=null&&ee.remaining.set(e,Math.max(0,t-Date.now())),ee.paused.add(e),Hr(e);},resume:e=>{if(!ee.paused.has(e))return;ee.paused.delete(e);let t=ee.displayed.find(o=>o.id===e)??ee.queue.find(o=>o.id===e),n=ee.remaining.get(e);t&&Nr(t,n??void 0),ee.remaining.delete(e);},pauseLatest:()=>{let e=ee.displayed.at(-1);e&&De.pause(e.id);},resumeLatest:()=>{let e=ee.displayed.at(-1);e&&De.resume(e.id);},promise:(e,t,n={})=>{let o=De(t.loading,{...n,status:"info",duration:null});return e.then(r=>{De.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{De.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ge.max=e.max),e.position&&(ge.position=e.position),e.gutter!=null&&(ge.gutter=e.gutter),e.zIndex!=null&&(ge.zIndex=e.zIndex),e.duration!==void 0&&(ge.duration=e.duration),e.showDismiss&&(ge.showDismiss=e.showDismiss),e.styles&&(ge.styles={...ge.styles,...e.styles}),e.renderer!==void 0&&(ge.renderer=e.renderer),e.bareRenderer!==void 0&&(ge.bareRenderer=e.bareRenderer);}});function Cg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ge.showDismiss}function Rg(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 Tg=css({display:"flex",alignItems:"flex-start",gap:10}),Ql=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),wg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Eg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Sg=de.memo(function(){let t=useSyncExternalStore(ee.subscribe.bind(ee),()=>ee.snapshot,()=>ee.snapshot),n=j(),o=ge.position.startsWith("bottom"),r=de.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=de.useMemo(()=>({position:"fixed",zIndex:ge.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Rg(ge.position),...ge.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((i,u)=>{let a=t.enterFrom[i.id]||"tail",l=o?a==="head"?-16:16:a==="head"?16:-16,c=u>0?ge.gutter:0,p={toast:i,close:De.dismiss,pause:De.pause,resume:De.resume},{bg:h,fg:f,border:R}=vg(n,i.status),I={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:gg.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:i.onClick?"pointer":"default",border:R?`1px solid ${R}`:"1px solid transparent"},x=typeof ge.styles.surface=="function"?ge.styles.surface(i):ge.styles.surface??{},C=Cg(i.showDismiss),g={},d="& .plainframe-ui-toast-close",m="&:hover .plainframe-ui-toast-close";C==="hover"?(g[d]={opacity:0,pointerEvents:"none"},g[m]={opacity:1,pointerEvents:"auto"}):C==="always"?g[d]={opacity:1,pointerEvents:"auto"}:C==="never"&&(g[d]={display:"none"});let v=css({...I,...x,...g}),D=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",...ge.styles.close??{}}),T;if(i.bare&&i.render){let w=typeof i.render=="function"?i.render(p):i.render;T=jsx("div",{style:{pointerEvents:"auto"},onClick:F=>i.onClick?.(i.id,F),children:w});}else if(ge.bareRenderer&&ge.renderer){let w=typeof ge.renderer=="function"?ge.renderer(p):ge.renderer;T=jsx("div",{style:{pointerEvents:"auto"},onClick:F=>i.onClick?.(i.id,F),children:w});}else {let w;ge.renderer?w=typeof ge.renderer=="function"?ge.renderer(p):ge.renderer:i.render&&!i.bare?w=typeof i.render=="function"?i.render(p):i.render:w=jsxs(Fragment,{children:[jsxs("div",{css:Tg,children:[i.startIcon&&jsx("div",{css:Ql,children:i.startIcon}),jsx("div",{css:wg,children:i.content}),i.endIcon&&jsx("div",{css:Ql,children:i.endIcon})]}),i.action&&jsx("div",{css:Eg,children:i.action})]}),T=jsxs("div",{css:v,onClick:F=>i.onClick?.(i.id,F),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:D,onClick:F=>{F.stopPropagation(),De.dismiss(i.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Ig,{id:i.id,isBottom:o,mt:c,enterY:l,width:i.width,pauseOnHover:i.pauseOnHover!==false,children:T},i.id)})})})}),Ig=de.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:i,pauseOnHover:u,children:a}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:pg});},[l]);let c={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:i!=null?typeof i=="number"?`${i}px`:i:"none",...ge.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(c),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:(p,h)=>{let f=Math.abs(h.offset.x),R=Math.abs(h.velocity.x);if(!(f>60||R>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let C=(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:C,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:g}}).then(()=>De.dismiss(n));},onMouseEnter:u?()=>De.pause(n):void 0,onMouseLeave:u?()=>De.resume(n):void 0,children:a})}),ec=false;(function(){ec||(ec=true,tc());})();var Yg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},rc=createContext(null),sc=()=>{let e=useContext(rc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Jg=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:i=true,autoWidth:u=false,disableHoverListener:a=false})=>{let[l,c]=useState(!!o),p=n??l,h=T=>{n===void 0&&c(T),r?.(T);},f=useRef(null),R=useFloating({placement:t,open:p,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),i?arrow({element:f,padding:4}):void 0].filter(Boolean)}),I=useHover(R.context,{enabled:!a,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),x=useFocus(R.context),C=useDismiss(R.context,{escapeKey:true,outsidePress:true}),g=useRole(R.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:m}=useInteractions([I,x,C,g]),v=useId(),D=useMemo(()=>({open:p,setOpen:h,id:v,placement:R.placement,autoWidth:u,allowArrow:!!i,refs:R.refs,floatingStyles:R.floatingStyles,middlewareData:R.middlewareData,getReferenceProps:d,getFloatingProps:m,arrowRef:f}),[p,u,i,R.placement,R.refs,R.floatingStyles,R.middlewareData,d,m]);return jsx(rc.Provider,{value:D,children:e})},Zg=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:i}=sc(),u=de.isValidElement(t),a=u&&typeof t.type=="string";if(e&&u&&a){let l=t,c="ref"in l?l.ref:void 0,p=s({...l.props,"aria-describedby":i,ref:Yg(c,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return de.cloneElement(l,{...p,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":i}),children:t})},Qg=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:i,middlewareData:u,getFloatingProps:a,placement:l,id:c,autoWidth:p,allowArrow:h,arrowRef:f}=sc(),R=j(),I=l.split("-")[0]||"top",C=I==="bottom"?{opacity:0,y:-8,scale:.98}:I==="top"?{opacity:0,y:8,scale:.98}:I==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},g=C,d=I==="bottom"?"center top":I==="top"?"center bottom":I==="left"?"right center":"left center",m=css({zIndex:1300,backgroundColor:R.neutral[900],color:R.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:p?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),v=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:R.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),D=u.arrow,T={top:"bottom",bottom:"top",left:"right",right:"left"}[I];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:c,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[m,n],style:i,initial:C,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"}},...a(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[v,o],style:{left:D?.x!=null?`${D.x}px`:void 0,top:D?.y!=null?`${D.y}px`:void 0,[T]:"-3px"}})]})})})};function ob(){let e=j();return jsx(Global,{styles:css`
21
21
  *,*::before,*::after{box-sizing:border-box}
22
22
 
23
23
  body{
@@ -45,4 +45,4 @@ ${y}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),m()
45
45
  @media (prefers-reduced-motion:reduce){
46
46
  *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}
47
47
  }
48
- `})}export{Wa as Accordion,es as AccordionDetails,ja as AccordionGroup,Qr as AccordionSummary,Ua as ActionBar,Qa as Alert,ss as AlertDescription,rs as AlertTitle,Di as Autocomplete,Ni as Avatar,Gd as AvatarGroup,ws as Backdrop,tp as Badge,br as BreadCrumbItem,ip as BreadCrumbs,_i as Button,Gi as ButtonGroup,Ji as Card,kp as CardContent,Pp as CardDescription,Fp as CardEnd,el as CardGroup,Mp as CardStart,Ap as CardTitle,rr as Checkbox,ol as Chip,qp as CodeField,Ln as Container,Xp as ContextZone,ob as CssBaseline,Qp as Divider,hl as Drawer,An as DropdownMenu,cn as DropdownMenuContent,Si as DropdownMenuSub,ki as DropdownMenuSubContent,Ii as DropdownMenuSubTrigger,Pn as DropdownMenuTrigger,Os as Fade,Rl as Flex,Ws as Grow,El as Image,$m as ImageStack,_m as Kbd,ai as Menu,fs as MenuCheckboxGroup,ao as MenuCheckboxItem,kt as MenuItem,rn as MenuLabel,Ci as MenuRadioGroup,nd as MenuRadioItem,od as MenuSeparator,xi as MenuSwitchItem,Qo as MenuVariantCtx,Qm as Modal,Bl as ModalContent,Ll as ModalTrigger,lf as Pagination,Ou as Popover,ui as PopoverAnchor,di as PopoverContent,ci as PopoverTrigger,Qn as Progress,ff as Quote,vf as RadioGroup,Cf as RadioItem,Sf as Rotate,_l as Select,Js as SelectItem,Pf as Skeleton,Us as Slide,Gl as Slider,na as Step,Gf as Stepper,ps as Switch,Fr as Tab,Ar as TabContent,Jf as Tabs,og as TextArea,Zo as TextField,Na as ThemeProvider,Jg as Tooltip,Qg as TooltipContent,Zg as TooltipTrigger,zn as Typography,Ta as defaultDarkTheme,jo as defaultLightTheme,Yn as surfaceFromNeutral,_o as textDark,Ko as textLight,De as toast,Cc as useColorMode,Rd as useDropdownMenuActiveIndex,j as usePlainframeUITheme,Ku as usePopoverContext,Rc as usePrimary,cb as usePrimitives};
48
+ `})}export{Wa as Accordion,es as AccordionDetails,ja as AccordionGroup,Qr as AccordionSummary,Ua as ActionBar,Qa as Alert,ss as AlertDescription,rs as AlertTitle,Di as Autocomplete,Ni as Avatar,Gd as AvatarGroup,ws as Backdrop,tp as Badge,br as BreadCrumbItem,ip as BreadCrumbs,_i as Button,Gi as ButtonGroup,Ji as Card,kp as CardContent,Pp as CardDescription,Fp as CardEnd,el as CardGroup,Mp as CardStart,Ap as CardTitle,rr as Checkbox,ol as Chip,qp as CodeField,Bn as Container,Xp as ContextZone,ob as CssBaseline,Qp as Divider,hl as Drawer,Pn as DropdownMenu,dn as DropdownMenuContent,Si as DropdownMenuSub,ki as DropdownMenuSubContent,Ii as DropdownMenuSubTrigger,Dn as DropdownMenuTrigger,Os as Fade,Rl as Flex,Ws as Grow,El as Image,$m as ImageStack,_m as Kbd,ai as Menu,fs as MenuCheckboxGroup,ao as MenuCheckboxItem,Mt as MenuItem,an as MenuLabel,Ci as MenuRadioGroup,nd as MenuRadioItem,od as MenuSeparator,xi as MenuSwitchItem,Qo as MenuVariantCtx,Qm as Modal,Bl as ModalContent,Ll as ModalTrigger,lf as Pagination,Ou as Popover,ui as PopoverAnchor,di as PopoverContent,ci as PopoverTrigger,Qn as Progress,ff as Quote,vf as RadioGroup,Cf as RadioItem,Sf as Rotate,_l as Select,Js as SelectItem,Pf as Skeleton,Us as Slide,Gl as Slider,na as Step,Gf as Stepper,ps as Switch,Fr as Tab,Ar as TabContent,Jf as Tabs,og as TextArea,Zo as TextField,Na as ThemeProvider,Jg as Tooltip,Qg as TooltipContent,Zg as TooltipTrigger,On as Typography,Ta as defaultDarkTheme,jo as defaultLightTheme,Jn as surfaceFromNeutral,_o as textDark,Ko as textLight,De as toast,Cc as useColorMode,Rd as useDropdownMenuActiveIndex,j as usePlainframeUITheme,Ku as usePopoverContext,Rc as usePrimary,cb as usePrimitives};