plainframe-ui 0.1.77 → 0.1.80
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 +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import fe,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,useLayoutEffect,Children,memo,useSyncExternalStore}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 xa={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},va={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},Ca={sm:32,md:36,lg:40,border:"1px"},Ra={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:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Ur={0:"#080808",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ha={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"},sky:{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"}},ya={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"},sky:{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"}},Ta=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,sky:e.sky,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}),eo=(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:{}}),Vo=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),xc=["danger","success","warning","info","red","amber","orange","yellow","lime","green","teal","cyan","sky","blue","indigo","purple","magenta","pink","rose","mono"],wa=e=>xc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:jr,palette:{...Ta(ha),primary:ha.mono},surface:eo("light",jr),text:{...Ko(jr),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}},Ea={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Ur,palette:{...Ta(ya),primary:ya.mono},surface:eo("dark",Ur),text:{...Vo(Ur),onColors:{primary:"#000000",...wa({yellow:"#000000",mono:"#000000"})}}};function Ia(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 Fa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ht=e=>Fa[e]??e;function cn(e){let t={...e};return Object.entries(Fa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Gr=fe.createContext(null),Ma=fe.createContext(null),Xr=fe.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=fe.createContext({setPrimary:e=>{}}),Da=fe.createContext(null);function V(){return useTheme()}function Rc(){let e=fe.useContext(Gr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=fe.useContext(Xr),[n,o]=fe.useState(()=>e.get());return fe.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Tc(){let e=fe.useContext(Ma);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=fe.useContext(Pa),[n,o]=fe.useState(()=>e.get());return fe.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function mb(e){let t=fe.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Rc(),{primary:o}=Tc(),r=fe.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ht(o)]??s.palette.primary,c=cn(s.text.onColors)[ht(o)]??Yr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...cn(s.text.onColors),primary:c,[ht(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function Uo(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 Yr(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=c=>{let i=c/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function ka(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function qr(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Jr(e,t,n){let o=[],r=i=>i.startsWith("var(")?i.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():i;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(([i,l])=>o.push(`--pf-text-on-${i}:${l};`)),Object.entries(e.spacing).forEach(([i,l])=>o.push(`--pf-space-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([i,l])=>o.push(`--pf-radius-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([i,l])=>o.push(`--pf-fontSize-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([i,l])=>o.push(`--pf-cmph-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([i,l])=>o.push(`--pf-neutral-${i}:${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(([i,l])=>{Object.entries(l).forEach(([u,m])=>{o.push(`--pf-palette-${i}-${u}:${m};`);});});let s="300";Object.keys(e.palette).forEach(i=>{o.push(`--pf-focus-${i}-main: var(--pf-palette-${i}-${s});`),o.push(`--pf-focus-${i}-soft: transparent;`);});let a=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(i=>o.push(`--pf-primary-${i}:var(--pf-palette-${a}-${i});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let c=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),u=parseInt(l.slice(0,2),16),m=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=k=>{let y=k/255;return y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)};return .2126*f(u)+.7152*f(m)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${c};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function qo(e,t,n){return Jr(e,t,n).join("")}var Zr=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);}},Aa=(e,t)=>{Zr(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);}},Go=(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,a=t?.primaryKey??"mono",c=fe.useContext(Gr),i=fe.useContext(Xr),l=!!c,m=useRef((()=>{if(!s)try{let E=JSON.parse(localStorage.getItem(o)||"null");if(E?.mode==="light"||E?.mode==="dark")return E.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),h=fe.useMemo(()=>c??Ia(m.current),[c]),f=fe.useMemo(()=>Ia(a),[]);fe.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),k=useRef(0),y=useRef(r??"__root__");fe.useLayoutEffect(()=>{let E=0,g=T.current;for(;g&&g!==document.body;)g.hasAttribute("data-pfui-scope")&&E++,g=g.parentElement;k.current=E;},[r]);let x=useMemo(()=>{let E=Uo(jo,t),g=Uo(E,t?.light),v=t?.light?.primaryKey??a,L=ht(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=cn({...Ko(g.neutral).onColors,...g.text.onColors}),K=O[L]??Yr(H[600]),N=t?.surface||t?.light?.surface?g.surface:eo("light",g.neutral),G={...t?.text||t?.light?.text?g.text:Ko(g.neutral),onColors:cn({...O,primary:K,[L]:K})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),b=useMemo(()=>{let E=Uo(Ea,t),g=Uo(E,t?.dark),v=t?.dark?.primaryKey??a,L=ht(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=cn({...Vo(g.neutral).onColors,...g.text.onColors}),K=O[L]??Yr(H[600]),N=t?.surface||t?.dark?.surface?g.surface:eo("dark",g.neutral),G={...t?.text||t?.dark?.text?g.text:Vo(g.neutral),onColors:cn({...O,primary:K,[L]:K})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),d=useRef(null),p=useRef(null),C=fe.useInsertionEffect||fe.useLayoutEffect,M=useCallback(()=>{let E=qr(r);ka(p,s?`pfui-guard-${r}`:"pfui-guard-root"),p.current.textContent=`${E} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{p.current.textContent="";});},[r,s]);C(()=>{ka(d,s?`pfui-vars-${r}`:"pfui-vars-root");let E=t?.light?.primaryKey??t?.primaryKey??a,g=t?.dark?.primaryKey??t?.primaryKey??a,v=qr(r),L=qo(x,ht(E),"light"),H=qo(b,ht(g),"dark");d.current.textContent=`${v}.pf-light{${L}}
|
|
1
|
+
import fe,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,useLayoutEffect,Children,memo,useSyncExternalStore}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 va={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},Ca={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},Ra={sm:32,md:36,lg:40,border:"1px"},Ta={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:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Ur={0:"#080808",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ya={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"},sky:{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"}},xa={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"},sky:{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"}},wa=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,sky:e.sky,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}),eo=(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:{}}),Vo=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),xc=["danger","success","warning","info","red","amber","orange","yellow","lime","green","teal","cyan","sky","blue","indigo","purple","magenta","pink","rose","mono"],Ea=e=>xc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:va,radius:Ca,componentHeights:Ra,typography:Ta,neutral:jr,palette:{...wa(ya),primary:ya.mono},surface:eo("light",jr),text:{...Ko(jr),onColors:{primary:"#FFFFFF",...Ea({yellow:"#000000"})}}},Sa={spacing:va,radius:Ca,componentHeights:Ra,typography:Ta,neutral:Ur,palette:{...wa(xa),primary:xa.mono},surface:eo("dark",Ur),text:{...Vo(Ur),onColors:{primary:"#000000",...Ea({yellow:"#000000",mono:"#000000"})}}};function ka(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 Fa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ht=e=>Fa[e]??e;function cn(e){let t={...e};return Object.entries(Fa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Gr=fe.createContext(null),Pa=fe.createContext(null),Xr=fe.createContext({setMode:e=>{},toggleMode:()=>{}}),Da=fe.createContext({setPrimary:e=>{}}),Na=fe.createContext(null);function V(){return useTheme()}function Rc(){let e=fe.useContext(Gr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=fe.useContext(Xr),[n,o]=fe.useState(()=>e.get());return fe.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Tc(){let e=fe.useContext(Pa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=fe.useContext(Da),[n,o]=fe.useState(()=>e.get());return fe.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function mb(e){let t=fe.useContext(Na);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Rc(),{primary:o}=Tc(),r=fe.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ht(o)]??s.palette.primary,c=cn(s.text.onColors)[ht(o)]??Yr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...cn(s.text.onColors),primary:c,[ht(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function Uo(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 Yr(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=c=>{let i=c/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function Aa(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function qr(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Jr(e,t,n){let o=[],r=i=>i.startsWith("var(")?i.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():i;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(([i,l])=>o.push(`--pf-text-on-${i}:${l};`)),Object.entries(e.spacing).forEach(([i,l])=>o.push(`--pf-space-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([i,l])=>o.push(`--pf-radius-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([i,l])=>o.push(`--pf-fontSize-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([i,l])=>o.push(`--pf-cmph-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([i,l])=>o.push(`--pf-neutral-${i}:${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(([i,l])=>{Object.entries(l).forEach(([u,m])=>{o.push(`--pf-palette-${i}-${u}:${m};`);});});let s="300";Object.keys(e.palette).forEach(i=>{o.push(`--pf-focus-${i}-main: var(--pf-palette-${i}-${s});`),o.push(`--pf-focus-${i}-soft: transparent;`);});let a=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(i=>o.push(`--pf-primary-${i}:var(--pf-palette-${a}-${i});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let c=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),u=parseInt(l.slice(0,2),16),m=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=A=>{let y=A/255;return y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)};return .2126*f(u)+.7152*f(m)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${c};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function qo(e,t,n){return Jr(e,t,n).join("")}var Zr=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);}},Ma=(e,t)=>{Zr(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);}},Go=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");},Ha=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",c=fe.useContext(Gr),i=fe.useContext(Xr),l=!!c,m=useRef((()=>{if(!s)try{let w=JSON.parse(localStorage.getItem(o)||"null");if(w?.mode==="light"||w?.mode==="dark")return w.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),h=fe.useMemo(()=>c??ka(m.current),[c]),f=fe.useMemo(()=>ka(a),[]);fe.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),A=useRef(0),y=useRef(r??"__root__");fe.useLayoutEffect(()=>{let w=0,b=T.current;for(;b&&b!==document.body;)b.hasAttribute("data-pfui-scope")&&w++,b=b.parentElement;A.current=w;},[r]);let x=useMemo(()=>{let w=Uo(jo,t),b=Uo(w,t?.light),v=t?.light?.primaryKey??a,B=ht(v),H=b.palette.primary??b.palette[B]??b.palette.mono,O=cn({...Ko(b.neutral).onColors,...b.text.onColors}),K=O[B]??Yr(H[600]),N=t?.surface||t?.light?.surface?b.surface:eo("light",b.neutral),G={...t?.text||t?.light?.text?b.text:Ko(b.neutral),onColors:cn({...O,primary:K,[B]:K})};return {...b,palette:{...b.palette,primary:H},surface:N,text:G}},[t,a]),g=useMemo(()=>{let w=Uo(Sa,t),b=Uo(w,t?.dark),v=t?.dark?.primaryKey??a,B=ht(v),H=b.palette.primary??b.palette[B]??b.palette.mono,O=cn({...Vo(b.neutral).onColors,...b.text.onColors}),K=O[B]??Yr(H[600]),N=t?.surface||t?.dark?.surface?b.surface:eo("dark",b.neutral),G={...t?.text||t?.dark?.text?b.text:Vo(b.neutral),onColors:cn({...O,primary:K,[B]:K})};return {...b,palette:{...b.palette,primary:H},surface:N,text:G}},[t,a]),d=useRef(null),p=useRef(null),C=fe.useInsertionEffect||fe.useLayoutEffect,F=useCallback(()=>{let w=qr(r);Aa(p,s?`pfui-guard-${r}`:"pfui-guard-root"),p.current.textContent=`${w} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{p.current.textContent="";});},[r,s]);C(()=>{Aa(d,s?`pfui-vars-${r}`:"pfui-vars-root");let w=t?.light?.primaryKey??t?.primaryKey??a,b=t?.dark?.primaryKey??t?.primaryKey??a,v=qr(r),B=qo(x,ht(w),"light"),H=qo(g,ht(b),"dark");d.current.textContent=`${v}.pf-light{${B}}
|
|
2
2
|
${v}.pf-dark{${H}}`+(s?`
|
|
3
|
-
${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[x,
|
|
4
|
-
${
|
|
5
|
-
${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),M();let H=h.get();if(S(H),F(H),!s)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:E}));}catch{}},[x,b,r,s,h,f,M,S,F]),B=l?i:{setMode:I,toggleMode:P},z=jsx(Da.Provider,{value:{light:x,dark:b},children:jsx(Gr.Provider,{value:h,children:jsx(Ma.Provider,{value:f,children:jsx(Xr.Provider,{value:B,children:jsx(Pa.Provider,{value:{setPrimary:D},children:jsx(ThemeProvider,{theme:wc(x),children:e})})})})})});return s?jsx("div",{ref:T,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:z}):jsx("div",{ref:T,children:z})};function wc(e){let t=(l,u)=>Object.fromEntries(Object.keys(l).map(m=>[m,u(m)])),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})`),a={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},c=t(e.neutral,l=>`var(--pf-neutral-${l})`),i={};return Object.keys(e.palette).forEach(l=>{i[l]={},Object.keys(e.palette[l]).forEach(u=>{i[l][u]=`var(--pf-palette-${l}-${u})`;});}),i.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:a,sizes:r},neutral:c,palette:i,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(cn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var Ec=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=Ec(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 ve(){let e=V();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,a=t?.offset??0,c=t?.mode==="always"?"&:focus":"&:focus-visible",i={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 i[c]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e4},css(i)}}function Yo(){let e=V();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,a=t?.offset??0,c=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",i={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 i[c]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e3},css(i)}}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||""},ns=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:a},c)=>{let i=V(),l=i.typography.sizes.sm,u=20,m=10,h=i.spacing.lg,f=i.spacing.md,T=Number(i.componentHeights?.md),k=i.text,y=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:T,padding:`${f} ${h}`,gap:m,fontSize:l,color:k.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),b=css({marginRight:0,marginLeft:-2,lineHeight:0,color:i.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:i.text.secondary});return jsxs("div",{ref:c,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[y,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[b,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})})]})});ns.__PFUI_SLOT="AccordionSummary";ns.displayName="AccordionSummary";var os=({children:e,className:t,css:n})=>{let o=V(),r=o.typography.sizes.sm,s=o.spacing.lg,a="0.15rem",c=o.spacing.md,i=css({padding:`${a} ${s} ${c} ${s}`,fontSize:r,boxSizing:"border-box",minHeight:0});return jsx("div",{className:["plainframe-ui-accordion-details",t||""].join(" ").trim(),css:[i,n],tabIndex:-1,children:e})};os.__PFUI_SLOT="AccordionDetails";os.displayName="AccordionDetails";var Wa=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:s=false,width:a,fullWidth:c=false,css:i,children:l})=>{let u=V(),m=useId(),h=useId(),f=u.radius?.md,T=u.text,k=u.componentHeights?.border??1,y=za(k)??"1px",x=e!==void 0,[b,d]=useState(!!t),p=x?!!e:b,C=ve(),[M,R]=useState(0),[w,A]=useState(false),$=useRef(null),_=useRef(null),W=useRef(null),S=()=>{if(!p)return;let N=document.activeElement;_.current?.contains(N)&&W.current?.focus();},F=()=>{s||(S(),x?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},I=fe.Children.toArray(l).filter(N=>isValidElement(N)),P=I.findIndex(N=>Oa(N)==="AccordionSummary"),D=I.findIndex(N=>Oa(N)==="AccordionDetails");P===-1&&I.length&&(P=0),D===-1&&(D=I.findIndex((N,U)=>U!==P),D===-1&&I.length>=2&&(D=1));let B=I[P]??null,z=I[D]??null,E=r==="subtle"?u.surface.subtleBg:r==="outlined"?u.surface.panelBg:"transparent",g=css({backgroundColor:E,color:T.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${u.surface.border}`:"none",outline:"none",marginBottom:u.spacing.sm,maxWidth:a!=null?za(a):void 0,width:c?"100%":a!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let N=$.current;N&&R(N.scrollHeight);},[p,l]),useEffect(()=>{let N=$.current;if(!N)return;let U=new ResizeObserver(()=>R(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{M>0&&!w&&A(true);},[M,w]),useLayoutEffect(()=>{if(!p&&_.current){let N=document.activeElement;_.current.contains(N)&&W.current?.focus();}},[p]),useLayoutEffect(()=>{let N=_.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]"));p?(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",""));},[p]);let v=css({maxHeight:p?M||"none":0,overflow:p&&!w?"visible":"hidden",transition:w?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:w?"max-height":void 0}),L=css({opacity:p?1:0,transform:p?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),H=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:p?"rotate(180deg)":"rotate(0deg)"}}),O=B&&cloneElement(B,{...typeof B.props=="object"&&B.props?B.props:{},className:[B.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),K=z;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":p?"true":"false","data-disabled":s?"true":"false",css:[C(),g,i],tabIndex:s?-1:0,ref:W,role:"button","aria-expanded":p,"aria-controls":m,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==W.current||F();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),F());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),H],children:O}),jsx("div",{id:m,"aria-hidden":!p,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:_,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:L,children:K})})]})};Wa.displayName="Accordion";var Lc=e=>isValidElement(e),Bc=e=>Lc(e)?e.type?.displayName||e.type?.name:void 0,Ka=e=>Bc(e)==="Accordion",$c=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zc=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,Va=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:a,disabled:c=false,width:i,fullWidth:l=false,className:u,role:m="group",css:h})=>{let f=V(),T=useRef(null),k=Children.toArray(e),y=k.filter(Ka),x=y.length,b=o&&r!==void 0,[d,p]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let F=0;F<y.length;F++){let I=y[F].props;if(I.open||I.defaultOpen)return F}return null}),C=o?b?r??null:d:null,M=zc(f.componentHeights?.border,1),R=f.surface.border,w=f.radius.md,A=n,$=A==="outlined";useEffect(()=>{let F=T.current;if(!F)return;let I=P=>{if(P.key!=="ArrowDown"&&P.key!=="ArrowUp"&&P.key!=="Home"&&P.key!=="End")return;let B=Array.from(F.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(B.length===0)return;let z=document.activeElement,E=B.findIndex(v=>v.contains(z));if(E===-1)return;P.preventDefault();let g=E;P.key==="ArrowDown"?g=(E+1)%B.length:P.key==="ArrowUp"?g=(E-1+B.length)%B.length:P.key==="Home"?g=0:P.key==="End"&&(g=B.length-1),B[g]?.focus();};return F.addEventListener("keydown",I),()=>F.removeEventListener("keydown",I)},[x]);let _=css({display:"flex",flexDirection:"column",maxWidth:i!=null?$c(i):void 0,width:l?"100%":i!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&$?`${M} solid ${R}`:"none",borderRadius:t&&$?w:void 0,background:t&&$?f.surface.panelBg:"transparent"}),W=0,S=[];return k.forEach((F,I)=>{if(!Ka(F)){S.push(F);return}let P=F.props,D=W++,B=D===0,z=D===x-1,E=c||!!P.disabled,g=A??P.variant,v=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:B?w:0,borderTopRightRadius:B?w:0,borderBottomLeftRadius:z?w:0,borderBottomRightRadius:z?w:0}):css({width:"100%",marginBottom:0}),L=!B&&x>1&&t?css({borderTop:`${M} solid ${R}`}):null,H=$?css({border:"1px solid transparent"}):null,O={variant:g,disabled:E,width:"100%",css:[P.css,v,H,L],className:[P.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let K=P.onChange,N=C===D;O.open=N,O.defaultOpen=void 0,O.onChange=U=>{let G=U?D:null;b||p(G),a?.(G),K?.(U);};}S.push(cloneElement(F,{...P,...O,key:F?.key??I}));}),jsx("div",{ref:T,role:m,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",u||""].join(" ").trim(),css:[_,h],children:S})};Va.displayName="AccordionGroup";var Ut=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:a="lg",offset:c=0,offsetX:i=0,offsetY:l=0,elevated:u=true,unstyled:m=false,fullWidth:h=false,width:f,height:T,role:k="toolbar","aria-label":y,onClose:x})=>{let b=V(),d=useRef(null),p=useRef(null),C=useRef(false),M=useRef(t),R=n.horizontal??"center",w=n.vertical??"bottom",A=g=>typeof g=="string"?b.spacing[g]??g:g,$=g=>typeof g=="string"?b.radius[g]??g:g,_=Ut(A(c)),W=Ut(A(i)),S=Ut(A(l)),F={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:R==="left"?"flex-start":R==="right"?"flex-end":"center",alignItems:w==="top"?"flex-start":w==="bottom"?"flex-end":"center"},I=()=>`${R==="left"?"left":R==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,P=()=>w==="top"||w==="bottom"?`translateY(${w==="bottom"?100:-100}px) scale(0.98)`:w==="center"?R==="left"?"translateX(-100px) scale(0.98)":R==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",D=()=>w==="center"&&R==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",B=24,z={margin:B,marginTop:w==="top"?`calc(${B}px + ${_} + ${S})`:B,marginBottom:w==="bottom"?`calc(${B}px + ${_} + ${S})`:B,marginLeft:R==="left"?`calc(${B}px + ${_} + ${W})`:B,marginRight:R==="right"?`calc(${B}px + ${_} + ${W})`:B,padding:m?0:Ut(A(r)),background:m?"transparent":b.surface.panelBg,border:m?"none":`1px solid ${b.surface.border}`,borderRadius:m?0:Ut($(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Ut(A(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Ut(f):"auto",height:T?Ut(T):"auto",maxWidth:h?"100%":"none"},E=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let g=d.current;if(!g)return;let v=P(),L=D();if(!C.current){C.current=true,M.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}if(M.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}M.current=t,p.current&&p.current.cancel();let H=t?[{opacity:0,transform:v},{opacity:1,transform:L}]:[{opacity:1,transform:L},{opacity:0,transform:v}];return p.current=g.animate(H,{duration:250,easing:"ease",fill:"forwards"}),()=>{p.current&&p.current.cancel();}},[t,R,w]),useEffect(()=>{if(!t||!x)return;let g=v=>{v.key==="Escape"&&x();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t,x]),jsx("div",{css:F,children:jsx("div",{ref:d,css:E,style:z,role:k,"aria-label":y,"aria-hidden":!t,...!t&&{inert:true},children:e})})};Ua.displayName="ActionBar";var Ga=(e,t,n)=>Math.min(n,Math.max(t,e)),rs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qa=1,jc=keyframes`100% { transform: rotate(360deg); }`,Uc=keyframes`
|
|
3
|
+
${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[x,g,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,a]);let R=useRef(false);fe.useLayoutEffect(()=>{if(R.current)return;R.current=true;let w=s?T.current:document.documentElement;if(!w)return;let b=h.get();Zr(w),Go(w,b),w.setAttribute("data-pfui-mode",b),w.setAttribute("data-pfui-primary",f.get()),l||h.set(b);},[s,h,f,l]);let E=useCallback(()=>{window.__pfuiActiveScope={id:y.current,depth:A.current,ts:Date.now()};},[]),k=useCallback(()=>{let w=s?T.current:document.documentElement,b={capture:true},v=()=>E();return w?.addEventListener("pointerdown",v,b),w?.addEventListener("mouseenter",v,b),w?.addEventListener("focusin",v,b),w?.addEventListener("keydown",v,b),()=>{w?.removeEventListener("pointerdown",v,b),w?.removeEventListener("mouseenter",v,b),w?.removeEventListener("focusin",v,b),w?.removeEventListener("keydown",v,b);}},[s,E]),$=useCallback(w=>{let b=window.__pfuiActiveScope,v=b&&Date.now()-b.ts<1500;if(!b||!v||b.id!==y.current)return;let B=h.get(),H=f.get(),K=Jr(B==="light"?x:g,ht(H),B);Ma(w,K),Go(w,B),w.setAttribute("data-pfui-portal-owner",y.current),w.setAttribute("data-pfui-mode",B),w.setAttribute("data-pfui-primary",H);},[h,f,x,g]),_=w=>{if(w.getAttribute("data-floating-ui-portal")==="true"||w.getAttribute("data-radix-portal")==="true"||w.getAttribute("data-portal")==="true")return true;let b=w.getAttribute("role");if(b==="tooltip"||b==="dialog")return true;let v=window.getComputedStyle(w);return v.position==="fixed"||v.position==="absolute"},W=useCallback(()=>{let w=new MutationObserver(b=>{for(let v of b)v.addedNodes.forEach(B=>{B instanceof HTMLElement&&(_(B)&&$(B),B.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(H=>$(H)));});});return w.observe(document.body,{childList:true,subtree:true}),()=>w.disconnect()},[$]);fe.useEffect(()=>{let w=k(),b=W();return ()=>{w(),b();}},[k,W]);let S=useCallback(w=>{let b=s?T.current:document.documentElement;b&&(Zr(b),Go(b,w),b.setAttribute("data-pfui-mode",w),b.setAttribute("data-pfui-primary",f.get()));},[s,f]),M=useCallback(w=>{let b=ht(f.get()),B=Jr(w==="light"?x:g,b,w);document.querySelectorAll(`[data-pfui-portal-owner="${y.current}"]`).forEach(H=>{Ma(H,B),Go(H,w),H.setAttribute("data-pfui-mode",w),H.setAttribute("data-pfui-primary",b);});},[x,g,f]);fe.useLayoutEffect(()=>{M(h.get());},[M,x,g,a,h]),fe.useLayoutEffect(()=>{if(!l)return;let w=()=>{let v=h.get();F(),S(v),M(v);};w();let b=h.subscribe(w);return ()=>b()},[l,h,F,S,M]);let I=useCallback(w=>{if(h.get()!==w&&(F(),h.set(w),S(w),M(w),!s))try{let b=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...b,mode:w}));}catch{}},[h,s,o,F,S,M]),D=useCallback(()=>I(h.get()==="light"?"dark":"light"),[I,h]),P=useCallback(w=>{f.set(w);let b=qr(r),v=qo(x,ht(w),"light"),B=qo(g,ht(w),"dark");d.current&&(d.current.textContent=`${b}.pf-light{${v}}
|
|
4
|
+
${b}.pf-dark{${B}}`+(s?`
|
|
5
|
+
${b}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F();let H=h.get();if(S(H),M(H),!s)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:w}));}catch{}},[x,g,r,s,h,f,F,S,M]),L=l?i:{setMode:I,toggleMode:D},z=jsx(Na.Provider,{value:{light:x,dark:g},children:jsx(Gr.Provider,{value:h,children:jsx(Pa.Provider,{value:f,children:jsx(Xr.Provider,{value:L,children:jsx(Da.Provider,{value:{setPrimary:P},children:jsx(ThemeProvider,{theme:wc(x),children:e})})})})})});return s?jsx("div",{ref:T,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:z}):jsx("div",{ref:T,children:z})};function wc(e){let t=(l,u)=>Object.fromEntries(Object.keys(l).map(m=>[m,u(m)])),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})`),a={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},c=t(e.neutral,l=>`var(--pf-neutral-${l})`),i={};return Object.keys(e.palette).forEach(l=>{i[l]={},Object.keys(e.palette[l]).forEach(u=>{i[l][u]=`var(--pf-palette-${l}-${u})`;});}),i.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:a,sizes:r},neutral:c,palette:i,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(cn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var Ec=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},La=(e,t)=>{let n=Ec(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 ve(){let e=V();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=La(e,t?.color),s=t?.haloWidth??3,a=t?.offset??0,c=t?.mode==="always"?"&:focus":"&:focus-visible",i={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 i[c]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e4},css(i)}}function Yo(){let e=V();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=La(e,t?.color),s=t?.haloWidth??3,a=t?.offset??0,c=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",i={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 i[c]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e3},css(i)}}var Oa=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Wa=e=>{let t=e.type;return t?.__PFUI_SLOT||t?.displayName||t?.name||""},ns=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:a},c)=>{let i=V(),l=i.typography.sizes.sm,u=20,m=10,h=i.spacing.lg,f=i.spacing.md,T=Number(i.componentHeights?.md),A=i.text,y=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:T,padding:`${f} ${h}`,gap:m,fontSize:l,color:A.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),g=css({marginRight:0,marginLeft:-2,lineHeight:0,color:i.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:i.text.secondary});return jsxs("div",{ref:c,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[y,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[g,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})})]})});ns.__PFUI_SLOT="AccordionSummary";ns.displayName="AccordionSummary";var os=({children:e,className:t,css:n})=>{let o=V(),r=o.typography.sizes.sm,s=o.spacing.lg,a="0.15rem",c=o.spacing.md,i=css({padding:`${a} ${s} ${c} ${s}`,fontSize:r,boxSizing:"border-box",minHeight:0});return jsx("div",{className:["plainframe-ui-accordion-details",t||""].join(" ").trim(),css:[i,n],tabIndex:-1,children:e})};os.__PFUI_SLOT="AccordionDetails";os.displayName="AccordionDetails";var _a=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:s=false,width:a,fullWidth:c=false,css:i,children:l})=>{let u=V(),m=useId(),h=useId(),f=u.radius?.md,T=u.text,A=u.componentHeights?.border??1,y=Oa(A)??"1px",x=e!==void 0,[g,d]=useState(!!t),p=x?!!e:g,C=ve(),[F,R]=useState(0),[E,k]=useState(false),$=useRef(null),_=useRef(null),W=useRef(null),S=()=>{if(!p)return;let N=document.activeElement;_.current?.contains(N)&&W.current?.focus();},M=()=>{s||(S(),x?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},I=fe.Children.toArray(l).filter(N=>isValidElement(N)),D=I.findIndex(N=>Wa(N)==="AccordionSummary"),P=I.findIndex(N=>Wa(N)==="AccordionDetails");D===-1&&I.length&&(D=0),P===-1&&(P=I.findIndex((N,U)=>U!==D),P===-1&&I.length>=2&&(P=1));let L=I[D]??null,z=I[P]??null,w=r==="subtle"?u.surface.subtleBg:r==="outlined"?u.surface.panelBg:"transparent",b=css({backgroundColor:w,color:T.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${u.surface.border}`:"none",outline:"none",marginBottom:u.spacing.sm,maxWidth:a!=null?Oa(a):void 0,width:c?"100%":a!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let N=$.current;N&&R(N.scrollHeight);},[p,l]),useEffect(()=>{let N=$.current;if(!N)return;let U=new ResizeObserver(()=>R(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{F>0&&!E&&k(true);},[F,E]),useLayoutEffect(()=>{if(!p&&_.current){let N=document.activeElement;_.current.contains(N)&&W.current?.focus();}},[p]),useLayoutEffect(()=>{let N=_.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]"));p?(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",""));},[p]);let v=css({maxHeight:p?F||"none":0,overflow:p&&!E?"visible":"hidden",transition:E?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:E?"max-height":void 0}),B=css({opacity:p?1:0,transform:p?"translateY(0)":"translateY(1rem)",transition:E?"transform 0.28s ease, opacity 0.28s ease":"none"}),H=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:p?"rotate(180deg)":"rotate(0deg)"}}),O=L&&cloneElement(L,{...typeof L.props=="object"&&L.props?L.props:{},className:[L.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),K=z;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":p?"true":"false","data-disabled":s?"true":"false",css:[C(),b,i],tabIndex:s?-1:0,ref:W,role:"button","aria-expanded":p,"aria-controls":m,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==W.current||M();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),M());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),H],children:O}),jsx("div",{id:m,"aria-hidden":!p,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:_,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:B,children:K})})]})};_a.displayName="Accordion";var Lc=e=>isValidElement(e),Bc=e=>Lc(e)?e.type?.displayName||e.type?.name:void 0,Va=e=>Bc(e)==="Accordion",$c=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zc=(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:a,disabled:c=false,width:i,fullWidth:l=false,className:u,role:m="group",css:h})=>{let f=V(),T=useRef(null),A=Children.toArray(e),y=A.filter(Va),x=y.length,g=o&&r!==void 0,[d,p]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let M=0;M<y.length;M++){let I=y[M].props;if(I.open||I.defaultOpen)return M}return null}),C=o?g?r??null:d:null,F=zc(f.componentHeights?.border,1),R=f.surface.border,E=f.radius.md,k=n,$=k==="outlined";useEffect(()=>{let M=T.current;if(!M)return;let I=D=>{if(D.key!=="ArrowDown"&&D.key!=="ArrowUp"&&D.key!=="Home"&&D.key!=="End")return;let L=Array.from(M.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(L.length===0)return;let z=document.activeElement,w=L.findIndex(v=>v.contains(z));if(w===-1)return;D.preventDefault();let b=w;D.key==="ArrowDown"?b=(w+1)%L.length:D.key==="ArrowUp"?b=(w-1+L.length)%L.length:D.key==="Home"?b=0:D.key==="End"&&(b=L.length-1),L[b]?.focus();};return M.addEventListener("keydown",I),()=>M.removeEventListener("keydown",I)},[x]);let _=css({display:"flex",flexDirection:"column",maxWidth:i!=null?$c(i):void 0,width:l?"100%":i!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&$?`${F} solid ${R}`:"none",borderRadius:t&&$?E:void 0,background:t&&$?f.surface.panelBg:"transparent"}),W=0,S=[];return A.forEach((M,I)=>{if(!Va(M)){S.push(M);return}let D=M.props,P=W++,L=P===0,z=P===x-1,w=c||!!D.disabled,b=k??D.variant,v=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:L?E:0,borderTopRightRadius:L?E:0,borderBottomLeftRadius:z?E:0,borderBottomRightRadius:z?E:0}):css({width:"100%",marginBottom:0}),B=!L&&x>1&&t?css({borderTop:`${F} solid ${R}`}):null,H=$?css({border:"1px solid transparent"}):null,O={variant:b,disabled:w,width:"100%",css:[D.css,v,H,B],className:[D.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let K=D.onChange,N=C===P;O.open=N,O.defaultOpen=void 0,O.onChange=U=>{let G=U?P:null;g||p(G),a?.(G),K?.(U);};}S.push(cloneElement(M,{...D,...O,key:M?.key??I}));}),jsx("div",{ref:T,role:m,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",u||""].join(" ").trim(),css:[_,h],children:S})};ja.displayName="AccordionGroup";var Ut=e=>typeof e=="number"?`${e}px`:e,qa=({children:e,open:t=true,anchorOrigin:n={horizontal:"center",vertical:"bottom"},direction:o="horizontal",padding:r="sm",gap:s="xs",radius:a="lg",offset:c=0,offsetX:i=0,offsetY:l=0,elevated:u=true,unstyled:m=false,fullWidth:h=false,width:f,height:T,role:A="toolbar","aria-label":y,onClose:x})=>{let g=V(),d=useRef(null),p=useRef(null),C=useRef(false),F=useRef(t),R=n.horizontal??"center",E=n.vertical??"bottom",k=b=>typeof b=="string"?g.spacing[b]??b:b,$=b=>typeof b=="string"?g.radius[b]??b:b,_=Ut(k(c)),W=Ut(k(i)),S=Ut(k(l)),M={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:R==="left"?"flex-start":R==="right"?"flex-end":"center",alignItems:E==="top"?"flex-start":E==="bottom"?"flex-end":"center"},I=()=>`${R==="left"?"left":R==="right"?"right":"center"} ${E==="top"?"top":E==="bottom"?"bottom":"center"}`,D=()=>E==="top"||E==="bottom"?`translateY(${E==="bottom"?100:-100}px) scale(0.98)`:E==="center"?R==="left"?"translateX(-100px) scale(0.98)":R==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",P=()=>E==="center"&&R==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",L=24,z={margin:L,marginTop:E==="top"?`calc(${L}px + ${_} + ${S})`:L,marginBottom:E==="bottom"?`calc(${L}px + ${_} + ${S})`:L,marginLeft:R==="left"?`calc(${L}px + ${_} + ${W})`:L,marginRight:R==="right"?`calc(${L}px + ${_} + ${W})`:L,padding:m?0:Ut(k(r)),background:m?"transparent":g.surface.panelBg,border:m?"none":`1px solid ${g.surface.border}`,borderRadius:m?0:Ut($(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Ut(k(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Ut(f):"auto",height:T?Ut(T):"auto",maxWidth:h?"100%":"none"},w=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let b=d.current;if(!b)return;let v=D(),B=P();if(!C.current){C.current=true,F.current=t,b.style.opacity=t?"1":"0",b.style.transform=t?B:v;return}if(F.current===t){b.style.opacity=t?"1":"0",b.style.transform=t?B:v;return}F.current=t,p.current&&p.current.cancel();let H=t?[{opacity:0,transform:v},{opacity:1,transform:B}]:[{opacity:1,transform:B},{opacity:0,transform:v}];return p.current=b.animate(H,{duration:250,easing:"ease",fill:"forwards"}),()=>{p.current&&p.current.cancel();}},[t,R,E]),useEffect(()=>{if(!t||!x)return;let b=v=>{v.key==="Escape"&&x();};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,x]),jsx("div",{css:M,children:jsx("div",{ref:d,css:w,style:z,role:A,"aria-label":y,"aria-hidden":!t,...!t&&{inert:true},children:e})})};qa.displayName="ActionBar";var Xa=(e,t,n)=>Math.min(n,Math.max(t,e)),rs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ga=1,jc=keyframes`100% { transform: rotate(360deg); }`,Uc=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 @@ ${g}{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
|
-
`,Gc=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),Xc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Yc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Gc(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&Xc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=fe.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),T=typeof t=="number",k=Math.max(o-n,1),y=T?Ga(t,n,o):void 0,x=T?(y-n)/k*100:void 0,b=Yc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Zc,{size:s,active:b,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Jc,{thickness:a,active:b,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Jc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),k=css([{position:"relative",width:"100%",height:rs(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,qa):qa,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),b={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...b,left:"-35%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...b,left:"-200%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:k,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Zc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),m=40,h=(m-t)/2,f=2*Math.PI*h,k=`${(o?Ga((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:rs(e,`${u.componentHeights.md}`),height:rs(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),b=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:k,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:b})})})};var Ja=createContext(null),Za=()=>{let e=useContext(Ja);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},lu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),cu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),uu=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),Qa=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:l,children:u,...m},h){let f=V(),T=useId(),k=useId(),y=useMemo(()=>{let F={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?F[c]:F.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},b=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??b:v==="warning"?x.warning??b:v==="success"?x.success??b:v==="info"?x.info??x.primary??b:b)(t),P=I?.[50]??b[50],D=I?.[300]??b[300],B=I?.[600]??I?.[500]??b[600],z=I?.[700]??B,E=I?.[800]??f.text?.primary??"#000",g=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:B,fg:g,border:void 0,iconColor:g}:n==="outlined"?{bg:P,fg:E,border:`1px solid ${D}`,iconColor:E}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:P,fg:E,border:void 0,iconColor:z}},[t,n,b,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),M=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),w=useMemo(()=>[cu,{color:d.iconColor}],[d.iconColor]),A=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[uu,{color:d.fg}],[d.fg]),_=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:k}),[d.fg,d.iconColor,y,T,k]),W=fe.Children.toArray(u).some(F=>fe.isValidElement(F)&&F.type===is),S=fe.Children.toArray(u).some(F=>fe.isValidElement(F)&&F.type===ls);return jsx(Ja.Provider,{value:_,children:jsxs("div",{ref:h,role:p,"aria-live":p==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":W?T:void 0,"aria-describedby":S?k:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[M,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:lu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:A,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});Qa.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Za(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});is.displayName="AlertTitle";var ls=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Za(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});ls.displayName="AlertDescription";var cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yt=e=>e==null?[]:Array.isArray(e)?e:[e],Jt=(...e)=>css(e.filter(Boolean));function 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 Qo=fe.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:k,togglePasswordVisible:y=false,showClear:x,type:b="text",step:d,focusRingMode:p="always",className:C,wrapperCss:M,inputCss:R,labelCss:w,helperRowCss:A,helperTextCss:$,startIconCss:_,endIconCss:W,css:S,onBlur:F,onFocus:I,onKeyDown:P,autoFocus:D,name:B,id:z,tabIndex:E,autoComplete:g,readOnly:v,required:L,maxLength:H,onSurfaceClick:O},K){let N=V(),U=Yo(),G=useId(),se=useMemo(()=>{let ue={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Ee=["sm","md","lg"].includes(m)?m:"md";return ue[Ee]},[m,N]),j=N.neutral,J=N.text,le=b==="number",de=b==="password",ge=n!==void 0,[Pe,Te]=useState(o),Re=ge?n:Pe,Ie=useCallback(ue=>{ge||Te(ue),r?.(ue);},[ge,r]),we=/^-?\d*(?:[.,]\d*)?$/,Q=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(Re??"")),ie=le?Q?"decimal":"numeric":void 0,me=le?Q?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ue=>{(ue===""||we.test(ue))&&Ie(ue);},[Ie]),xe=i?j[200]:a&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:a&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",ee=N.componentHeights.border,oe=h==="outlined"?`${ee} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Jt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?cs(u):void 0,flex:"0 0 auto",fontWeight:500}),be=useMemo(()=>Jt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?j[500]:J.primary,marginBottom:4,display:"inline-block"},...Yt(w)),[se.labelFont,a,i,j,J,N.palette.danger,w]),Ne=useMemo(()=>Jt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(se.paddingY)} ${cs(se.paddingX)}`,background:xe,border:oe,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Yt(M),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,xe,oe,f,i,M,S]),ze=useMemo(()=>Jt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?j[500]:a?N.palette.danger?.[800]??J.primary:J.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?N.palette.danger?.[700]??J.secondary:J.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??J.primary:J.primary} !important`,boxShadow:`0 0 0 1000px ${xe} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??J.primary:J.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Yt(R)),[se.fontSize,i,j,J,a,N.palette.danger,le,xe,R]),X$1=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Yt(_)),[a,N.palette.danger,J.secondary,_]),re=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Yt(W)),[a,N.palette.danger,J.secondary,i,W]),Z=useMemo(()=>Jt({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??J.secondary:J.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Yt(A)),[se.helperFont,a,N.palette.danger,J.secondary,A]),ce=useMemo(()=>Jt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Yt($)),[$]),pe=useRef(null),Ue=useCallback(ue=>{pe.current=ue,K&&(typeof K=="function"?K(ue):K.current=ue);},[K]),Oe=useCallback(ue=>{let Ee=ue.target.value;if(le){Y(Ee);return}H&&Ee.length>H||Ie(Ee);},[le,H,Ie,Y]),[ke,st]=useState(false),He=useCallback(()=>{i||st(ue=>!ue);},[i]),nt=useCallback(()=>{i||(Ie(""),pe.current?.focus());},[i,Ie]),qe=useMemo(()=>{let ue=se.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[se.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:X$1,children:ti(T,qe)}):null,[T,X$1,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ue=[];if(de&&y){let bt=ke?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ue.push(jsx("button",{type:"button",css:re,onMouseDown:Qn=>Qn.preventDefault(),onClick:Qn=>{Qn.stopPropagation(),He();},tabIndex:-1,"aria-label":ke?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&Re&&Re.length>0&&!i&&ue.push(jsx("button",{type:"button",css:re,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=k?jsx("span",{css:re,children:ti(k,qe)},"user-end"):null,at=ue.length>0,De=!!Ee;return !at&&!De?null:!at&&De?Ee:at&&!De?ue.length===1?ue[0]:jsx("span",{css:ot,children:ue}):jsxs("span",{css:ot,children:[ue,Ee]})},[de,y,ke,qe,re,ot,i,x,Re,k,He,nt]),rn=c!=null?`${z??G}-help`:void 0,Zn=z??G,Je=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=pe.current;if(!Ee)return;let at=ue.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),xt=useCallback(ue=>{if(i)return;let Ee=pe.current;if(Ee&&(O?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Zn,className:"plainframe-ui-textfield-label",css:be,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Ne],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Zn,className:"plainframe-ui-textfield-input",css:ze,type:de?ke?"text":"password":b==="number"?"text":b,inputMode:ie,pattern:me,value:Re,maxLength:le?void 0:H,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:F,onFocus:I,onKeyDown:P,autoFocus:D,name:B,tabIndex:E,autoComplete:g,readOnly:v,required:L,"aria-invalid":!!a||void 0,"aria-describedby":rn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Z,children:jsx("span",{id:rn,className:"plainframe-ui-textfield-helper-text",css:ce,children:c})})]})}));Qo.displayName="TextField";var er=fe.createContext("ghost"),Tt=fe.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...m},h){let f=V(),[T,k]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),b=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:b,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:k}),[T]),M=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(P=>{if(P.closest('[role="menu"]')!==I)return false;let D=window.getComputedStyle(P);return D.display!=="none"&&D.visibility!=="hidden"}),[]),w=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),k(false);},[]),A=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(A.current){A.current=false;return}let P=I.currentTarget,D=R(P);D.length>0&&(k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(B=>B.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(B=>B.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true}));},[R]),_=useCallback(I=>{let P=I.currentTarget,D=R(P);if(D.length===0)return;if(I.key==="Tab"){A.current=true,P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.tabIndex=-1,requestAnimationFrame(()=>{P.tabIndex=0,A.current=false;});return}let B=P.querySelector("[data-highlighted]"),z=P.querySelector("[data-hovered]"),E=B||z,g=E?D.indexOf(E):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),g===-1&&(g=I.key==="ArrowDown"?-1:D.length);let v=I.key==="ArrowDown"?1:-1,L=(g+v+D.length)%D.length;D[L].setAttribute("data-highlighted",""),D[L].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[D.length-1].setAttribute("data-highlighted",""),D[D.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.blur();return}},[R]),W=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&w(P);},[w]),S=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&w(P);},[w]),F=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:M,children:jsx(Tt.Provider,{value:p,children:jsx(er.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:F,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:_,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ai.displayName="Menu";var li=createContext(null),or=()=>{let e=useContext(li);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function zu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)zu(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ou=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},tr=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Wu=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Ou(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let b=document.querySelector(".plainframe-ui-popover");if(!b)return;let d=Array.from(b.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(R=>{let w=window.getComputedStyle(R);return w.display!=="none"&&w.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],M=document.activeElement;x.shiftKey&&M===p?(x.preventDefault(),C.focus()):!x.shiftKey&&M===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let k=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(li.Provider,{value:k,children:a})},ci=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:l}=or(),u=fe.Children.only(t),m=u.props||{},h=io(c,o,u.ref),f=a==="click"?{onClick:k=>{k.stopPropagation(),s(!r),m.onClick?.(k);}}:{onMouseEnter:k=>{l(),r||s(true),m.onMouseEnter?.(k);},onMouseLeave:k=>{i(),m.onMouseLeave?.(k);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let k=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[k,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=fe.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return fe.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:ds(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});ui.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var di=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:k,setOpen:y,triggerOn:x,referenceRef:b,scheduleClose:d,cancelClose:p}=or(),C=V(),M=_u(e),{refs:R,x:w,y:A,strategy:$,context:_}=useFloating({open:k,onOpenChange:y,whileElementsMounted:autoUpdate,placement:M,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{b.current&&R.setReference(b.current);},[R,b]);let W=useDismiss(_,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(_,{role:"dialog"}),{getFloatingProps:F}=useInteractions([W,S]),[I]=_.placement.split("-"),P=I,D=`${P==="left"?"right":P==="right"?"left":"center"} ${P==="top"?"bottom":P==="bottom"?"top":"center"}`,B=8,z=P==="top"?{y:B}:P==="bottom"?{y:-B}:P==="left"?{x:B}:{x:-B},E={initial:{opacity:0,scale:.96,...z},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...z},transition:{scale:{type:"spring",stiffness:520,damping:32,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.16,ease:"linear"}}},g=C.surface.panelBg,v=C.text.primary,L=`${C.componentHeights.border} solid ${C.surface.border}`,H=tr(i,C.spacing),O=tr(l,C.spacing),K=tr(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),K&&(N.paddingBlock=K);let U=tr(m,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:A??0,left:w??0,zIndex:1e3,transformOrigin:D,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(a)??"fit-content",height:ds(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),j=r?css({}):css({background:g,color:v,border:L,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),J=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},le=io(R.setFloating,T),de=jsx(motion.div,{className:"plainframe-ui-popover",...F({...f,ref:le,...J}),...E,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?de:null})})});di.displayName="PopoverContent";var Ku=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=fe.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),k=ve(),y={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},x={slideMs:250,pressMs:150,easing:"ease"},b=t!==void 0,[d,p]=useState(n),C=b?!!t:d,[M,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let w=["sm","md","lg"].includes(s)?s:"md",A=y[w],$=`${x.slideMs}ms ${x.easing}`,_=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?_:W,F=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:P,thumb:D}=A,B=(P-D)/2,z=css({display:"inline-flex",alignItems:"center",gap:A.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),E=css({position:"relative",width:I,height:P,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),g=css({position:"absolute",top:B,left:C?I-D-B:B,width:D,height:D,backgroundColor:F,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:M?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),L=()=>{if(r)return;let O=!C;b||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:L,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,k({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[E,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[g,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[v,m],children:a})]})}));var Ju=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},sr=fe.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:k,...y},x)=>{let b=V(),d=ve(),p=typeof e=="boolean",[C,M]=useState(t),R=p?e:C,w=r==="sm"||r==="lg"?r:"md",A=useMemo(()=>Ju(b,w),[b,w]),{checkedBg:$,checkColor:_,borderCol:W,hoverBg:S,gapPx:F}=useMemo(()=>{let O=b.palette||{},K=b.neutral||{},N=b.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=K,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||K,G=l):(U=O.primary||K,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??b.palette.primary[600],j=N[G]??N.primary??b.text?.onColors?.primary??b.text.primary,J=typeof A.gap=="number"?A.gap+2:A.gap;return {checkedBg:se,checkColor:j,borderCol:b.surface.border,hoverBg:b.surface.panelHover,gapPx:J}},[A.gap,l,b]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:F,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:b.radius.sm,padding:b.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:W,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[W,$,a,o,F,S,s,b.radius.sm,b.spacing.xs]),P=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),D=useMemo(()=>css({width:A.box,height:A.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${A.borderWidth} solid ${W}`,outlineOffset:`-${A.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?b.radius.full:A.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"}),[A.box,A.borderRadius,A.borderWidth,W,c,b.radius.full]),B=useMemo(()=>({w:Math.round(A.box*A.iconRatioW),h:Math.round(A.box*A.iconRatioH)}),[A.box,A.iconRatioH,A.iconRatioW]),z=useMemo(()=>css({width:B.w,height:B.h,transition:"opacity .14s ease, transform .14s ease",color:_,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[_,B.h,B.w]),E=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),g=useMemo(()=>css({fontSize:A.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:b.text.primary}),[A.labelFont,b.text.primary]),v=useMemo(()=>css({fontSize:A.labelFont,lineHeight:1.25,color:b.text.secondary,fontWeight:400,marginTop:s&&a?b.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[A.labelFont,a,s,b.spacing.xs,b.text.secondary]),L=useCallback(()=>{o||(p?n?.(!R):M(O=>{let K=!O;return n?.(K),K}));},[o,p,R,n]),H=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},[o,L]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",k||""].join(" ").trim(),css:[I,d({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:R,onChange:L,disabled:o,css:P,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[D,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:_,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:E,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[g,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,T],children:a})]})]})}));sr.displayName="Checkbox";var ed=()=>useContext(gn),td=()=>useContext(ro),nd=()=>useContext(cr),mn=null,bi=(e,t=35)=>{mn!==null&&window.clearTimeout(mn),mn=window.setTimeout(()=>{e(),mn=null;},t);},lo=()=>{mn!==null&&(window.clearTimeout(mn),mn=null);},Ht=fe.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:k,...y},x){let b=ed(),d=nd(),p=lr(),C=uo(),M=td(),R=V(),A=!!useContext(Tt),$=y["data-subtrigger"]!==void 0,_=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,F=useContext(er),I=F==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],P=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:S>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${S}))`:R.spacing.md,minHeight:A?R.componentHeights.sm:R.componentHeights.md,display:"flex",alignItems:"center",gap:R.spacing.sm,fontWeight:500,fontSize:R.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?R.palette.danger[800]:R.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?R.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:I},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:R.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[R,A,S,t,n,I]),D=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"}}),[]),B=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),E=[];A&&E.push({minHeight:R.componentHeights.sm,paddingLeft:R.spacing.sm,paddingRight:R.spacing.xs,paddingTop:R.spacing.xs,paddingBottom:R.spacing.xs});let g=()=>{s?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let K=H.closest('[role="menu"]');if(!K)return;let N=Array.from(K.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(J=>{if(J.closest('[role="menu"]')!==K)return false;let le=window.getComputedStyle(J);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),j=N[se];j&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),b&&T!=null&&b.setActiveIndex(se));},L=t?-1:M?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:L,ref:H=>{if(b&&!k){let O=b.listRef.current;H&&(T!=null?O[T]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&bi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');K?.hasAttribute("data-keyboard-nav")&&K.removeAttribute("data-keyboard-nav"),!t&&b&&T!=null&&b.setActiveIndex(T),!t&&!M?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)lo();else {let N=!!H.currentTarget.closest("[data-submenu-content]");p&&!N&&bi(p.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&b&&T!=null&&(K?.hasAttribute("data-keyboard-nav")&&(K.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),b.setActiveIndex(T)),!t&&!M?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{b&&b.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&b&&!M?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!b){let K=O.closest('[role="menu"]');if(K){K.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=K.tabIndex;K.tabIndex=-1,requestAnimationFrame(()=>{K.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),g());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[P,...E,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),g());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:D,children:l}),a,(f!=null||_||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:B,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:R.typography.sizes.sm,color:R.text.secondary,whiteSpace:"nowrap"}),children:f}):null,_,m&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=fe.createContext(null),hs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,k=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(k),l.current?.(k);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(yi.Provider,{value:m,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:m,...h},f){let T=useContext(yi),k=!!T&&r!==void 0,y=!k&&t!==void 0,[x,b]=useState(()=>k?T.values.some(W=>Object.is(W,r)):!!n),d=k?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),M=!!useContext(Tt),R=()=>{if(!c)if(k)T.toggle(r);else {let W=!d;y||b(W),o?.(W);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:M?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),A=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),_=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:w,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:d,css:A})}),u]});return jsx(Ht,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon:_,endIcon:m,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:m,...h},f){let T=t!==void 0,[k,y]=useState(!!n),x=T?!!t:k,d=!!useContext(Tt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),M=()=>{if(a)return;let w=!x;T||y(w),o?.(w);},R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(Ht,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:M,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(gs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});xi.displayName="MenuSwitchItem";var vi=fe.createContext(null),Ci=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(vi.Provider,{value:i,children:o})};Ci.displayName="MenuRadioGroup";var od=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(vi),u=l?.value===t,m=V(),h=css({width:m.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:m.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Ht,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:h,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),fn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let m=V(),f=!!useContext(Tt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,k=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),b=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(k,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:b,children:a})]})});fn.displayName="MenuLabel";var rd=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var Ti=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},ys=io,po=0,ur=null,dr=null,yd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function xd(){if(!(typeof document>"u")){if(po===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=yd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function vd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;ur!==null&&(e.style.overflow=ur),dr!==null&&(e.style.paddingRight=dr),ur=null,dr=null;}}var gn=createContext(null),pr=()=>{let e=useContext(gn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),Cd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),wi=createContext(null),lr=()=>useContext(wi),Ei=createContext(false),Rd=()=>useContext(Ei),ro=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Td(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var wd=()=>Cd()?.activeIndex??null,Si=0,Ln=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(F=>{F&&Ti(h.current),e===void 0&&i(F),n?.(F);},[e,n]),m=useRef(`pfui-menu-${++Si}`),h=useRef(null),f=useRef([]),T=useRef(null),[k,y]=useState(null),[x,b]=useState(false);useEffect(()=>{l||(y(null),f.current=[],b(false));},[l]);let d=useRef(null),p=useCallback((F,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let P=I??20;d.current=window.setTimeout(()=>u(F),P);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return xd(),()=>vd()},[l,r]);let M=xs(),[R]=useState(()=>M??Td()),w=useRef(new Set),A=useMemo(()=>({registerSubMenu:F=>(w.current.add(F),()=>w.current.delete(F)),closeAllSubMenus:()=>{w.current.forEach(F=>F());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),_=useMemo(()=>({activeIndex:k,setActiveIndex:y}),[k,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:b}),[x]),S=s==="sm";return jsx(cr.Provider,{value:R,children:jsx(Tt.Provider,{value:S,children:jsx(oo.Provider,{value:W,children:jsx(wi.Provider,{value:A,children:jsx(mo.Provider,{value:_,children:jsx(gn.Provider,{value:$,children:a})})})})})})};Ln.displayName="DropdownMenu";var Bn=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:k,menuId:y}=pr(),x=uo(),b=lr(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,M=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:w,...A}=s,$=useMemo(()=>ys(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),_=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(D=>{let B=_();requestAnimationFrame(()=>B[D]?.focus());},[_]),S=useCallback(D=>{if(D.key==="Tab"&&c){D.preventDefault(),x?.setIsKeyboardNav(true);let B=k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=B.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');z&&(document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(D.key==="ArrowRight"&&c){let B=document.querySelector("[data-subtrigger][data-hovered]");if(B){D.preventDefault(),D.stopPropagation(),x?.setIsKeyboardNav(true),B.removeAttribute("data-hovered"),B.setAttribute("data-highlighted",""),B.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});B.dispatchEvent(z);});return}}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){D.preventDefault(),i(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=Array.from(B.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=>{let g=E.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(E);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let E=D.key==="ArrowDown"?0:z.length-1;h(E),z[E]?.setAttribute("data-highlighted",""),z[E]?.focus();}}}),C?.(D),R?.(D);return}if(c){D.preventDefault();let B=document.querySelectorAll("[data-hovered]");for(let E of Array.from(B))if(E.closest("[data-submenu-content]")){let v=E.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let L=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let K=window.getComputedStyle(O);return K.display!=="none"&&K.visibility!=="hidden"}),H=L.indexOf(E);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),E.removeAttribute("data-hovered"),H!==-1&&L.length>0){let O=D.key==="ArrowDown"?1:-1,K=(H+O+L.length)%L.length;L[K]?.setAttribute("data-highlighted",""),L[K]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(z){z.setAttribute("data-keyboard-nav",""),b?.closeAllSubMenus();let E=Array.from(z.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(g=>{if(g.closest('[role="menu"]')!==z)return false;let v=window.getComputedStyle(g);return v.display!=="none"&&v.visibility!=="hidden"});if(E.length>0){let g=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),L=-1;g?L=E.indexOf(g):v&&(L=E.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(K=>K.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),L===-1&&(L=D.key==="ArrowDown"?-1:E.length);let H=D.key==="ArrowDown"?1:-1,O=(L+H+E.length)%E.length;h(O),E[O]?.setAttribute("data-highlighted",""),E[O]?.focus();}}C?.(D),R?.(D);return}}if((D.key==="Enter"||D.key===" ")&&!c){D.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=Array.from(B.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=>{let g=E.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(E);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(D),R?.(D);return}C?.(D),R?.(D);},[c,i,h,C,R,_,W,m,x,y,k,b]),F=useCallback(D=>{l==="click"&&((D.nativeEvent.composedPath?.()??[]).some(g=>{let v=g;if(!v||!("tagName"in v))return false;let L=String(v.tagName).toUpperCase();if(L==="INPUT"||L==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(D.stopPropagation(),i(!c))),M?.(D),w?.(D);},[l,c,i,M,w]),I=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},P=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&p){let D=p.props,B=D.css,z=typeof D.className=="string"?D.className:void 0,E=typeof D.tabIndex=="number"?D.tabIndex:0,g={ref:$,tabIndex:E,className:[z,o].filter(Boolean).join(" ")||void 0,css:[B,P,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...I,...A};return cloneElement(p,g)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),P,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...I,...A,children:t})});Bn.displayName="DropdownMenuTrigger";var yn=fe.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:k,exitPlacement:y,animateOnBusClose:x=true,gap:b,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...M},R)=>{let{open:w,setOpen:A,referenceRef:$,clearSubmenuHover:_,setActiveIndex:W,floatingRef:S,menuId:F}=pr(),I=V(),P=xs(),D=uo();useEffect(()=>{if(!P)return;let X=P.registerCloser(()=>A(false));return ()=>{X&&X();}},[P,A]);let B=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,E=typeof s=="string"?parseFloat(s):s,g=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(X=>({getBoundingClientRect:()=>{let re=Math.round(X.x),Z=Math.round(X.y);return {x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0,toJSON:()=>({x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0})}},contextElement:void 0}),[]),L=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let X=e;return v({x:X.x,y:X.y})},[e,v]),{refs:H,x:O,y:K,strategy:N,context:U,update:G}=useFloating({open:w,onOpenChange:A,placement:g,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:B??0,crossAxis:z??0}),flip({padding:E??8}),shift({padding:E??8}),size({apply({rects:X,elements:re}){let Z=re.floating;Z.style.boxSizing="border-box",i!=null?Z.style.height=typeof i=="number"?`${i}px`:String(i):Z.style.removeProperty("height"),c!=null?Z.style.width=typeof c=="number"?`${c}px`:String(c):a?Z.style.width=`${Math.round(X.reference.width)}px`:Z.style.width="200px",l!=null?Z.style.maxHeight=typeof l=="number"?`${l}px`:String(l):Z.style.removeProperty("max-height");}})]});useEffect(()=>{L?H.setReference(L):$.current&&H.setReference($.current);},[H,L,$]),useEffect(()=>{if(!w)return;let X=L||$.current,re=H.floating.current;if(!(!X||!re))return autoUpdate(X,re,G)},[w,L,$,H,G]),useEffect(()=>{G();},[G,a,c,i,l]),useEffect(()=>{w&&!h&&W(0);},[w,h,W]),useEffect(()=>{if(!m||!w)return;let X=()=>{let re=document.activeElement,Z=$.current,ce=H.floating.current;re&&(Z?.contains(re)||ce?.contains(re)||A(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,w,A,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:X=>{if(d?.length){let re=X.target;for(let Z of d)if(Z.current?.contains(re))return false}return true}}),j=useRole(U,{role:"menu"}),{getFloatingProps:J}=useInteractions([se,j]),le=useRef(false);useEffect(()=>{w?le.current=true:le.current&&$.current&&C&&(P?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[w,$,P,C]),useLayoutEffect(()=>{if(!w)return;let X=()=>{let ce=S?.current;if(!ce)return false;let pe=ce.closest('[data-floating-ui-portal="true"]')??ce,Ue=$?.current;if(!Ue)return false;let Oe=Ue.closest("[data-pfui-portal-owner]");if(Oe){let He=Oe.getAttribute("data-pfui-portal-owner");if(!He)return false;if(pe.getAttribute("data-pfui-portal-owner")===He&&ce.getAttribute("data-pfui-portal-owner")===He)return true;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=Oe.getAttribute("data-pfui-mode"),qe=Oe.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<Oe.style.length;Ge++){let ot=Oe.style[Ge];if(ot.startsWith("--pf-")){let dt=Oe.style.getPropertyValue(ot);pe.style.setProperty(ot,dt),ce.style.setProperty(ot,dt);}}return pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),Oe.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),Oe.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark")),true}let ke=Ue.closest('[data-floating-ui-portal="true"]');if(ke&&!ke.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let He=st.getAttribute("data-pfui-scope");if(!He)return false;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe)),pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),st.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${He}"]`);if(Ge&&Ge!==pe)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let rn=Ge.style.getPropertyValue(dt);pe.style.setProperty(dt,rn),ce.style.setProperty(dt,rn);}}return true}return false},re=[0,5,15,30,60,100,150,250],Z=[];for(let ce of re)Z.push(window.setTimeout(()=>X(),ce));return ()=>{for(let ce of Z)window.clearTimeout(ce);}},[w,$]);let de=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),ge=b===void 0?void 0:typeof b=="number"?b:I.spacing[b]??b,Pe=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":de,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:ge,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Te=-1,Re=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let Z=X.type?.displayName;if(Z==="DropdownMenu"||Z==="DropdownMenuSub")return X;if(Z==="MenuItem"||Z==="MenuCheckboxItem"||Z==="MenuRadioItem"||Z==="MenuSwitchItem")return Te+=1,cloneElement(X,{__index:Te,key:X.key??Te});if(Z==="DropdownMenuTrigger"){let pe=X.props.children;return cloneElement(X,{children:fe.Children.map(pe,Re)})}if(Z==="DropdownMenuSubTrigger"){Te+=1;let pe=Te;return cloneElement(X,{__index:pe,key:X.key??pe})}let ce=X.props.children;return ce==null?X:cloneElement(X,{children:fe.Children.map(ce,Re)})},Ie=fe.Children.map(k,Re),Q=U.placement.split("-")[0]||"bottom",ie=Q==="bottom"?"center top":Q==="top"?"center bottom":Q==="left"?"right center":"left center",me=Q==="bottom"?{opacity:0,y:-8,scale:.96}:Q==="top"?{opacity:0,y:8,scale:.96}:Q==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Y=y??Q,xe=Y==="bottom"?{opacity:0,y:-8,scale:.96}:Y==="top"?{opacity:0,y:8,scale:.96}:Y==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},oe=!!P?.isBusClosingRef.current&&!x?{scale:{duration:0},x:{duration:0},y:{duration:0},opacity:{duration:0}}:{scale:{type:"spring",stiffness:520,damping:38,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.12,ease:"linear"}},ae=css({position:N,top:K??0,left:O??0,zIndex:1e3,transformOrigin:ie}),be=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),D?.setIsKeyboardNav(true);let re=X.currentTarget;re.setAttribute("data-keyboard-nav","");let Z=Array.from(re.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(ce=>{if(ce.closest('[role="menu"]')!==re)return false;let pe=window.getComputedStyle(ce);return pe.display!=="none"&&pe.visibility!=="hidden"});if(Z.length>0){let ce=re.querySelector("[data-highlighted]"),pe=re.querySelector("[data-hovered]"),Ue=-1;ce?Ue=Z.indexOf(ce):pe&&(Ue=Z.indexOf(pe)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),pe&&pe.removeAttribute("data-hovered"),Ue===-1&&(Ue=X.key==="ArrowDown"?-1:Z.length);let Oe=X.key==="ArrowDown"?1:-1,ke=(Ue+Oe+Z.length)%Z.length;W(ke),Z[ke]?.setAttribute("data-highlighted",""),Z[ke]?.focus();}}},[D,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...M,ref:ys(R,H.setFloating,X=>{if(S&&(S.current=X),X&&$.current){let Z=$.current.closest("[data-pfui-portal-owner]");if(Z){let ce=Z.getAttribute("data-pfui-portal-owner");if(ce){X.setAttribute("data-pfui-portal-owner",ce);let pe=Z.getAttribute("data-pfui-mode"),Ue=Z.getAttribute("data-pfui-primary");pe&&X.setAttribute("data-pfui-mode",pe),Ue&&X.setAttribute("data-pfui-primary",Ue);for(let Oe=0;Oe<Z.style.length;Oe++){let ke=Z.style[Oe];ke.startsWith("--pf-")&&X.style.setProperty(ke,Z.style.getPropertyValue(ke));}Z.classList.contains("pf-light")&&X.classList.add("pf-light"),Z.classList.contains("pf-dark")&&X.classList.add("pf-dark");}}}})}),"data-menu-id":F,"data-keyboard-nav":D?.isKeyboardNav?"":void 0,className:f,css:[Pe,ae,T],initial:me,animate:{opacity:1,x:0,y:0,scale:1},exit:xe,transition:oe,onPointerMove:X=>ze(X.currentTarget),onPointerDown:X=>ze(X.currentTarget),onKeyDown:be,onMouseMove:Ne,onMouseEnter:()=>{_(),P?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:Ie})}):null})})});yn.displayName="DropdownMenuContent";var Ii=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Rd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&Ti(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,F)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=F??20;m.current=window.setTimeout(()=>{h.current=false,u(S);},I);},[o,u]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let k=lr();useEffect(()=>{if(!k)return;let S=()=>{T(),u(false);};return k.registerSubMenu(S)},[k,u,T]);let y=useRef(`pfui-submenu-${++Si}`),x=useRef(null),b=useRef([]),d=useRef(null),[p,C]=useState(null),[M,R]=useState(false);useEffect(()=>{l||(C(null),b.current=[],R(false));},[l]);let w=useContext(Tt),A=r??w,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:b,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),_=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:M,setIsKeyboardNav:R}),[M]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:fe.Children.map(s,S=>{if(!isValidElement(S))return S;let F=S.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Ei.Provider,{value:true,children:jsx(Tt.Provider,{value:A,children:jsx(mo.Provider,{value:_,children:jsx(oo.Provider,{value:W,children:jsx(gn.Provider,{value:$,children:s})})})})})};Ii.displayName="DropdownMenuSub";var ki=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=pr(),k=uo(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),b=x?t:null,d=b?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:M,onClick:R,...w}=s,A=useMemo(()=>ys(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,_=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let F=S.currentTarget,I=P=>{k?.setIsKeyboardNav(true);let D=F.closest("[data-menu-id]");if(!D)return;D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let B=Array.from(D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==D)return false;let L=window.getComputedStyle(v);return L.display!=="none"&&L.visibility!=="hidden"});if(!B.length)return;let z=B.indexOf(F),E=z>=0?z:0,g=P==="next"?(E+1)%B.length:(E-1+B.length)%B.length;B[g]?.setAttribute("data-highlighted",""),B[g]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),k?.setIsKeyboardNav(true);let P=S.currentTarget;i(true),requestAnimationFrame(()=>{let D=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(D){D.setAttribute("data-keyboard-nav",""),P.removeAttribute("data-highlighted"),P.removeAttribute("data-hovered");let B=D.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])');B&&(B.setAttribute("data-highlighted",""),B.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let P=F.closest("[data-menu-id]");P&&P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),F.setAttribute("data-highlighted",""),F.focus(),k&&k.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),M?.(S);},[c,i,p,M,u,k,T]),W=l==="hover"?{onMouseEnter:S=>{let F=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),F.setAttribute("data-hovered",""),F.focus({preventScroll:true});let I=F.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),k&&k.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let F=S.currentTarget;lo(),F.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),F.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&b){let S=d?.css,F=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,P={ref:A,tabIndex:I,className:[F,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:D=>{if(D.target.hasAttribute("data-highlighted")){let B=D.target.closest("[data-menu-id]");B&&!B.hasAttribute("data-keyboard-nav")&&(B.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(D);},...W,...w};return cloneElement(b,P)}return jsx("div",{ref:A,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:_,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let F=S.currentTarget.closest("[data-menu-id]");F&&!F.hasAttribute("data-keyboard-nav")&&(F.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...W,...w,children:t})});ki.displayName="DropdownMenuSubTrigger";var Ai=fe.forwardRef((e,t)=>{let n=xs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=pr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(yn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});Ai.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Id=css({display:"inline"}),Mi=css({display:"inline",fontWeight:700}),kd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Ad=css({display:"flex",alignItems:"center",gap:4}),Fd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Pi=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}),Pd=()=>{},Dd=e=>e,Nd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Hd=e=>{e.preventDefault(),e.stopPropagation();},Ld=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Bd=e=>{e.preventDefault(),e.stopPropagation();},Di=fe.memo(({onCapture:e})=>{let t=useContext(gn),n=useContext(mo),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Di.displayName="CtxCapture";var vs=fe.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),k=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Fd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Pi,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Md,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Pi,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(b=>Object.is(b,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:k},e.value)}return s?jsx(Ht,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Ht,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:k},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));vs.displayName="AutocompleteRow";var Ni=fe.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:k,disabled:y=false,error:x=false,showClear:b=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:M=true,openOnClick:R=true,closeOnSelect:w=true,closeOnBlur:A=true,blurOnSelect:$=false,freeSolo:_=false,customValueLabel:W=false,maxHeight:S,maxItems:F,noResultsText:I="No Items Found",highlightTypedValue:P,typedValueHighlightCss:D,showNoResults:B=true,noResultsLabelCss:z,loadingLabelCss:E,loadItems:g,loading:v,loadingText:L="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:K,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:j,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:de,textFieldHelperRowCss:ge,textFieldHelperTextCss:Pe,textFieldStartIconCss:Te,textFieldEndIconCss:Re,menuContentCss:Ie})=>{let Q=V().text.secondary,[ie,me]=useState(""),Y=typeof d=="boolean",[xe,ee]=useState(false),oe=Y?d:xe,ae=useRef(null),be=useRef(null),Ne=useRef(null),ze=useRef(null),X=useRef(false),re=useRef(null),Z=useRef(false),ce=useRef(0),pe=useMemo(()=>[be],[]),[Ue,Oe]=useState(N??[]),ke=K??Ue,st=useRef(ke);st.current=ke;let[He,nt]=useState(null),qe=useRef(He);qe.current=He;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[rn,Zn]=useState(false),Je=typeof g=="function",xt=Je?ot:e,ue=useRef(xt);ue.current=xt;let Ee=!!v||rn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let De=useCallback(q=>{Y||ee(q),at.current?.(q);},[Y]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let q=ie;return bt.current=window.setTimeout(async()=>{Zn(true);try{let ne=await g(q)||[];dt(Array.isArray(ne)?ne:[]);}catch{dt([]);}finally{Zn(false);}},Math.max(0,H)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,g,H]);let Qn=useMemo(()=>{let q=mr(ie);return q?xt.some(ne=>mr(ne.title??ne.value)===q):false},[xt,ie]),ia=_&&!!W&&ie.trim().length>0&&!Qn,ic=q=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),Ce=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||Ce){let Ae=ne?W.prefix??"":"",he=Ce?W.suffix??"":"";return `${Ae}${q}${he}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Je)return xt;let q=mr(ie);if(!q)return xt;let ne=[],Ce=[];for(let Ae of xt){let he=mr(Ae.title??Ae.value);he.split(" ").some(Ze=>Ze.startsWith(q))?ne.push(Ae):he.includes(q)&&Ce.push(Ae);}return ne.length>0?ne:Ce},[xt,ie,Je]),la=useMemo(()=>{if(ia){let q=ie.trim();return [...$r,{value:q,title:ic(q),__pfui_free__:true}]}return $r},[$r,ia,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of la){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof F=="number"?Math.max(0,F):1/0,he=[];for(let pt of q){if(Ae<=0)break;let an=ne.get(pt).slice(0,Ae);an.length>0&&(he.push({label:pt==="__ungrouped__"?void 0:pt,items:an}),Ae-=an.length);}return he},[la,F]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),Ho=kn.length>0,zr=!Ho&&!!B&&!Ee&&ie.trim().length>0,An=Ee||Ho||zr,Lo=An||Je;useEffect(()=>{!Je&&oe&&!An&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));},[Je,oe,An,De]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(_&&!O){if(Wr.current){Wr.current=false;return}let q=ie.trim();if(Or.current===q)return;Or.current=q,t?.({value:q,title:q});}},[ie,_,O,t]);let _r=useCallback(q=>{let ne=ue.current,Ce=new Map(ne.map(he=>[he.value,he])),Ae=q.map(he=>Ce.get(he)??{value:he,title:he});U?.(Ae);},[U]),Bo=useCallback(q=>{let ne=q.map(String);K||Oe(ne),_r(ne);},[K,_r]),ca=useCallback(q=>{let Ce=ke.includes(q)?ke.filter(Ae=>Ae!==q):[...ke,q];Bo(Ce);},[ke,Bo]),$o=useCallback(q=>{let ne=ue.current.find(Ce=>Ce.value===q)??{value:q,title:q};ne.disabled||(Wr.current=true,Or.current=(ne.title??ne.value).trim(),nt(ne),me(ne.title??ne.value),t?.(ne),Y||(w?(X.current=false,Z.current=true,ee(false),at.current?.(false),setTimeout(()=>{Z.current=false;},150)):X.current=true),!w&&Ne.current?.setActiveIndex&&Ne.current.setActiveIndex(null),$?(X.current=false,setTimeout(()=>{ze.current&&ae.current?(ze.current.tabIndex=0,ze.current.focus(),ze.current.blur(),ze.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,Y,w,$]),lc=useCallback(q=>{if(y)return;me(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):_&&nt(null)),!Y&&!ne&&M&&!oe&&De(true);},[O,Y,M,oe,De,y,_,t]),it=Nd,ua=Pd,cc=Dd,da=useMemo(()=>D?[Mi,D]:Mi,[D]),uc=useCallback(q=>{let ne=ie.trim();if(!ne||ne.length<1)return q;let Ce=ne.toLowerCase(),he=q.toLowerCase().indexOf(Ce);return he<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Id,children:[q.slice(0,he),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:da,children:q.slice(he,he+ne.length)}),q.slice(he+ne.length)]})},[ie,da]),zo=P?uc:cc,dc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Hd,Wo=Ld,pc=useCallback(q=>{Ne.current=q;},[]),pa=useCallback(q=>{let ne=Ne.current;if(!ne)return;let Ce=kn.length;if(Ce===0)return;let Ae=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),he=-1;if(Ae){let Ze=Ae.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),an=Ae.querySelector("[data-active]")||Ae.querySelector("[data-hovered]");an&&(he=Array.from(Ze).indexOf(an));}he<0&&typeof ne.activeIndex=="number"&&(he=ne.activeIndex);let pt=he<0?q===1?0:Ce-1:(he+q+Ce)%Ce;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(Vr=>Vr.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(Vr=>Vr.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[kn.length]),mc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!An&&!Je)return;q.preventDefault(),!oe&&!Y&&De(true),pa(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let ne=Ne.current&&typeof Ne.current.activeIndex=="number"?Ne.current.activeIndex:-1,Ce=ne>=0&&ne<kn.length?kn[ne]:null;if(oe&&Ce&&ne>=0){q.preventDefault(),q.stopPropagation(),O?(ca(Ce.value),w||requestAnimationFrame(()=>ae.current?.focus())):$o(Ce.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),oe&&!Y&&(Z.current=true,De(false),q.target.focus(),setTimeout(()=>{Z.current=false;},150))):q.key==="Tab"&&oe&&!Y&&De(false);},[An,Je,oe,Y,kn,O,w,pa,ca,$o,De,y]),fc=useCallback(()=>{y||Z.current||C&&Lo&&(ce.current=Date.now(),Y||De(true));},[Y,C,Lo,De,y]),gc=useCallback(()=>{if(X.current){X.current=false;return}A&&De(false),!_&&!O&&(He?me(He.title??He.value):ie.trim()&&me(""));},[A,_,O,He,ie,De]),ma=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{q.push(jsx(vs,{item:he,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:ua,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),jsx(hs,{values:ke,onValuesChange:Bo,children:q},"multi-group")},[Vt,it,Ge,s,zo,ke,Bo,ua,Wo,Oo,Q]),fa=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{let pt=He?.value===he.value;q.push(jsx(vs,{item:he,absIndex:ne,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:w,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),q},[Vt,it,He,Ge,s,zo,w,$o,Wo,Oo,Q]),bc=useMemo(()=>Ee?jsx(fn,{css:E,className:it("label-loading"),children:L},"loading"):zr?jsx(fn,{css:z,className:it("label-empty"),children:I},"empty"):Vt.length===0?null:O?ma():fa(),[Ee,zr,Vt.length,it,L,I,O,ma,fa]),sn=oe?false:y||!Je&&!Ho&&!B,ga=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(sn||y)&&(Y||(oe?(Z.current=true,De(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{Z.current=false;},150)):(De(true),queueMicrotask(()=>ae.current?.focus()))));},[oe,Ho,Je,De,sn,y,Y]),ba=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:oe?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:sn?"not-allowed":"pointer",userSelect:"none",opacity:sn?.5:1}),[oe,sn]),_o=useMemo(()=>se?jsx("span",{ref:re,role:"button",tabIndex:-1,css:[ba,j],"aria-disabled":sn||void 0,onMouseDown:Bd,onClick:ga,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ba,j,sn,ga,G]),hc=useMemo(()=>T&&_o?jsxs("span",{css:Ad,children:[T,_o]}):T??_o,[T,_o]),yc=useCallback(q=>{if(!(re.current&&re.current.contains(q.target)||Z.current||y||Date.now()-ce.current<300)){if(oe){!ie.trim()&&!Y&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));return}R&&Lo&&(!Y||R)&&De(true);}},[oe,ie,R,Lo,De,y,Y]);return jsx("div",{ref:be,className:it(""),css:[dc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Di,{onCapture:pc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:kd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:lc,onKeyDown:mc,onFocus:fc,onBlur:gc,onSurfaceClick:yc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:hc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:b,css:i,wrapperCss:J,inputCss:le,labelCss:de,helperRowCss:ge,helperTextCss:Pe,startIconCss:Te,endIconCss:Re}),jsx("span",{ref:ze,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),An&&jsx(yn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:pe,disableOutsidePressDismiss:Y,returnFocus:!$,children:bc})]})})});Ni.displayName="Autocomplete";var _d=["sm","md","lg"],Kd=(e,t)=>typeof e=="number"?e:_d.includes(e)?t.componentHeights[e]:t.componentHeights.md,Vd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},jd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Ud=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Hi=fe.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Kd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Vd(u,o),b=jd(u,o),d=Ud(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":b,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),M=css({fontSize:k,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[p,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:M,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:M,children:d})})}));Hi.displayName="Avatar";var Li=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),m=ve(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let R=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Li(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),k=typeof t=="number"&&t>=0,y=k&&T.length>t?T.slice(0,t):T,x=k&&T.length>t?T.length-t:0,b=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Li(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${b}`,backgroundColor:b,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),M=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[p,r,m()],children:[y.map((R,w)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:jsx("span",{css:M,children:R})},w);let A=R,$=A.props?.css,_=$==null?M:[M,$],W=cloneElement(A,{size:n,rounded:s,css:_,style:{...A.props?.style,width:"100%",height:"100%",objectFit:A.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:W},w)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var zi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ep=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",tp=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",np=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),op=fe.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:k,className:y,badgeClassName:x,css:b,badgeCss:d,offsetX:p,offsetY:C})=>{let M=V(),R=s==="dot",w=f??(R?8:17),A=r??(R?0:10),{scale:$,onKey:_}=Zd(M,t),W=Qd($),S=M.text?.onColors||{},F=ep(M,S,_,n),I=tp(e,a,s),P=np(i,s,e,c),D=css({position:"relative",display:"inline-block"}),B=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=zi(p??B),E=zi(C??B),g=l.vertical||"top",v=l.horizontal||"right",L={},H="0",O="0";g==="center"?(L.top="50%",O="-50%"):g==="top"?(L.top=E,O="-45%"):(L.bottom=E,O="45%"),v==="center"?(L.left="50%",H="-50%"):v==="right"?(L.right=z,H="45%"):(L.left=z,H="-45%");let K=P?1:.8,N=css({minWidth:R?w:w/2,height:w,background:W,color:F,fontSize:typeof A=="number"?`${A}px`:A,fontWeight:o,borderRadius:999,padding:R?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",...T?{boxShadow:`0 0 0 2px ${k??M.surface?.appBg}`}:{},opacity:P?1:0,transform:`translate(${H}, ${O}) scale(${P?K:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...L});return jsxs("div",{className:["plainframe-ui-badge-wrapper",y||""].join(" ").trim(),css:[D,b],children:[m,jsx("span",{"aria-hidden":!P,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Is=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...k})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[b,d]=useState(e),[p,C]=useState(e),M=useRef(null),R=useRef(null),w=useRef(null);useEffect(()=>(M.current&&(clearTimeout(M.current),M.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),M.current=setTimeout(()=>{d(false),M.current=null;},u)),()=>{M.current&&(clearTimeout(M.current),M.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let F=document.body,I=F.style.overflow,P=F.style.paddingRight,D=window.innerWidth-document.documentElement.clientWidth,B=parseFloat(getComputedStyle(F).paddingRight||"0");return F.style.overflow="hidden",D>0&&(F.style.paddingRight=`${B+D}px`),()=>{F.style.overflow=I,F.style.paddingRight=P;}},[e,T]),useEffect(()=>{if(!p||!t)return;let F=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[p,t]);let A=F=>{if(!p||!t||!w.current)return;let I=F.target;I&&!w.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!b)return null;let _=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:p?"auto":"none",visibility:b?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!b||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[_,a],onPointerDown:A,...k,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,i],role:"presentation"}),jsx("div",{ref:w,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function lp(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var cp=fe.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let m=V(),h=ve(),f=fe.useMemo(()=>fe.Children.toArray(e).flatMap(d=>{if(!fe.isValidElement(d))return [];let{type:p,props:C}=lp(d);if(!(p===hr||typeof p=="function"&&"displayName"in p&&p.displayName===hr.displayName))return [];let R=C;return [{href:R.href,disabled:R.disabled,node:R.children,className:R.className,css:R.css,onClick:R.onClick,startIcon:R.startIcon,endIcon:R.endIcon}]}),[e]),T=fe.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),k=fe.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=fe.useCallback((d,p,C)=>{let M=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:M,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=fe.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),b=fe.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,M=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",M?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),w=[y(C,M,d.disabled),o,C?r:s,M?a:void 0,h(),d.css],A=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:b,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(fe.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,c],children:t}),M?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:w,children:A}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:R,css:w,children:A})]},p)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},As=e=>typeof e=="number"?`${e}px`:e,Ki=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Ki(n)&&(t=true));}),t};function mp(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function fp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var Vi=fe.memo(fe.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:k,...y},x)=>{let b=V(),d=ve(),p=useMemo(()=>mp(b,t),[b,t]),C=useMemo(()=>fp(b,e),[b,e]),M=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Ki(u)&&fe.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,w=useMemo(()=>ks(n,R),[n,R]),A=useMemo(()=>ks(o,R),[o,R]),$=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),_=useMemo(()=>M?"center":l??"center",[M,l]),W=!!c&&_==="center",S=!!c&&_==="start",F=!!c&&_==="end",I=a||c,P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?b.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,b,I]),D=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),B=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(M&&!s?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:As(p.iconSize)}:{fontSize:As(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[M,s,p,n,o]),E=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:As(b.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[b,W]),g=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),L=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),K=useMemo(()=>()=>{if(M)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?w||n:null}),jsx("span",{css:H(!!S),children:$})]})},[M,n,S,L,H,w,c,$]),N=useMemo(()=>()=>{if(M)return null;let G=!!o;return !G&&!F?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!F),children:G?A||o:null}),jsx("span",{css:H(!!F),children:$})]})},[M,o,F,L,H,A,c,$]),U=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[P,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),D,B,z,k],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:E,children:[K(),jsx("span",{className:"plainframe-ui-button-label",css:g,children:M?c?$:ks(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));Vi.displayName="Button";var Cr=e=>isValidElement(e),gp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>gp(e)===t,qi=e=>Ds(e,"ButtonGroup"),Gi=e=>Ds(e,"DropdownMenu"),Ms=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,bp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,hp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ps=(e,t)=>{if(!Cr(e))return null;if(qi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ps(t?n[0]:n[n.length-1],t):null}if(Gi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Ms);return o?Ps(o,t):null}if(Ms(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Ui=(e,t)=>{if(!e)return false;let n=Ps(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return hp(o)},Xi=fe.memo(fe.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...k},y){let x=V(),b=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:b,p=o==="vertical",C=bp(x.componentHeights.border,1),M=x.surface.border,R=n&&!!f,w=n&&!!T,A=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?On(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:On(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,S=0,F=false,I=[];for(let P of $){if(!Cr(P)){I.push(P);continue}let D=S===0,B=S===W-1,z=P.props??{},E=z.disabled??s,g=z.size??a,v=0,L=0,H=0,O=0;n&&(p?(v=D?R?0:d:0,L=D?w?0:d:0,O=B?R?0:d:0,H=B?w?0:d:0):(v=D?R?0:d:0,O=D?R?0:d:0,L=B?w?0:d:0,H=B?w?0:d:0));let K=Ui(P,"left"),N=Ui(P,"right"),se=n&&!D&&!(F&&K)&&!(F||K)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${M}`}):null,j=n&&!D&&F&&K?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(L),borderBottomRightRadius:On(H),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Gi(P)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=qi(P)&&n?{__clipLeft:!D,__clipRight:!B}:{},Q=cloneElement(P,{...z,disabled:E,size:g,className:Ie,css:[Re,de],...we});I.push(Q),F=N,S+=1;continue}let ge=z.children,Pe=Children.map(ge,Re=>{if(!Cr(Re)||!Ms(Re))return Re;let Ie=Re.props,we=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Re,{...Ie,css:[Ie.css,de],className:we,disabled:E,size:g})}),Te=cloneElement(P,{...z,children:Pe});I.push(Te),F=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[A,h],...k,children:I})}));Xi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Rr(n?.[e]??e)}}},wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Rr(n?.[e]??e)}}},Ep=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Sp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},Wn=fe.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:k,role:y,tabIndex:x,...b},d){let p=V(),C=p.surface??{},[M,R]=useState(!!u),w=l!=null,A=w?!!l:M,$=useMemo(()=>Ep(o,p),[o,p]),_=useMemo(()=>Sp(o,p,$),[o,p,$]),W=_,S=useMemo(()=>Tp(r,p),[r,p]),F=useMemo(()=>wp(s,p),[s,p]),I=!!c||!!i,P=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:F,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Rr(h),height:Rr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:I?"pointer":void 0,...I?{"&:hover":{backgroundColor:_}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,F,o,p.componentHeights,C.border,h,f,I,_,W]),D=useCallback(()=>{if(!i)return;let g=!A;w||R(g),m?.(g);},[w,m,i,A]),B=useCallback(g=>{i&&D(),T?.(g);},[i,D,T]),z=useCallback(g=>{i&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),D()),k?.(g);},[i,D,k]),E=ve();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&A?"true":void 0,"aria-pressed":i?A:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[E(),P,n],onClick:B,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...b,children:t})}));Wn.displayName="Container";var kp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Hs(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return kp(o)}return e}}}function yo(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ls(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ap(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function xo(e,t,n,o){let r=Hs(t,e),s=Hs(n,e),a=Hs(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Yi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Ji=fe.createContext("horizontal"),Bs=()=>fe.useContext(Ji),Zi=fe.memo(fe.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:k,...y},x)=>{let b=V(),d=ve(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ap(h,b),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Ji.Provider,{value:f,children:jsx(Wn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:k,tabIndex:k?0:void 0,...y,children:e})})}));Zi.displayName="Card";var Fp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Ls(o),...u?{width:"100%"}:{flex:1,minWidth:0},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Mp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Pp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Dp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Yi(m,l)??m.text?.primary,textAlign:Ls(o),...xo(m,r,s,a),display:"flex",alignItems:"center",gap:m.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[h,t],...u,children:e})}),Np=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Yi(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Ls(o),...xo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var el=e=>isValidElement(e),$p=e=>el(e)?e.type?.displayName||e.type?.name:void 0,Qi=e=>$p(e)==="Card",zp=e=>typeof e=="number"?`${e}px`:e,tl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?zp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(Qi).length,x=0,b=T.map((d,p)=>{if(!Qi(d)||!el(d))return d;let C=d.props,M=x++,R=M===0,w=M===y-1,A=s??C.variant,$=t?u?{borderTopLeftRadius:R?C.radius:0,borderTopRightRadius:R?C.radius:0,borderBottomLeftRadius:w?C.radius:0,borderBottomRightRadius:w?C.radius:0}:{borderTopLeftRadius:R?C.radius:0,borderBottomLeftRadius:R?C.radius:0,borderTopRightRadius:w?C.radius:0,borderBottomRightRadius:w?C.radius:0}:void 0,_=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=A==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,F=[$,_,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:A??C.variant,css:[C.css,...F],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:b})};tl.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,ol=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&ol(n)&&(t=true));}),t},Kp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},rl=fe.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:k},y){let x=V(),b=ve(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Kp(x,d),[x,d]),C=!!l&&!h,M=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),w=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),A=useCallback(G=>{let se=x.palette;return (w==="neutral"?x.neutral[G]:se[w]?.[G])??se.primary?.[G]},[w,x.neutral,x.palette]),$=useMemo(()=>w==="neutral"?x.neutral[100]:A(50),[w,A,x.neutral]),_=useMemo(()=>w==="neutral"?x.text.secondary:A(800),[w,A,x.text.secondary]),W=useMemo(()=>w==="neutral"?x.neutral[100]:A(50),[w,A,x.neutral]),S=useMemo(()=>w==="neutral"?x.text.secondary:A(800),[w,A,x.text.secondary]),F=useMemo(()=>w==="neutral"?x.neutral[400]:A(300),[w,A,x.neutral]),I=useMemo(()=>w==="neutral"?x.surface.subtleBg:A(600),[w,A,x.surface.subtleBg]),P=useMemo(()=>(x.text.onColors??{})[w]??(w==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[w,x.text.onColors,x.neutral]),D="transparent",B=useMemo(()=>w==="neutral"?x.text.secondary:A(700)??x.text.primary,[w,A,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!ol(t)&&fe.Children.count(t)===1,[a,c,t]),E=useMemo(()=>o==="filled"?css({backgroundColor:I,color:P,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:S,border:"none",boxShadow:`inset 0 0 0 ${R} ${F}`}):o==="ghost"?css({backgroundColor:D,color:B,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:_,border:"none",boxShadow:"none"}),[I,P,B,W,S,F,$,_,R,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(p.gap),padding:o==="ghost"?0:z||t==null?Le(p.soloPadding):`${Le(p.paddingY)} ${Le(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:M,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,minHeight:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,M,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:Le(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Le(p.iconSize):void 0,height:z?Le(p.iconSize):void 0,display:z?"block":void 0}}),[p.fontSize,p.iconSize,z]),L=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Le(p.iconSize),lineHeight:0,"& > svg":{width:Le(p.iconSize),height:Le(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Le(p.gap),marginLeft:z||t==null?0:Le(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Le(p.gap),marginRight:z||t==null?0:Le(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),K=useMemo(()=>css({marginRight:s?0:Le(p.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:h?"not-allowed":"pointer",color:"currentColor",opacity:h?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Le(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[g,E,C?b({color:r??"primary"}):null,k],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":w,"data-size":i,"data-icon-only":z||void 0,children:[a&&jsx("span",{css:[L,H],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[L,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[K,b({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));rl.displayName="Chip";var qp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gp=fe.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let k=ve(),y=r.neutral,x=r.text,b=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),M=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),w=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),A=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${b} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",_=z=>css({width:w,height:w,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:A,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?k({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),F=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let E=Math.max(0,Math.min(o-1,z));C(E),d.current[E]?.focus();},[o]),P=useCallback((z,E)=>{let g=F(E).slice(0,1),v=[...M];v[z]=g,n(v.join("")),g&&z<o-1&&I(z+1);},[M,o,n,I]),D=useCallback((z,E)=>{if(E.key==="Backspace")if(!M[z]&&z>0){let g=[...M];g[z-1]="",n(g.join("")),I(z-1),E.preventDefault();return}else {let g=[...M];g[z]="",n(g.join(""));return}if(E.key==="ArrowLeft"&&z>0){E.preventDefault(),I(z-1);return}if(E.key==="ArrowRight"&&z<o-1){E.preventDefault(),I(z+1);return}if(E.key==="Home"){E.preventDefault(),I(0);return}if(E.key==="End"){E.preventDefault(),I(o-1);return}},[M,o,n,I]),B=useCallback(z=>{let E=F(z.clipboardData.getData("text")).slice(0,o);E&&(n(E),requestAnimationFrame(()=>{let g=Math.min(E.length,o-1);I(g);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,E)=>jsxs(fe.Fragment,{children:[jsx("input",{ref:g=>{d.current[E]=g;},type:"text",inputMode:"text",maxLength:1,value:M[E]||"",placeholder:M[E]?"":R[E]||"",disabled:l,onChange:g=>P(E,g.target.value),onKeyDown:g=>D(E,g),onFocus:()=>C(E),onPaste:E===0?B:void 0,className:"plainframe-ui-code-box",css:_(E===p),"aria-label":`Code character ${E+1}`,tabIndex:E===p?0:-1}),f&&E<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},E))})}),Xp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:k,labelCss:y,helperRowCss:x,helperTextCss:b,css:d})=>{let p=V(),C=useId(),M=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",w=M[R],A=p.neutral,$=p.text,_=t!=null,[W,S]=useState(n),F=_?t:W,I=H=>{_||S(H),o?.(H);},P=Math.max(2,Math.min(h,10)),D=p.spacing.sm,B=qp(l??D)??"0px",z=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(k)?k:k?[k]:[]),E=css({fontSize:w.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??$.primary:i?A[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),g=css({display:"flex",alignItems:"center",justifyContent:"center",gap:B,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:w.helperFont,color:a?p.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),L=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??$.primary:i?A[500]:$.primary},...Array.isArray(b)?b:b?[b]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:E,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:g,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Gp,{value:F||"",onChange:I,len:P,theme:p,sizeKey:R,s:{codeFontSize:w.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:B})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:L,children:c})})]})};var cl=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},zs=e=>{if(!e||typeof e!="object")return false;let t=cl(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some(zs):zs(o)},Jp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=fe.useRef(null),[c,i]=fe.useState(false),l=fe.useCallback(v=>{i(v),o?.(v);},[o]),u=fe.useCallback(()=>l(false),[l]),m=fe.useRef({x:0,y:0}),h=fe.useRef(null),f=fe.useRef(null),T=fe.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let L=Math.round(m.current.x),H=Math.round(m.current.y);v.style.transform=`translate3d(${L}px, ${H}px, 0)`;},[]),k=fe.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);fe.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=fe.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),L=Math.round(m.current.y);return {x:v,y:L,left:v,top:L,right:v,bottom:L,width:0,height:0,toJSON:()=>({x:v,y:L})}}}),[]),x=fe.useRef(`cz-${Math.random().toString(36).slice(2)}`),b=fe.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=fe.useRef(null),p=fe.useRef(null),C=fe.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),M=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=fe.useCallback(()=>{M(),p.current=window.setTimeout(()=>l(false),0);},[M,l]),w=fe.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),A=fe.useCallback((v,L)=>{m.current={x:v,y:L},k(),l(true);},[k,l]),$=typeof t=="function"?t({close:u}):t,_=zs($),W=v=>{if(!fe.isValidElement(v))return v;let L=cl(v),H=v,O=H.props.children,K=O==null?O:Array.isArray(O)?O.map(N=>fe.isValidElement(N)?W(N):N):fe.isValidElement(O)?W(O):O;if(L==="DropdownMenu"){let N=H.props.onOpenChange;return fe.cloneElement(H,{...H.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:K})}if(L==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return fe.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{M(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:K})}return K===O?H:fe.cloneElement(H,{...H.props,children:K})},S=_?W($):$,F=fe.useCallback(v=>{v.preventDefault(),A(v.clientX,v.clientY);},[A]),I=fe.useCallback(v=>{n==="contextmenu"&&F(v);},[n,F]),P=fe.useCallback(v=>{n==="dblclick"&&F(v);},[n,F]),D=fe.useCallback(v=>{n==="click"&&F(v);},[n,F]),B=fe.useCallback(v=>{if(n!=="hover")return;C(),M();let L=r==="center"?w():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=L.x+(r==="cursor"?s:0),O=L.y+(r==="cursor"?s:0);A(H,O);},0);},[n,r,s,w,A,C,M]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!_&&(m.current={x:v.clientX+s,y:v.clientY+s},k());},[n,c,r,_,s,k]),E=fe.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);fe.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");L||H?M():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,b,M,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");if(L||H?M():R(),r==="center"&&a.current){let O=w();m.current={x:O.x,y:O.y},k();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,w,k,l,M,R,b]),fe.useEffect(()=>()=>{C(),M();},[C,M]);let g=({children:v})=>c?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(m.current.x)}px, ${Math.round(m.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&M(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:P,onClick:D,onMouseEnter:B,onMouseMove:z,onMouseLeave:E,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,_?S:jsx(g,{children:S})]})};var Kn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tm=fe.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:k,className:y,...x},b){let d=V(),{t:p,strokeColor:C,labelTextColor:M,chipSubtleBg:R,chipOutlinedBg:w,outerM:A,padX:$,verticalStrokeMargin:_}=useMemo(()=>{let P=typeof s=="number"?`${s}px`:s,D=d.surface.border,B=d.text.secondary,z=d.surface.subtleBg,E=d.surface.panelBg,g=Kn(h,"10px"),v=o==="horizontal"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0",L=o==="vertical"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0";return {t:P,strokeColor:D,labelTextColor:B,chipSubtleBg:z,chipOutlinedBg:E,outerM:g,padX:v,verticalStrokeMargin:L}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:A,marginRight:A}:{flexDirection:"row",width:a?Kn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:A,marginBottom:A},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,A,a,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:_,marginBottom:_}:{height:p,flex:1}]),[C,m,d.radius.full,d.radius.xs,o,p,_]),F=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:M,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:w,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,M,u,R,w,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,k]}),[S,k]);return o==="vertical"?jsxs("div",{ref:b,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:b,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="right"&&I,!t&&I]})}));var bl=fe.createContext(null),hl=()=>{let e=useContext(bl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},yl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(bl.Provider,{value:u,children:e})},rm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=hl(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:l,...r,children:t})});rm.displayName="DrawerTrigger";var To=0,xl="",vl="",sm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function am(){if(!(typeof document>"u")){if(To===0){let e=document.body;xl=e.style.overflow||"",vl=e.style.paddingRight||"";let t=sm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function im(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=xl,e.style.paddingRight=vl;}}var lm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Cl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:k,css:y,...x},b){let d=V(),{open:p,setOpen:C,lockScroll:M,closeOnEscape:R}=hl();useEffect(()=>{if(!(!M||!p))return am(),()=>im()},[p,M]);let w=useMemo(()=>lm(a,0),[a]),A=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),_=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[n,r,s,w]),W=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[o,r,s,w]),S=useMemo(()=>{let j=String(d.radius.lg);switch(r){case "left":return `0 ${j} ${j} 0`;case "right":return `${j} 0 0 ${j}`;case "top":return `0 0 ${j} ${j}`;default:return `${j} ${j} 0 0`}},[r,d.radius.lg]),F=useMemo(()=>c??(s==="inset"?d.radius.lg:S),[c,s,d.radius.lg,S]),I=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]),P=useRef(null),D=useCallback(()=>{let j=P.current;if(!j)return 1;let J=j.getBoundingClientRect();return A==="x"?J.width:J.height},[A]),B=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(m??280)/1e3,ease:[.22,1,.36,1]}),[m]),E=useMemo(()=>$*1.1,[$]),g=useMemo(()=>A==="x"?{x:`${E*100}%`,y:0}:{y:`${E*100}%`,x:0},[A,E]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:_,height:W,backgroundColor:d.surface.panelBg,borderRadius:F,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:A==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,_,W,d.surface,F,p,A]),L=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,d.surface]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>A==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[A,$,T]),K=useMemo(()=>A==="x"?{left:0,right:0}:{top:0,bottom:0},[A]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((j,J)=>{let le=A==="x"?J.offset.x:J.offset.y,de=A==="x"?J.velocity.x:J.velocity.y,ge=$*le>0,Pe=Math.abs(le)>=D()*N,Te=$*de>f;ge&&(Pe||Te)&&C(false);},[A,$,D,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let j=setTimeout(()=>{let de=P.current;if(!de)return;let ge=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');ge.length>0?ge[0].focus():de.focus();},100),J=de=>{let ge=P.current;if(!ge||!de.target)return;let Pe=de.target;if(!ge.contains(Pe)){de.preventDefault();let Te=ge.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Te.length>0?Te[0].focus():ge.focus();}},le=de=>{de.key==="Escape"&&R&&(de.stopPropagation(),C(false));};return document.addEventListener("focusin",J,true),window.addEventListener("keydown",le),()=>{clearTimeout(j),document.removeEventListener("focusin",J,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,C,R]);let{...se}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:L,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:j=>{P.current=j,typeof b=="function"?b(j):b&&(b.current=j);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[v,y],drag:A,dragConstraints:K,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...g,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...g,opacity:.98},transition:m?z:B,...se,children:t},"panel")]}):null})});Cl.displayName="DrawerContent";var cm=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),k=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(yl,{open:k,onOpenChange:y,children:jsx(Cl,{ref:l,...i,children:c})})});cm.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),k=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(k)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Rl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tl=fe.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Rl(c),width:c?"100%":void 0,maxHeight:Rl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});Tl.displayName="Flex";var Vs=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(k)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var wl={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},wm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Em={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Vn=fe.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:k,style:y,as:x})=>{let b=V(),d=wl[e]??wl.body,p=x??Em[e]??"span",C=F=>F==null?d.size:typeof F=="number"?F:b?.typography?.sizes?.[F]??F,M=C(o)??C(d.size),R=r??d.weight,w=s??d.lh,A=a??d.ls,$=n==="secondary"?b.text.secondary:n==="primary"?b.text.primary:n??"inherit",_=f??b.surface.border,W=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:b?.typography?.fonts?.sans||"inherit",fontSize:M,fontWeight:R,lineHeight:w,letterSpacing:A,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:_,textDecorationThickness:wm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Gs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Sl=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:k,placeholder:y,blurDataURL:x,placeholderColor:b="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:M,onLoad:R,onError:w,...A},$){let[_,W]=useState(false),[S,F]=useState(false),[I,P]=useState(false),D=V(),B=km(s,D)??"0px",z=i?"figure":"div",E=css({display:"flex",flexDirection:"column",gap:i?D.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${B})`}),g=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${B})`,maxWidth:o?Gs(o):"100%",maxHeight:r?Gs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:_&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:M?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?b:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),L=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:_&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",p||""].join(" ").trim(),css:[E,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:M,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:L,src:S&&d?d:t,alt:n,srcSet:T,sizes:k,loading:m,decoding:h,fetchPriority:f,onLoad:H=>{P(true),R?.(H);},onError:H=>{F(true),w?.(H);},...A})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Sl.displayName="Image";var Il=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pm=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Dm=e=>e*Math.PI/180,Nm=(e,t,n)=>{let o=Math.abs(Dm(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Hm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Lm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,kl=[1.02,1.03,1.02],Al=[1.06,1.08,1.06],Bm={sm:150,md:200,lg:260,xl:340},$m=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function zm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return $m(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Om=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:k="md",label:y,labelAlign:x="center",css:b,className:d,...p}){let C=V(),M=Pm(r)??4/5,R=typeof o=="string"?o:void 0,w=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Bm[s],A=Math.max(1,w/M),_=Children.toArray(t).filter(isValidElement).slice(0,i),W=_.length,S=Hm(n,W),F=_.map((j,J)=>Lm(n,W,J)),I=j=>A*.6*F[j],P=j=>I(j)*M,D=0,B=0;for(let j=0;j<W;j++){let J=P(j),le=I(j),de=Math.max(Math.abs(S.base.ang[j]??0),Math.abs(S.exp.ang[j]??0)),ge=Math.max(Math.abs(S.base.dx[j]??0),Math.abs(S.exp.dx[j]??0)),Pe=Math.max(Math.abs(S.base.dy[j]??0),Math.abs(S.exp.dy[j]??0)),Te=a==="expand"?Al[j]??1.08:a==="reveal"?kl[j]??1.03:1,Re=Nm(J,le,de),Ie=Re.w*Te,we=Re.h*Te,Q=ge/100*J*Te,ie=Pe/100*le*Te;D=Math.max(D,Ie/2+Q),B=Math.max(B,we/2+ie);}let z=Math.max(1,2*D),E=Math.max(1,2*B),g=Math.min(1,w/z,A/E),v=c===void 0?"pointer":"controlled",L=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:Il(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:Il(A)}),K=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${E}px`,transform:`translate(-50%, -50%) scale(${g})`,transformOrigin:"center center"}),N=zm(k,C)??"0px",U=j=>{let J=n==="fan"?`rotate(${S.base.ang[j]}deg) translate(${S.base.dx[j]}%, ${S.base.dy[j]}%)`:n==="slide"?`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[j]}%)`:`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[j]}deg) translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%)`:n==="slide"?`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[j]}%)`:`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`,de=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,ge=a==="expand"?`${le} scale(${Al[j]??1.06})`:a==="reveal"?`${J} scale(${kl[j]??1.03})`:`${J} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${de}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&j===1?10:j+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${ge}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${ge}`}})},G=j=>css({width:`${P(j)}px`,aspectRatio:`${M}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":L,css:[H,b],tabIndex:-1,...p,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:K,children:_.map((j,J)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(J),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(J),children:j})},J))})}),y&&jsx(Vn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Ml={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Km(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function Vm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var jm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},m){let h=V(),f=ve(),T=Ml[o]??Ml.sm,k=Km(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:k,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),b=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?b:n==="ghost"?d:p,R=s&&c>0&&Vm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var Xm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Xs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:c,distance:i})=>{let u=Xm(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,b=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:b,className:d,onTransitionEnd:T(p)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:k,onTransitionEnd:T(),children:e})};var Ys=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hl=fe.createContext(null),Ll=()=>{let e=useContext(Hl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},tf=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]);useEffect(()=>{if(!i||!s)return;let m=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",m,true),()=>window.removeEventListener("keydown",m,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Hl.Provider,{value:u,children:e})},Bl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Ll(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r,children:t})});Bl.displayName="ModalTrigger";var $l=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:k,...y},x)=>{let b=V(),{open:d,setOpen:p,lockScroll:C}=Ll(),M=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!d)return;R.current=document.activeElement;let S=setTimeout(()=>{let I=M.current;if(!I)return;let P=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');P.length>0?P[0].focus():I.focus();},100),F=I=>{let P=M.current;if(!P||!I.target)return;let D=I.target;if(!P.contains(D)){I.preventDefault();let B=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');B.length>0?B[0].focus():P.focus();}};return document.addEventListener("focusin",F,true),()=>{clearTimeout(S),document.removeEventListener("focusin",F,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let w=typeof b.spacing.sm=="number"?`${b.spacing.sm}px`:String(b.spacing.sm),A=css({width:"100%",height:Ys(o),maxWidth:t==="inset"?`min(${Ys(n)||"100%"}, calc(100% - ${w} * 2))`:Ys(n),maxHeight:t==="inset"?`calc(100% - ${w} * 2)`:"100%",margin:t==="inset"?w:void 0}),$=jsx(Wn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[A,f],ref:S=>{M.current=S,typeof x=="function"?x(S):x&&(x.current=S);},...y,children:e}),_=u==="none"?$:u==="slide"?jsx(Xs,{on:d,direction:m,duration:h,children:$}):u==="grow"?jsx(Vs,{initialScale:.75,on:d,duration:h,children:$}):jsx(Ks,{on:d,duration:h,children:$});if(!a)return jsx(Fragment,{children:_});let W=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Is,{on:d,blur:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[W,T].filter(Boolean),contentCss:W,lockScroll:C,children:_})});$l.displayName="ModalContent";var uf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:m,css:h})=>{let f=V(),T=ve(),k=t!==void 0,[y,x]=useState(n),b=Math.max(1,e),d=Ir(k?t:y,1,b),p=useCallback(g=>{let v=Ir(g,1,b);k||x(v),o?.(v);},[k,b,o]),C=useMemo(()=>df({count:b,page:d,siblingCount:r,boundaryCount:s}),[b,d,r,s]),M=f.palette?.primary?.[600],R=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,A=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",_=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:$,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),W=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:A,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),F=(g=false)=>css([W,T({color:g?"primary":"neutral"}),l==="outlined"?g?{background:M,color:f.text.onColors.primary,borderColor:M}:{background:"transparent",borderColor:R,":hover":{background:w}}:l==="ghost"?g?{background:M,color:f.text.onColors.primary}:{":hover":{background:w}}:g?{background:M,color:f.text.onColors.primary,borderColor:M}:{":hover":{background:w}}]),I=useCallback(()=>p(1),[p]),P=useCallback(()=>p(b),[p,b]),D=useCallback(()=>{d===1?i&&p(b):p(d-1);},[d,i,b,p]),B=useCallback(()=>{d===b?i&&p(1):p(d+1);},[d,i,b,p]),z=a||d===1&&!i,E=a||d===b&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",m||""].join(" ").trim(),css:_,onKeyDown:g=>{a||(g.key==="ArrowLeft"&&(g.preventDefault(),D()),g.key==="ArrowRight"&&(g.preventDefault(),B()),g.key==="Home"&&(g.preventDefault(),I()),g.key==="End"&&(g.preventDefault(),P()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[F(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[F(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((g,v)=>typeof g=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":g===d?`Page ${g}, current page`:`Go to page ${g}`,"aria-current":g===d?"page":void 0,css:F(g===d),onClick:()=>p(g),children:g},g):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":E,disabled:E,css:[F(false),S],onClick:B,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":E,disabled:E,css:[F(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Ir(e,t,n){return Math.max(t,Math.min(n,e))}function df({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Sr(1,e);let s=Sr(1,Math.min(o,e)),a=Sr(Math.max(e-o+1,o+1),e),c=Ir(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Ir(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=m=>{let h=l[l.length-1];h!==m&&(h==="ellipsis"&&m==="ellipsis"||l.push(m));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Sr(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var gf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,bf=fe.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:gf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var _l=createContext(null),vf=()=>{let e=useContext(_l);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Cf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Rf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),k=h?e:f,y=useRef([]),[x,b]=useState(0),d=()=>b(F=>F+1),p=useCallback(F=>{h||T(F),n?.(F);},[h,n]),C=useCallback(F=>(y.current.push(F),d(),y.current.length-1),[]),M=useCallback((F,I)=>{let P=y.current[F];P&&(y.current[F]={...P,...I},d());},[]),R=()=>y.current.map((F,I)=>({it:F,i:I})).filter(({it:F})=>F.ref&&!F.disabled).map(({i:F})=>F),w=useCallback((F,I)=>{let P=R();if(!P.length)return;let D=Math.max(0,P.indexOf(F)),B=P[(D+I+P.length)%P.length],z=y.current[B]?.ref;if(z){z.focus();let E=y.current[B]?.value;E!==void 0&&p(E);}},[p]),A=useCallback(F=>{let I=R();if(!I.length)return;let P=F==="first"?I[0]:I[I.length-1],D=y.current[P]?.ref;if(D){D.focus();let B=y.current[P]?.value;B!==void 0&&p(B);}},[p]),$=useMemo(()=>{let F=y.current.filter(P=>P.ref&&!P.disabled);return F.length?F.some(P=>P.value===k)?k:F[0]?.value:void 0},[k,x]),_=useMemo(()=>({selected:k,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:M,moveFocusBy:w,moveToEdge:A,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[k,p,o,r,s,a,C,M,w,A,$,m,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(_l.Provider,{value:_,children:i})})})},Tf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:k,anchorOrigin:y}=vf(),x=c||t,b=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],M=C(600),R=C(100),w=f.neutral[300],A=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],_="transparent",W=A,S=$;T==="soft"?(_=R,W=null,S=M):T==="outlined"?(_=C(50),W=A,S=M):(_=f.neutral[200],W="transparent",S=$),b&&(T==="outlined"?(_=R,W=A,S=M):T==="filled"?(_=M,W=null,S=$):(_=R,W=null,S=M));let F=T==="filled"?w:f.palette.primary[100],I=useRef(null),P=useRef(-1);useEffect(()=>{P.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(P.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let D=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||b?{}:{background:F,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${A}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),B=css({width:p,height:p,minWidth:p,minHeight:p,borderRadius:f.radius.full,background:_,boxShadow:W?`inset 0 0 0 ${f.componentHeights.border} ${W}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),z=css({width:b?p*.45:0,height:b?p*.45:0,borderRadius:f.radius.full,background:b?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:b?"scale(1)":"scale(0.6)",opacity:b?1:0}),E=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),g=(()=>{let O=y.horizontal,K=y.vertical;return K==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:K==="top"?1:3}})(),L=!x&&k===e?0:-1,H=ve();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":b,"aria-disabled":x||void 0,disabled:x,tabIndex:L,onClick:()=>{x||a(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(P.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(P.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[D,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[B,css({gridColumn:g.col,gridRow:g.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:E,children:o})]})};var kf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:k,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var qn=e=>null;qn.displayName="SelectItem";var Fo=(...e)=>e.filter(Boolean).flat(),Mf=e=>{if(e.type===qn)return true;let t=e.props;return t?.type===qn||t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__===qn},Pf=e=>{if(e.type===qn)return e.props;let t=e.props||{},{type:n,__EMOTION_TYPE_PLEASE_DO_NOT_USE__:o,...r}=t;return r};function Qs(e,t){if(e==null||typeof e=="boolean")return;if(Array.isArray(e)){for(let o of e)Qs(o,t);return}if(!fe.isValidElement(e))return;let n=e;if(Mf(n)){t.push(n);return}if(n.type===fe.Fragment){Qs(n.props.children,t);return}}var Vl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:k=280,wrapperCss:y,labelCss:x,triggerCss:b,menuCss:d,optionCss:p,children:C,className:M,menuSize:R="md",triggerRender:w})=>{let A=V(),$=ve(),_=fe.useId(),W=`${_}-label`,S=`${_}-menu`,F={sm:{minHeight:A.componentHeights.sm,radius:A.radius.sm},md:{minHeight:A.componentHeights.md,radius:A.radius.md},lg:{minHeight:A.componentHeights.lg,radius:A.radius.md}},I=F[l]||F.md,[P,D]=fe.useState(false),B=Q=>D(!!Q),z=typeof e<"u",E=c||Array.isArray(e)||Array.isArray(t),[g,v]=fe.useState(()=>typeof t<"u"?t:E?[]:void 0),L=z?e:g,H=Q=>{z||v(Q),n?.(Q);},O=[];Qs(C,O);let K=O.map((Q,ie)=>{let me=Pf(Q),Y=typeof me.children=="string"||typeof me.children=="number"?String(me.children):void 0,xe=typeof me.value=="string"||typeof me.value=="number"?String(me.value):void 0,ee=me.label??Y??xe;return {key:Q.key??ie,value:me.value,startIcon:me.startIcon,endIcon:me.endIcon,node:me.children,triggerLabel:ee,itemCss:me.css,itemClassName:me.className}}),N=Q=>E?(Array.isArray(L)?L:[]).some(me=>Object.is(me,Q)):Object.is(L,Q),U=fe.useMemo(()=>{if(E){let ie=Array.isArray(L)?L:[];return K.filter(Y=>ie.some(xe=>Object.is(xe,Y.value))).map(Y=>Y.triggerLabel??Y.node)}let Q=K.find(ie=>Object.is(ie.value,L));if(Q)return Q.triggerLabel??Q.node},[L,E,K]),G=Q=>{i||(Object.is(Q,L)||H(Q),B(false));},se=Q=>{if(i)return;let ie=Array.isArray(L)?L:[],Y=ie.some(xe=>Object.is(xe,Q))?ie.filter(xe=>!Object.is(xe,Q)):[...ie,Q];H(Y);},j={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},J={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:A.typography.sizes.sm,padding:`0 ${typeof A.spacing.sm=="number"?`${A.spacing.sm}px`:A.spacing.sm} 0 ${typeof A.spacing.md=="number"?`${A.spacing.md}px`:A.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:A.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:A.surface.subtleBg}:u==="outlined"?{background:A.surface.panelBg,border:`1px solid ${A.surface.border}`}:{background:"transparent"},de={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},ge={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Pe={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Te=jsx(ChevronsUpDown,{size:16,css:css({color:A.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Re=()=>{if(w)return w(U);if(Array.isArray(U)){let ie=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),me=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:me,children:me})]})}let Q=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:typeof Q=="string"?Q:void 0,children:Q})]})},Ie={left:"start",center:"center",right:"end"},we=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),B(true));};return jsxs("div",{css:Fo(j,y),className:["plainframe-ui-select-wrapper",M||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Fo({marginBottom:6,fontSize:A.typography.sizes.sm,fontWeight:500,color:A.text.secondary},x),children:o}),jsxs(Ln,{size:R,open:P,onOpenChange:B,children:[jsx(Bn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":P||void 0,"aria-controls":S,"aria-labelledby":o?W:void 0,onKeyDown:we,onClick:()=>B(!P),className:"plainframe-ui-select-trigger",css:Fo(css(J),css(le),b,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(de),children:Re()}),a??Te]})}),jsx(yn,{id:S,gap:"xs",align:Ie[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Fo({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},d),children:K.map((Q,ie)=>{let me=N(Q.value);return jsx(Ht,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:me,disabled:i,closeOnSelect:!E,onSelect:()=>E?se(Q.value):G(Q.value),css:Fo(p,Q.itemCss),className:["plainframe-ui-select-option",Q.itemClassName||""].join(" ").trim(),children:Q.node},Q.key??ie)})})]})]})};Vl.displayName="Select";var ea=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Nf=keyframes`
|
|
13
|
+
`,Gc=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),Xc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Yc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Gc(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&Xc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=fe.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),T=typeof t=="number",A=Math.max(o-n,1),y=T?Xa(t,n,o):void 0,x=T?(y-n)/A*100:void 0,g=Yc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Zc,{size:s,active:g,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Jc,{thickness:a,active:g,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Jc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),A=css([{position:"relative",width:"100%",height:rs(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,Ga):Ga,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...g,left:"-35%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...g,left:"-200%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:A,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Zc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),m=40,h=(m-t)/2,f=2*Math.PI*h,A=`${(o?Xa((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:rs(e,`${u.componentHeights.md}`),height:rs(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:A,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:g})})})};var Za=createContext(null),Qa=()=>{let e=useContext(Za);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},lu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),cu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),uu=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),ei=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:l,children:u,...m},h){let f=V(),T=useId(),A=useId(),y=useMemo(()=>{let M={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?M[c]:M.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},g=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??g:v==="warning"?x.warning??g:v==="success"?x.success??g:v==="info"?x.info??x.primary??g:g)(t),D=I?.[50]??g[50],P=I?.[300]??g[300],L=I?.[600]??I?.[500]??g[600],z=I?.[700]??L,w=I?.[800]??f.text?.primary??"#000",b=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:L,fg:b,border:void 0,iconColor:b}:n==="outlined"?{bg:D,fg:w,border:`1px solid ${P}`,iconColor:w}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:D,fg:w,border:void 0,iconColor:z}},[t,n,g,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),F=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),E=useMemo(()=>[cu,{color:d.iconColor}],[d.iconColor]),k=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[uu,{color:d.fg}],[d.fg]),_=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:A}),[d.fg,d.iconColor,y,T,A]),W=fe.Children.toArray(u).some(M=>fe.isValidElement(M)&&M.type===is),S=fe.Children.toArray(u).some(M=>fe.isValidElement(M)&&M.type===ls);return jsx(Za.Provider,{value:_,children:jsxs("div",{ref:h,role:p,"aria-live":p==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":W?T:void 0,"aria-describedby":S?A:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[F,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:E,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:lu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:k,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});ei.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Qa(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});is.displayName="AlertTitle";var ls=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Qa(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});ls.displayName="AlertDescription";var cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yt=e=>e==null?[]:Array.isArray(e)?e:[e],Jt=(...e)=>css(e.filter(Boolean));function ni(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var Qo=fe.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:A,togglePasswordVisible:y=false,showClear:x,type:g="text",step:d,focusRingMode:p="always",className:C,wrapperCss:F,inputCss:R,labelCss:E,helperRowCss:k,helperTextCss:$,startIconCss:_,endIconCss:W,css:S,onBlur:M,onFocus:I,onKeyDown:D,autoFocus:P,name:L,id:z,tabIndex:w,autoComplete:b,readOnly:v,required:B,maxLength:H,onSurfaceClick:O},K){let N=V(),U=Yo(),G=useId(),se=useMemo(()=>{let ue={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Ee=["sm","md","lg"].includes(m)?m:"md";return ue[Ee]},[m,N]),j=N.neutral,J=N.text,le=g==="number",de=g==="password",ge=n!==void 0,[Pe,Te]=useState(o),Re=ge?n:Pe,Ie=useCallback(ue=>{ge||Te(ue),r?.(ue);},[ge,r]),we=/^-?\d*(?:[.,]\d*)?$/,Q=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(Re??"")),ie=le?Q?"decimal":"numeric":void 0,me=le?Q?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ue=>{(ue===""||we.test(ue))&&Ie(ue);},[Ie]),xe=i?j[200]:a&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:a&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",ee=N.componentHeights.border,oe=h==="outlined"?`${ee} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Jt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?cs(u):void 0,flex:"0 0 auto",fontWeight:500}),be=useMemo(()=>Jt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?j[500]:J.primary,marginBottom:4,display:"inline-block"},...Yt(E)),[se.labelFont,a,i,j,J,N.palette.danger,E]),Ne=useMemo(()=>Jt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(se.paddingY)} ${cs(se.paddingX)}`,background:xe,border:oe,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Yt(F),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,xe,oe,f,i,F,S]),ze=useMemo(()=>Jt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?j[500]:a?N.palette.danger?.[800]??J.primary:J.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?N.palette.danger?.[700]??J.secondary:J.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??J.primary:J.primary} !important`,boxShadow:`0 0 0 1000px ${xe} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??J.primary:J.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Yt(R)),[se.fontSize,i,j,J,a,N.palette.danger,le,xe,R]),X$1=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Yt(_)),[a,N.palette.danger,J.secondary,_]),re=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Yt(W)),[a,N.palette.danger,J.secondary,i,W]),Z=useMemo(()=>Jt({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??J.secondary:J.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Yt(k)),[se.helperFont,a,N.palette.danger,J.secondary,k]),ce=useMemo(()=>Jt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Yt($)),[$]),pe=useRef(null),Ue=useCallback(ue=>{pe.current=ue,K&&(typeof K=="function"?K(ue):K.current=ue);},[K]),Oe=useCallback(ue=>{let Ee=ue.target.value;if(le){Y(Ee);return}H&&Ee.length>H||Ie(Ee);},[le,H,Ie,Y]),[ke,st]=useState(false),He=useCallback(()=>{i||st(ue=>!ue);},[i]),nt=useCallback(()=>{i||(Ie(""),pe.current?.focus());},[i,Ie]),qe=useMemo(()=>{let ue=se.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[se.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:X$1,children:ni(T,qe)}):null,[T,X$1,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ue=[];if(de&&y){let bt=ke?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ue.push(jsx("button",{type:"button",css:re,onMouseDown:Qn=>Qn.preventDefault(),onClick:Qn=>{Qn.stopPropagation(),He();},tabIndex:-1,"aria-label":ke?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&Re&&Re.length>0&&!i&&ue.push(jsx("button",{type:"button",css:re,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=A?jsx("span",{css:re,children:ni(A,qe)},"user-end"):null,at=ue.length>0,De=!!Ee;return !at&&!De?null:!at&&De?Ee:at&&!De?ue.length===1?ue[0]:jsx("span",{css:ot,children:ue}):jsxs("span",{css:ot,children:[ue,Ee]})},[de,y,ke,qe,re,ot,i,x,Re,A,He,nt]),rn=c!=null?`${z??G}-help`:void 0,Zn=z??G,Je=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=pe.current;if(!Ee)return;let at=ue.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),xt=useCallback(ue=>{if(i)return;let Ee=pe.current;if(Ee&&(O?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Zn,className:"plainframe-ui-textfield-label",css:be,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Ne],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Zn,className:"plainframe-ui-textfield-input",css:ze,type:de?ke?"text":"password":g==="number"?"text":g,inputMode:ie,pattern:me,value:Re,maxLength:le?void 0:H,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:M,onFocus:I,onKeyDown:D,autoFocus:P,name:L,tabIndex:w,autoComplete:b,readOnly:v,required:B,"aria-invalid":!!a||void 0,"aria-describedby":rn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Z,children:jsx("span",{id:rn,className:"plainframe-ui-textfield-helper-text",css:ce,children:c})})]})}));Qo.displayName="TextField";var er=fe.createContext("ghost"),Tt=fe.createContext(false),ii=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...m},h){let f=V(),[T,A]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),g=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:g,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:A}),[T]),F=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(D=>{if(D.closest('[role="menu"]')!==I)return false;let P=window.getComputedStyle(D);return P.display!=="none"&&P.visibility!=="hidden"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),A(false);},[]),k=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(k.current){k.current=false;return}let D=I.currentTarget,P=R(D);P.length>0&&(A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(L=>L.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true}));},[R]),_=useCallback(I=>{let D=I.currentTarget,P=R(D);if(P.length===0)return;if(I.key==="Tab"){k.current=true,D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),A(false),D.tabIndex=-1,requestAnimationFrame(()=>{D.tabIndex=0,k.current=false;});return}let L=D.querySelector("[data-highlighted]"),z=D.querySelector("[data-hovered]"),w=L||z,b=w?P.indexOf(w):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),b===-1&&(b=I.key==="ArrowDown"?-1:P.length);let v=I.key==="ArrowDown"?1:-1,B=(b+v+P.length)%P.length;P[B].setAttribute("data-highlighted",""),P[B].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),A(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[P.length-1].setAttribute("data-highlighted",""),P[P.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),A(false),D.blur();return}},[R]),W=useCallback(I=>{let D=I.currentTarget;D.hasAttribute("data-keyboard-nav")&&E(D);},[E]),S=useCallback(I=>{let D=I.currentTarget;D.hasAttribute("data-keyboard-nav")&&E(D);},[E]),M=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:F,children:jsx(Tt.Provider,{value:p,children:jsx(er.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:M,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:_,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ii.displayName="Menu";var ci=createContext(null),or=()=>{let e=useContext(ci);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function zu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)zu(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ou=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},tr=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Wu=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Ou(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let d=Array.from(g.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(R=>{let E=window.getComputedStyle(R);return E.display!=="none"&&E.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],F=document.activeElement;x.shiftKey&&F===p?(x.preventDefault(),C.focus()):!x.shiftKey&&F===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let A=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ci.Provider,{value:A,children:a})},ui=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:l}=or(),u=fe.Children.only(t),m=u.props||{},h=io(c,o,u.ref),f=a==="click"?{onClick:A=>{A.stopPropagation(),s(!r),m.onClick?.(A);}}:{onMouseEnter:A=>{l(),r||s(true),m.onMouseEnter?.(A);},onMouseLeave:A=>{i(),m.onMouseLeave?.(A);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let A=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[A,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});ui.displayName="PopoverTrigger";var di=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=fe.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return fe.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:ds(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});di.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var pi=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:A,setOpen:y,triggerOn:x,referenceRef:g,scheduleClose:d,cancelClose:p}=or(),C=V(),F=_u(e),{refs:R,x:E,y:k,strategy:$,context:_}=useFloating({open:A,onOpenChange:y,whileElementsMounted:autoUpdate,placement:F,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&R.setReference(g.current);},[R,g]);let W=useDismiss(_,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(_,{role:"dialog"}),{getFloatingProps:M}=useInteractions([W,S]),[I]=_.placement.split("-"),D=I,P=`${D==="left"?"right":D==="right"?"left":"center"} ${D==="top"?"bottom":D==="bottom"?"top":"center"}`,L=8,z=D==="top"?{y:L}:D==="bottom"?{y:-L}:D==="left"?{x:L}:{x:-L},w={initial:{opacity:0,scale:.96,...z},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...z},transition:{scale:{type:"spring",stiffness:520,damping:32,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.16,ease:"linear"}}},b=C.surface.panelBg,v=C.text.primary,B=`${C.componentHeights.border} solid ${C.surface.border}`,H=tr(i,C.spacing),O=tr(l,C.spacing),K=tr(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),K&&(N.paddingBlock=K);let U=tr(m,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:k??0,left:E??0,zIndex:1e3,transformOrigin:P,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(a)??"fit-content",height:ds(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),j=r?css({}):css({background:b,color:v,border:B,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),J=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},le=io(R.setFloating,T),de=jsx(motion.div,{className:"plainframe-ui-popover",...M({...f,ref:le,...J}),...w,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:A?de:null})})});pi.displayName="PopoverContent";var Ku=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=fe.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),A=ve(),y={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},x={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[d,p]=useState(n),C=g?!!t:d,[F,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let E=["sm","md","lg"].includes(s)?s:"md",k=y[E],$=`${x.slideMs}ms ${x.easing}`,_=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?_:W,M=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:D,thumb:P}=k,L=(D-P)/2,z=css({display:"inline-flex",alignItems:"center",gap:k.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),w=css({position:"relative",width:I,height:D,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),b=css({position:"absolute",top:L,left:C?I-P-L:L,width:P,height:P,backgroundColor:M,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:F?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),B=()=>{if(r)return;let O=!C;g||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:B,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,A({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[w,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[b,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[v,m],children:a})]})}));var Ju=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},sr=fe.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:A,...y},x)=>{let g=V(),d=ve(),p=typeof e=="boolean",[C,F]=useState(t),R=p?e:C,E=r==="sm"||r==="lg"?r:"md",k=useMemo(()=>Ju(g,E),[g,E]),{checkedBg:$,checkColor:_,borderCol:W,hoverBg:S,gapPx:M}=useMemo(()=>{let O=g.palette||{},K=g.neutral||{},N=g.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=K,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||K,G=l):(U=O.primary||K,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],j=N[G]??N.primary??g.text?.onColors?.primary??g.text.primary,J=typeof k.gap=="number"?k.gap+2:k.gap;return {checkedBg:se,checkColor:j,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:J}},[k.gap,l,g]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:M,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:W,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[W,$,a,o,M,S,s,g.radius.sm,g.spacing.xs]),D=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),P=useMemo(()=>css({width:k.box,height:k.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${k.borderWidth} solid ${W}`,outlineOffset:`-${k.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?g.radius.full:k.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, box-shadow .16s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden",transform:"translateZ(0)",backfaceVisibility:"hidden"}),[k.box,k.borderRadius,k.borderWidth,W,c,g.radius.full]),L=useMemo(()=>({w:Math.round(k.box*k.iconRatioW),h:Math.round(k.box*k.iconRatioH)}),[k.box,k.iconRatioH,k.iconRatioW]),z=useMemo(()=>css({width:L.w,height:L.h,transition:"opacity .14s ease, transform .14s ease",color:_,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[_,L.h,L.w]),w=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),b=useMemo(()=>css({fontSize:k.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[k.labelFont,g.text.primary]),v=useMemo(()=>css({fontSize:k.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[k.labelFont,a,s,g.spacing.xs,g.text.secondary]),B=useCallback(()=>{o||(p?n?.(!R):F(O=>{let K=!O;return n?.(K),K}));},[o,p,R,n]),H=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},[o,B]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",A||""].join(" ").trim(),css:[I,d({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:R,onChange:B,disabled:o,css:D,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[P,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:_,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:w,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[b,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,T],children:a})]})]})}));sr.displayName="Checkbox";var ed=()=>useContext(gn),td=()=>useContext(ro),nd=()=>useContext(cr),mn=null,hi=(e,t=35)=>{mn!==null&&window.clearTimeout(mn),mn=window.setTimeout(()=>{e(),mn=null;},t);},lo=()=>{mn!==null&&(window.clearTimeout(mn),mn=null);},Ht=fe.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:A,...y},x){let g=ed(),d=nd(),p=lr(),C=uo(),F=td(),R=V(),k=!!useContext(Tt),$=y["data-subtrigger"]!==void 0,_=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,M=useContext(er),I=M==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],D=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:S>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${S}))`:R.spacing.md,minHeight:k?R.componentHeights.sm:R.componentHeights.md,display:"flex",alignItems:"center",gap:R.spacing.sm,fontWeight:500,fontSize:R.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?R.palette.danger[800]:R.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?R.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:I},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:R.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[R,k,S,t,n,I]),P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),L=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),w=[];k&&w.push({minHeight:R.componentHeights.sm,paddingLeft:R.spacing.sm,paddingRight:R.spacing.xs,paddingTop:R.spacing.xs,paddingBottom:R.spacing.xs});let b=()=>{s?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let K=H.closest('[role="menu"]');if(!K)return;let N=Array.from(K.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(J=>{if(J.closest('[role="menu"]')!==K)return false;let le=window.getComputedStyle(J);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),j=N[se];j&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),g&&T!=null&&g.setActiveIndex(se));},B=t?-1:F?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:B,ref:H=>{if(g&&!A){let O=g.listRef.current;H&&(T!=null?O[T]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&hi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');K?.hasAttribute("data-keyboard-nav")&&K.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)lo();else {let N=!!H.currentTarget.closest("[data-submenu-content]");p&&!N&&hi(p.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let K=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&g&&T!=null&&(K?.hasAttribute("data-keyboard-nav")&&(K.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),g.setActiveIndex(T)),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&g&&!F?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!g){let K=O.closest('[role="menu"]');if(K){K.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=K.tabIndex;K.tabIndex=-1,requestAnimationFrame(()=>{K.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),b());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!K)return;K.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let K=O.closest("[data-menu-id]")||O.closest('[role="menu"]');K&&K.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[D,...w,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),b());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:P,children:l}),a,(f!=null||_||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:L,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:R.typography.sizes.sm,color:R.text.secondary,whiteSpace:"nowrap"}),children:f}):null,_,m&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),xi=fe.createContext(null),hs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,A=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(A),l.current?.(A);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(xi.Provider,{value:m,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:m,...h},f){let T=useContext(xi),A=!!T&&r!==void 0,y=!A&&t!==void 0,[x,g]=useState(()=>A?T.values.some(W=>Object.is(W,r)):!!n),d=A?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),F=!!useContext(Tt),R=()=>{if(!c)if(A)T.toggle(r);else {let W=!d;y||g(W),o?.(W);}},E=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:F?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),k=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),_=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:E,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:d,css:k})}),u]});return jsx(Ht,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon:_,endIcon:m,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var vi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:m,...h},f){let T=t!==void 0,[A,y]=useState(!!n),x=T?!!t:A,d=!!useContext(Tt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),F=()=>{if(a)return;let E=!x;T||y(E),o?.(E);},R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(Ht,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:F,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(gs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});vi.displayName="MenuSwitchItem";var Ci=fe.createContext(null),Ri=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(Ci.Provider,{value:i,children:o})};Ri.displayName="MenuRadioGroup";var od=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(Ci),u=l?.value===t,m=V(),h=css({width:m.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:m.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Ht,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:h,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),fn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let m=V(),f=!!useContext(Tt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,A=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),g=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(A,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:a})]})});fn.displayName="MenuLabel";var rd=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var wi=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},ys=io,po=0,ur=null,dr=null,yd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function xd(){if(!(typeof document>"u")){if(po===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=yd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function vd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;ur!==null&&(e.style.overflow=ur),dr!==null&&(e.style.paddingRight=dr),ur=null,dr=null;}}var gn=createContext(null),pr=()=>{let e=useContext(gn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),Cd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Ei=createContext(null),lr=()=>useContext(Ei),Si=createContext(false),Rd=()=>useContext(Si),ro=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Td(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var wd=()=>Cd()?.activeIndex??null,Ii=0,Ln=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(M=>{M&&wi(h.current),e===void 0&&i(M),n?.(M);},[e,n]),m=useRef(`pfui-menu-${++Ii}`),h=useRef(null),f=useRef([]),T=useRef(null),[A,y]=useState(null),[x,g]=useState(false);useEffect(()=>{l||(y(null),f.current=[],g(false));},[l]);let d=useRef(null),p=useCallback((M,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let D=I??20;d.current=window.setTimeout(()=>u(M),D);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return xd(),()=>vd()},[l,r]);let F=xs(),[R]=useState(()=>F??Td()),E=useRef(new Set),k=useMemo(()=>({registerSubMenu:M=>(E.current.add(M),()=>E.current.delete(M)),closeAllSubMenus:()=>{E.current.forEach(M=>M());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),_=useMemo(()=>({activeIndex:A,setActiveIndex:y}),[A,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:g}),[x]),S=s==="sm";return jsx(cr.Provider,{value:R,children:jsx(Tt.Provider,{value:S,children:jsx(oo.Provider,{value:W,children:jsx(Ei.Provider,{value:k,children:jsx(mo.Provider,{value:_,children:jsx(gn.Provider,{value:$,children:a})})})})})})};Ln.displayName="DropdownMenu";var Bn=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:A,menuId:y}=pr(),x=uo(),g=lr(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,F=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:E,...k}=s,$=useMemo(()=>ys(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),_=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(P=>{let L=_();requestAnimationFrame(()=>L[P]?.focus());},[_]),S=useCallback(P=>{if(P.key==="Tab"&&c){P.preventDefault(),x?.setIsKeyboardNav(true);let L=A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=L.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');z&&(document.querySelectorAll("[data-highlighted]").forEach(w=>w.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(P.key==="ArrowRight"&&c){let L=document.querySelector("[data-subtrigger][data-hovered]");if(L){P.preventDefault(),P.stopPropagation(),x?.setIsKeyboardNav(true),L.removeAttribute("data-hovered"),L.setAttribute("data-highlighted",""),L.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});L.dispatchEvent(z);});return}}if(P.key==="ArrowDown"||P.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){P.preventDefault(),i(true),requestAnimationFrame(()=>{let L=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=Array.from(L.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==L)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let w=P.key==="ArrowDown"?0:z.length-1;h(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),C?.(P),R?.(P);return}if(c){P.preventDefault();let L=document.querySelectorAll("[data-hovered]");for(let w of Array.from(L))if(w.closest("[data-submenu-content]")){let v=w.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let B=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let K=window.getComputedStyle(O);return K.display!=="none"&&K.visibility!=="hidden"}),H=B.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),H!==-1&&B.length>0){let O=P.key==="ArrowDown"?1:-1,K=(H+O+B.length)%B.length;B[K]?.setAttribute("data-highlighted",""),B[K]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(z){z.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let w=Array.from(z.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(b=>{if(b.closest('[role="menu"]')!==z)return false;let v=window.getComputedStyle(b);return v.display!=="none"&&v.visibility!=="hidden"});if(w.length>0){let b=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),B=-1;b?B=w.indexOf(b):v&&(B=w.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(K=>K.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),B===-1&&(B=P.key==="ArrowDown"?-1:w.length);let H=P.key==="ArrowDown"?1:-1,O=(B+H+w.length)%w.length;h(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}C?.(P),R?.(P);return}}if((P.key==="Enter"||P.key===" ")&&!c){P.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let L=y?document.querySelector(`[data-menu-id="${y}"]`):A?.current;if(L){L.setAttribute("data-keyboard-nav","");let z=Array.from(L.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==L)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(P),R?.(P);return}C?.(P),R?.(P);},[c,i,h,C,R,_,W,m,x,y,A,g]),M=useCallback(P=>{l==="click"&&((P.nativeEvent.composedPath?.()??[]).some(b=>{let v=b;if(!v||!("tagName"in v))return false;let B=String(v.tagName).toUpperCase();if(B==="INPUT"||B==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(P.stopPropagation(),i(!c))),F?.(P),E?.(P);},[l,c,i,F,E]),I=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},D=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&p){let P=p.props,L=P.css,z=typeof P.className=="string"?P.className:void 0,w=typeof P.tabIndex=="number"?P.tabIndex:0,b={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[L,D,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...k};return cloneElement(p,b)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),D,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...k,children:t})});Bn.displayName="DropdownMenuTrigger";var yn=fe.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:A,exitPlacement:y,animateOnBusClose:x=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...F},R)=>{let{open:E,setOpen:k,referenceRef:$,clearSubmenuHover:_,setActiveIndex:W,floatingRef:S,menuId:M}=pr(),I=V(),D=xs(),P=uo();useEffect(()=>{if(!D)return;let X=D.registerCloser(()=>k(false));return ()=>{X&&X();}},[D,k]);let L=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,w=typeof s=="string"?parseFloat(s):s,b=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(X=>({getBoundingClientRect:()=>{let re=Math.round(X.x),Z=Math.round(X.y);return {x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0,toJSON:()=>({x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0})}},contextElement:void 0}),[]),B=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let X=e;return v({x:X.x,y:X.y})},[e,v]),{refs:H,x:O,y:K,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:k,placement:b,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:L??0,crossAxis:z??0}),flip({padding:w??8}),shift({padding:w??8}),size({apply({rects:X,elements:re}){let Z=re.floating;Z.style.boxSizing="border-box",i!=null?Z.style.height=typeof i=="number"?`${i}px`:String(i):Z.style.removeProperty("height"),c!=null?Z.style.width=typeof c=="number"?`${c}px`:String(c):a?Z.style.width=`${Math.round(X.reference.width)}px`:Z.style.width="200px",l!=null?Z.style.maxHeight=typeof l=="number"?`${l}px`:String(l):Z.style.removeProperty("max-height");}})]});useEffect(()=>{B?H.setReference(B):$.current&&H.setReference($.current);},[H,B,$]),useEffect(()=>{if(!E)return;let X=B||$.current,re=H.floating.current;if(!(!X||!re))return autoUpdate(X,re,G)},[E,B,$,H,G]),useEffect(()=>{G();},[G,a,c,i,l]),useEffect(()=>{E&&!h&&W(0);},[E,h,W]),useEffect(()=>{if(!m||!E)return;let X=()=>{let re=document.activeElement,Z=$.current,ce=H.floating.current;re&&(Z?.contains(re)||ce?.contains(re)||k(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,E,k,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:X=>{if(d?.length){let re=X.target;for(let Z of d)if(Z.current?.contains(re))return false}return true}}),j=useRole(U,{role:"menu"}),{getFloatingProps:J}=useInteractions([se,j]),le=useRef(false);useEffect(()=>{E?le.current=true:le.current&&$.current&&C&&(D?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[E,$,D,C]),useLayoutEffect(()=>{if(!E)return;let X=()=>{let ce=S?.current;if(!ce)return false;let pe=ce.closest('[data-floating-ui-portal="true"]')??ce,Ue=$?.current;if(!Ue)return false;let Oe=Ue.closest("[data-pfui-portal-owner]");if(Oe){let He=Oe.getAttribute("data-pfui-portal-owner");if(!He)return false;if(pe.getAttribute("data-pfui-portal-owner")===He&&ce.getAttribute("data-pfui-portal-owner")===He)return true;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=Oe.getAttribute("data-pfui-mode"),qe=Oe.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<Oe.style.length;Ge++){let ot=Oe.style[Ge];if(ot.startsWith("--pf-")){let dt=Oe.style.getPropertyValue(ot);pe.style.setProperty(ot,dt),ce.style.setProperty(ot,dt);}}return pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),Oe.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),Oe.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark")),true}let ke=Ue.closest('[data-floating-ui-portal="true"]');if(ke&&!ke.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let He=st.getAttribute("data-pfui-scope");if(!He)return false;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe)),pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),st.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${He}"]`);if(Ge&&Ge!==pe)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let rn=Ge.style.getPropertyValue(dt);pe.style.setProperty(dt,rn),ce.style.setProperty(dt,rn);}}return true}return false},re=[0,5,15,30,60,100,150,250],Z=[];for(let ce of re)Z.push(window.setTimeout(()=>X(),ce));return ()=>{for(let ce of Z)window.clearTimeout(ce);}},[E,$]);let de=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),ge=g===void 0?void 0:typeof g=="number"?g:I.spacing[g]??g,Pe=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":de,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:ge,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Te=-1,Re=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let Z=X.type?.displayName;if(Z==="DropdownMenu"||Z==="DropdownMenuSub")return X;if(Z==="MenuItem"||Z==="MenuCheckboxItem"||Z==="MenuRadioItem"||Z==="MenuSwitchItem")return Te+=1,cloneElement(X,{__index:Te,key:X.key??Te});if(Z==="DropdownMenuTrigger"){let pe=X.props.children;return cloneElement(X,{children:fe.Children.map(pe,Re)})}if(Z==="DropdownMenuSubTrigger"){Te+=1;let pe=Te;return cloneElement(X,{__index:pe,key:X.key??pe})}let ce=X.props.children;return ce==null?X:cloneElement(X,{children:fe.Children.map(ce,Re)})},Ie=fe.Children.map(A,Re),Q=U.placement.split("-")[0]||"bottom",ie=Q==="bottom"?"center top":Q==="top"?"center bottom":Q==="left"?"right center":"left center",me=Q==="bottom"?{opacity:0,y:-8,scale:.96}:Q==="top"?{opacity:0,y:8,scale:.96}:Q==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Y=y??Q,xe=Y==="bottom"?{opacity:0,y:-8,scale:.96}:Y==="top"?{opacity:0,y:8,scale:.96}:Y==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},oe=!!D?.isBusClosingRef.current&&!x?{scale:{duration:0},x:{duration:0},y:{duration:0},opacity:{duration:0}}:{scale:{type:"spring",stiffness:520,damping:38,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.12,ease:"linear"}},ae=css({position:N,top:K??0,left:O??0,zIndex:1e3,transformOrigin:ie}),be=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),P?.setIsKeyboardNav(true);let re=X.currentTarget;re.setAttribute("data-keyboard-nav","");let Z=Array.from(re.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(ce=>{if(ce.closest('[role="menu"]')!==re)return false;let pe=window.getComputedStyle(ce);return pe.display!=="none"&&pe.visibility!=="hidden"});if(Z.length>0){let ce=re.querySelector("[data-highlighted]"),pe=re.querySelector("[data-hovered]"),Ue=-1;ce?Ue=Z.indexOf(ce):pe&&(Ue=Z.indexOf(pe)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),pe&&pe.removeAttribute("data-hovered"),Ue===-1&&(Ue=X.key==="ArrowDown"?-1:Z.length);let Oe=X.key==="ArrowDown"?1:-1,ke=(Ue+Oe+Z.length)%Z.length;W(ke),Z[ke]?.setAttribute("data-highlighted",""),Z[ke]?.focus();}}},[P,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...F,ref:ys(R,H.setFloating,X=>{if(S&&(S.current=X),X&&$.current){let Z=$.current.closest("[data-pfui-portal-owner]");if(Z){let ce=Z.getAttribute("data-pfui-portal-owner");if(ce){X.setAttribute("data-pfui-portal-owner",ce);let pe=Z.getAttribute("data-pfui-mode"),Ue=Z.getAttribute("data-pfui-primary");pe&&X.setAttribute("data-pfui-mode",pe),Ue&&X.setAttribute("data-pfui-primary",Ue);for(let Oe=0;Oe<Z.style.length;Oe++){let ke=Z.style[Oe];ke.startsWith("--pf-")&&X.style.setProperty(ke,Z.style.getPropertyValue(ke));}Z.classList.contains("pf-light")&&X.classList.add("pf-light"),Z.classList.contains("pf-dark")&&X.classList.add("pf-dark");}}}})}),"data-menu-id":M,"data-keyboard-nav":P?.isKeyboardNav?"":void 0,className:f,css:[Pe,ae,T],initial:me,animate:{opacity:1,x:0,y:0,scale:1},exit:xe,transition:oe,onPointerMove:X=>ze(X.currentTarget),onPointerDown:X=>ze(X.currentTarget),onKeyDown:be,onMouseMove:Ne,onMouseEnter:()=>{_(),D?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:Ie})}):null})})});yn.displayName="DropdownMenuContent";var ki=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Rd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&wi(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,M)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=M??20;m.current=window.setTimeout(()=>{h.current=false,u(S);},I);},[o,u]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let A=lr();useEffect(()=>{if(!A)return;let S=()=>{T(),u(false);};return A.registerSubMenu(S)},[A,u,T]);let y=useRef(`pfui-submenu-${++Ii}`),x=useRef(null),g=useRef([]),d=useRef(null),[p,C]=useState(null),[F,R]=useState(false);useEffect(()=>{l||(C(null),g.current=[],R(false));},[l]);let E=useContext(Tt),k=r??E,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:g,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),_=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:F,setIsKeyboardNav:R}),[F]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:fe.Children.map(s,S=>{if(!isValidElement(S))return S;let M=S.type;return M?.displayName==="DropdownMenuSubTrigger"||M?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Si.Provider,{value:true,children:jsx(Tt.Provider,{value:k,children:jsx(mo.Provider,{value:_,children:jsx(oo.Provider,{value:W,children:jsx(gn.Provider,{value:$,children:s})})})})})};ki.displayName="DropdownMenuSub";var Ai=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=pr(),A=uo(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),g=x?t:null,d=g?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:F,onClick:R,...E}=s,k=useMemo(()=>ys(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,_=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let M=S.currentTarget,I=D=>{A?.setIsKeyboardNav(true);let P=M.closest("[data-menu-id]");if(!P)return;P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let L=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==P)return false;let B=window.getComputedStyle(v);return B.display!=="none"&&B.visibility!=="hidden"});if(!L.length)return;let z=L.indexOf(M),w=z>=0?z:0,b=D==="next"?(w+1)%L.length:(w-1+L.length)%L.length;L[b]?.setAttribute("data-highlighted",""),L[b]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),A?.setIsKeyboardNav(true);let D=S.currentTarget;i(true),requestAnimationFrame(()=>{let P=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(P){P.setAttribute("data-keyboard-nav",""),D.removeAttribute("data-highlighted"),D.removeAttribute("data-hovered");let L=P.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');L&&(L.setAttribute("data-highlighted",""),L.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let D=M.closest("[data-menu-id]");D&&D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),M.setAttribute("data-highlighted",""),M.focus(),A&&A.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),F?.(S);},[c,i,p,F,u,A,T]),W=l==="hover"?{onMouseEnter:S=>{let M=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),M.setAttribute("data-hovered",""),M.focus({preventScroll:true});let I=M.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),A&&A.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let M=S.currentTarget;lo(),M.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),M.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&g){let S=d?.css,M=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,D={ref:k,tabIndex:I,className:[M,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:P=>{if(P.target.hasAttribute("data-highlighted")){let L=P.target.closest("[data-menu-id]");L&&!L.hasAttribute("data-keyboard-nav")&&(L.setAttribute("data-keyboard-nav",""),A&&A.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(P);},...W,...E};return cloneElement(g,D)}return jsx("div",{ref:k,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:_,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let M=S.currentTarget.closest("[data-menu-id]");M&&!M.hasAttribute("data-keyboard-nav")&&(M.setAttribute("data-keyboard-nav",""),A&&A.setIsKeyboardNav(true));}},...W,...E,children:t})});Ai.displayName="DropdownMenuSubTrigger";var Mi=fe.forwardRef((e,t)=>{let n=xs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=pr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(yn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});Mi.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Id=css({display:"inline"}),Pi=css({display:"inline",fontWeight:700}),kd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Ad=css({display:"flex",alignItems:"center",gap:4}),Md=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Di=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Fd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Pd=()=>{},Dd=e=>e,Nd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Hd=e=>{e.preventDefault(),e.stopPropagation();},Ld=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Bd=e=>{e.preventDefault(),e.stopPropagation();},Ni=fe.memo(({onCapture:e})=>{let t=useContext(gn),n=useContext(mo),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Ni.displayName="CtxCapture";var vs=fe.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),A=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Md,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Fd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(g=>Object.is(g,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:A},e.value)}return s?jsx(Ht,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Ht,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:A},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));vs.displayName="AutocompleteRow";var Hi=fe.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:A,disabled:y=false,error:x=false,showClear:g=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:F=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:k=true,blurOnSelect:$=false,freeSolo:_=false,customValueLabel:W=false,maxHeight:S,maxItems:M,noResultsText:I="No Items Found",highlightTypedValue:D,typedValueHighlightCss:P,showNoResults:L=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:b,loading:v,loadingText:B="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:K,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:j,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:de,textFieldHelperRowCss:ge,textFieldHelperTextCss:Pe,textFieldStartIconCss:Te,textFieldEndIconCss:Re,menuContentCss:Ie})=>{let Q=V().text.secondary,[ie,me]=useState(""),Y=typeof d=="boolean",[xe,ee]=useState(false),oe=Y?d:xe,ae=useRef(null),be=useRef(null),Ne=useRef(null),ze=useRef(null),X=useRef(false),re=useRef(null),Z=useRef(false),ce=useRef(0),pe=useMemo(()=>[be],[]),[Ue,Oe]=useState(N??[]),ke=K??Ue,st=useRef(ke);st.current=ke;let[He,nt]=useState(null),qe=useRef(He);qe.current=He;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[rn,Zn]=useState(false),Je=typeof b=="function",xt=Je?ot:e,ue=useRef(xt);ue.current=xt;let Ee=!!v||rn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let De=useCallback(q=>{Y||ee(q),at.current?.(q);},[Y]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let q=ie;return bt.current=window.setTimeout(async()=>{Zn(true);try{let ne=await b(q)||[];dt(Array.isArray(ne)?ne:[]);}catch{dt([]);}finally{Zn(false);}},Math.max(0,H)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,b,H]);let Qn=useMemo(()=>{let q=mr(ie);return q?xt.some(ne=>mr(ne.title??ne.value)===q):false},[xt,ie]),la=_&&!!W&&ie.trim().length>0&&!Qn,ic=q=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),Ce=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||Ce){let Ae=ne?W.prefix??"":"",he=Ce?W.suffix??"":"";return `${Ae}${q}${he}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Je)return xt;let q=mr(ie);if(!q)return xt;let ne=[],Ce=[];for(let Ae of xt){let he=mr(Ae.title??Ae.value);he.split(" ").some(Ze=>Ze.startsWith(q))?ne.push(Ae):he.includes(q)&&Ce.push(Ae);}return ne.length>0?ne:Ce},[xt,ie,Je]),ca=useMemo(()=>{if(la){let q=ie.trim();return [...$r,{value:q,title:ic(q),__pfui_free__:true}]}return $r},[$r,la,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of ca){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof M=="number"?Math.max(0,M):1/0,he=[];for(let pt of q){if(Ae<=0)break;let an=ne.get(pt).slice(0,Ae);an.length>0&&(he.push({label:pt==="__ungrouped__"?void 0:pt,items:an}),Ae-=an.length);}return he},[ca,M]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),Ho=kn.length>0,zr=!Ho&&!!L&&!Ee&&ie.trim().length>0,An=Ee||Ho||zr,Lo=An||Je;useEffect(()=>{!Je&&oe&&!An&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));},[Je,oe,An,De]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(_&&!O){if(Wr.current){Wr.current=false;return}let q=ie.trim();if(Or.current===q)return;Or.current=q,t?.({value:q,title:q});}},[ie,_,O,t]);let _r=useCallback(q=>{let ne=ue.current,Ce=new Map(ne.map(he=>[he.value,he])),Ae=q.map(he=>Ce.get(he)??{value:he,title:he});U?.(Ae);},[U]),Bo=useCallback(q=>{let ne=q.map(String);K||Oe(ne),_r(ne);},[K,_r]),ua=useCallback(q=>{let Ce=ke.includes(q)?ke.filter(Ae=>Ae!==q):[...ke,q];Bo(Ce);},[ke,Bo]),$o=useCallback(q=>{let ne=ue.current.find(Ce=>Ce.value===q)??{value:q,title:q};ne.disabled||(Wr.current=true,Or.current=(ne.title??ne.value).trim(),nt(ne),me(ne.title??ne.value),t?.(ne),Y||(E?(X.current=false,Z.current=true,ee(false),at.current?.(false),setTimeout(()=>{Z.current=false;},150)):X.current=true),!E&&Ne.current?.setActiveIndex&&Ne.current.setActiveIndex(null),$?(X.current=false,setTimeout(()=>{ze.current&&ae.current?(ze.current.tabIndex=0,ze.current.focus(),ze.current.blur(),ze.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,Y,E,$]),lc=useCallback(q=>{if(y)return;me(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):_&&nt(null)),!Y&&!ne&&F&&!oe&&De(true);},[O,Y,F,oe,De,y,_,t]),it=Nd,da=Pd,cc=Dd,pa=useMemo(()=>P?[Pi,P]:Pi,[P]),uc=useCallback(q=>{let ne=ie.trim();if(!ne||ne.length<1)return q;let Ce=ne.toLowerCase(),he=q.toLowerCase().indexOf(Ce);return he<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Id,children:[q.slice(0,he),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:pa,children:q.slice(he,he+ne.length)}),q.slice(he+ne.length)]})},[ie,pa]),zo=D?uc:cc,dc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Hd,Wo=Ld,pc=useCallback(q=>{Ne.current=q;},[]),ma=useCallback(q=>{let ne=Ne.current;if(!ne)return;let Ce=kn.length;if(Ce===0)return;let Ae=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),he=-1;if(Ae){let Ze=Ae.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),an=Ae.querySelector("[data-active]")||Ae.querySelector("[data-hovered]");an&&(he=Array.from(Ze).indexOf(an));}he<0&&typeof ne.activeIndex=="number"&&(he=ne.activeIndex);let pt=he<0?q===1?0:Ce-1:(he+q+Ce)%Ce;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=be.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(Vr=>Vr.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(Vr=>Vr.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[kn.length]),mc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!An&&!Je)return;q.preventDefault(),!oe&&!Y&&De(true),ma(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let ne=Ne.current&&typeof Ne.current.activeIndex=="number"?Ne.current.activeIndex:-1,Ce=ne>=0&&ne<kn.length?kn[ne]:null;if(oe&&Ce&&ne>=0){q.preventDefault(),q.stopPropagation(),O?(ua(Ce.value),E||requestAnimationFrame(()=>ae.current?.focus())):$o(Ce.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),oe&&!Y&&(Z.current=true,De(false),q.target.focus(),setTimeout(()=>{Z.current=false;},150))):q.key==="Tab"&&oe&&!Y&&De(false);},[An,Je,oe,Y,kn,O,E,ma,ua,$o,De,y]),fc=useCallback(()=>{y||Z.current||C&&Lo&&(ce.current=Date.now(),Y||De(true));},[Y,C,Lo,De,y]),gc=useCallback(()=>{if(X.current){X.current=false;return}k&&De(false),!_&&!O&&(He?me(He.title??He.value):ie.trim()&&me(""));},[k,_,O,He,ie,De]),fa=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{q.push(jsx(vs,{item:he,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:da,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),jsx(hs,{values:ke,onValuesChange:Bo,children:q},"multi-group")},[Vt,it,Ge,s,zo,ke,Bo,da,Wo,Oo,Q]),ga=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(he=>{let pt=He?.value===he.value;q.push(jsx(vs,{item:he,absIndex:ne,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:E,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:Q},`${he.group??"__"}|${he.value}`)),ne+=1;});}),q},[Vt,it,He,Ge,s,zo,E,$o,Wo,Oo,Q]),bc=useMemo(()=>Ee?jsx(fn,{css:w,className:it("label-loading"),children:B},"loading"):zr?jsx(fn,{css:z,className:it("label-empty"),children:I},"empty"):Vt.length===0?null:O?fa():ga(),[Ee,zr,Vt.length,it,B,I,O,fa,ga]),sn=oe?false:y||!Je&&!Ho&&!L,ba=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(sn||y)&&(Y||(oe?(Z.current=true,De(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{Z.current=false;},150)):(De(true),queueMicrotask(()=>ae.current?.focus()))));},[oe,Ho,Je,De,sn,y,Y]),ha=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:oe?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:sn?"not-allowed":"pointer",userSelect:"none",opacity:sn?.5:1}),[oe,sn]),_o=useMemo(()=>se?jsx("span",{ref:re,role:"button",tabIndex:-1,css:[ha,j],"aria-disabled":sn||void 0,onMouseDown:Bd,onClick:ba,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ha,j,sn,ba,G]),hc=useMemo(()=>T&&_o?jsxs("span",{css:Ad,children:[T,_o]}):T??_o,[T,_o]),yc=useCallback(q=>{if(!(re.current&&re.current.contains(q.target)||Z.current||y||Date.now()-ce.current<300)){if(oe){!ie.trim()&&!Y&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));return}R&&Lo&&(!Y||R)&&De(true);}},[oe,ie,R,Lo,De,y,Y]);return jsx("div",{ref:be,className:it(""),css:[dc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Ni,{onCapture:pc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:kd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:lc,onKeyDown:mc,onFocus:fc,onBlur:gc,onSurfaceClick:yc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:hc,size:A,width:n,fullWidth:o,disabled:y,error:x,showClear:g,css:i,wrapperCss:J,inputCss:le,labelCss:de,helperRowCss:ge,helperTextCss:Pe,startIconCss:Te,endIconCss:Re}),jsx("span",{ref:ze,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),An&&jsx(yn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:pe,disableOutsidePressDismiss:Y,returnFocus:!$,children:bc})]})})});Hi.displayName="Autocomplete";var _d=["sm","md","lg"],Kd=(e,t)=>typeof e=="number"?e:_d.includes(e)?t.componentHeights[e]:t.componentHeights.md,Vd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},jd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Ud=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Li=fe.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Kd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,A=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Vd(u,o),g=jd(u,o),d=Ud(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":g,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),F=css({fontSize:A,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[p,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:d})})}));Li.displayName="Avatar";var Bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),m=ve(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let R=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Bi(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),A=typeof t=="number"&&t>=0,y=A&&T.length>t?T.slice(0,t):T,x=A&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Bi(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${g}`,backgroundColor:g,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),F=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[p,r,m()],children:[y.map((R,E)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:jsx("span",{css:F,children:R})},E);let k=R,$=k.props?.css,_=$==null?F:[F,$],W=cloneElement(k,{size:n,rounded:s,css:_,style:{...k.props?.style,width:"100%",height:"100%",objectFit:k.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:W},E)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var Oi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ep=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",tp=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",np=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),op=fe.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:A,className:y,badgeClassName:x,css:g,badgeCss:d,offsetX:p,offsetY:C})=>{let F=V(),R=s==="dot",E=f??(R?8:17),k=r??(R?0:10),{scale:$,onKey:_}=Zd(F,t),W=Qd($),S=F.text?.onColors||{},M=ep(F,S,_,n),I=tp(e,a,s),D=np(i,s,e,c),P=css({position:"relative",display:"inline-block"}),L=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Oi(p??L),w=Oi(C??L),b=l.vertical||"top",v=l.horizontal||"right",B={},H="0",O="0";b==="center"?(B.top="50%",O="-50%"):b==="top"?(B.top=w,O="-45%"):(B.bottom=w,O="45%"),v==="center"?(B.left="50%",H="-50%"):v==="right"?(B.right=z,H="45%"):(B.left=z,H="-45%");let K=D?1:.8,N=css({minWidth:R?E:E/2,height:E,background:W,color:M,fontSize:typeof k=="number"?`${k}px`:k,fontWeight:o,borderRadius:999,padding:R?0:`0 ${E/4}px`,boxShadow:"0 2px 8px rgba(0,0,0,0.04)",lineHeight:1,position:"absolute",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",...T?{boxShadow:`0 0 0 2px ${A??F.surface?.appBg}`}:{},opacity:D?1:0,transform:`translate(${H}, ${O}) scale(${D?K:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...B});return jsxs("div",{className:["plainframe-ui-badge-wrapper",y||""].join(" ").trim(),css:[P,g],children:[m,jsx("span",{"aria-hidden":!D,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Is=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...A})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[g,d]=useState(e),[p,C]=useState(e),F=useRef(null),R=useRef(null),E=useRef(null);useEffect(()=>(F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),F.current=setTimeout(()=>{d(false),F.current=null;},u)),()=>{F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let M=document.body,I=M.style.overflow,D=M.style.paddingRight,P=window.innerWidth-document.documentElement.clientWidth,L=parseFloat(getComputedStyle(M).paddingRight||"0");return M.style.overflow="hidden",P>0&&(M.style.paddingRight=`${L+P}px`),()=>{M.style.overflow=I,M.style.paddingRight=D;}},[e,T]),useEffect(()=>{if(!p||!t)return;let M=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,t]);let k=M=>{if(!p||!t||!E.current)return;let I=M.target;I&&!E.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!g)return null;let _=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:p?"auto":"none",visibility:g?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[_,a],onPointerDown:k,...A,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,i],role:"presentation"}),jsx("div",{ref:E,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function lp(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var cp=fe.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let m=V(),h=ve(),f=fe.useMemo(()=>fe.Children.toArray(e).flatMap(d=>{if(!fe.isValidElement(d))return [];let{type:p,props:C}=lp(d);if(!(p===hr||typeof p=="function"&&"displayName"in p&&p.displayName===hr.displayName))return [];let R=C;return [{href:R.href,disabled:R.disabled,node:R.children,className:R.className,css:R.css,onClick:R.onClick,startIcon:R.startIcon,endIcon:R.endIcon}]}),[e]),T=fe.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),A=fe.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=fe.useCallback((d,p,C)=>{let F=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:F,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=fe.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=fe.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,F=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",F?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,F,d.disabled),o,C?r:s,F?a:void 0,h(),d.css],k=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(fe.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[A,c],children:t}),F?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:E,children:k}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:R,css:E,children:k})]},p)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},As=e=>typeof e=="number"?`${e}px`:e,Vi=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Vi(n)&&(t=true));}),t};function mp(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function fp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var ji=fe.memo(fe.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:A,...y},x)=>{let g=V(),d=ve(),p=useMemo(()=>mp(g,t),[g,t]),C=useMemo(()=>fp(g,e),[g,e]),F=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Vi(u)&&fe.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,E=useMemo(()=>ks(n,R),[n,R]),k=useMemo(()=>ks(o,R),[o,R]),$=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),_=useMemo(()=>F?"center":l??"center",[F,l]),W=!!c&&_==="center",S=!!c&&_==="start",M=!!c&&_==="end",I=a||c,D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,g,I]),P=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),L=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(F&&!s?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:As(p.iconSize)}:{fontSize:As(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[F,s,p,n,o]),w=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:As(g.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[g,W]),b=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),B=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),K=useMemo(()=>()=>{if(F)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?E||n:null}),jsx("span",{css:H(!!S),children:$})]})},[F,n,S,B,H,E,c,$]),N=useMemo(()=>()=>{if(F)return null;let G=!!o;return !G&&!M?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!M),children:G?k||o:null}),jsx("span",{css:H(!!M),children:$})]})},[F,o,M,B,H,k,c,$]),U=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[D,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),P,L,z,A],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:w,children:[K(),jsx("span",{className:"plainframe-ui-button-label",css:b,children:F?c?$:ks(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));ji.displayName="Button";var Cr=e=>isValidElement(e),gp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>gp(e)===t,Gi=e=>Ds(e,"ButtonGroup"),Xi=e=>Ds(e,"DropdownMenu"),Fs=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,bp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,hp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ps=(e,t)=>{if(!Cr(e))return null;if(Gi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ps(t?n[0]:n[n.length-1],t):null}if(Xi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Fs);return o?Ps(o,t):null}if(Fs(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},qi=(e,t)=>{if(!e)return false;let n=Ps(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return hp(o)},Yi=fe.memo(fe.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...A},y){let x=V(),g=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:g,p=o==="vertical",C=bp(x.componentHeights.border,1),F=x.surface.border,R=n&&!!f,E=n&&!!T,k=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?On(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:On(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,S=0,M=false,I=[];for(let D of $){if(!Cr(D)){I.push(D);continue}let P=S===0,L=S===W-1,z=D.props??{},w=z.disabled??s,b=z.size??a,v=0,B=0,H=0,O=0;n&&(p?(v=P?R?0:d:0,B=P?E?0:d:0,O=L?R?0:d:0,H=L?E?0:d:0):(v=P?R?0:d:0,O=P?R?0:d:0,B=L?E?0:d:0,H=L?E?0:d:0));let K=qi(D,"left"),N=qi(D,"right"),se=n&&!P&&!(M&&K)&&!(M||K)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${F}`}):null,j=n&&!P&&M&&K?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(B),borderBottomRightRadius:On(H),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Xi(D)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=Gi(D)&&n?{__clipLeft:!P,__clipRight:!L}:{},Q=cloneElement(D,{...z,disabled:w,size:b,className:Ie,css:[Re,de],...we});I.push(Q),M=N,S+=1;continue}let ge=z.children,Pe=Children.map(ge,Re=>{if(!Cr(Re)||!Fs(Re))return Re;let Ie=Re.props,we=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Re,{...Ie,css:[Ie.css,de],className:we,disabled:w,size:b})}),Te=cloneElement(D,{...z,children:Pe});I.push(Te),M=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[k,h],...A,children:I})}));Yi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Rr(n?.[e]??e)}}},wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Rr(n?.[e]??e)}}},Ep=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Sp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},Wn=fe.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:A,role:y,tabIndex:x,...g},d){let p=V(),C=p.surface??{},[F,R]=useState(!!u),E=l!=null,k=E?!!l:F,$=useMemo(()=>Ep(o,p),[o,p]),_=useMemo(()=>Sp(o,p,$),[o,p,$]),W=_,S=useMemo(()=>Tp(r,p),[r,p]),M=useMemo(()=>wp(s,p),[s,p]),I=!!c||!!i,D=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:M,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Rr(h),height:Rr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:I?"pointer":void 0,...I?{"&:hover":{backgroundColor:_}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,M,o,p.componentHeights,C.border,h,f,I,_,W]),P=useCallback(()=>{if(!i)return;let b=!k;E||R(b),m?.(b);},[E,m,i,k]),L=useCallback(b=>{i&&P(),T?.(b);},[i,P,T]),z=useCallback(b=>{i&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),P()),A?.(b);},[i,P,A]),w=ve();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&k?"true":void 0,"aria-pressed":i?k:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[w(),D,n],onClick:L,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...g,children:t})}));Wn.displayName="Container";var kp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Hs(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return kp(o)}return e}}}function yo(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ls(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ap(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function xo(e,t,n,o){let r=Hs(t,e),s=Hs(n,e),a=Hs(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Ji(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Zi=fe.createContext("horizontal"),Bs=()=>fe.useContext(Zi),Qi=fe.memo(fe.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:A,...y},x)=>{let g=V(),d=ve(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ap(h,g),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Zi.Provider,{value:f,children:jsx(Wn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:A,tabIndex:A?0:void 0,...y,children:e})})}));Qi.displayName="Card";var Mp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Ls(o),...u?{width:"100%"}:{flex:1,minWidth:0},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Fp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Pp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Bs()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Dp=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Ji(m,l)??m.text?.primary,textAlign:Ls(o),...xo(m,r,s,a),display:"flex",alignItems:"center",gap:m.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[h,t],...u,children:e})}),Np=fe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Ji(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Ls(o),...xo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var tl=e=>isValidElement(e),$p=e=>tl(e)?e.type?.displayName||e.type?.name:void 0,el=e=>$p(e)==="Card",zp=e=>typeof e=="number"?`${e}px`:e,nl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?zp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(el).length,x=0,g=T.map((d,p)=>{if(!el(d)||!tl(d))return d;let C=d.props,F=x++,R=F===0,E=F===y-1,k=s??C.variant,$=t?u?{borderTopLeftRadius:R?C.radius:0,borderTopRightRadius:R?C.radius:0,borderBottomLeftRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:{borderTopLeftRadius:R?C.radius:0,borderBottomLeftRadius:R?C.radius:0,borderTopRightRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:void 0,_=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=k==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,M=[$,_,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:k??C.variant,css:[C.css,...M],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:g})};nl.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,rl=e=>{let t=false;return fe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&rl(n)&&(t=true));}),t},Kp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},sl=fe.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:A},y){let x=V(),g=ve(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Kp(x,d),[x,d]),C=!!l&&!h,F=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),E=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),k=useCallback(G=>{let se=x.palette;return (E==="neutral"?x.neutral[G]:se[E]?.[G])??se.primary?.[G]},[E,x.neutral,x.palette]),$=useMemo(()=>E==="neutral"?x.neutral[100]:k(50),[E,k,x.neutral]),_=useMemo(()=>E==="neutral"?x.text.secondary:k(800),[E,k,x.text.secondary]),W=useMemo(()=>E==="neutral"?x.neutral[100]:k(50),[E,k,x.neutral]),S=useMemo(()=>E==="neutral"?x.text.secondary:k(800),[E,k,x.text.secondary]),M=useMemo(()=>E==="neutral"?x.neutral[400]:k(300),[E,k,x.neutral]),I=useMemo(()=>E==="neutral"?x.surface.subtleBg:k(600),[E,k,x.surface.subtleBg]),D=useMemo(()=>(x.text.onColors??{})[E]??(E==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[E,x.text.onColors,x.neutral]),P="transparent",L=useMemo(()=>E==="neutral"?x.text.secondary:k(700)??x.text.primary,[E,k,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!rl(t)&&fe.Children.count(t)===1,[a,c,t]),w=useMemo(()=>o==="filled"?css({backgroundColor:I,color:D,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:S,border:"none",boxShadow:`inset 0 0 0 ${R} ${M}`}):o==="ghost"?css({backgroundColor:P,color:L,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:_,border:"none",boxShadow:"none"}),[I,D,L,W,S,M,$,_,R,o]),b=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(p.gap),padding:o==="ghost"?0:z||t==null?Le(p.soloPadding):`${Le(p.paddingY)} ${Le(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:F,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,minHeight:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,F,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:Le(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Le(p.iconSize):void 0,height:z?Le(p.iconSize):void 0,display:z?"block":void 0}}),[p.fontSize,p.iconSize,z]),B=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Le(p.iconSize),lineHeight:0,"& > svg":{width:Le(p.iconSize),height:Le(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Le(p.gap),marginLeft:z||t==null?0:Le(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Le(p.gap),marginRight:z||t==null?0:Le(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),K=useMemo(()=>css({marginRight:s?0:Le(p.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:h?"not-allowed":"pointer",color:"currentColor",opacity:h?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Le(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[b,w,C?g({color:r??"primary"}):null,A],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":E,"data-size":i,"data-icon-only":z||void 0,children:[a&&jsx("span",{css:[B,H],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[B,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[K,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));sl.displayName="Chip";var qp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gp=fe.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let A=ve(),y=r.neutral,x=r.text,g=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),F=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),E=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),k=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",_=z=>css({width:E,height:E,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:k,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?A({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),M=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let w=Math.max(0,Math.min(o-1,z));C(w),d.current[w]?.focus();},[o]),D=useCallback((z,w)=>{let b=M(w).slice(0,1),v=[...F];v[z]=b,n(v.join("")),b&&z<o-1&&I(z+1);},[F,o,n,I]),P=useCallback((z,w)=>{if(w.key==="Backspace")if(!F[z]&&z>0){let b=[...F];b[z-1]="",n(b.join("")),I(z-1),w.preventDefault();return}else {let b=[...F];b[z]="",n(b.join(""));return}if(w.key==="ArrowLeft"&&z>0){w.preventDefault(),I(z-1);return}if(w.key==="ArrowRight"&&z<o-1){w.preventDefault(),I(z+1);return}if(w.key==="Home"){w.preventDefault(),I(0);return}if(w.key==="End"){w.preventDefault(),I(o-1);return}},[F,o,n,I]),L=useCallback(z=>{let w=M(z.clipboardData.getData("text")).slice(0,o);w&&(n(w),requestAnimationFrame(()=>{let b=Math.min(w.length,o-1);I(b);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,w)=>jsxs(fe.Fragment,{children:[jsx("input",{ref:b=>{d.current[w]=b;},type:"text",inputMode:"text",maxLength:1,value:F[w]||"",placeholder:F[w]?"":R[w]||"",disabled:l,onChange:b=>D(w,b.target.value),onKeyDown:b=>P(w,b),onFocus:()=>C(w),onPaste:w===0?L:void 0,className:"plainframe-ui-code-box",css:_(w===p),"aria-label":`Code character ${w+1}`,tabIndex:w===p?0:-1}),f&&w<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},w))})}),Xp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:A,labelCss:y,helperRowCss:x,helperTextCss:g,css:d})=>{let p=V(),C=useId(),F=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",E=F[R],k=p.neutral,$=p.text,_=t!=null,[W,S]=useState(n),M=_?t:W,I=H=>{_||S(H),o?.(H);},D=Math.max(2,Math.min(h,10)),P=p.spacing.sm,L=qp(l??P)??"0px",z=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(A)?A:A?[A]:[]),w=css({fontSize:E.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??$.primary:i?k[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),b=css({display:"flex",alignItems:"center",justifyContent:"center",gap:L,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:E.helperFont,color:a?p.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),B=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??$.primary:i?k[500]:$.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:w,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:b,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Gp,{value:M||"",onChange:I,len:D,theme:p,sizeKey:R,s:{codeFontSize:E.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:L})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:B,children:c})})]})};var ul=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},zs=e=>{if(!e||typeof e!="object")return false;let t=ul(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some(zs):zs(o)},Jp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=fe.useRef(null),[c,i]=fe.useState(false),l=fe.useCallback(v=>{i(v),o?.(v);},[o]),u=fe.useCallback(()=>l(false),[l]),m=fe.useRef({x:0,y:0}),h=fe.useRef(null),f=fe.useRef(null),T=fe.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let B=Math.round(m.current.x),H=Math.round(m.current.y);v.style.transform=`translate3d(${B}px, ${H}px, 0)`;},[]),A=fe.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);fe.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=fe.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),B=Math.round(m.current.y);return {x:v,y:B,left:v,top:B,right:v,bottom:B,width:0,height:0,toJSON:()=>({x:v,y:B})}}}),[]),x=fe.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=fe.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=fe.useRef(null),p=fe.useRef(null),C=fe.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),F=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=fe.useCallback(()=>{F(),p.current=window.setTimeout(()=>l(false),0);},[F,l]),E=fe.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),k=fe.useCallback((v,B)=>{m.current={x:v,y:B},A(),l(true);},[A,l]),$=typeof t=="function"?t({close:u}):t,_=zs($),W=v=>{if(!fe.isValidElement(v))return v;let B=ul(v),H=v,O=H.props.children,K=O==null?O:Array.isArray(O)?O.map(N=>fe.isValidElement(N)?W(N):N):fe.isValidElement(O)?W(O):O;if(B==="DropdownMenu"){let N=H.props.onOpenChange;return fe.cloneElement(H,{...H.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:K})}if(B==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return fe.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{F(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:K})}return K===O?H:fe.cloneElement(H,{...H.props,children:K})},S=_?W($):$,M=fe.useCallback(v=>{v.preventDefault(),k(v.clientX,v.clientY);},[k]),I=fe.useCallback(v=>{n==="contextmenu"&&M(v);},[n,M]),D=fe.useCallback(v=>{n==="dblclick"&&M(v);},[n,M]),P=fe.useCallback(v=>{n==="click"&&M(v);},[n,M]),L=fe.useCallback(v=>{if(n!=="hover")return;C(),F();let B=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=B.x+(r==="cursor"?s:0),O=B.y+(r==="cursor"?s:0);k(H,O);},0);},[n,r,s,E,k,C,F]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!_&&(m.current={x:v.clientX+s,y:v.clientY+s},A());},[n,c,r,_,s,A]),w=fe.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);fe.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let B=a.current?.matches(":hover"),H=g()?.matches?.(":hover");B||H?F():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,g,F,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let B=a.current?.matches(":hover"),H=g()?.matches?.(":hover");if(B||H?F():R(),r==="center"&&a.current){let O=E();m.current={x:O.x,y:O.y},A();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,E,A,l,F,R,g]),fe.useEffect(()=>()=>{C(),F();},[C,F]);let b=({children:v})=>c?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(m.current.x)}px, ${Math.round(m.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&F(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:D,onClick:P,onMouseEnter:L,onMouseMove:z,onMouseLeave:w,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,_?S:jsx(b,{children:S})]})};var Kn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tm=fe.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:A,className:y,...x},g){let d=V(),{t:p,strokeColor:C,labelTextColor:F,chipSubtleBg:R,chipOutlinedBg:E,outerM:k,padX:$,verticalStrokeMargin:_}=useMemo(()=>{let D=typeof s=="number"?`${s}px`:s,P=d.surface.border,L=d.text.secondary,z=d.surface.subtleBg,w=d.surface.panelBg,b=Kn(h,"10px"),v=o==="horizontal"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0",B=o==="vertical"?n==="middle"?Kn(c):n==="inset"?Kn(i,"0px"):"0":"0";return {t:D,strokeColor:P,labelTextColor:L,chipSubtleBg:z,chipOutlinedBg:w,outerM:b,padX:v,verticalStrokeMargin:B}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:k,marginRight:k}:{flexDirection:"row",width:a?Kn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:k,marginBottom:k},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,k,a,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:_,marginBottom:_}:{height:p,flex:1}]),[C,m,d.radius.full,d.radius.xs,o,p,_]),M=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:F,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:E,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,F,u,R,E,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,A]}),[S,A]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="right"&&I,!t&&I]})}));var hl=fe.createContext(null),yl=()=>{let e=useContext(hl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},xl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(hl.Provider,{value:u,children:e})},rm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=yl(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:l,...r,children:t})});rm.displayName="DrawerTrigger";var To=0,vl="",Cl="",sm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function am(){if(!(typeof document>"u")){if(To===0){let e=document.body;vl=e.style.overflow||"",Cl=e.style.paddingRight||"";let t=sm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function im(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=vl,e.style.paddingRight=Cl;}}var lm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Rl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:A,css:y,...x},g){let d=V(),{open:p,setOpen:C,lockScroll:F,closeOnEscape:R}=yl();useEffect(()=>{if(!(!F||!p))return am(),()=>im()},[p,F]);let E=useMemo(()=>lm(a,0),[a]),k=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),_=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${E*2}px)`:"100%"),[n,r,s,E]),W=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${E*2}px)`:"100%"),[o,r,s,E]),S=useMemo(()=>{let j=String(d.radius.lg);switch(r){case "left":return `0 ${j} ${j} 0`;case "right":return `${j} 0 0 ${j}`;case "top":return `0 0 ${j} ${j}`;default:return `${j} ${j} 0 0`}},[r,d.radius.lg]),M=useMemo(()=>c??(s==="inset"?d.radius.lg:S),[c,s,d.radius.lg,S]),I=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:E,bottom:r==="top"?void 0:E,left:r==="right"?void 0:E,right:r==="left"?void 0:E}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,E]),D=useRef(null),P=useCallback(()=>{let j=D.current;if(!j)return 1;let J=j.getBoundingClientRect();return k==="x"?J.width:J.height},[k]),L=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(m??280)/1e3,ease:[.22,1,.36,1]}),[m]),w=useMemo(()=>$*1.1,[$]),b=useMemo(()=>k==="x"?{x:`${w*100}%`,y:0}:{y:`${w*100}%`,x:0},[k,w]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:_,height:W,backgroundColor:d.surface.panelBg,borderRadius:M,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:k==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,_,W,d.surface,M,p,k]),B=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,d.surface]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>k==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[k,$,T]),K=useMemo(()=>k==="x"?{left:0,right:0}:{top:0,bottom:0},[k]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((j,J)=>{let le=k==="x"?J.offset.x:J.offset.y,de=k==="x"?J.velocity.x:J.velocity.y,ge=$*le>0,Pe=Math.abs(le)>=P()*N,Te=$*de>f;ge&&(Pe||Te)&&C(false);},[k,$,P,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let j=setTimeout(()=>{let de=D.current;if(!de)return;let ge=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');ge.length>0?ge[0].focus():de.focus();},100),J=de=>{let ge=D.current;if(!ge||!de.target)return;let Pe=de.target;if(!ge.contains(Pe)){de.preventDefault();let Te=ge.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Te.length>0?Te[0].focus():ge.focus();}},le=de=>{de.key==="Escape"&&R&&(de.stopPropagation(),C(false));};return document.addEventListener("focusin",J,true),window.addEventListener("keydown",le),()=>{clearTimeout(j),document.removeEventListener("focusin",J,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,C,R]);let{...se}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:B,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:j=>{D.current=j,typeof g=="function"?g(j):g&&(g.current=j);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",A||""].join(" ").trim(),css:[v,y],drag:k,dragConstraints:K,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...b,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...b,opacity:.98},transition:m?z:L,...se,children:t},"panel")]}):null})});Rl.displayName="DrawerContent";var cm=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),A=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(xl,{open:A,onOpenChange:y,children:jsx(Rl,{ref:l,...i,children:c})})});cm.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),A=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(A)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Tl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wl=fe.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Tl(c),width:c?"100%":void 0,maxHeight:Tl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});wl.displayName="Flex";var Vs=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],A=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(A)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var El={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},wm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Em={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Vn=fe.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:A,style:y,as:x})=>{let g=V(),d=El[e]??El.body,p=x??Em[e]??"span",C=M=>M==null?d.size:typeof M=="number"?M:g?.typography?.sizes?.[M]??M,F=C(o)??C(d.size),R=r??d.weight,E=s??d.lh,k=a??d.ls,$=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",_=f??g.surface.border,W=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:F,fontWeight:R,lineHeight:E,letterSpacing:k,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:_,textDecorationThickness:wm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,A||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Gs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Il=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:A,placeholder:y,blurDataURL:x,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:F,onLoad:R,onError:E,...k},$){let[_,W]=useState(false),[S,M]=useState(false),[I,D]=useState(false),P=V(),L=km(s,P)??"0px",z=i?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:i?P.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${L})`}),b=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${L})`,maxWidth:o?Gs(o):"100%",maxHeight:r?Gs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:_&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:F?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?g:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),B=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:_&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",p||""].join(" ").trim(),css:[w,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:b,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:F,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:B,src:S&&d?d:t,alt:n,srcSet:T,sizes:A,loading:m,decoding:h,fetchPriority:f,onLoad:H=>{D(true),R?.(H);},onError:H=>{M(true),E?.(H);},...k})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Il.displayName="Image";var kl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pm=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Dm=e=>e*Math.PI/180,Nm=(e,t,n)=>{let o=Math.abs(Dm(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Hm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Lm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,Al=[1.02,1.03,1.02],Ml=[1.06,1.08,1.06],Bm={sm:150,md:200,lg:260,xl:340},$m=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function zm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return $m(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Om=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:A="md",label:y,labelAlign:x="center",css:g,className:d,...p}){let C=V(),F=Pm(r)??4/5,R=typeof o=="string"?o:void 0,E=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Bm[s],k=Math.max(1,E/F),_=Children.toArray(t).filter(isValidElement).slice(0,i),W=_.length,S=Hm(n,W),M=_.map((j,J)=>Lm(n,W,J)),I=j=>k*.6*M[j],D=j=>I(j)*F,P=0,L=0;for(let j=0;j<W;j++){let J=D(j),le=I(j),de=Math.max(Math.abs(S.base.ang[j]??0),Math.abs(S.exp.ang[j]??0)),ge=Math.max(Math.abs(S.base.dx[j]??0),Math.abs(S.exp.dx[j]??0)),Pe=Math.max(Math.abs(S.base.dy[j]??0),Math.abs(S.exp.dy[j]??0)),Te=a==="expand"?Ml[j]??1.08:a==="reveal"?Al[j]??1.03:1,Re=Nm(J,le,de),Ie=Re.w*Te,we=Re.h*Te,Q=ge/100*J*Te,ie=Pe/100*le*Te;P=Math.max(P,Ie/2+Q),L=Math.max(L,we/2+ie);}let z=Math.max(1,2*P),w=Math.max(1,2*L),b=Math.min(1,E/z,k/w),v=c===void 0?"pointer":"controlled",B=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:kl(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:kl(k)}),K=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${w}px`,transform:`translate(-50%, -50%) scale(${b})`,transformOrigin:"center center"}),N=zm(A,C)??"0px",U=j=>{let J=n==="fan"?`rotate(${S.base.ang[j]}deg) translate(${S.base.dx[j]}%, ${S.base.dy[j]}%)`:n==="slide"?`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[j]}%)`:`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[j]}deg) translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%)`:n==="slide"?`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[j]}%)`:`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`,de=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,ge=a==="expand"?`${le} scale(${Ml[j]??1.06})`:a==="reveal"?`${J} scale(${Al[j]??1.03})`:`${J} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${de}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&j===1?10:j+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${ge}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${ge}`}})},G=j=>css({width:`${D(j)}px`,aspectRatio:`${F}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":B,css:[H,g],tabIndex:-1,...p,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:K,children:_.map((j,J)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(J),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(J),children:j})},J))})}),y&&jsx(Vn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Pl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Km(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function Vm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var jm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},m){let h=V(),f=ve(),T=Pl[o]??Pl.sm,A=Km(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:A,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?g:n==="ghost"?d:p,R=s&&c>0&&Vm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var Xm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Xs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:c,distance:i})=>{let u=Xm(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,g=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:g,className:d,onTransitionEnd:T(p)})}let A=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:A,onTransitionEnd:T(),children:e})};var Js=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hl=fe.createContext(null),Ll=()=>{let e=useContext(Hl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},tf=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]);useEffect(()=>{if(!i||!s)return;let m=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",m,true),()=>window.removeEventListener("keydown",m,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Hl.Provider,{value:u,children:e})},Bl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Ll(),c=!!e&&fe.isValidElement(t),i=useCallback(u=>{if(c){let m;fe.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;fe.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return fe.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r,children:t})});Bl.displayName="ModalTrigger";var $l=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:A,...y},x)=>{let g=V(),{open:d,setOpen:p,lockScroll:C}=Ll(),F=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!d)return;R.current=document.activeElement;let I=setTimeout(()=>{let P=F.current;if(!P)return;let L=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');L.length>0?L[0].focus():P.focus();},100),D=P=>{let L=F.current;if(!L||!P.target)return;let z=P.target;if(!L.contains(z)){P.preventDefault();let w=L.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');w.length>0?w[0].focus():L.focus();}};return document.addEventListener("focusin",D,true),()=>{clearTimeout(I),document.removeEventListener("focusin",D,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let E=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),k=typeof g.spacing.sm=="number"?`calc(100% - ${g.spacing.sm*2}px)`:`calc(100% - (${E} + ${E}))`,$=css({width:"100%",height:Js(o),maxWidth:t==="inset"?`min(${Js(n)||"100%"}, ${k})`:Js(n),maxHeight:t==="inset"?k:"100%",margin:t==="inset"?`${E} auto`:void 0}),_=jsx(Wn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",A||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[$,f],ref:I=>{F.current=I,typeof x=="function"?x(I):x&&(x.current=I);},...y,children:e}),W=u==="none"?_:u==="slide"?jsx(Xs,{on:d,direction:m,duration:h,children:_}):u==="grow"?jsx(Vs,{initialScale:.75,on:d,duration:h,children:_}):jsx(Ks,{on:d,duration:h,children:_});if(!a)return jsx(Fragment,{children:W});let S=css({position:"fixed",inset:0,width:"100vw",height:"100vh",margin:0,maxWidth:"100vw",maxHeight:"100vh",display:"flex",alignItems:t==="full"?"flex-start":"center",justifyContent:t==="full"?"flex-start":"center"}),M=css({width:"100%",height:"100%",display:"flex",alignItems:t==="full"?"flex-start":"center",justifyContent:t==="full"?"flex-start":"center"});return jsx(Is,{on:d,blur:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[S,T].filter(Boolean),contentCss:M,lockScroll:C,children:W})});$l.displayName="ModalContent";var uf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:m,css:h})=>{let f=V(),T=ve(),A=t!==void 0,[y,x]=useState(n),g=Math.max(1,e),d=Ir(A?t:y,1,g),p=useCallback(b=>{let v=Ir(b,1,g);A||x(v),o?.(v);},[A,g,o]),C=useMemo(()=>df({count:g,page:d,siblingCount:r,boundaryCount:s}),[g,d,r,s]),F=f.palette?.primary?.[600],R=f.surface?.border,E=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,k=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",_=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:$,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),W=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:k,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),M=(b=false)=>css([W,T({color:b?"primary":"neutral"}),l==="outlined"?b?{background:F,color:f.text.onColors.primary,borderColor:F}:{background:"transparent",borderColor:R,":hover":{background:E}}:l==="ghost"?b?{background:F,color:f.text.onColors.primary}:{":hover":{background:E}}:b?{background:F,color:f.text.onColors.primary,borderColor:F}:{":hover":{background:E}}]),I=useCallback(()=>p(1),[p]),D=useCallback(()=>p(g),[p,g]),P=useCallback(()=>{d===1?i&&p(g):p(d-1);},[d,i,g,p]),L=useCallback(()=>{d===g?i&&p(1):p(d+1);},[d,i,g,p]),z=a||d===1&&!i,w=a||d===g&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",m||""].join(" ").trim(),css:_,onKeyDown:b=>{a||(b.key==="ArrowLeft"&&(b.preventDefault(),P()),b.key==="ArrowRight"&&(b.preventDefault(),L()),b.key==="Home"&&(b.preventDefault(),I()),b.key==="End"&&(b.preventDefault(),D()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((b,v)=>typeof b=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":b===d?`Page ${b}, current page`:`Go to page ${b}`,"aria-current":b===d?"page":void 0,css:M(b===d),onClick:()=>p(b),children:b},b):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:L,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Ir(e,t,n){return Math.max(t,Math.min(n,e))}function df({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Sr(1,e);let s=Sr(1,Math.min(o,e)),a=Sr(Math.max(e-o+1,o+1),e),c=Ir(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Ir(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=m=>{let h=l[l.length-1];h!==m&&(h==="ellipsis"&&m==="ellipsis"||l.push(m));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Sr(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var gf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,bf=fe.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:gf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var _l=createContext(null),vf=()=>{let e=useContext(_l);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Cf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Rf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),A=h?e:f,y=useRef([]),[x,g]=useState(0),d=()=>g(M=>M+1),p=useCallback(M=>{h||T(M),n?.(M);},[h,n]),C=useCallback(M=>(y.current.push(M),d(),y.current.length-1),[]),F=useCallback((M,I)=>{let D=y.current[M];D&&(y.current[M]={...D,...I},d());},[]),R=()=>y.current.map((M,I)=>({it:M,i:I})).filter(({it:M})=>M.ref&&!M.disabled).map(({i:M})=>M),E=useCallback((M,I)=>{let D=R();if(!D.length)return;let P=Math.max(0,D.indexOf(M)),L=D[(P+I+D.length)%D.length],z=y.current[L]?.ref;if(z){z.focus();let w=y.current[L]?.value;w!==void 0&&p(w);}},[p]),k=useCallback(M=>{let I=R();if(!I.length)return;let D=M==="first"?I[0]:I[I.length-1],P=y.current[D]?.ref;if(P){P.focus();let L=y.current[D]?.value;L!==void 0&&p(L);}},[p]),$=useMemo(()=>{let M=y.current.filter(D=>D.ref&&!D.disabled);return M.length?M.some(D=>D.value===A)?A:M[0]?.value:void 0},[A,x]),_=useMemo(()=>({selected:A,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:F,moveFocusBy:E,moveToEdge:k,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[A,p,o,r,s,a,C,F,E,k,$,m,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(_l.Provider,{value:_,children:i})})})},Tf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:A,anchorOrigin:y}=vf(),x=c||t,g=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],F=C(600),R=C(100),E=f.neutral[300],k=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],_="transparent",W=k,S=$;T==="soft"?(_=R,W=null,S=F):T==="outlined"?(_=C(50),W=k,S=F):(_=f.neutral[200],W="transparent",S=$),g&&(T==="outlined"?(_=R,W=k,S=F):T==="filled"?(_=F,W=null,S=$):(_=R,W=null,S=F));let M=T==="filled"?E:f.palette.primary[100],I=useRef(null),D=useRef(-1);useEffect(()=>{D.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(D.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let P=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||g?{}:{background:M,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${k}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),L=css({width:p,height:p,minWidth:p,minHeight:p,borderRadius:f.radius.full,background:_,boxShadow:W?`inset 0 0 0 ${f.componentHeights.border} ${W}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),z=css({width:g?p*.45:0,height:g?p*.45:0,borderRadius:f.radius.full,background:g?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),w=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),b=(()=>{let O=y.horizontal,K=y.vertical;return K==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:K==="top"?1:3}})(),B=!x&&A===e?0:-1,H=ve();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":x||void 0,disabled:x,tabIndex:B,onClick:()=>{x||a(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(D.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(D.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[P,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[L,css({gridColumn:b.col,gridRow:b.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:w,children:o})]})};var kf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],A=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:A,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var qn=e=>null;qn.displayName="SelectItem";var Mo=(...e)=>e.filter(Boolean).flat(),Ff=e=>{if(e.type===qn)return true;let t=e.props;return t?.type===qn||t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__===qn},Pf=e=>{if(e.type===qn)return e.props;let t=e.props||{},{type:n,__EMOTION_TYPE_PLEASE_DO_NOT_USE__:o,...r}=t;return r};function ea(e,t){if(e==null||typeof e=="boolean")return;if(Array.isArray(e)){for(let o of e)ea(o,t);return}if(!fe.isValidElement(e))return;let n=e;if(Ff(n)){t.push(n);return}if(n.type===fe.Fragment){ea(n.props.children,t);return}}var Vl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:A=280,wrapperCss:y,labelCss:x,triggerCss:g,menuCss:d,optionCss:p,children:C,className:F,menuSize:R="md",triggerRender:E})=>{let k=V(),$=ve(),_=fe.useId(),W=`${_}-label`,S=`${_}-menu`,M={sm:{minHeight:k.componentHeights.sm,radius:k.radius.sm},md:{minHeight:k.componentHeights.md,radius:k.radius.md},lg:{minHeight:k.componentHeights.lg,radius:k.radius.md}},I=M[l]||M.md,[D,P]=fe.useState(false),L=Q=>P(!!Q),z=typeof e<"u",w=c||Array.isArray(e)||Array.isArray(t),[b,v]=fe.useState(()=>typeof t<"u"?t:w?[]:void 0),B=z?e:b,H=Q=>{z||v(Q),n?.(Q);},O=[];ea(C,O);let K=O.map((Q,ie)=>{let me=Pf(Q),Y=typeof me.children=="string"||typeof me.children=="number"?String(me.children):void 0,xe=typeof me.value=="string"||typeof me.value=="number"?String(me.value):void 0,ee=me.label??Y??xe;return {key:Q.key??ie,value:me.value,startIcon:me.startIcon,endIcon:me.endIcon,node:me.children,triggerLabel:ee,itemCss:me.css,itemClassName:me.className}}),N=Q=>w?(Array.isArray(B)?B:[]).some(me=>Object.is(me,Q)):Object.is(B,Q),U=fe.useMemo(()=>{if(w){let ie=Array.isArray(B)?B:[];return K.filter(Y=>ie.some(xe=>Object.is(xe,Y.value))).map(Y=>Y.triggerLabel??Y.node)}let Q=K.find(ie=>Object.is(ie.value,B));if(Q)return Q.triggerLabel??Q.node},[B,w,K]),G=Q=>{i||(Object.is(Q,B)||H(Q),L(false));},se=Q=>{if(i)return;let ie=Array.isArray(B)?B:[],Y=ie.some(xe=>Object.is(xe,Q))?ie.filter(xe=>!Object.is(xe,Q)):[...ie,Q];H(Y);},j={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},J={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:k.typography.sizes.sm,padding:`0 ${typeof k.spacing.sm=="number"?`${k.spacing.sm}px`:k.spacing.sm} 0 ${typeof k.spacing.md=="number"?`${k.spacing.md}px`:k.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:k.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:k.surface.subtleBg}:u==="outlined"?{background:k.surface.panelBg,border:`1px solid ${k.surface.border}`}:{background:"transparent"},de={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},ge={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Pe={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Te=jsx(ChevronsUpDown,{size:16,css:css({color:k.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Re=()=>{if(E)return E(U);if(Array.isArray(U)){let ie=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),me=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:me,children:me})]})}let Q=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(ge),children:s}),jsx("span",{css:css(Pe),title:typeof Q=="string"?Q:void 0,children:Q})]})},Ie={left:"start",center:"center",right:"end"},we=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),L(true));};return jsxs("div",{css:Mo(j,y),className:["plainframe-ui-select-wrapper",F||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Mo({marginBottom:6,fontSize:k.typography.sizes.sm,fontWeight:500,color:k.text.secondary},x),children:o}),jsxs(Ln,{size:R,open:D,onOpenChange:L,children:[jsx(Bn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":D||void 0,"aria-controls":S,"aria-labelledby":o?W:void 0,onKeyDown:we,onClick:()=>L(!D),className:"plainframe-ui-select-trigger",css:Mo(css(J),css(le),g,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(de),children:Re()}),a??Te]})}),jsx(yn,{id:S,gap:"xs",align:Ie[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Mo({maxHeight:typeof A=="number"?`${A}px`:A,overflowY:"auto"},d),children:K.map((Q,ie)=>{let me=N(Q.value);return jsx(Ht,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:me,disabled:i,closeOnSelect:!w,onSelect:()=>w?se(Q.value):G(Q.value),css:Mo(p,Q.itemCss),className:["plainframe-ui-select-option",Q.itemClassName||""].join(" ").trim(),children:Q.node},Q.key??ie)})})]})]})};Vl.displayName="Select";var ta=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Nf=keyframes`
|
|
14
14
|
0% { background-position: -200% 0; }
|
|
15
15
|
100% { background-position: 200% 0; }
|
|
16
16
|
`,Hf=keyframes`
|
|
17
17
|
0% { opacity: .6; }
|
|
18
18
|
50% { opacity: 1; }
|
|
19
19
|
100% { opacity: .6; }
|
|
20
|
-
`,Lf=fe.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=V(),u=l.surface.subtleBg,m=l.neutral[200],h=ea(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":ea(r,String(r)),height:s==null?"fit-content":ea(s,String(s))}),T=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:u,willChange:"background-position, opacity"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Nf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Hf} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,k]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var Ar=8,ta=20,Xn=4,Xl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:k="horizontal",className:y,...x})=>{let b=V(),d=k==="vertical",p=useRef(null),[C,M]=useState(false),[R,w]=useState(false),[A,$]=useState(false),_=e!==void 0,W=useCallback(Y=>Math.min(r,Math.max(o,Y)),[o,r]),S=useCallback(Y=>W(Math.round((Y-o)/s)*s+o),[o,s,W]),[F,I]=useState(()=>S(t??o)),P=_?S(e):F;useEffect(()=>{_||I(Y=>S(Y));},[o,r,s,_,S]);let D=b.palette.primary[600];b.surface.panelBg;let z=b.neutral[500],E=useMemo(()=>{let Y=r-o||1;return (P-o)/Y*100},[P,o,r]),g=useCallback(Y=>{_||I(Y),n?.(Y);},[_,n]),v=useCallback((Y,xe)=>{let ee=p.current;if(!ee)return P;let oe=ee.getBoundingClientRect(),ae=d?(oe.bottom-xe)/oe.height:(Y-oe.left)/oe.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[P,d,o,r,S]),L=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),g(v(Y.clientX,Y.clientY)),M(true));},[a,g,v]),H=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),M(true));},[a]),O=useCallback(Y=>{!C||a||g(v(Y.clientX,Y.clientY));},[C,a,g,v]),K=useCallback(()=>M(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K);}},[C,O,K]);let N=useCallback(Y=>{if(a)return;let xe=P;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")xe=P+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")xe=P-s;else if(Y.key==="Home")xe=o;else if(Y.key==="End")xe=r;else return;Y.preventDefault(),g(S(xe));},[a,P,s,o,r,g,S]),U=C||R||A,G=(R||C)&&!a,se=`color-mix(in srgb, ${D} 25%, transparent)`,j=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":m?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),J=css({marginBottom:d?0:4,marginRight:d?8:0,color:b.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Ar:"100%",height:d?"100%":Ar,backgroundColor:b.neutral[200],borderRadius:b.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),de=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Ar:`calc(100% - ${Xn*.5}px)`,height:d?`calc(100% - ${Xn*.5}px)`:Ar,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),ge=css({width:Xn,height:Xn,borderRadius:"50%",backgroundColor:b.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-E}% )`:0,bottom:0,width:d?"100%":`${E}%`,height:d?`${E}%`:"100%",backgroundColor:a?z:D,borderRadius:b.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Te=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:b.text.onColors.primary,width:ta,height:ta,left:d?"50%":`calc(${E}% - ${ta/2}px)`,bottom:d?`${E}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?b.radius.full:`calc(${b.radius.md} * 0.75)`,border:`2px solid ${a?z:D}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),Re=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ie=css({position:"absolute",top:d?`calc(50% - ${Xn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Xn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:b.neutral[800],color:b.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:b.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),we=h,Q=f,ie=T,me=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[j,we],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:J,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[le,Q],onPointerDown:L,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:de,children:Array.from({length:me}).map((Y,xe)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:ge},xe))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":P,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:H,onPointerUp:K,onPointerCancel:K,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Te,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Re,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ie,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:P})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Xl.displayName="Slider";var _f=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Kf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Vf=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),jf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Uf=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),qf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),Gf=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),Xf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Yl=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),Yf=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),Jf=fe.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:k}){let y=V(),x=ve(),{MAIN:b,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:M,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:w,UPCOMING_FG:A}=r,$="transparent",_=A,W=w;s==="subtle"?i?($=C,_=M,W=C):c?($=b,_=d,W=b):($=R,_=A,W=R):i?($=C,_=M,W=C):c?($="transparent",_=p,W=b):($="transparent",_=A,W=w);let S=n.label,F=n.icon??jsx("span",{css:Xf,children:typeof S=="number"?S:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Vf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[Gf(o,$,_,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Yl(!i),children:F}),jsx("span",{className:"plainframe-ui-step-check",css:Yl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Yf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:qf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:jf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Uf(i?1:0,u,h),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),ra=()=>null;ra.displayName="PlainframeUIStep";var Zf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:k,className:y,children:x,...b})=>{let d=V(),p=e==="outlined"?"outlined":"subtle",C=fe.useMemo(()=>{let v=fe.Children.toArray(x).filter(L=>fe.isValidElement(L)&&L.type===ra);return v.length?v.map((L,H)=>({index:H,...L.props})):[{value:1},{value:2},{value:3}]},[x]),M=fe.useCallback((v,L)=>v?d.palette?.[v]??v:L,[d.palette]),R=fe.useMemo(()=>({MAIN:String(M(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(M(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(M(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(M(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(M(m,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[M,i,l,u,m,d.palette.primary,d.neutral,d.text]),w=fe.useMemo(()=>{let v=M(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[M,c,d.palette.primary]),[A,$]=fe.useState(()=>C.some(L=>L?.value===n)?n:C[0]?.value),_=t!==void 0,W=_?t:A,{activeIndex:S,afterLast:F}=fe.useMemo(()=>{let v=C.findIndex(L=>L.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let L=Math.floor(W)-1;if(L>=C.length)return {activeIndex:C.length-1,afterLast:true};if(L>=0)return {activeIndex:L,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=fe.useCallback(v=>{r||(_||$(v),o?.(v));},[r,_,o]),P=fe.useCallback(v=>a||!!C[v]?.complete||(F?true:v<S),[a,C,F,S]),D=fe.useCallback(v=>{if(r)return false;let L=C[v];if(!L||L.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>S)return false}else if(typeof s=="function"&&!s(S,v))return false;return true},[r,C,s,S]),[B,z]=fe.useState(false);fe.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let E=fe.useCallback(v=>{if(!C.length||r)return;let L=S;if(v.key==="ArrowRight")L=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")L=Math.max(0,S-1);else if(v.key==="Home")L=0;else if(v.key==="End")L=C.length-1;else return;v.preventDefault(),D(L)&&I(C[L].value);},[C,r,S,D,I]),g=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[_f(T),k],...b,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:E,css:Kf,children:C.map((v,L)=>jsx(fe.Fragment,{children:jsx(Jf,{i:L,item:v,size:g,tokens:R,variant:p,titlePosition:f,isActive:!F&&L===S,completed:P(L),disabled:r||!!v.disabled,connectorColor:w,showConnector:L<C.length-1,animate:B,separator:h,canGoToIndex:D,setSelected:I})},String(v.value??L)))})})};var Mr=()=>null;Mr.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function eg(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var tg=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:k,activeTabCss:y,activeIndicatorCss:x})=>{let b=V(),d=ve(),p=s==="vertical",C=l||i!=null,M=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:A}=fe.useMemo(()=>{let ee=[],oe=[];return fe.Children.forEach(e,ae=>{if(!fe.isValidElement(ae))return;let{type:be,props:Ne}=eg(ae),ze=be===Mr||be?.displayName===Mr.displayName,X=be===Pr||be?.displayName===Pr.displayName;if(ze){let re=Ne;if(re?.value===void 0)return;ee.push({value:re.value,disabled:re.disabled,node:re.children,className:re.className,css:re.css,activeCss:re.activeCss});}else if(X){let re=Ne;if(re?.value===void 0)return;oe.push({value:re.value,node:re.children,className:re.className,css:re.css});}}),{tabs:ee,contents:oe}},[e]),$=fe.useMemo(()=>w.find(ee=>!ee.disabled)?.value,[w]),[_,W]=fe.useState(()=>t!==void 0&&w.some(oe=>oe.value===t&&!oe.disabled)?t:$),S=n!==void 0,F=S?n:_,I=fe.useRef(null),P=fe.useRef([]),D=Math.max(0,w.findIndex(ee=>ee.value===F)),[B,z]=fe.useState({left:0,top:0,width:0,height:0}),[E,g]=fe.useState(false),[v,L]=fe.useState(false),H=fe.useCallback(()=>{let ee=I.current,oe=P.current[D];if(!ee||!oe)return;let ae=ee.getBoundingClientRect(),be=oe.getBoundingClientRect();z({left:be.left-ae.left,top:be.top-ae.top,width:be.width,height:be.height});},[D]);fe.useLayoutEffect(()=>{H(),E||(g(true),requestAnimationFrame(()=>L(true)));},[H,E]),fe.useEffect(()=>{let ee=new ResizeObserver(()=>H());I.current&&ee.observe(I.current);let oe=P.current[D];oe&&ee.observe(oe);let ae=()=>H();return window.addEventListener("resize",ae),()=>{ee.disconnect(),window.removeEventListener("resize",ae);}},[H,D]);let O=(ee,oe)=>{if(!w.length)return ee;let ae=ee;for(let be=0;be<w.length;be++)if(ae=(ae+oe+w.length)%w.length,!w[ae].disabled)return ae;return ee},K=ee=>{S||W(ee),o?.(ee);},N=ee=>{if(!w.length)return;let oe=D;if(ee.key===(p?"ArrowDown":"ArrowRight"))oe=O(D,1);else if(ee.key===(p?"ArrowUp":"ArrowLeft"))oe=O(D,-1);else if(ee.key==="Home")oe=w.findIndex(be=>!be.disabled);else if(ee.key==="End"){let be=[...w].reverse().findIndex(Ne=>!Ne.disabled);oe=be===-1?D:w.length-1-be;}else return;ee.preventDefault();let ae=w[oe]?.value;ae!==void 0&&K(ae),requestAnimationFrame(()=>P.current[oe]?.focus());},U=b.text.primary,G=b.text.secondary,se=b.neutral[500],j=r==="subtle"?b.surface.subtleBg:"transparent",J=r==="subtle"?b.surface.panelBg??b.surface.panelBg:r==="ghost"?b.surface.subtleBg:"transparent",le=b.text.primary,de=r==="subtle"||r==="ghost"||r==="underlined",ge=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Te=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:b.spacing.xs,padding:Pe?b.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?p?b.radius.lg:b.radius.full:b.radius.lg:"none"}),Re=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:E?1:0,visibility:E?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?b.radius.full:b.radius.md:0,background:r==="underlined"?"transparent":J,...p?{top:`${B.top}px`,height:`${B.height}px`,left:b.spacing.xs,right:b.spacing.xs}:{left:`${B.left}px`,width:`${B.width}px`,top:b.spacing.xs,bottom:b.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ie=css(r!=="underlined"?{}:p?{background:"transparent",top:`${B.top}px`,height:`${B.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${B.left}px`,width:`${B.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),we=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${b.spacing.md}`:r==="ghost"&&s!=="vertical"?`${b.spacing.md}`:`${b.spacing.xs} ${b.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?b.radius.full:b.radius.md,minHeight:b.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:M}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:b.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Q=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[M]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),ie=css({marginTop:b.spacing.sm,width:"100%"}),me=fe.useId(),Y=new Map;A.forEach((ee,oe)=>Y.set(ee.value,`${me}-panel-${oe}`));let xe=ee=>`${me}-tab-${ee}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[ge,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Te,T],children:[de&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Re,Ie,k,x]}),w.map((ee,oe)=>{let ae=F===ee.value;return jsx("button",{ref:be=>{P.current[oe]=be;},role:"tab",id:xe(oe),"aria-selected":ae,"aria-controls":Y.get(ee.value),"aria-disabled":ee.disabled||void 0,disabled:ee.disabled,tabIndex:ee.disabled?-1:oe===D?0:-1,className:["plainframe-ui-tab",ee.className||""].join(" ").trim(),onClick:()=>{ee.disabled||K(ee.value);},css:[we,!ee.disabled&&d(),ee.css,ae?ee.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Q,children:ee.node})},String(ee.value??oe))})]}),A.map((ee,oe)=>{if(!(ee.value===F))return null;let be=w.findIndex(ze=>ze.value===ee.value),Ne=be>=0?xe(be):void 0;return jsx("div",{role:"tabpanel",id:Y.get(ee.value),"aria-labelledby":Ne,className:["plainframe-ui-tab-panel",ee.className||""].join(" ").trim(),css:[ie,ee.css],children:ee.node},oe)})]})};var Po=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sn=e=>e==null?[]:Array.isArray(e)?e:[e],Do=(...e)=>css(e.filter(Boolean)),ig=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:k,showCharCount:y,focusRingMode:x="always",resizable:b=false,className:d,wrapperCss:p,inputCss:C,labelCss:M,helperRowCss:R,helperTextCss:w,charCountCss:A,css:$,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:F,name:I,id:P,tabIndex:D,autoComplete:B,readOnly:z,required:E})=>{let g=V(),v=Yo(),L=useId(),H=useMemo(()=>({sm:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.sm,labelFont:g.typography.sizes.xs,helperFont:g.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:g.spacing.md},md:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.md,labelFont:g.typography.sizes.sm,helperFont:g.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:g.spacing.md},lg:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.lg,labelFont:g.typography.sizes.md,helperFont:g.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:g.spacing.md}}),[g]),O=["sm","md","lg"].includes(u)?u:"md",K=H[O],N=g.neutral,U=g.text,G=t!==void 0,[se,j]=useState(n),J=G?t:se,le=useCallback(ae=>{G||j(ae),o?.(ae);},[G,o]),de=useMemo(()=>c?N[200]:s&&m==="outlined"?g.palette.danger?.[50]??g.surface.panelBg:s&&m==="subtle"?g.palette.danger?.[50]??g.surface.subtleBg:m==="outlined"?g.surface.panelBg:m==="subtle"?g.surface.subtleBg:"transparent",[c,s,m,N,g.surface,g.palette.danger]),ge=g.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${ge} solid ${s?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[m,ge,s,g.palette.danger,g.surface.border]),Te=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Po(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),Re=useMemo(()=>Do({fontSize:K.labelFont,fontWeight:500,color:s?g.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...Sn(M)),[K.labelFont,s,c,N,U,g.palette.danger,M]),Ie=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Po(K.paddingY)} 0 ${Po(K.paddingY)} ${Po(K.paddingX)}`,background:de,border:Pe,borderRadius:h?g.radius.full:g.radius.md,minHeight:K.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...Sn(p),...Sn($)],[g,K,de,Pe,ge,h,c,p,$]),we=typeof K.minHeight=="number"?`${K.minHeight}px`:K.minHeight,Q=useMemo(()=>Do({width:"100%",minWidth:0,flex:1,resize:b?"vertical":"none",font:"inherit",fontWeight:500,fontSize:K.fontSize,lineHeight:1.5,color:c?N[500]:s?g.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Po(K.paddingX),overflowY:"auto",minHeight:we,"&::placeholder":{color:s?g.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?g.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${de} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?g.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${we} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...Sn(C)),[b,K,c,s,N,U,g.palette.danger,we,de,f,C]),ie=useMemo(()=>Do({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...Sn(R)),[R]),me=useMemo(()=>Do({fontSize:K.helperFont,color:s?g.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...Sn(w)),[K.helperFont,s,g.palette.danger,U,w]),Y=useMemo(()=>Do({fontSize:K.helperFont,color:k&&J.length>k?g.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...Sn(A)),[K.helperFont,k,J.length,g.palette.danger,U,A]),xe=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=xe.current;if(!ae)return;if(b){let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);return}(()=>{let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);let Z=T?ze*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,Z)}px`;})();},[J,f,T,K.minHeight,b]);let ee=a!=null||y?`${P??L}-help`:void 0,oe=P??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Te,children:[e&&jsx("label",{htmlFor:oe,className:"plainframe-ui-textarea-label",css:Re,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Ie],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&xe.current?.focus(),children:jsx("textarea",{ref:xe,id:oe,className:"plainframe-ui-textarea-input",css:Q,rows:f,value:J,onChange:ae=>{let be=ae.target.value;k&&be.length>k||le(be);},placeholder:r||"",disabled:c,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:F,name:I,tabIndex:D,autoComplete:B,readOnly:z,required:E,"aria-invalid":!!s||void 0,"aria-describedby":ee})}),(a!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:ee,className:"plainframe-ui-textarea-helper-text",css:me,children:a}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",k]})]})]})};var gg=jo,bg={type:"spring",stiffness:920,damping:100},Ql="__toast_root__",hg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Nr=(e,t)=>{for(let n of t){let o=hg(e,n);if(o!=null&&o!=="")return o}},aa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function yg(e){let t=Nr(e,["radius.md","shape.borderRadius","radii.md"]),n=Nr(e,["spacing.lg","space.4","spacing.4"]),o=Nr(e,["spacing.md","space.3","spacing.3"]),r=Nr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:aa(t,16),padX:aa(n,14),padY:aa(o,12),shadow:String(r)}}var xg=yg(gg),Kt=null,Yn=null,ye={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function nc(){typeof document>"u"||(Kt||(Kt=document.getElementById("toast-host"),Kt||(Kt=document.createElement("div"),Kt.id="toast-host",document.body.appendChild(Kt))),Yn||(Yn=Kt[Ql]??null,Yn||(Yn=createRoot(Kt),Kt[Ql]=Yn,Yn.render(jsx(Na,{children:jsx(Fg,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},In=()=>{te.sync(),te.notify();},vg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Hr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||te.timers.has(e.id))return;let o=Date.now(),r=te.remaining.get(e.id),s=r!=null?Math.max(0,r):n;te.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Be.dismiss(e.id),s);te.timers.set(e.id,a);}function Lr(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function Cg(){let e=false;for(;te.displayed.length<ye.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],In();}),Hr(t);}e&&In();}function Rg(){if(te.displayed.length<ye.max)return;let e=te.displayed.filter(o=>!te.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=te.expiry.get(t.id);n!=null&&te.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),te.exiting[t.id]=true,te.displayed=te.displayed.filter(o=>o.id!==t.id),delete te.enterFrom[t.id],te.queue.push(t),In();}var Tg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function wg(e,t){let n=Tg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,k=o.palette;return {bg:T?.[m]??k?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Be=Object.assign((e,t)=>{nc();let n=i=>i!=null&&typeof i[Symbol.iterator]=="function",o=i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function",r;typeof e=="object"&&e!=null&&!fe.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(fe.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??vg(),a=i=>{let l=i.findIndex(h=>h.id===s);if(l===-1)return false;let u=i[l],m={...u,status:r.status??u.status,content:r.content??u.content,title:r.title??u.title,description:r.description??u.description,startIcon:r.startIcon??u.startIcon,endIcon:r.endIcon??u.endIcon,action:r.action??u.action,onClose:r.onClose??u.onClose,duration:r.duration===void 0?u.duration:r.duration,pauseOnHover:r.pauseOnHover??u.pauseOnHover,showDismiss:r.showDismiss??u.showDismiss,render:r.render??u.render,bare:r.bare??u.bare,onClick:r.onClick??u.onClick,width:r.width??u.width};return i[l]=m,Lr(s),te.remaining.delete(s),te.paused.has(s)||Hr(m),In(),true};if(a(te.displayed)||a(te.queue))return s;let c={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?ye.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return te.displayed.length>=ye.max&&Rg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],In();}),In(),Hr(c),s},{success:(e,t={})=>Be(e,{...t,status:"success"}),error:(e,t={})=>Be(e,{...t,status:"error"}),warning:(e,t={})=>Be(e,{...t,status:"warning"}),info:(e,t={})=>Be(e,{...t,status:"info"}),custom:(e,t={})=>Be(e,{...t}),update:(e,t)=>Be({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Be.dismiss(n);return}Lr(e),te.remaining.delete(e),te.paused.delete(e),te.exiting[e]=true;let t=te.displayed.find(n=>n.id===e);te.displayed=te.displayed.filter(n=>n.id!==e),delete te.enterFrom[e],In(),window.setTimeout(()=>t?.onClose?.(),120),Cg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Be.dismiss(t));},pause:e=>{if(te.paused.has(e))return;let t=te.expiry.get(e);t!=null&&te.remaining.set(e,Math.max(0,t-Date.now())),te.paused.add(e),Lr(e);},resume:e=>{if(!te.paused.has(e))return;te.paused.delete(e);let t=te.displayed.find(o=>o.id===e)??te.queue.find(o=>o.id===e),n=te.remaining.get(e);t&&Hr(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Be.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Be.resume(e.id);},promise:(e,t,n={})=>{let o=Be(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Be.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Be.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ye.max=e.max),e.position&&(ye.position=e.position),e.gutter!=null&&(ye.gutter=e.gutter),e.zIndex!=null&&(ye.zIndex=e.zIndex),e.duration!==void 0&&(ye.duration=e.duration),e.showDismiss&&(ye.showDismiss=e.showDismiss),e.styles&&(ye.styles={...ye.styles,...e.styles}),e.renderer!==void 0&&(ye.renderer=e.renderer),e.bareRenderer!==void 0&&(ye.bareRenderer=e.bareRenderer);}});function Eg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ye.showDismiss}function Sg(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var Ig=css({display:"flex",alignItems:"flex-start",gap:10}),ec=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),kg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Ag=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Fg=fe.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=V(),o=ye.position.startsWith("bottom"),r=fe.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=fe.useMemo(()=>({position:"fixed",zIndex:ye.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Sg(ye.position),...ye.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,c)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,u=c>0?ye.gutter:0,m={toast:a,close:Be.dismiss,pause:Be.pause,resume:Be.resume},{bg:h,fg:f,border:T}=wg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:xg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:h,color:f,cursor:a.onClick?"pointer":"default",border:T?`1px solid ${T}`:"1px solid transparent"},y=typeof ye.styles.surface=="function"?ye.styles.surface(a):ye.styles.surface??{},x=Eg(a.showDismiss),b={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(b[d]={opacity:0,pointerEvents:"none"},b[p]={opacity:1,pointerEvents:"auto"}):x==="always"?b[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(b[d]={display:"none"});let C=css({...k,...y,...b}),M=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...ye.styles.close??{}}),R;if(a.bare&&a.render){let w=typeof a.render=="function"?a.render(m):a.render;R=jsx("div",{style:{pointerEvents:"auto"},onClick:A=>a.onClick?.(a.id,A),children:w});}else if(ye.bareRenderer&&ye.renderer){let w=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:A=>a.onClick?.(a.id,A),children:w});}else {let w;ye.renderer?w=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer:a.render&&!a.bare?w=typeof a.render=="function"?a.render(m):a.render:w=jsxs(Fragment,{children:[jsxs("div",{css:Ig,children:[a.startIcon&&jsx("div",{css:ec,children:a.startIcon}),jsx("div",{css:kg,children:a.content}),a.endIcon&&jsx("div",{css:ec,children:a.endIcon})]}),a.action&&jsx("div",{css:Ag,children:a.action})]}),R=jsxs("div",{css:C,onClick:A=>a.onClick?.(a.id,A),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:M,onClick:A=>{A.stopPropagation(),Be.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Mg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Mg=fe.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:c,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:bg});},[l]);let u={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:a!=null?typeof a=="number"?`${a}px`:a:"none",...ye.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),b=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:b}}).then(()=>Be.dismiss(n));},onMouseEnter:c?()=>Be.pause(n):void 0,onMouseLeave:c?()=>Be.resume(n):void 0,children:i})}),tc=false;(function(){tc||(tc=true,nc());})();var eb=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},sc=createContext(null),ac=()=>{let e=useContext(sc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},tb=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),k=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),b=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([k,y,x,b]),C=useId(),M=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(sc.Provider,{value:M,children:e})},nb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=ac(),c=fe.isValidElement(t),i=c&&typeof t.type=="string";if(e&&c&&i){let l=t,u="ref"in l?l.ref:void 0,m=s({...l.props,"aria-describedby":a,ref:eb(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return fe.cloneElement(l,{...m,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},ob=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:c,getFloatingProps:i,placement:l,id:u,autoWidth:m,allowArrow:h,arrowRef:f}=ac(),T=V(),k=l.split("-")[0]||"top",x=k==="bottom"?{opacity:0,y:-8,scale:.98}:k==="top"?{opacity:0,y:8,scale:.98}:k==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},b=x,d=k==="bottom"?"center top":k==="top"?"center bottom":k==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),M=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:b,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:M?.x!=null?`${M.x}px`:void 0,top:M?.y!=null?`${M.y}px`:void 0,[R]:"-3px"}})]})})})};function ib(){let e=V();return jsx(Global,{styles:css`
|
|
20
|
+
`,Lf=fe.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=V(),u=l.surface.subtleBg,m=l.neutral[200],h=ta(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":ta(r,String(r)),height:s==null?"fit-content":ta(s,String(s))}),T=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:u,willChange:"background-position, opacity"}),A=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Nf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Hf} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,A]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var Ar=8,na=20,Xn=4,Xl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:A="horizontal",className:y,...x})=>{let g=V(),d=A==="vertical",p=useRef(null),[C,F]=useState(false),[R,E]=useState(false),[k,$]=useState(false),_=e!==void 0,W=useCallback(Y=>Math.min(r,Math.max(o,Y)),[o,r]),S=useCallback(Y=>W(Math.round((Y-o)/s)*s+o),[o,s,W]),[M,I]=useState(()=>S(t??o)),D=_?S(e):M;useEffect(()=>{_||I(Y=>S(Y));},[o,r,s,_,S]);let P=g.palette.primary[600];g.surface.panelBg;let z=g.neutral[500],w=useMemo(()=>{let Y=r-o||1;return (D-o)/Y*100},[D,o,r]),b=useCallback(Y=>{_||I(Y),n?.(Y);},[_,n]),v=useCallback((Y,xe)=>{let ee=p.current;if(!ee)return D;let oe=ee.getBoundingClientRect(),ae=d?(oe.bottom-xe)/oe.height:(Y-oe.left)/oe.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[D,d,o,r,S]),B=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),b(v(Y.clientX,Y.clientY)),F(true));},[a,b,v]),H=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),F(true));},[a]),O=useCallback(Y=>{!C||a||b(v(Y.clientX,Y.clientY));},[C,a,b,v]),K=useCallback(()=>F(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K);}},[C,O,K]);let N=useCallback(Y=>{if(a)return;let xe=D;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")xe=D+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")xe=D-s;else if(Y.key==="Home")xe=o;else if(Y.key==="End")xe=r;else return;Y.preventDefault(),b(S(xe));},[a,D,s,o,r,b,S]),U=C||R||k,G=(R||C)&&!a,se=`color-mix(in srgb, ${P} 25%, transparent)`,j=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":m?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),J=css({marginBottom:d?0:4,marginRight:d?8:0,color:g.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Ar:"100%",height:d?"100%":Ar,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),de=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Ar:`calc(100% - ${Xn*.5}px)`,height:d?`calc(100% - ${Xn*.5}px)`:Ar,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),ge=css({width:Xn,height:Xn,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-w}% )`:0,bottom:0,width:d?"100%":`${w}%`,height:d?`${w}%`:"100%",backgroundColor:a?z:P,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Te=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:g.text.onColors.primary,width:na,height:na,left:d?"50%":`calc(${w}% - ${na/2}px)`,bottom:d?`${w}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${a?z:P}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),Re=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ie=css({position:"absolute",top:d?`calc(50% - ${Xn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Xn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:g.neutral[800],color:g.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:g.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),we=h,Q=f,ie=T,me=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[j,we],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:J,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[le,Q],onPointerDown:B,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:de,children:Array.from({length:me}).map((Y,xe)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:ge},xe))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":D,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:H,onPointerUp:K,onPointerCancel:K,onMouseEnter:()=>E(true),onMouseLeave:()=>E(false),className:"plainframe-ui-slider-thumb",css:[Te,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Re,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ie,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:D})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Xl.displayName="Slider";var _f=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Kf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Vf=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),jf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Uf=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),qf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),Gf=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),Xf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Yl=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),Yf=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),Jf=fe.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:A}){let y=V(),x=ve(),{MAIN:g,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:F,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:E,UPCOMING_FG:k}=r,$="transparent",_=k,W=E;s==="subtle"?i?($=C,_=F,W=C):c?($=g,_=d,W=g):($=R,_=k,W=R):i?($=C,_=F,W=C):c?($="transparent",_=p,W=g):($="transparent",_=k,W=E);let S=n.label,M=n.icon??jsx("span",{css:Xf,children:typeof S=="number"?S:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Vf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[Gf(o,$,_,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&A(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Yl(!i),children:M}),jsx("span",{className:"plainframe-ui-step-check",css:Yl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Yf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:qf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:jf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Uf(i?1:0,u,h),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),sa=()=>null;sa.displayName="PlainframeUIStep";var Zf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:A,className:y,children:x,...g})=>{let d=V(),p=e==="outlined"?"outlined":"subtle",C=fe.useMemo(()=>{let v=fe.Children.toArray(x).filter(B=>fe.isValidElement(B)&&B.type===sa);return v.length?v.map((B,H)=>({index:H,...B.props})):[{value:1},{value:2},{value:3}]},[x]),F=fe.useCallback((v,B)=>v?d.palette?.[v]??v:B,[d.palette]),R=fe.useMemo(()=>({MAIN:String(F(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(F(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(F(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(F(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(F(m,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[F,i,l,u,m,d.palette.primary,d.neutral,d.text]),E=fe.useMemo(()=>{let v=F(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[F,c,d.palette.primary]),[k,$]=fe.useState(()=>C.some(B=>B?.value===n)?n:C[0]?.value),_=t!==void 0,W=_?t:k,{activeIndex:S,afterLast:M}=fe.useMemo(()=>{let v=C.findIndex(B=>B.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let B=Math.floor(W)-1;if(B>=C.length)return {activeIndex:C.length-1,afterLast:true};if(B>=0)return {activeIndex:B,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=fe.useCallback(v=>{r||(_||$(v),o?.(v));},[r,_,o]),D=fe.useCallback(v=>a||!!C[v]?.complete||(M?true:v<S),[a,C,M,S]),P=fe.useCallback(v=>{if(r)return false;let B=C[v];if(!B||B.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>S)return false}else if(typeof s=="function"&&!s(S,v))return false;return true},[r,C,s,S]),[L,z]=fe.useState(false);fe.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let w=fe.useCallback(v=>{if(!C.length||r)return;let B=S;if(v.key==="ArrowRight")B=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")B=Math.max(0,S-1);else if(v.key==="Home")B=0;else if(v.key==="End")B=C.length-1;else return;v.preventDefault(),P(B)&&I(C[B].value);},[C,r,S,P,I]),b=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[_f(T),A],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:w,css:Kf,children:C.map((v,B)=>jsx(fe.Fragment,{children:jsx(Jf,{i:B,item:v,size:b,tokens:R,variant:p,titlePosition:f,isActive:!M&&B===S,completed:D(B),disabled:r||!!v.disabled,connectorColor:E,showConnector:B<C.length-1,animate:L,separator:h,canGoToIndex:P,setSelected:I})},String(v.value??B)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function eg(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var tg=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:A,activeTabCss:y,activeIndicatorCss:x})=>{let g=V(),d=ve(),p=s==="vertical",C=l||i!=null,F=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:E,contents:k}=fe.useMemo(()=>{let ee=[],oe=[];return fe.Children.forEach(e,ae=>{if(!fe.isValidElement(ae))return;let{type:be,props:Ne}=eg(ae),ze=be===Fr||be?.displayName===Fr.displayName,X=be===Pr||be?.displayName===Pr.displayName;if(ze){let re=Ne;if(re?.value===void 0)return;ee.push({value:re.value,disabled:re.disabled,node:re.children,className:re.className,css:re.css,activeCss:re.activeCss});}else if(X){let re=Ne;if(re?.value===void 0)return;oe.push({value:re.value,node:re.children,className:re.className,css:re.css});}}),{tabs:ee,contents:oe}},[e]),$=fe.useMemo(()=>E.find(ee=>!ee.disabled)?.value,[E]),[_,W]=fe.useState(()=>t!==void 0&&E.some(oe=>oe.value===t&&!oe.disabled)?t:$),S=n!==void 0,M=S?n:_,I=fe.useRef(null),D=fe.useRef([]),P=Math.max(0,E.findIndex(ee=>ee.value===M)),[L,z]=fe.useState({left:0,top:0,width:0,height:0}),[w,b]=fe.useState(false),[v,B]=fe.useState(false),H=fe.useCallback(()=>{let ee=I.current,oe=D.current[P];if(!ee||!oe)return;let ae=ee.getBoundingClientRect(),be=oe.getBoundingClientRect();z({left:be.left-ae.left,top:be.top-ae.top,width:be.width,height:be.height});},[P]);fe.useLayoutEffect(()=>{H(),w||(b(true),requestAnimationFrame(()=>B(true)));},[H,w]),fe.useEffect(()=>{let ee=new ResizeObserver(()=>H());I.current&&ee.observe(I.current);let oe=D.current[P];oe&&ee.observe(oe);let ae=()=>H();return window.addEventListener("resize",ae),()=>{ee.disconnect(),window.removeEventListener("resize",ae);}},[H,P]);let O=(ee,oe)=>{if(!E.length)return ee;let ae=ee;for(let be=0;be<E.length;be++)if(ae=(ae+oe+E.length)%E.length,!E[ae].disabled)return ae;return ee},K=ee=>{S||W(ee),o?.(ee);},N=ee=>{if(!E.length)return;let oe=P;if(ee.key===(p?"ArrowDown":"ArrowRight"))oe=O(P,1);else if(ee.key===(p?"ArrowUp":"ArrowLeft"))oe=O(P,-1);else if(ee.key==="Home")oe=E.findIndex(be=>!be.disabled);else if(ee.key==="End"){let be=[...E].reverse().findIndex(Ne=>!Ne.disabled);oe=be===-1?P:E.length-1-be;}else return;ee.preventDefault();let ae=E[oe]?.value;ae!==void 0&&K(ae),requestAnimationFrame(()=>D.current[oe]?.focus());},U=g.text.primary,G=g.text.secondary,se=g.neutral[500],j=r==="subtle"?g.surface.subtleBg:"transparent",J=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",le=g.text.primary,de=r==="subtle"||r==="ghost"||r==="underlined",ge=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Te=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:Pe?g.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?p?g.radius.lg:g.radius.full:g.radius.lg:"none"}),Re=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:w?1:0,visibility:w?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":J,...p?{top:`${L.top}px`,height:`${L.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${L.left}px`,width:`${L.width}px`,top:g.spacing.xs,bottom:g.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ie=css(r!=="underlined"?{}:p?{background:"transparent",top:`${L.top}px`,height:`${L.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${L.left}px`,width:`${L.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),we=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${g.spacing.md}`:r==="ghost"&&s!=="vertical"?`${g.spacing.md}`:`${g.spacing.xs} ${g.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:F}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:g.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Q=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[F]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),ie=css({marginTop:g.spacing.sm,width:"100%"}),me=fe.useId(),Y=new Map;k.forEach((ee,oe)=>Y.set(ee.value,`${me}-panel-${oe}`));let xe=ee=>`${me}-tab-${ee}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[ge,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Te,T],children:[de&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Re,Ie,A,x]}),E.map((ee,oe)=>{let ae=M===ee.value;return jsx("button",{ref:be=>{D.current[oe]=be;},role:"tab",id:xe(oe),"aria-selected":ae,"aria-controls":Y.get(ee.value),"aria-disabled":ee.disabled||void 0,disabled:ee.disabled,tabIndex:ee.disabled?-1:oe===P?0:-1,className:["plainframe-ui-tab",ee.className||""].join(" ").trim(),onClick:()=>{ee.disabled||K(ee.value);},css:[we,!ee.disabled&&d(),ee.css,ae?ee.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Q,children:ee.node})},String(ee.value??oe))})]}),k.map((ee,oe)=>{if(!(ee.value===M))return null;let be=E.findIndex(ze=>ze.value===ee.value),Ne=be>=0?xe(be):void 0;return jsx("div",{role:"tabpanel",id:Y.get(ee.value),"aria-labelledby":Ne,className:["plainframe-ui-tab-panel",ee.className||""].join(" ").trim(),css:[ie,ee.css],children:ee.node},oe)})]})};var Po=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sn=e=>e==null?[]:Array.isArray(e)?e:[e],Do=(...e)=>css(e.filter(Boolean)),ig=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:A,showCharCount:y,focusRingMode:x="always",resizable:g=false,className:d,wrapperCss:p,inputCss:C,labelCss:F,helperRowCss:R,helperTextCss:E,charCountCss:k,css:$,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:M,name:I,id:D,tabIndex:P,autoComplete:L,readOnly:z,required:w})=>{let b=V(),v=Yo(),B=useId(),H=useMemo(()=>({sm:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.sm,labelFont:b.typography.sizes.xs,helperFont:b.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:b.spacing.md},md:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.md,labelFont:b.typography.sizes.sm,helperFont:b.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:b.spacing.md},lg:{fontSize:b.typography.sizes.sm,minHeight:b.componentHeights.lg,labelFont:b.typography.sizes.md,helperFont:b.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:b.spacing.md}}),[b]),O=["sm","md","lg"].includes(u)?u:"md",K=H[O],N=b.neutral,U=b.text,G=t!==void 0,[se,j]=useState(n),J=G?t:se,le=useCallback(ae=>{G||j(ae),o?.(ae);},[G,o]),de=useMemo(()=>c?N[200]:s&&m==="outlined"?b.palette.danger?.[50]??b.surface.panelBg:s&&m==="subtle"?b.palette.danger?.[50]??b.surface.subtleBg:m==="outlined"?b.surface.panelBg:m==="subtle"?b.surface.subtleBg:"transparent",[c,s,m,N,b.surface,b.palette.danger]),ge=b.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${ge} solid ${s?b.palette.danger?.[300]??b.surface.border:b.surface.border}`:"none",[m,ge,s,b.palette.danger,b.surface.border]),Te=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Po(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),Re=useMemo(()=>Do({fontSize:K.labelFont,fontWeight:500,color:s?b.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...Sn(F)),[K.labelFont,s,c,N,U,b.palette.danger,F]),Ie=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:b.spacing.sm,padding:`${Po(K.paddingY)} 0 ${Po(K.paddingY)} ${Po(K.paddingX)}`,background:de,border:Pe,borderRadius:h?b.radius.full:b.radius.md,minHeight:K.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...Sn(p),...Sn($)],[b,K,de,Pe,ge,h,c,p,$]),we=typeof K.minHeight=="number"?`${K.minHeight}px`:K.minHeight,Q=useMemo(()=>Do({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:K.fontSize,lineHeight:1.5,color:c?N[500]:s?b.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Po(K.paddingX),overflowY:"auto",minHeight:we,"&::placeholder":{color:s?b.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?b.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${de} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?b.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${we} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...Sn(C)),[g,K,c,s,N,U,b.palette.danger,we,de,f,C]),ie=useMemo(()=>Do({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...Sn(R)),[R]),me=useMemo(()=>Do({fontSize:K.helperFont,color:s?b.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...Sn(E)),[K.helperFont,s,b.palette.danger,U,E]),Y=useMemo(()=>Do({fontSize:K.helperFont,color:A&&J.length>A?b.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...Sn(k)),[K.helperFont,A,J.length,b.palette.danger,U,k]),xe=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=xe.current;if(!ae)return;if(g){let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);return}(()=>{let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof K.minHeight=="number"?K.minHeight:parseFloat(String(K.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);let Z=T?ze*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,Z)}px`;})();},[J,f,T,K.minHeight,g]);let ee=a!=null||y?`${D??B}-help`:void 0,oe=D??B;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Te,children:[e&&jsx("label",{htmlFor:oe,className:"plainframe-ui-textarea-label",css:Re,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Ie],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&xe.current?.focus(),children:jsx("textarea",{ref:xe,id:oe,className:"plainframe-ui-textarea-input",css:Q,rows:f,value:J,onChange:ae=>{let be=ae.target.value;A&&be.length>A||le(be);},placeholder:r||"",disabled:c,onBlur:_,onFocus:W,onKeyDown:S,autoFocus:M,name:I,tabIndex:P,autoComplete:L,readOnly:z,required:w,"aria-invalid":!!s||void 0,"aria-describedby":ee})}),(a!=null||y&&A!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:ee,className:"plainframe-ui-textarea-helper-text",css:me,children:a}),y&&A!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",A]})]})]})};var gg=jo,bg={type:"spring",stiffness:920,damping:100},Ql="__toast_root__",hg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Nr=(e,t)=>{for(let n of t){let o=hg(e,n);if(o!=null&&o!=="")return o}},ia=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function yg(e){let t=Nr(e,["radius.md","shape.borderRadius","radii.md"]),n=Nr(e,["spacing.lg","space.4","spacing.4"]),o=Nr(e,["spacing.md","space.3","spacing.3"]),r=Nr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:ia(t,16),padX:ia(n,14),padY:ia(o,12),shadow:String(r)}}var xg=yg(gg),Kt=null,Yn=null,ye={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function nc(){typeof document>"u"||(Kt||(Kt=document.getElementById("toast-host"),Kt||(Kt=document.createElement("div"),Kt.id="toast-host",document.body.appendChild(Kt))),Yn||(Yn=Kt[Ql]??null,Yn||(Yn=createRoot(Kt),Kt[Ql]=Yn,Yn.render(jsx(Ha,{children:jsx(Mg,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},In=()=>{te.sync(),te.notify();},vg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Hr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||te.timers.has(e.id))return;let o=Date.now(),r=te.remaining.get(e.id),s=r!=null?Math.max(0,r):n;te.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Be.dismiss(e.id),s);te.timers.set(e.id,a);}function Lr(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function Cg(){let e=false;for(;te.displayed.length<ye.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],In();}),Hr(t);}e&&In();}function Rg(){if(te.displayed.length<ye.max)return;let e=te.displayed.filter(o=>!te.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=te.expiry.get(t.id);n!=null&&te.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),te.exiting[t.id]=true,te.displayed=te.displayed.filter(o=>o.id!==t.id),delete te.enterFrom[t.id],te.queue.push(t),In();}var Tg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function wg(e,t){let n=Tg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,A=o.palette;return {bg:T?.[m]??A?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Be=Object.assign((e,t)=>{nc();let n=i=>i!=null&&typeof i[Symbol.iterator]=="function",o=i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function",r;typeof e=="object"&&e!=null&&!fe.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(fe.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??vg(),a=i=>{let l=i.findIndex(h=>h.id===s);if(l===-1)return false;let u=i[l],m={...u,status:r.status??u.status,content:r.content??u.content,title:r.title??u.title,description:r.description??u.description,startIcon:r.startIcon??u.startIcon,endIcon:r.endIcon??u.endIcon,action:r.action??u.action,onClose:r.onClose??u.onClose,duration:r.duration===void 0?u.duration:r.duration,pauseOnHover:r.pauseOnHover??u.pauseOnHover,showDismiss:r.showDismiss??u.showDismiss,render:r.render??u.render,bare:r.bare??u.bare,onClick:r.onClick??u.onClick,width:r.width??u.width};return i[l]=m,Lr(s),te.remaining.delete(s),te.paused.has(s)||Hr(m),In(),true};if(a(te.displayed)||a(te.queue))return s;let c={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?ye.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return te.displayed.length>=ye.max&&Rg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],In();}),In(),Hr(c),s},{success:(e,t={})=>Be(e,{...t,status:"success"}),error:(e,t={})=>Be(e,{...t,status:"error"}),warning:(e,t={})=>Be(e,{...t,status:"warning"}),info:(e,t={})=>Be(e,{...t,status:"info"}),custom:(e,t={})=>Be(e,{...t}),update:(e,t)=>Be({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Be.dismiss(n);return}Lr(e),te.remaining.delete(e),te.paused.delete(e),te.exiting[e]=true;let t=te.displayed.find(n=>n.id===e);te.displayed=te.displayed.filter(n=>n.id!==e),delete te.enterFrom[e],In(),window.setTimeout(()=>t?.onClose?.(),120),Cg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Be.dismiss(t));},pause:e=>{if(te.paused.has(e))return;let t=te.expiry.get(e);t!=null&&te.remaining.set(e,Math.max(0,t-Date.now())),te.paused.add(e),Lr(e);},resume:e=>{if(!te.paused.has(e))return;te.paused.delete(e);let t=te.displayed.find(o=>o.id===e)??te.queue.find(o=>o.id===e),n=te.remaining.get(e);t&&Hr(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Be.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Be.resume(e.id);},promise:(e,t,n={})=>{let o=Be(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Be.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Be.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ye.max=e.max),e.position&&(ye.position=e.position),e.gutter!=null&&(ye.gutter=e.gutter),e.zIndex!=null&&(ye.zIndex=e.zIndex),e.duration!==void 0&&(ye.duration=e.duration),e.showDismiss&&(ye.showDismiss=e.showDismiss),e.styles&&(ye.styles={...ye.styles,...e.styles}),e.renderer!==void 0&&(ye.renderer=e.renderer),e.bareRenderer!==void 0&&(ye.bareRenderer=e.bareRenderer);}});function Eg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ye.showDismiss}function Sg(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var Ig=css({display:"flex",alignItems:"flex-start",gap:10}),ec=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),kg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Ag=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Mg=fe.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=V(),o=ye.position.startsWith("bottom"),r=fe.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=fe.useMemo(()=>({position:"fixed",zIndex:ye.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Sg(ye.position),...ye.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,c)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,u=c>0?ye.gutter:0,m={toast:a,close:Be.dismiss,pause:Be.pause,resume:Be.resume},{bg:h,fg:f,border:T}=wg(n,a.status),A={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:xg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:h,color:f,cursor:a.onClick?"pointer":"default",border:T?`1px solid ${T}`:"1px solid transparent"},y=typeof ye.styles.surface=="function"?ye.styles.surface(a):ye.styles.surface??{},x=Eg(a.showDismiss),g={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(g[d]={opacity:0,pointerEvents:"none"},g[p]={opacity:1,pointerEvents:"auto"}):x==="always"?g[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(g[d]={display:"none"});let C=css({...A,...y,...g}),F=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...ye.styles.close??{}}),R;if(a.bare&&a.render){let E=typeof a.render=="function"?a.render(m):a.render;R=jsx("div",{style:{pointerEvents:"auto"},onClick:k=>a.onClick?.(a.id,k),children:E});}else if(ye.bareRenderer&&ye.renderer){let E=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:k=>a.onClick?.(a.id,k),children:E});}else {let E;ye.renderer?E=typeof ye.renderer=="function"?ye.renderer(m):ye.renderer:a.render&&!a.bare?E=typeof a.render=="function"?a.render(m):a.render:E=jsxs(Fragment,{children:[jsxs("div",{css:Ig,children:[a.startIcon&&jsx("div",{css:ec,children:a.startIcon}),jsx("div",{css:kg,children:a.content}),a.endIcon&&jsx("div",{css:ec,children:a.endIcon})]}),a.action&&jsx("div",{css:Ag,children:a.action})]}),R=jsxs("div",{css:C,onClick:k=>a.onClick?.(a.id,k),children:[E,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:F,onClick:k=>{k.stopPropagation(),Be.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Fg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Fg=fe.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:c,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:bg});},[l]);let u={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:a!=null?typeof a=="number"?`${a}px`:a:"none",...ye.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),g=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:g}}).then(()=>Be.dismiss(n));},onMouseEnter:c?()=>Be.pause(n):void 0,onMouseLeave:c?()=>Be.resume(n):void 0,children:i})}),tc=false;(function(){tc||(tc=true,nc());})();var eb=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},sc=createContext(null),ac=()=>{let e=useContext(sc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},tb=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),A=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),g=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([A,y,x,g]),C=useId(),F=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(sc.Provider,{value:F,children:e})},nb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=ac(),c=fe.isValidElement(t),i=c&&typeof t.type=="string";if(e&&c&&i){let l=t,u="ref"in l?l.ref:void 0,m=s({...l.props,"aria-describedby":a,ref:eb(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return fe.cloneElement(l,{...m,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},ob=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:c,getFloatingProps:i,placement:l,id:u,autoWidth:m,allowArrow:h,arrowRef:f}=ac(),T=V(),A=l.split("-")[0]||"top",x=A==="bottom"?{opacity:0,y:-8,scale:.98}:A==="top"?{opacity:0,y:8,scale:.98}:A==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},g=x,d=A==="bottom"?"center top":A==="top"?"center bottom":A==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),F=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[A];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:g,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:F?.x!=null?`${F.x}px`:void 0,top:F?.y!=null?`${F.y}px`:void 0,[R]:"-3px"}})]})})})};function ib(){let e=V();return jsx(Global,{styles:css`
|
|
21
21
|
*,*::before,*::after{box-sizing:border-box}
|
|
22
22
|
|
|
23
23
|
body{
|
|
@@ -45,4 +45,4 @@ ${g}{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{
|
|
48
|
+
`})}export{_a as Accordion,os as AccordionDetails,ja as AccordionGroup,ns as AccordionSummary,qa as ActionBar,ei as Alert,ls as AlertDescription,is as AlertTitle,Hi as Autocomplete,Li as Avatar,Yd as AvatarGroup,Is as Backdrop,op as Badge,hr as BreadCrumbItem,cp as BreadCrumbs,ji as Button,Yi as ButtonGroup,Qi as Card,Mp as CardContent,Np as CardDescription,Pp as CardEnd,nl as CardGroup,Fp as CardStart,Dp as CardTitle,sr as Checkbox,sl as Chip,Xp as CodeField,Wn as Container,Jp as ContextZone,ib as CssBaseline,tm as Divider,xl as Drawer,Ln as DropdownMenu,yn as DropdownMenuContent,ki as DropdownMenuSub,Mi as DropdownMenuSubContent,Ai as DropdownMenuSubTrigger,Bn as DropdownMenuTrigger,Ks as Fade,wl as Flex,Vs as Grow,Il as Image,Om as ImageStack,jm as Kbd,ii as Menu,hs as MenuCheckboxGroup,co as MenuCheckboxItem,Ht as MenuItem,fn as MenuLabel,Ri as MenuRadioGroup,od as MenuRadioItem,rd as MenuSeparator,vi as MenuSwitchItem,er as MenuVariantCtx,tf as Modal,$l as ModalContent,Bl as ModalTrigger,uf as Pagination,Wu as Popover,di as PopoverAnchor,pi as PopoverContent,ui as PopoverTrigger,no as Progress,bf as Quote,Rf as RadioGroup,Tf as RadioItem,kf as Rotate,Vl as Select,qn as SelectItem,Lf as Skeleton,Xs as Slide,Xl as Slider,sa as Step,Zf as Stepper,gs as Switch,Fr as Tab,Pr as TabContent,tg as Tabs,ig as TextArea,Qo as TextField,Ha as ThemeProvider,tb as Tooltip,ob as TooltipContent,nb as TooltipTrigger,Vn as Typography,Sa as defaultDarkTheme,jo as defaultLightTheme,eo as surfaceFromNeutral,Vo as textDark,Ko as textLight,Be as toast,Rc as useColorMode,wd as useDropdownMenuActiveIndex,V as usePlainframeUITheme,Ku as usePopoverContext,Tc as usePrimary,mb as usePrimitives};
|