plainframe-ui 0.1.59 → 0.1.61
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 +10 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import de,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,Children,memo,useSyncExternalStore,useLayoutEffect}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var 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"}},Vr={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"},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"},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,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),Jn=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),yc=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],wa=e=>yc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Vr,palette:{...Ta(ha),primary:ha.mono},surface:Jn("light",Vr),text:{...Ko(Vr),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}},Ea={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Ur,palette:{...Ta(ya),primary:ya.mono},surface:Jn("dark",Ur),text:{..._o(Ur),onColors:{primary:"#FFFFFF",...wa({yellow:"#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 Aa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ct=e=>Aa[e]??e;function tn(e){let t={...e};return Object.entries(Aa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Gr=de.createContext(null),Fa=de.createContext(null),Xr=de.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=de.createContext({setPrimary:e=>{}}),Da=de.createContext(null);function j(){return useTheme()}function Cc(){let e=de.useContext(Gr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=de.useContext(Xr),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Rc(){let e=de.useContext(Fa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=de.useContext(Pa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function cb(e){let t=de.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Cc(),{primary:o}=Rc(),r=de.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ct(o)]??s.palette.primary,u=tn(s.text.onColors)[ct(o)]??Yr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...tn(s.text.onColors),primary:u,[ct(o)]:u,[o]:u}}}},[t,n,o]);return e?e(r):r}function Vo(e,t){if(!t)return e;let n={...e.palette};if(t.palette)for(let o of Object.keys(t.palette)){let r=t.palette[o];r&&(n[o]={...e.palette[o]??{},...r});}return {...e,spacing:{...e.spacing,...t.spacing??{}},radius:{...e.radius,...t.radius??{}},componentHeights:{...e.componentHeights,...t.componentHeights??{}},typography:{fonts:{...e.typography.fonts,...t.typography?.fonts??{}},sizes:{...e.typography.sizes,...t.typography?.sizes??{}}},palette:n,neutral:t.neutral?{...e.neutral,...t.neutral}:e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}}function 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=u=>{let i=u/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(([c,m])=>{o.push(`--pf-palette-${i}-${c}:${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 u=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),c=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(c)+.7152*f(m)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${u};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return 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);}},qo=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");},Na=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",u=de.useContext(Gr),i=de.useContext(Xr),l=!!u,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=de.useMemo(()=>u??Ia(m.current),[u]),f=de.useMemo(()=>Ia(a),[]);de.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),k=useRef(0),y=useRef(r??"__root__");de.useLayoutEffect(()=>{let w=0,b=T.current;for(;b&&b!==document.body;)b.hasAttribute("data-pfui-scope")&&w++,b=b.parentElement;k.current=w;},[r]);let x=useMemo(()=>{let w=Vo(jo,t),b=Vo(w,t?.light),C=t?.light?.primaryKey??a,L=ct(C),H=b.palette.primary??b.palette[L]??b.palette.mono,O=tn({...Ko(b.neutral).onColors,...b.text.onColors}),_=O[L]??Yr(H[600]),N=t?.surface||t?.light?.surface?b.surface:Jn("light",b.neutral),G={...t?.text||t?.light?.text?b.text:Ko(b.neutral),onColors:tn({...O,primary:_,[L]:_})};return {...b,palette:{...b.palette,primary:H},surface:N,text:G}},[t,a]),g=useMemo(()=>{let w=Vo(Ea,t),b=Vo(w,t?.dark),C=t?.dark?.primaryKey??a,L=ct(C),H=b.palette.primary??b.palette[L]??b.palette.mono,O=tn({..._o(b.neutral).onColors,...b.text.onColors}),_=O[L]??Yr(H[600]),N=t?.surface||t?.dark?.surface?b.surface:Jn("dark",b.neutral),G={...t?.text||t?.dark?.text?b.text:_o(b.neutral),onColors:tn({...O,primary:_,[L]:_})};return {...b,palette:{...b.palette,primary:H},surface:N,text:G}},[t,a]),d=useRef(null),p=useRef(null),v=de.useInsertionEffect||de.useLayoutEffect,F=useCallback(()=>{let w=qr(r);ka(p,s?`pfui-guard-${r}`:"pfui-guard-root"),p.current.textContent=`${w} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{p.current.textContent="";});},[r,s]);v(()=>{ka(d,s?`pfui-vars-${r}`:"pfui-vars-root");let w=t?.light?.primaryKey??t?.primaryKey??a,b=t?.dark?.primaryKey??t?.primaryKey??a,C=qr(r),L=Uo(x,ct(w),"light"),H=Uo(g,ct(b),"dark");d.current.textContent=`${C}.pf-light{${L}}
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${b}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F();let H=h.get();if(S(H),A(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,A]),B=l?i:{setMode:I,toggleMode:P},z=jsx(Da.Provider,{value:{light:x,dark:g},children:jsx(Gr.Provider,{value:h,children:jsx(Fa.Provider,{value:f,children:jsx(Xr.Provider,{value:B,children:jsx(Pa.Provider,{value:{setPrimary:D},children:jsx(ThemeProvider,{theme:Tc(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 Tc(e){let t=(l,c)=>Object.fromEntries(Object.keys(l).map(m=>[m,c(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)"},u=t(e.neutral,l=>`var(--pf-neutral-${l})`),i={};return Object.keys(e.palette).forEach(l=>{i[l]={},Object.keys(e.palette[l]).forEach(c=>{i[l][c]=`var(--pf-palette-${l}-${c})`;});}),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:u,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(tn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var wc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=wc(e,t);if(n==="neutral")return {soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"};let o=e?.palette?.[n];return o?{soft:o[300]??"transparent",main:o[600]??o[500]??"currentColor"}:{soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"}};function he(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,a=t?.offset??0,u=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[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e4},css(i)}}function Xo(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,a=t?.offset??0,u=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[u]={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},u)=>{let i=j(),l=i.typography.sizes.sm,c=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}),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:u,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:c,height:c}})}),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:c,height:c}})})]})});ns.__PFUI_SLOT="AccordionSummary";ns.displayName="AccordionSummary";var os=({children:e,className:t,css:n})=>{let o=j(),r=o.typography.sizes.sm,s=o.spacing.lg,a="0.15rem",u=o.spacing.md,i=css({padding:`${a} ${s} ${u} ${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:u=false,css:i,children:l})=>{let c=j(),m=useId(),h=useId(),f=c.radius?.md,T=c.text,k=c.componentHeights?.border??1,y=za(k)??"1px",x=e!==void 0,[g,d]=useState(!!t),p=x?!!e:g,v=he(),[F,R]=useState(0),[E,M]=useState(false),$=useRef(null),K=useRef(null),W=useRef(null),S=()=>{if(!p)return;let N=document.activeElement;K.current?.contains(N)&&W.current?.focus();},A=()=>{s||(S(),x?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},I=de.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,w=r==="subtle"?c.surface.subtleBg:r==="outlined"?c.surface.panelBg:"transparent",b=css({backgroundColor:w,color:T.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${c.surface.border}`:"none",outline:"none",marginBottom:c.spacing.sm,maxWidth:a!=null?za(a):void 0,width:u?"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&&M(true);},[F,E]),useLayoutEffect(()=>{if(!p&&K.current){let N=document.activeElement;K.current.contains(N)&&W.current?.focus();}},[p]),useLayoutEffect(()=>{let N=K.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 C=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}),L=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=B&&cloneElement(B,{...typeof B.props=="object"&&B.props?B.props:{},className:[B.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=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:[v(),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||A();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),A());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),H],children:O}),jsx("div",{id:m,"aria-hidden":!p,className:"plainframe-ui-accordion-details-clip",css:C,tabIndex:-1,ref:K,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:L,children:_})})]})};Wa.displayName="Accordion";var Hc=e=>isValidElement(e),Lc=e=>Hc(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Lc(e)==="Accordion",Bc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,$c=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,ja=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:a,disabled:u=false,width:i,fullWidth:l=false,className:c,role:m="group",css:h})=>{let f=j(),T=useRef(null),k=Children.toArray(e),y=k.filter(_a),x=y.length,g=o&&r!==void 0,[d,p]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let A=0;A<y.length;A++){let I=y[A].props;if(I.open||I.defaultOpen)return A}return null}),v=o?g?r??null:d:null,F=$c(f.componentHeights?.border,1),R=f.surface.border,E=f.radius.md,M=n,$=M==="outlined";useEffect(()=>{let A=T.current;if(!A)return;let I=P=>{if(P.key!=="ArrowDown"&&P.key!=="ArrowUp"&&P.key!=="Home"&&P.key!=="End")return;let B=Array.from(A.querySelectorAll(".plainframe-ui-accordion")).filter(C=>C.getAttribute("data-disabled")!=="true");if(B.length===0)return;let z=document.activeElement,w=B.findIndex(C=>C.contains(z));if(w===-1)return;P.preventDefault();let b=w;P.key==="ArrowDown"?b=(w+1)%B.length:P.key==="ArrowUp"?b=(w-1+B.length)%B.length:P.key==="Home"?b=0:P.key==="End"&&(b=B.length-1),B[b]?.focus();};return A.addEventListener("keydown",I),()=>A.removeEventListener("keydown",I)},[x]);let K=css({display:"flex",flexDirection:"column",maxWidth:i!=null?Bc(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 k.forEach((A,I)=>{if(!_a(A)){S.push(A);return}let P=A.props,D=W++,B=D===0,z=D===x-1,w=u||!!P.disabled,b=M??P.variant,C=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:B?E:0,borderTopRightRadius:B?E:0,borderBottomLeftRadius:z?E:0,borderBottomRightRadius:z?E:0}):css({width:"100%",marginBottom:0}),L=!B&&x>1&&t?css({borderTop:`${F} solid ${R}`}):null,H=$?css({border:"1px solid transparent"}):null,O={variant:b,disabled:w,width:"100%",css:[P.css,C,H,L],className:[P.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=P.onChange,N=v===D;O.open=N,O.defaultOpen=void 0,O.onChange=U=>{let G=U?D:null;g||p(G),a?.(G),_?.(U);};}S.push(cloneElement(A,{...P,...O,key:A?.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",c||""].join(" ").trim(),css:[K,h],children:S})};ja.displayName="AccordionGroup";var Ot=e=>typeof e=="number"?`${e}px`:e,Ua=({children:e,open:t=true,anchorOrigin:n={horizontal:"center",vertical:"bottom"},direction:o="horizontal",padding:r="sm",gap:s="xs",radius:a="lg",offset:u=0,offsetX:i=0,offsetY:l=0,elevated:c=true,unstyled:m=false,fullWidth:h=false,width:f,height:T,role:k="toolbar","aria-label":y,onClose:x})=>{let g=j(),d=useRef(null),p=useRef(null),v=useRef(false),F=useRef(t),R=n.horizontal??"center",E=n.vertical??"bottom",M=b=>typeof b=="string"?g.spacing[b]??b:b,$=b=>typeof b=="string"?g.radius[b]??b:b,K=Ot(M(u)),W=Ot(M(i)),S=Ot(M(l)),A={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"}`,P=()=>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)",D=()=>E==="center"&&R==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",B=24,z={margin:B,marginTop:E==="top"?`calc(${B}px + ${K} + ${S})`:B,marginBottom:E==="bottom"?`calc(${B}px + ${K} + ${S})`:B,marginLeft:R==="left"?`calc(${B}px + ${K} + ${W})`:B,marginRight:R==="right"?`calc(${B}px + ${K} + ${W})`:B,padding:m?0:Ot(M(r)),background:m?"transparent":g.surface.panelBg,border:m?"none":`1px solid ${g.surface.border}`,borderRadius:m?0:Ot($(a)),boxShadow:m||!c?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Ot(M(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Ot(f):"auto",height:T?Ot(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 C=P(),L=D();if(!v.current){v.current=true,F.current=t,b.style.opacity=t?"1":"0",b.style.transform=t?L:C;return}if(F.current===t){b.style.opacity=t?"1":"0",b.style.transform=t?L:C;return}F.current=t,p.current&&p.current.cancel();let H=t?[{opacity:0,transform:C},{opacity:1,transform:L}]:[{opacity:1,transform:L},{opacity:0,transform:C}];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=C=>{C.key==="Escape"&&x();};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,x]),jsx("div",{css:A,children:jsx("div",{ref:d,css:w,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); }`,Vc=keyframes`
|
|
1
|
+
import fe,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,Children,memo,useSyncExternalStore,useLayoutEffect}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var 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"},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"},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,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}),Qn=(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]},_o=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","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],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:Qn("light",jr),text:{..._o(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:Qn("dark",Ur),text:{...Vo(Ur),onColors:{primary:"#FFFFFF",...Ea({yellow:"#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"},bt=e=>Fa[e]??e;function un(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 ub(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[bt(o)]??s.palette.primary,c=un(s.text.onColors)[bt(o)]??Yr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...un(s.text.onColors),primary:c,[bt(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 Ma(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=M=>{let x=M/255;return x<=.03928?x/12.92:Math.pow((x+.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");},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 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??ka(m.current),[c]),f=fe.useMemo(()=>ka(a),[]);fe.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),M=useRef(0),x=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;M.current=E;},[r]);let y=useMemo(()=>{let E=Uo(jo,t),g=Uo(E,t?.light),v=t?.light?.primaryKey??a,B=bt(v),L=g.palette.primary??g.palette[B]??g.palette.mono,O=un({..._o(g.neutral).onColors,...g.text.onColors}),_=O[B]??Yr(L[600]),N=t?.surface||t?.light?.surface?g.surface:Qn("light",g.neutral),G={...t?.text||t?.light?.text?g.text:_o(g.neutral),onColors:un({...O,primary:_,[B]:_})};return {...g,palette:{...g.palette,primary:L},surface:N,text:G}},[t,a]),b=useMemo(()=>{let E=Uo(Sa,t),g=Uo(E,t?.dark),v=t?.dark?.primaryKey??a,B=bt(v),L=g.palette.primary??g.palette[B]??g.palette.mono,O=un({...Vo(g.neutral).onColors,...g.text.onColors}),_=O[B]??Yr(L[600]),N=t?.surface||t?.dark?.surface?g.surface:Qn("dark",g.neutral),G={...t?.text||t?.dark?.text?g.text:Vo(g.neutral),onColors:un({...O,primary:_,[B]:_})};return {...g,palette:{...g.palette,primary:L},surface:N,text:G}},[t,a]),p=useRef(null),d=useRef(null),C=fe.useInsertionEffect||fe.useLayoutEffect,P=useCallback(()=>{let E=qr(r);Ma(d,s?`pfui-guard-${r}`:"pfui-guard-root"),d.current.textContent=`${E} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{d.current.textContent="";});},[r,s]);C(()=>{Ma(p,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),B=qo(y,bt(E),"light"),L=qo(b,bt(g),"dark");p.current.textContent=`${v}.pf-light{${B}}
|
|
2
|
+
${v}.pf-dark{${L}}`+(s?`
|
|
3
|
+
${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[y,b,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 E=s?T.current:document.documentElement;if(!E)return;let g=h.get();Zr(E),Go(E,g),E.setAttribute("data-pfui-mode",g),E.setAttribute("data-pfui-primary",f.get()),l||h.set(g);},[s,h,f,l]);let w=useCallback(()=>{window.__pfuiActiveScope={id:x.current,depth:M.current,ts:Date.now()};},[]),I=useCallback(()=>{let E=s?T.current:document.documentElement,g={capture:true},v=()=>w();return E?.addEventListener("pointerdown",v,g),E?.addEventListener("mouseenter",v,g),E?.addEventListener("focusin",v,g),E?.addEventListener("keydown",v,g),()=>{E?.removeEventListener("pointerdown",v,g),E?.removeEventListener("mouseenter",v,g),E?.removeEventListener("focusin",v,g),E?.removeEventListener("keydown",v,g);}},[s,w]),$=useCallback(E=>{let g=window.__pfuiActiveScope,v=g&&Date.now()-g.ts<1500;if(!g||!v||g.id!==x.current)return;let B=h.get(),L=f.get(),_=Jr(B==="light"?y:b,bt(L),B);Aa(E,_),Go(E,B),E.setAttribute("data-pfui-portal-owner",x.current),E.setAttribute("data-pfui-mode",B),E.setAttribute("data-pfui-primary",L);},[h,f,y,b]),K=E=>{if(E.getAttribute("data-floating-ui-portal")==="true"||E.getAttribute("data-radix-portal")==="true"||E.getAttribute("data-portal")==="true")return true;let g=E.getAttribute("role");if(g==="tooltip"||g==="dialog")return true;let v=window.getComputedStyle(E);return v.position==="fixed"||v.position==="absolute"},W=useCallback(()=>{let E=new MutationObserver(g=>{for(let v of g)v.addedNodes.forEach(B=>{B instanceof HTMLElement&&(K(B)&&$(B),B.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(L=>$(L)));});});return E.observe(document.body,{childList:true,subtree:true}),()=>E.disconnect()},[$]);fe.useEffect(()=>{let E=I(),g=W();return ()=>{E(),g();}},[I,W]);let k=useCallback(E=>{let g=s?T.current:document.documentElement;g&&(Zr(g),Go(g,E),g.setAttribute("data-pfui-mode",E),g.setAttribute("data-pfui-primary",f.get()));},[s,f]),D=useCallback(E=>{let g=bt(f.get()),B=Jr(E==="light"?y:b,g,E);document.querySelectorAll(`[data-pfui-portal-owner="${x.current}"]`).forEach(L=>{Aa(L,B),Go(L,E),L.setAttribute("data-pfui-mode",E),L.setAttribute("data-pfui-primary",g);});},[y,b,f]);fe.useLayoutEffect(()=>{D(h.get());},[D,y,b,a,h]),fe.useLayoutEffect(()=>{if(!l)return;let E=()=>{let v=h.get();P(),k(v),D(v);};E();let g=h.subscribe(E);return ()=>g()},[l,h,P,k,D]);let S=useCallback(E=>{if(h.get()!==E&&(P(),h.set(E),k(E),D(E),!s))try{let g=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...g,mode:E}));}catch{}},[h,s,o,P,k,D]),A=useCallback(()=>S(h.get()==="light"?"dark":"light"),[S,h]),F=useCallback(E=>{f.set(E);let g=qr(r),v=qo(y,bt(E),"light"),B=qo(b,bt(E),"dark");p.current&&(p.current.textContent=`${g}.pf-light{${v}}
|
|
4
|
+
${g}.pf-dark{${B}}`+(s?`
|
|
5
|
+
${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),P();let L=h.get();if(k(L),D(L),!s)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:E}));}catch{}},[y,b,r,s,h,f,P,k,D]),H=l?i:{setMode:S,toggleMode:A},z=jsx(Na.Provider,{value:{light:y,dark:b},children:jsx(Gr.Provider,{value:h,children:jsx(Pa.Provider,{value:f,children:jsx(Xr.Provider,{value:H,children:jsx(Da.Provider,{value:{setPrimary:F},children:jsx(ThemeProvider,{theme:wc(y),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(un(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 ye(){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),M=i.text,x=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:T,padding:`${f} ${h}`,gap:m,fontSize:l,color:M.primary}),y=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}),p=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:[x,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:y,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[p,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 Ka=({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,M=u.componentHeights?.border??1,x=Oa(M)??"1px",y=e!==void 0,[b,p]=useState(!!t),d=y?!!e:b,C=ye(),[P,R]=useState(0),[w,I]=useState(false),$=useRef(null),K=useRef(null),W=useRef(null),k=()=>{if(!d)return;let N=document.activeElement;K.current?.contains(N)&&W.current?.focus();},D=()=>{s||(k(),y?n?.(!e):p(N=>{let U=!N;return n?.(U),U}));},S=fe.Children.toArray(l).filter(N=>isValidElement(N)),A=S.findIndex(N=>Wa(N)==="AccordionSummary"),F=S.findIndex(N=>Wa(N)==="AccordionDetails");A===-1&&S.length&&(A=0),F===-1&&(F=S.findIndex((N,U)=>U!==A),F===-1&&S.length>=2&&(F=1));let H=S[A]??null,z=S[F]??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"?`${x} 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);},[d,l]),useEffect(()=>{let N=$.current;if(!N)return;let U=new ResizeObserver(()=>R(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{P>0&&!w&&I(true);},[P,w]),useLayoutEffect(()=>{if(!d&&K.current){let N=document.activeElement;K.current.contains(N)&&W.current?.focus();}},[d]),useLayoutEffect(()=>{let N=K.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]"));d?(U.forEach(G=>{let oe=G.dataset.accordionTabindex;oe!=null&&(oe===""?G.removeAttribute("tabindex"):G.tabIndex=Number(oe),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",""));},[d]);let v=css({maxHeight:d?P||"none":0,overflow:d&&!w?"visible":"hidden",transition:w?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:w?"max-height":void 0}),B=css({opacity:d?1:0,transform:d?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),L=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:d?"rotate(180deg)":"rotate(0deg)"}}),O=H&&cloneElement(H,{...typeof H.props=="object"&&H.props?H.props:{},className:[H.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=z;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":d?"true":"false","data-disabled":s?"true":"false",css:[C(),g,i],tabIndex:s?-1:0,ref:W,role:"button","aria-expanded":d,"aria-controls":m,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==W.current||D();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),D());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),L],children:O}),jsx("div",{id:m,"aria-hidden":!d,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:K,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:B,children:_})})]})};Ka.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),M=Children.toArray(e),x=M.filter(Va),y=x.length,b=o&&r!==void 0,[p,d]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let D=0;D<x.length;D++){let S=x[D].props;if(S.open||S.defaultOpen)return D}return null}),C=o?b?r??null:p:null,P=zc(f.componentHeights?.border,1),R=f.surface.border,w=f.radius.md,I=n,$=I==="outlined";useEffect(()=>{let D=T.current;if(!D)return;let S=A=>{if(A.key!=="ArrowDown"&&A.key!=="ArrowUp"&&A.key!=="Home"&&A.key!=="End")return;let H=Array.from(D.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(H.length===0)return;let z=document.activeElement,E=H.findIndex(v=>v.contains(z));if(E===-1)return;A.preventDefault();let g=E;A.key==="ArrowDown"?g=(E+1)%H.length:A.key==="ArrowUp"?g=(E-1+H.length)%H.length:A.key==="Home"?g=0:A.key==="End"&&(g=H.length-1),H[g]?.focus();};return D.addEventListener("keydown",S),()=>D.removeEventListener("keydown",S)},[y]);let K=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&&$?`${P} solid ${R}`:"none",borderRadius:t&&$?w:void 0,background:t&&$?f.surface.panelBg:"transparent"}),W=0,k=[];return M.forEach((D,S)=>{if(!Va(D)){k.push(D);return}let A=D.props,F=W++,H=F===0,z=F===y-1,E=c||!!A.disabled,g=I??A.variant,v=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:H?w:0,borderTopRightRadius:H?w:0,borderBottomLeftRadius:z?w:0,borderBottomRightRadius:z?w:0}):css({width:"100%",marginBottom:0}),B=!H&&y>1&&t?css({borderTop:`${P} solid ${R}`}):null,L=$?css({border:"1px solid transparent"}):null,O={variant:g,disabled:E,width:"100%",css:[A.css,v,L,B],className:[A.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=A.onChange,N=C===F;O.open=N,O.defaultOpen=void 0,O.onChange=U=>{let G=U?F:null;b||d(G),a?.(G),_?.(U);};}k.push(cloneElement(D,{...A,...O,key:D?.key??S}));}),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:[K,h],children:k})};ja.displayName="AccordionGroup";var Gt=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:M="toolbar","aria-label":x,onClose:y})=>{let b=V(),p=useRef(null),d=useRef(null),C=useRef(false),P=useRef(t),R=n.horizontal??"center",w=n.vertical??"bottom",I=g=>typeof g=="string"?b.spacing[g]??g:g,$=g=>typeof g=="string"?b.radius[g]??g:g,K=Gt(I(c)),W=Gt(I(i)),k=Gt(I(l)),D={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"},S=()=>`${R==="left"?"left":R==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,A=()=>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)",F=()=>w==="center"&&R==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",H=24,z={margin:H,marginTop:w==="top"?`calc(${H}px + ${K} + ${k})`:H,marginBottom:w==="bottom"?`calc(${H}px + ${K} + ${k})`:H,marginLeft:R==="left"?`calc(${H}px + ${K} + ${W})`:H,marginRight:R==="right"?`calc(${H}px + ${K} + ${W})`:H,padding:m?0:Gt(I(r)),background:m?"transparent":b.surface.panelBg,border:m?"none":`1px solid ${b.surface.border}`,borderRadius:m?0:Gt($(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Gt(I(s)),transformOrigin:S(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Gt(f):"auto",height:T?Gt(T):"auto",maxWidth:h?"100%":"none"},E=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let g=p.current;if(!g)return;let v=A(),B=F();if(!C.current){C.current=true,P.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?B:v;return}if(P.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?B:v;return}P.current=t,d.current&&d.current.cancel();let L=t?[{opacity:0,transform:v},{opacity:1,transform:B}]:[{opacity:1,transform:B},{opacity:0,transform:v}];return d.current=g.animate(L,{duration:250,easing:"ease",fill:"forwards"}),()=>{d.current&&d.current.cancel();}},[t,R,w]),useEffect(()=>{if(!t||!y)return;let g=v=>{v.key==="Escape"&&y();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t,y]),jsx("div",{css:D,children:jsx("div",{ref:p,css:E,style:z,role:M,"aria-label":x,"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%; }
|
|
9
|
-
`,
|
|
9
|
+
`,qc=keyframes`
|
|
10
10
|
0% { left: -200%; right: 100%; }
|
|
11
11
|
60% { left: 107%; right: -8%; }
|
|
12
12
|
100% { left: 107%; right: -8%; }
|
|
13
|
-
`,qc=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),Gc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Xc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(qc(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&Gc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let 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 Qn=de.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:u=.75,wrapperCss:i,trackCss:l,barCss:c,circleCss:m,"aria-label":h})=>{let f=j(),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,g=Xc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Jc,{size:s,active:g,isDeterminate:T,percent:x,spinDuration:u,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Yc,{thickness:a,active:g,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:c,ariaLabel:h,min:n,max:o,value:y})}),Yc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:u,barCss:i,ariaLabel:l,min:c,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(u)?u:u?[u]:[]]),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]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...g,left:"-35%",right:"100%",animation:`${Vc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...g,left:"-200%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),v=r?{role:"progressbar","aria-valuemin":c,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(v["aria-label"]=l),jsx("span",{css:T,...v,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})]})})})},Jc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:u,circleCss:i,ariaLabel:l})=>{let c=j(),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,`${c.componentHeights.md}`),height:rs(e,`${c.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(u)?u:u?[u]:[]]),g=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:g})})})};var Ja=createContext(null),Za=()=>{let e=useContext(Ja);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},iu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),lu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),cu=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),Qa=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:u="md",loading:i=false,css:l,children:c,...m},h){let f=j(),T=useId(),k=useId(),y=useMemo(()=>{let A={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(u)?A[u]:A.md},[u,f.typography,f.radius,f.spacing]),x=f.palette??{},g=f.neutral??{},d=useMemo(()=>{let I=(C=>C==="danger"?x.danger??x.error??g:C==="warning"?x.warning??g:C==="success"?x.success??g:C==="info"?x.info??x.primary??g:g)(t),P=I?.[50]??g[50],D=I?.[300]??g[300],B=I?.[600]??I?.[500]??g[600],z=I?.[700]??B,w=I?.[800]??f.text?.primary??"#000",b=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:B,fg:b,border:void 0,iconColor:b}:n==="outlined"?{bg:P,fg:w,border:`1px solid ${D}`,iconColor:w}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:P,fg:w,border:void 0,iconColor:z}},[t,n,g,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",v=useMemo(()=>i?jsx(Qn,{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(()=>[lu,{color:d.iconColor}],[d.iconColor]),M=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[cu,{color:d.fg}],[d.fg]),K=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:k}),[d.fg,d.iconColor,y,T,k]),W=de.Children.toArray(c).some(A=>de.isValidElement(A)&&A.type===is),S=de.Children.toArray(c).some(A=>de.isValidElement(A)&&A.type===ls);return jsx(Ja.Provider,{value:K,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:[F,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[v&&jsx("span",{className:"plainframe-ui-alert-icon",css:E,children:v}),jsx("div",{className:"plainframe-ui-alert-content",css:iu,children:c})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:M,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:u}=Za(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:u,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(),u=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:[u,n],...o,children:t})});ls.displayName="AlertDescription";var cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,jt=e=>e==null?[]:Array.isArray(e)?e:[e],Vt=(...e)=>css(e.filter(Boolean));function ti(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var Zo=de.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:u,disabled:i=false,fullWidth:l=false,width:c=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:k,togglePasswordVisible:y=false,showClear:x,type:g="text",step:d,focusRingMode:p="always",className:v,wrapperCss:F,inputCss:R,labelCss:E,helperRowCss:M,helperTextCss:$,startIconCss:K,endIconCss:W,css:S,onBlur:A,onFocus:I,onKeyDown:P,autoFocus:D,name:B,id:z,tabIndex:w,autoComplete:b,readOnly:C,required:L,maxLength:H,onSurfaceClick:O},_){let N=j(),U=Xo(),G=useId(),se=useMemo(()=>{let ce={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Te=["sm","md","lg"].includes(m)?m:"md";return ce[Te]},[m,N]),V=N.neutral,Y=N.text,le=g==="number",ue=g==="password",pe=n!==void 0,[Me,Ce]=useState(o),ve=pe?n:Me,Ee=useCallback(ce=>{pe||Ce(ce),r?.(ce);},[pe,r]),Re=/^-?\d*(?:[.,]\d*)?$/,Z=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(ve??"")),ie=le?Z?"decimal":"numeric":void 0,be=le?Z?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,X$1=useCallback(ce=>{(ce===""||Re.test(ce))&&Ee(ce);},[Ee]),ye=i?V[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",Q=N.componentHeights.border,ne=h==="outlined"?`${Q} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Vt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":c!=null?cs(c):void 0,flex:"0 0 auto",fontWeight:500}),me=useMemo(()=>Vt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??Y.primary:i?V[500]:Y.primary,marginBottom:4,display:"inline-block"},...jt(E)),[se.labelFont,a,i,V,Y,N.palette.danger,E]),Fe=useMemo(()=>Vt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(se.paddingY)} ${cs(se.paddingX)}`,background:ye,border:ne,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"},...jt(F),...jt(S)),[N,se.minHeight,se.paddingX,se.paddingY,ye,ne,f,i,F,S]),He=useMemo(()=>Vt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?V[500]:a?N.palette.danger?.[800]??Y.primary:Y.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]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${ye} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...jt(R)),[se.fontSize,i,V,Y,a,N.palette.danger,le,ye,R]),J=useMemo(()=>Vt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},...jt(K)),[a,N.palette.danger,Y.secondary,K]),oe=useMemo(()=>Vt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...jt(W)),[a,N.palette.danger,Y.secondary,i,W]),re=useMemo(()=>Vt({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...jt(M)),[se.helperFont,a,N.palette.danger,Y.secondary,M]),Ve=useMemo(()=>Vt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...jt($)),[$]),Le=useRef(null),Et=useCallback(ce=>{Le.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),qn=useCallback(ce=>{let Te=ce.target.value;if(le){X$1(Te);return}H&&Te.length>H||Ee(Te);},[le,H,Ee,X$1]),[Ke,Cn]=useState(false),it=useCallback(()=>{i||Cn(ce=>!ce);},[i]),Rn=useCallback(()=>{i||(Ee(""),Le.current?.focus());},[i,Ee]),St=useMemo(()=>{let ce=se.fontSize;if(typeof ce=="number")return ce;let Te=parseFloat(String(ce));return Number.isFinite(Te)?Te:16},[se.fontSize]),Tn=useMemo(()=>T?jsx("span",{css:J,children:ti(T,St)}):null,[T,J,St]),Gn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),Po=useMemo(()=>{let ce=[];if(ue&&y){let lt=Ke?jsx(Eye,{strokeWidth:2.5,size:St}):jsx(EyeOff,{strokeWidth:2.5,size:St});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Yn=>Yn.preventDefault(),onClick:Yn=>{Yn.stopPropagation(),it();},tabIndex:-1,"aria-label":Ke?"Hide password":"Show password",disabled:i,children:lt},"pw-toggle"));}x&&ve&&ve.length>0&&!i&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:lt=>lt.preventDefault(),onClick:lt=>{lt.stopPropagation(),Rn();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:St})},"clear"));let Te=k?jsx("span",{css:oe,children:ti(k,St)},"user-end"):null,et=ce.length>0,Ae=!!Te;return !et&&!Ae?null:!et&&Ae?Te:et&&!Ae?ce.length===1?ce[0]:jsx("span",{css:Gn,children:ce}):jsxs("span",{css:Gn,children:[ce,Te]})},[ue,y,Ke,St,oe,Gn,i,x,ve,k,it,Rn]),Do=u!=null?`${z??G}-help`:void 0,Xn=z??G,Ue=useCallback(ce=>{if(i)return;ce.stopPropagation();let Te=Le.current;if(!Te)return;let et=ce.target;if(!(Te.contains(et)||et.closest("button,[role='button']"))){if(document.activeElement===Te){ce.preventDefault();return}ce.preventDefault();}},[i]),dt=useCallback(ce=>{if(i)return;let Te=Le.current;if(Te&&(O?.(ce),document.activeElement!==Te)){Te.focus({preventScroll:true});try{let et=Te.value?.length??0;Te.setSelectionRange?.(et,et);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",v||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Xn,className:"plainframe-ui-textfield-label",css:me,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Fe],onPointerDownCapture:Ue,onClick:dt,"aria-invalid":!!a||void 0,children:[Tn,jsx("input",{ref:Et,id:Xn,className:"plainframe-ui-textfield-input",css:He,type:ue?Ke?"text":"password":g==="number"?"text":g,inputMode:ie,pattern:be,value:ve,maxLength:le?void 0:H,onChange:le?ce=>X$1(ce.target.value):qn,placeholder:s||"",disabled:i,onBlur:A,onFocus:I,onKeyDown:P,autoFocus:D,name:B,tabIndex:w,autoComplete:b,readOnly:C,required:L,"aria-invalid":!!a||void 0,"aria-describedby":Do}),Po]}),u!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Do,className:"plainframe-ui-textfield-helper-text",css:Ve,children:u})})]})}));Zo.displayName="TextField";var Qo=de.createContext("ghost"),gt=de.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:u,children:i,label:l,allItemsTabbable:c=false,...m},h){let f=j(),[T,k]=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",v=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:k}),[T]),F=useMemo(()=>({allItemsTabbable:c}),[c]),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"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),k(false);},[]),M=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(M.current){M.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]),K=useCallback(I=>{let P=I.currentTarget,D=R(P);if(D.length===0)return;if(I.key==="Tab"){M.current=true,P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(C=>C.removeAttribute("data-highlighted")),k(false),P.tabIndex=-1,requestAnimationFrame(()=>{P.tabIndex=0,M.current=false;});return}let B=P.querySelector("[data-highlighted]"),z=P.querySelector("[data-hovered]"),w=B||z,b=w?D.indexOf(w):-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")),b===-1&&(b=I.key==="ArrowDown"?-1:D.length);let C=I.key==="ArrowDown"?1:-1,L=(b+C+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(C=>C.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(C=>C.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(C=>C.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(C=>C.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(C=>C.removeAttribute("data-highlighted")),k(false),P.blur();return}},[R]),W=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&E(P);},[E]),S=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&E(P);},[E]),A=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(eo.Provider,{value:v,children:jsx(to.Provider,{value:F,children:jsx(gt.Provider,{value:p,children:jsx(Qo.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:A,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,u],onFocus:$,onKeyDown:K,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ai.displayName="Menu";var li=createContext(null),nr=()=>{let e=useContext(li);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function $u(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ro=(...e)=>t=>{for(let n of e)$u(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zu=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},er=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Ou=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[u,i]=useState(!!t),l=e??u,c=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(()=>c(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};zu(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],v=d[d.length-1],F=document.activeElement;x.shiftKey&&F===p?(x.preventDefault(),v.focus()):!x.shiftKey&&F===v&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let k=useMemo(()=>({open:l,setOpen:c,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:u,scheduleClose:i,cancelClose:l}=nr(),c=de.Children.only(t),m=c.props||{},h=ro(u,o,c.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=c.props?.css;return de.cloneElement(c,{...f,...T,ref:h,css:[k,n].filter(Boolean)})}return de.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:c})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=nr(),a=de.Children.only(o),u=ro(s,r,a.ref);if(e){let l=a.props?.css;return de.cloneElement(a,{ref:u,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:ds(t),verticalAlign:"middle",...n});return jsx("span",{ref:u,css:i,children:a})});ui.displayName="PopoverAnchor";function Wu(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:u,padding:i,paddingX:l,paddingY:c,radius:m="lg",css:h,...f},T)=>{let{open:k,setOpen:y,triggerOn:x,referenceRef:g,scheduleClose:d,cancelClose:p}=nr(),v=j(),F=Wu(e),{refs:R,x:E,y:M,strategy:$,context:K}=useFloating({open:k,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(K,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(K,{role:"dialog"}),{getFloatingProps:A}=useInteractions([W,S]),[I]=K.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},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=v.surface.panelBg,C=v.text.primary,L=`${v.componentHeights.border} solid ${v.surface.border}`,H=er(i,v.spacing),O=er(l,v.spacing),_=er(c,v.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),_&&(N.paddingBlock=_);let U=er(m,v.radius)??v.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:M??0,left:E??0,zIndex:1e3,transformOrigin:D,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(a)??"fit-content",height:ds(u)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),V=r?css({}):css({background:b,color:C,border:L,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof v.spacing?.sm=="number"?`${v.spacing.sm}px ${v.spacing.md}px`:`${v.spacing?.sm??"0.5rem"} ${v.spacing?.md??"1rem"}`}}),Y=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},le=ro(R.setFloating,T),ue=jsx(motion.div,{className:"plainframe-ui-popover",...A({...f,ref:le,...Y}),...w,css:[se,V,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?ue:null})})});di.displayName="PopoverContent";var Ku=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=de.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:u,css:i,trackCss:l,thumbCss:c,labelCss:m,...h},f){let T=j(),k=he(),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),v=g?!!t:d,[F,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[v,r]);let E=["sm","md","lg"].includes(s)?s:"md",M=y[E],$=`${x.slideMs}ms ${x.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=v?K:W,A=v?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:P,thumb:D}=M,B=(P-D)/2,z=css({display:"inline-flex",alignItems:"center",gap:M.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: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}),b=css({position:"absolute",top:B,left:v?I-D-B:B,width:D,height:D,backgroundColor:A,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:F?"scaleX(1.2)":"scaleX(1)",transformOrigin:v?"right center":"left center"}),C=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),L=()=>{if(r)return;let O=!v;g||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":v,"aria-disabled":r||void 0,"data-checked":v?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:L,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},className:["plainframe-ui-switch",u||""].join(" ").trim(),css:[z,k({color:v?"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,c]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[C,m],children:a})]})}));var Yu=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},rr=de.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:u=false,checkedIcon:i,color:l="primary",css:c,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:k,...y},x)=>{let g=j(),d=he(),p=typeof e=="boolean",[v,F]=useState(t),R=p?e:v,E=r==="sm"||r==="lg"?r:"md",M=useMemo(()=>Yu(g,E),[g,E]),{checkedBg:$,checkColor:K,borderCol:W,hoverBg:S,gapPx:A}=useMemo(()=>{let O=g.palette||{},_=g.neutral||{},N=g.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||_,G=l):(U=O.primary||_,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],V=N[G]??N.primary??g.text?.onColors?.primary??g.text.primary,Y=typeof M.gap=="number"?M.gap+2:M.gap;return {checkedBg:se,checkColor:V,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:Y}},[M.gap,l,g]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:A,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:W,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[W,$,a,o,A,S,s,g.radius.sm,g.spacing.xs]),P=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),D=useMemo(()=>css({width:M.box,height:M.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${M.borderWidth} solid ${W}`,outlineOffset:`-${M.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:u?g.radius.full:M.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"}),[M.box,M.borderRadius,M.borderWidth,W,u,g.radius.full]),B=useMemo(()=>({w:Math.round(M.box*M.iconRatioW),h:Math.round(M.box*M.iconRatioH)}),[M.box,M.iconRatioH,M.iconRatioW]),z=useMemo(()=>css({width:B.w,height:B.h,transition:"opacity .14s ease, transform .14s ease",color:K,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[K,B.h,B.w]),w=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),b=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[M.labelFont,g.text.primary]),C=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[M.labelFont,a,s,g.spacing.xs,g.text.secondary]),L=useCallback(()=>{o||(p?n?.(!R):F(O=>{let _=!O;return n?.(_),_}));},[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"}),c,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:K,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:[C,T],children:a})]})]})}));rr.displayName="Checkbox";var Qu=()=>useContext(ln),ed=()=>useContext(to),td=()=>useContext(lr),sn=null,bi=(e,t=35)=>{sn!==null&&window.clearTimeout(sn),sn=window.setTimeout(()=>{e(),sn=null;},t);},so=()=>{sn!==null&&(window.clearTimeout(sn),sn=null);},Mt=de.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:u,css:i,startIcon:l,endIcon:c,selected:m=false,active:h,meta:f,__index:T,__skipListReg:k,...y},x){let g=Qu(),d=td(),p=ir(),v=io(),F=ed(),R=j(),M=!!useContext(gt),$=y["data-subtrigger"]!==void 0,K=$&&c===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):c,S=typeof o=="number"?o:o===false?0:0,A=useContext(Qo),I=A==="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:M?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,M,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]),w=[];M&&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();},C=(H,O)=>{let _=H.closest('[role="menu"]');if(!_)return;let N=Array.from(_.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(Y=>{if(Y.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(Y);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),V=N[se];V&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),V.setAttribute("data-highlighted",""),V.focus(),g&&T!=null&&g.setActiveIndex(se));},L=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:L,ref:H=>{if(g&&!k){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&&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 _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)so();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 _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&g&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),v&&v.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 _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}v&&v.setIsKeyboardNav(false);return}if(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(V=>V.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(V=>V.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(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 _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),v&&v.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),C(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),v&&v.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),C(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),C(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),C(O,N=>N-1);return}},className:["plainframe-ui-menu-item",u||""].join(" ").trim(),css:css(...[P,...w,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),b());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:D,children:l}),a,(f!=null||K||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,K,m&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=de.createContext(null),hs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,u=a?e:r,i=useRef(u);i.current=u;let l=useRef(n);l.current=n;let c=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:u,toggle:c}),[u,c]);return jsx(yi.Provider,{value:m,children:o})},ao=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:u=false,css:i,className:l,startIcon:c,endIcon:m,...h},f){let T=useContext(yi),k=!!T&&r!==void 0,y=!k&&t!==void 0,[x,g]=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=j(),F=!!useContext(gt),R=()=>{if(!u)if(k)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"}),M=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;}));},[]),K=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:E,"aria-hidden":"true",children:jsx(rr,{size:"sm",checked:d,css:M})}),c]});return jsx(Mt,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:u,startIcon:K,endIcon:m,css:i,selected:false,children:s})});ao.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:u,switchSize:i="md",switchCss:l,startIcon:c,className:m,...h},f){let T=t!==void 0,[k,y]=useState(!!n),x=T?!!t:k,d=!!useContext(gt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),v=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),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(Mt,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:F,css:u,selected:false,children:[c&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:c}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:v,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=de.createContext(null),Ci=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,u=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:u}),[a]);return jsx(vi.Provider,{value:i,children:o})};Ci.displayName="MenuRadioGroup";var nd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...u},i){let l=useContext(vi),c=l?.value===t,m=j(),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:c?"scale(1)":"scale(0.4)",opacity:c?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(Mt,{...u,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":c,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:h,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),an=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:u=false,color:i="primary",...l},c){let m=j(),f=!!useContext(gt),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:u?"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:c,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:g,children:a})]})});an.displayName="MenuLabel";var od=({className:e,css:t,variant:n="full",...o})=>{let r=j(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,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)"}),u=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"?u:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var dr=ro,lo=0,cr=null,ur=null,bd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function hd(){if(!(typeof document>"u")){if(lo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=bd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}lo+=1;}}function yd(){if(!(typeof document>"u")&&(lo>0&&(lo-=1),lo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var ln=createContext(null),pr=()=>{let e=useContext(ln);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},co=createContext(null),xd=()=>useContext(co),eo=createContext(null),io=()=>useContext(eo),Ti=createContext(null),ir=()=>useContext(Ti),wi=createContext(false),vd=()=>useContext(wi),to=createContext({allItemsTabbable:true}),lr=de.createContext(null),ys=()=>useContext(lr);function Cd(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var Rd=()=>xd()?.activeIndex??null,Ei=0,Pn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[u,i]=useState(!!t),l=e??u,c=useCallback(A=>{e===void 0&&i(A),n?.(A);},[e,n]),m=useRef(`pfui-menu-${++Ei}`),h=useRef(null),f=useRef([]),T=useRef(null),[k,y]=useState(null),[x,g]=useState(false);useEffect(()=>{l||(y(null),f.current=[],g(false));},[l]);let d=useRef(null),p=useCallback((A,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let P=I??20;d.current=window.setTimeout(()=>c(A),P);},[o,c]),v=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>v(),[v]),useEffect(()=>{if(!(!r||!l))return hd(),()=>yd()},[l,r]);let F=ys(),[R]=useState(()=>F??Cd()),E=useRef(new Set),M=useMemo(()=>({registerSubMenu:A=>(E.current.add(A),()=>E.current.delete(A)),closeAllSubMenus:()=>{E.current.forEach(A=>A());}}),[]),$=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:v,menuId:m.current}),[l,c,o,y,p,v]),K=useMemo(()=>({activeIndex:k,setActiveIndex:y}),[k,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:g}),[x]),S=s==="sm";return jsx(lr.Provider,{value:R,children:jsx(gt.Provider,{value:S,children:jsx(eo.Provider,{value:W,children:jsx(Ti.Provider,{value:M,children:jsx(co.Provider,{value:K,children:jsx(ln.Provider,{value:$,children:a})})})})})})};Pn.displayName="DropdownMenu";var Dn=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:u,setOpen:i,trigger:l,referenceRef:c,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:k,menuId:y}=pr(),x=io(),g=ir(),d=!!e&&isValidElement(t),p=d?t:null,v=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,...M}=s,$=useMemo(()=>dr(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,c),[a,d,t,c]),K=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(D=>{let B=K();requestAnimationFrame(()=>B[D]?.focus());},[K]),S=useCallback(D=>{if(D.key==="Tab"&&u){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(w=>w.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(D.key==="ArrowRight"&&u){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),!u){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(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==B)return false;let C=window.getComputedStyle(w);return C.display!=="none"&&C.visibility!=="hidden"});if(z.length>0){let w=D.key==="ArrowDown"?0:z.length-1;h(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),v?.(D),R?.(D);return}if(u){D.preventDefault();let B=document.querySelectorAll("[data-hovered]");for(let w of Array.from(B))if(w.closest("[data-submenu-content]")){let C=w.closest('[role="menu"]');if(C){C.setAttribute("data-keyboard-nav","");let L=Array.from(C.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==C)return false;let _=window.getComputedStyle(O);return _.display!=="none"&&_.visibility!=="hidden"}),H=L.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),H!==-1&&L.length>0){let O=D.key==="ArrowDown"?1:-1,_=(H+O+L.length)%L.length;L[_]?.setAttribute("data-highlighted",""),L[_]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):k?.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 C=window.getComputedStyle(b);return C.display!=="none"&&C.visibility!=="hidden"});if(w.length>0){let b=z.querySelector("[data-highlighted]"),C=z.querySelector("[data-hovered]"),L=-1;b?L=w.indexOf(b):C&&(L=w.indexOf(C)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),C&&C.removeAttribute("data-hovered"),L===-1&&(L=D.key==="ArrowDown"?-1:w.length);let H=D.key==="ArrowDown"?1:-1,O=(L+H+w.length)%w.length;h(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}v?.(D),R?.(D);return}}if((D.key==="Enter"||D.key===" ")&&!u){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(w=>{let b=w.closest("[data-submenu-content]");if(b&&b!==B)return false;let C=window.getComputedStyle(w);return C.display!=="none"&&C.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),v?.(D),R?.(D);return}v?.(D),R?.(D);},[u,i,h,v,R,K,W,m,x,y,k,g]),A=useCallback(D=>{l==="click"&&((D.nativeEvent.composedPath?.()??[]).some(b=>{let C=b;if(!C||!("tagName"in C))return false;let L=String(C.tagName).toUpperCase();if(L==="INPUT"||L==="TEXTAREA"||"isContentEditable"in C&&C.isContentEditable)return true;let H="getAttribute"in C?C.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(D.stopPropagation(),i(!u))),F?.(D),E?.(D);},[l,u,i,F,E]),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,w=typeof D.tabIndex=="number"?D.tabIndex:0,b={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[B,P,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,onClick:A,onKeyDown:S,...I,...M};return cloneElement(p,b)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),P,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":u,onClick:A,onKeyDown:S,...I,...M,children:t})});Dn.displayName="DropdownMenuTrigger";var dn=de.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:u,height:i,maxHeight:l,unstyled:c=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:k,exitPlacement:y,animateOnBusClose:x=true,gap:g,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:v=false,...F},R)=>{let{open:E,setOpen:M,referenceRef:$,clearSubmenuHover:K,setActiveIndex:W,floatingRef:S,menuId:A}=pr(),I=j(),P=ys(),D=io();useEffect(()=>{if(!P)return;let J=P.registerCloser(()=>M(false));return ()=>{J&&J();}},[P,M]);let B=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}`}`,C=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),re=Math.round(J.y);return {x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0,toJSON:()=>({x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0})}},contextElement:void 0}),[]),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 J=e;return C({x:J.x,y:J.y})},[e,C]),{refs:H,x:O,y:_,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:M,placement:b,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:B??0,crossAxis:z??0}),flip({padding:w??8}),shift({padding:w??8}),size({apply({rects:J,elements:oe}){let re=oe.floating;re.style.boxSizing="border-box",i!=null?re.style.height=typeof i=="number"?`${i}px`:String(i):re.style.removeProperty("height"),u!=null?re.style.width=typeof u=="number"?`${u}px`:String(u):a?re.style.width=`${Math.round(J.reference.width)}px`:re.style.width="200px",l!=null?re.style.maxHeight=typeof l=="number"?`${l}px`:String(l):re.style.removeProperty("max-height");}})]});useEffect(()=>{L?H.setReference(L):$.current&&H.setReference($.current);},[H,L,$]),useEffect(()=>{if(!E)return;let J=L||$.current,oe=H.floating.current;if(!(!J||!oe))return autoUpdate(J,oe,G)},[E,L,$,H,G]),useEffect(()=>{G();},[G,a,u,i,l]),useEffect(()=>{E&&!h&&W(0);},[E,h,W]),useEffect(()=>{if(!m||!E)return;let J=()=>{let oe=document.activeElement,re=$.current,Ve=H.floating.current;oe&&(re?.contains(oe)||Ve?.contains(oe)||M(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[m,E,M,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:J=>{if(d?.length){let oe=J.target;for(let re of d)if(re.current?.contains(oe))return false}return true}}),V=useRole(U,{role:"menu"}),{getFloatingProps:Y}=useInteractions([se,V]),le=useRef(false);useEffect(()=>{E?le.current=true:le.current&&$.current&&v&&(P?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[E,$,P,v]);let ue=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),pe=g===void 0?void 0:typeof g=="number"?g:I.spacing[g]??g,Me=c?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":ue,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:pe,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,ve=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let re=J.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return J;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Ce+=1,cloneElement(J,{__index:Ce,key:J.key??Ce});if(re==="DropdownMenuTrigger"){let Le=J.props.children;return cloneElement(J,{children:de.Children.map(Le,ve)})}if(re==="DropdownMenuSubTrigger"){Ce+=1;let Le=Ce;return cloneElement(J,{__index:Le,key:J.key??Le})}let Ve=J.props.children;return Ve==null?J:cloneElement(J,{children:de.Children.map(Ve,ve)})},Ee=de.Children.map(k,ve),Z=U.placement.split("-")[0]||"bottom",ie=Z==="bottom"?"center top":Z==="top"?"center bottom":Z==="left"?"right center":"left center",be=Z==="bottom"?{opacity:0,y:-8,scale:.96}:Z==="top"?{opacity:0,y:8,scale:.96}:Z==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},X=y??Z,ye=X==="bottom"?{opacity:0,y:-8,scale:.96}:X==="top"?{opacity:0,y:8,scale:.96}:X==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ne=!!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:_??0,left:O??0,zIndex:1e3,transformOrigin:ie}),me=useCallback(J=>{if(J.key==="Tab"){J.preventDefault();return}if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),D?.setIsKeyboardNav(true);let oe=J.currentTarget;oe.setAttribute("data-keyboard-nav","");let re=Array.from(oe.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(Ve=>{if(Ve.closest('[role="menu"]')!==oe)return false;let Le=window.getComputedStyle(Ve);return Le.display!=="none"&&Le.visibility!=="hidden"});if(re.length>0){let Ve=oe.querySelector("[data-highlighted]"),Le=oe.querySelector("[data-hovered]"),Et=-1;Ve?Et=re.indexOf(Ve):Le&&(Et=re.indexOf(Le)),document.querySelectorAll("[data-highlighted]").forEach(Cn=>Cn.removeAttribute("data-highlighted")),Le&&Le.removeAttribute("data-hovered"),Et===-1&&(Et=J.key==="ArrowDown"?-1:re.length);let qn=J.key==="ArrowDown"?1:-1,Ke=(Et+qn+re.length)%re.length;W(Ke),re[Ke]?.setAttribute("data-highlighted",""),re[Ke]?.focus();}}},[D,W]),Fe=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]),He=useCallback(J=>{J.removeAttribute("data-keyboard-nav"),J.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(to.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...Y({...F,ref:dr(R,H.setFloating,J=>{S&&(S.current=J);})}),"data-menu-id":A,"data-keyboard-nav":D?.isKeyboardNav?"":void 0,className:f,css:[Me,ae,T],initial:be,animate:{opacity:1,x:0,y:0,scale:1},exit:ye,transition:ne,onPointerMove:J=>He(J.currentTarget),onPointerDown:J=>He(J.currentTarget),onKeyDown:me,onMouseMove:Fe,onMouseEnter:()=>{K(),P?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:Ee})}):null})})});dn.displayName="DropdownMenuContent";var Si=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=vd(),[u,i]=useState(!!t),l=e??u,c=useCallback(S=>{e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,A)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=A??20;m.current=window.setTimeout(()=>{h.current=false,c(S);},I);},[o,c]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let k=ir();useEffect(()=>{if(!k)return;let S=()=>{T(),c(false);};return k.registerSubMenu(S)},[k,c,T]);let y=useRef(`pfui-submenu-${++Ei}`),x=useRef(null),g=useRef([]),d=useRef(null),[p,v]=useState(null),[F,R]=useState(false);useEffect(()=>{l||(v(null),g.current=[],R(false));},[l]);let E=useContext(gt),M=r??E,$=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:x,listRef:g,floatingRef:d,setActiveIndex:v,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,c,o,v,f,T]),K=useMemo(()=>({activeIndex:p,setActiveIndex:v}),[p,v]),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:de.Children.map(s,S=>{if(!isValidElement(S))return S;let A=S.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(wi.Provider,{value:true,children:jsx(gt.Provider,{value:M,children:jsx(co.Provider,{value:K,children:jsx(eo.Provider,{value:W,children:jsx(ln.Provider,{value:$,children:s})})})})})};Si.displayName="DropdownMenuSub";var Ii=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:u,setOpen:i,trigger:l,referenceRef:c,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=pr(),k=io(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),g=x?t:null,d=g?.props,p=d?.onKeyDown,v=d?.onClick,{onKeyDown:F,onClick:R,...E}=s,M=useMemo(()=>dr(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,c,y),[a,x,t,c,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let A=S.currentTarget,I=P=>{k?.setIsKeyboardNav(true);let D=A.closest("[data-menu-id]");if(!D)return;D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(C=>C.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(C=>{if(C.closest("[data-menu-id]")!==D)return false;let L=window.getComputedStyle(C);return L.display!=="none"&&L.visibility!=="hidden"});if(!B.length)return;let z=B.indexOf(A),w=z>=0?z:0,b=P==="next"?(w+1)%B.length:(w-1+B.length)%B.length;B[b]?.setAttribute("data-highlighted",""),B[b]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),u&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),u&&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(),u&&i(false);let P=A.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")),A.setAttribute("data-highlighted",""),A.focus(),k&&k.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),F?.(S);},[u,i,p,F,c,k,T]),W=l==="hover"?{onMouseEnter:S=>{let A=S.currentTarget;so(),h(),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let I=A.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),k&&k.setIsKeyboardNav(false),u||m(true,90);},onMouseMove:S=>{let A=S.currentTarget;so(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),A.setAttribute("data-hovered","")),!u&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!u),v?.(S),R?.(S);}};if(x&&g){let S=d?.css,A=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,P={ref:M,tabIndex:I,className:[A,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,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,...E};return cloneElement(g,P)}return jsx("div",{ref:M,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",onKeyDown:K,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let A=S.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...W,...E,children:t})});Ii.displayName="DropdownMenuSubTrigger";var ki=de.forwardRef((e,t)=>{let n=ys(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s,floatingRef:a}=pr(),u=useRef(null);useEffect(()=>{let l=u.current;if(!l)return;let c=a?.current;if(!c)return;let m=c.getAttribute("data-pfui-portal-owner");m&&l.setAttribute("data-pfui-portal-owner",m);let h=c.getAttribute("data-pfui-mode");h&&(l.setAttribute("data-pfui-mode",h),l.classList.remove("pf-light","pf-dark"),l.classList.add(h==="light"?"pf-light":"pf-dark"));let f=c.getAttribute("data-pfui-primary");f&&l.setAttribute("data-pfui-primary",f);let T=c.getAttribute("style");if(T){let y=T.matchAll(/--pf-[^:]+:\s*[^;]+/g);for(let x of y){let[g,d]=x[0].split(":").map(p=>p.trim());g&&d&&l.style.setProperty(g,d);}}let k=new MutationObserver(()=>{let y=c.getAttribute("data-pfui-mode");y&&(l.setAttribute("data-pfui-mode",y),l.classList.remove("pf-light","pf-dark"),l.classList.add(y==="light"?"pf-light":"pf-dark"));let x=c.getAttribute("data-pfui-primary");x&&l.setAttribute("data-pfui-primary",x);let g=c.getAttribute("style");if(g){let d=g.matchAll(/--pf-[^:]+:\s*[^;]+/g);for(let p of d){let[v,F]=p[0].split(":").map(R=>R.trim());v&&F&&l.style.setProperty(v,F);}}});return k.observe(c,{attributes:true,attributeFilter:["data-pfui-mode","data-pfui-primary","style","class"]}),()=>k.disconnect()},[a]);let i=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(dn,{ref:dr(t,u),side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:i,"data-submenu-content":"",anchor:o.current,onMouseEnter:l=>{r(),n?.clearAllHover(),so(),e.onMouseEnter?.(l);},onMouseLeave:l=>{s(false,60),e.onMouseLeave?.(l);}})});ki.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ed=css({display:"inline"}),Ai=css({display:"inline",fontWeight:700}),Sd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Id=css({display:"flex",alignItems:"center",gap:4}),kd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Fi=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}),Ad=()=>{},Fd=e=>e,Pd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Dd=e=>{e.preventDefault(),e.stopPropagation();},Nd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Hd=e=>{e.preventDefault(),e.stopPropagation();},Pi=de.memo(({onCapture:e})=>{let t=useContext(ln),n=useContext(co),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Pi.displayName="CtxCapture";var xs=de.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:u,closeOnSelect:i,pickSingle:l,handleItemKeyDown:c,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:kd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,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:Fi,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(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:k},e.value)}return s?jsx(Mt,{__index:t,onClick:y,onSelect:y,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Mt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("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));xs.displayName="AutocompleteRow";var Di=de.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:u,inputCss:i,containerCss:l,label:c,helperText:m,variant:h,startIcon:f,endIcon:T,size:k,disabled:y=false,error:x=false,showClear:g=false,open:d,onOpenChange:p,openOnFocus:v=false,openOnType:F=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:M=true,blurOnSelect:$=false,freeSolo:K=false,customValueLabel:W=false,maxHeight:S,maxItems:A,noResultsText:I="No Items Found",highlightTypedValue:P,typedValueHighlightCss:D,showNoResults:B=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:b,loading:C,loadingText:L="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:V,textFieldWrapperCss:Y,textFieldInputCss:le,textFieldLabelCss:ue,textFieldHelperRowCss:pe,textFieldHelperTextCss:Me,textFieldStartIconCss:Ce,textFieldEndIconCss:ve,menuContentCss:Ee})=>{let Z=j().text.secondary,[ie,be]=useState(""),X=typeof d=="boolean",[ye,Q]=useState(false),ne=X?d:ye,ae=useRef(null),me=useRef(null),Fe=useRef(null),He=useRef(null),J=useRef(false),oe=useRef(null),re=useRef(false),Ve=useRef(0),Le=useMemo(()=>[me],[]),[Et,qn]=useState(N??[]),Ke=_??Et,Cn=useRef(Ke);Cn.current=Ke;let[it,Rn]=useState(null),St=useRef(it);St.current=it;let Tn=useCallback(()=>Cn.current,[]),[Gn,Po]=useState([]),[Do,Xn]=useState(false),Ue=typeof b=="function",dt=Ue?Gn:e,ce=useRef(dt);ce.current=dt;let Te=!!C||Do&&Ue,et=useRef(p);useEffect(()=>{et.current=p;},[p]);let Ae=useCallback(q=>{X||Q(q),et.current?.(q);},[X]),lt=useRef(null);useEffect(()=>{if(!Ue)return;lt.current&&window.clearTimeout(lt.current);let q=ie;return lt.current=window.setTimeout(async()=>{Xn(true);try{let te=await b(q)||[];Po(Array.isArray(te)?te:[]);}catch{Po([]);}finally{Xn(false);}},Math.max(0,H)),()=>{lt.current&&window.clearTimeout(lt.current);}},[ie,Ue,b,H]);let Yn=useMemo(()=>{let q=mr(ie);return q?dt.some(te=>mr(te.title??te.value)===q):false},[dt,ie]),ia=K&&!!W&&ie.trim().length>0&&!Yn,ac=q=>{if(typeof W=="object"){let te=Object.prototype.hasOwnProperty.call(W,"prefix"),xe=Object.prototype.hasOwnProperty.call(W,"suffix");if(te||xe){let Se=te?W.prefix??"":"",fe=xe?W.suffix??"":"";return `${Se}${q}${fe}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Ue)return dt;let q=mr(ie);if(!q)return dt;let te=[],xe=[];for(let Se of dt){let fe=mr(Se.title??Se.value);fe.split(" ").some(qe=>qe.startsWith(q))?te.push(Se):fe.includes(q)&&xe.push(Se);}return te.length>0?te:xe},[dt,ie,Ue]),la=useMemo(()=>{if(ia){let q=ie.trim();return [...$r,{value:q,title:ac(q),__pfui_free__:true}]}return $r},[$r,ia,ie]),$t=useMemo(()=>{let q=[],te=new Map;for(let ot of la){let qe=ot.group??"__ungrouped__";te.has(qe)||(te.set(qe,[]),q.push(qe)),te.get(qe).push(ot);}let Se=typeof A=="number"?Math.max(0,A):1/0,fe=[];for(let ot of q){if(Se<=0)break;let Qt=te.get(ot).slice(0,Se);Qt.length>0&&(fe.push({label:ot==="__ungrouped__"?void 0:ot,items:Qt}),Se-=Qt.length);}return fe},[la,A]),wn=useMemo(()=>$t.reduce((q,te)=>(q.push(...te.items),q),[]),[$t]),No=wn.length>0,zr=!No&&!!B&&!Te&&ie.trim().length>0,En=Te||No||zr,Ho=En||Ue;useEffect(()=>{!Ue&&ne&&!En&&(re.current=true,Ae(false),setTimeout(()=>{re.current=false;},150));},[Ue,ne,En,Ae]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(K&&!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,K,O,t]);let Kr=useCallback(q=>{let te=ce.current,xe=new Map(te.map(fe=>[fe.value,fe])),Se=q.map(fe=>xe.get(fe)??{value:fe,title:fe});U?.(Se);},[U]),Lo=useCallback(q=>{let te=q.map(String);_||qn(te),Kr(te);},[_,Kr]),ca=useCallback(q=>{let xe=Ke.includes(q)?Ke.filter(Se=>Se!==q):[...Ke,q];Lo(xe);},[Ke,Lo]),Bo=useCallback(q=>{let te=ce.current.find(xe=>xe.value===q)??{value:q,title:q};te.disabled||(Wr.current=true,Or.current=(te.title??te.value).trim(),Rn(te),be(te.title??te.value),t?.(te),X||(E?(J.current=false,re.current=true,Q(false),et.current?.(false),setTimeout(()=>{re.current=false;},150)):J.current=true),!E&&Fe.current?.setActiveIndex&&Fe.current.setActiveIndex(null),$?(J.current=false,setTimeout(()=>{He.current&&ae.current?(He.current.tabIndex=0,He.current.focus(),He.current.blur(),He.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,X,E,$]),ic=useCallback(q=>{if(y)return;be(q);let te=!q.trim();O||(te?(Rn(null),t?.(null)):K&&Rn(null)),!X&&!te&&F&&!ne&&Ae(true);},[O,X,F,ne,Ae,y,K,t]),tt=Pd,ua=Ad,lc=Fd,da=useMemo(()=>D?[Ai,D]:Ai,[D]),cc=useCallback(q=>{let te=ie.trim();if(!te||te.length<1)return q;let xe=te.toLowerCase(),fe=q.toLowerCase().indexOf(xe);return fe<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Ed,children:[q.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:da,children:q.slice(fe,fe+te.length)}),q.slice(fe+te.length)]})},[ie,da]),$o=P?cc:lc,uc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Dd,Oo=Nd,dc=useCallback(q=>{Fe.current=q;},[]),pa=useCallback(q=>{let te=Fe.current;if(!te)return;let xe=wn.length;if(xe===0)return;let Se=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(Se){let qe=Se.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),Qt=Se.querySelector("[data-active]")||Se.querySelector("[data-hovered]");Qt&&(fe=Array.from(qe).indexOf(Qt));}fe<0&&typeof te.activeIndex=="number"&&(fe=te.activeIndex);let ot=fe<0?q===1?0:xe-1:(fe+q+xe)%xe;te.setActiveIndex?.(ot),requestAnimationFrame(()=>{let qe=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!qe)return;qe.setAttribute("data-keyboard-nav",""),qe.querySelectorAll("[data-active]").forEach(jr=>jr.removeAttribute("data-active")),qe.querySelectorAll("[data-hovered]").forEach(jr=>jr.removeAttribute("data-hovered"));let _r=qe.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[ot];_r&&(_r.setAttribute("data-active",""),_r.scrollIntoView?.({block:"nearest"}));});},[wn.length]),pc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!En&&!Ue)return;q.preventDefault(),!ne&&!X&&Ae(true),pa(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let te=Fe.current&&typeof Fe.current.activeIndex=="number"?Fe.current.activeIndex:-1,xe=te>=0&&te<wn.length?wn[te]:null;if(ne&&xe&&te>=0){q.preventDefault(),q.stopPropagation(),O?(ca(xe.value),E||requestAnimationFrame(()=>ae.current?.focus())):Bo(xe.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),ne&&!X&&(re.current=true,Ae(false),q.target.focus(),setTimeout(()=>{re.current=false;},150))):q.key==="Tab"&&ne&&!X&&Ae(false);},[En,Ue,ne,X,wn,O,E,pa,ca,Bo,Ae,y]),mc=useCallback(()=>{y||re.current||v&&Ho&&(Ve.current=Date.now(),X||Ae(true));},[X,v,Ho,Ae,y]),fc=useCallback(()=>{if(J.current){J.current=false;return}M&&Ae(false),!K&&!O&&(it?be(it.title??it.value):ie.trim()&&be(""));},[M,K,O,it,ie,Ae]),ma=useCallback(()=>{let q=[],te=0;return $t.forEach((xe,Se)=>{xe.label&&q.push(jsx(an,{className:tt("group-label"),children:xe.label},`g-${Se}`)),xe.items.forEach(fe=>{q.push(jsx(xs,{item:fe,absIndex:te,multiple:true,getCurrentMulti:Tn,isSelected:false,renderItem:s,paint:$o,cls:tt,closeOnSelect:false,pickSingle:ua,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),jsx(hs,{values:Ke,onValuesChange:Lo,children:q},"multi-group")},[$t,tt,Tn,s,$o,Ke,Lo,ua,Oo,zo,Z]),fa=useCallback(()=>{let q=[],te=0;return $t.forEach((xe,Se)=>{xe.label&&q.push(jsx(an,{className:tt("group-label"),children:xe.label},`g-${Se}`)),xe.items.forEach(fe=>{let ot=it?.value===fe.value;q.push(jsx(xs,{item:fe,absIndex:te,multiple:false,getCurrentMulti:Tn,isSelected:ot,renderItem:s,paint:$o,cls:tt,closeOnSelect:E,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),q},[$t,tt,it,Tn,s,$o,E,Bo,Oo,zo,Z]),gc=useMemo(()=>Te?jsx(an,{css:w,className:tt("label-loading"),children:L},"loading"):zr?jsx(an,{css:z,className:tt("label-empty"),children:I},"empty"):$t.length===0?null:O?ma():fa(),[Te,zr,$t.length,tt,L,I,O,ma,fa]),Zt=ne?false:y||!Ue&&!No&&!B,ga=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(Zt||y)&&(X||(ne?(re.current=true,Ae(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{re.current=false;},150)):(Ae(true),queueMicrotask(()=>ae.current?.focus()))));},[ne,No,Ue,Ae,Zt,y,X]),ba=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:ne?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:Zt?"not-allowed":"pointer",userSelect:"none",opacity:Zt?.5:1}),[ne,Zt]),Wo=useMemo(()=>se?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[ba,V],"aria-disabled":Zt||void 0,onMouseDown:Hd,onClick:ga,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ba,V,Zt,ga,G]),bc=useMemo(()=>T&&Wo?jsxs("span",{css:Id,children:[T,Wo]}):T??Wo,[T,Wo]),hc=useCallback(q=>{if(!(oe.current&&oe.current.contains(q.target)||re.current||y||Date.now()-Ve.current<300)){if(ne){!ie.trim()&&!X&&(re.current=true,Ae(false),setTimeout(()=>{re.current=false;},150));return}R&&Ho&&(!X||R)&&Ae(true);}},[ne,ie,R,Ho,Ae,y,X]);return jsx("div",{ref:me,className:tt(""),css:[uc,l,u],children:jsxs(Pn,{open:y?false:ne,onOpenChange:y?void 0:Ae,children:[jsx(Pi,{onCapture:dc}),jsx(Dn,{asChild:true,children:jsx("span",{className:tt("anchor"),css:Sd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:ae,className:tt("input"),focusRingMode:a,value:ie,onChange:ic,onKeyDown:pc,onFocus:mc,onBlur:fc,onSurfaceClick:hc,placeholder:r,label:c,helperText:m,variant:h,startIcon:f,endIcon:bc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:g,css:i,wrapperCss:Y,inputCss:le,labelCss:ue,helperRowCss:pe,helperTextCss:Me,startIconCss:Ce,endIconCss:ve}),jsx("span",{ref:He,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),En&&jsx(dn,{className:tt("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ee,ignoreOutsidePressRefs:Le,disableOutsidePressDismiss:X,returnFocus:!$,children:gc})]})})});Di.displayName="Autocomplete";var Od=["sm","md","lg"],Wd=(e,t)=>typeof e=="number"?e:Od.includes(e)?t.componentHeights[e]:t.componentHeights.md,Kd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},_d=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},jd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Ni=de.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:u,...i},l)=>{let c=j(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Wd(n,c),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?c.radius.full:c.radius.md,x=Kd(c,o),g=_d(c,o),d=jd(u,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"}),v=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),F=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:v,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof u=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:u}):u||jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:d})})}));Ni.displayName="Avatar";var Hi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:u,outlineThickness:i=4,className:l})=>{let c=j(),m=he(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let R=(c.componentHeights&&c.componentHeights[n])??(c.spacing&&c.spacing[n]);return Hi(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,g=a==="panel"?c.surface.panelBg:a==="subtle"?c.surface.subtleBg:a??c.surface.appBg,d=Hi(i)??"4px",p=css({display:"flex",alignItems:"center"}),v=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${g}`,backgroundColor:g,borderRadius:s?c.radius.full:c.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),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:v(E),children:jsx("span",{css:F,children:R})},E);let M=R,$=M.props?.css,K=$==null?F:[F,$],W=cloneElement(M,{size:n,rounded:s,css:K,style:{...M.props?.style,width:"100%",height:"100%",objectFit:M.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:v(E),children:W},E)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:c.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:c.text.secondary}),u],"aria-label":`+${x} more`,children:["+",x]})]})};var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Jd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Zd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Qd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",ep=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),tp=de.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:u=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:c="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:k,className:y,badgeClassName:x,css:g,badgeCss:d,offsetX:p,offsetY:v})=>{let F=j(),R=s==="dot",E=f??(R?8:17),M=r??(R?0:10),{scale:$,onKey:K}=Yd(F,t),W=Jd($),S=F.text?.onColors||{},A=Zd(F,S,K,n),I=Qd(e,a,s),P=ep(i,s,e,u),D=css({position:"relative",display:"inline-block"}),B=c==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=$i(p??B),w=$i(v??B),b=l.vertical||"top",C=l.horizontal||"right",L={},H="0",O="0";b==="center"?(L.top="50%",O="-50%"):b==="top"?(L.top=w,O="-45%"):(L.bottom=w,O="45%"),C==="center"?(L.left="50%",H="-50%"):C==="right"?(L.right=z,H="45%"):(L.left=z,H="-45%");let _=P?1:.8,N=css({minWidth:R?E:E/2,height:E,background:W,color:A,fontSize:typeof M=="number"?`${M}px`:M,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 ${k??F.surface?.appBg}`}:{},opacity:P?1:0,transform:`translate(${H}, ${O}) scale(${P?_:.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,g],children:[m,jsx("span",{"aria-hidden":!P,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Ss=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:u,overlayCss:i,children:l,transitionDuration:c=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...k})=>{let y=j(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[g,d]=useState(e),[p,v]=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(()=>{v(true),R.current=null;})):(v(false),F.current=setTimeout(()=>{d(false),F.current=null;},c)),()=>{F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,c]),useEffect(()=>{if(!T||!e)return;let A=document.body,I=A.style.overflow,P=A.style.paddingRight,D=window.innerWidth-document.documentElement.clientWidth,B=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",D>0&&(A.style.paddingRight=`${B+D}px`),()=>{A.style.overflow=I,A.style.paddingRight=P;}},[e,T]),useEffect(()=>{if(!p||!t)return;let A=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[p,t]);let M=A=>{if(!p||!t||!E.current)return;let I=A.target;I&&!E.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!g)return null;let K=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 ${c}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:[K,a],onPointerDown:M,...k,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,u],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function ap(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var ip=de.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:u,hover:i=true,className:l,...c})=>{let m=j(),h=he(),f=de.useMemo(()=>de.Children.toArray(e).flatMap(d=>{if(!de.isValidElement(d))return [];let{type:p,props:v}=ap(d);if(!(p===hr||typeof p=="function"&&"displayName"in p&&p.displayName===hr.displayName))return [];let R=v;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=de.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),k=de.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=de.useCallback((d,p,v)=>{let F=d?m.text.primary:m.text.secondary,R=i&&p&&!v;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:F,cursor:p&&!v?"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=de.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=de.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...c,children:f.map((d,p)=>{let v=p===f.length-1,F=!!d.href&&!d.disabled&&!v,R=["plainframe-ui-breadcrumb",v?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",F?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(v,F,d.disabled),o,v?r:s,F?a:void 0,h(),d.css],M=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(de.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,u],children:t}),F?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":v?"true":"false","data-link":"true",className:R,css:E,children:M}):jsx("span",{"aria-current":v?"page":void 0,tabIndex:v?-1:0,"data-active":v?"true":"false","data-link":"false",className:R,css:E,children:M})]},p)})})});var Is=(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})},ks=e=>typeof e=="number"?`${e}px`:e,Ki=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Ki(n)&&(t=true));}),t};function dp(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function pp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,u=e.text.onColors||{},i=u.primary??o.onColors.primary,l=u.danger??i,c=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=c(m,600,n[900])||c(m,500,n[900]),f=c(m,500,n[800])||c(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=c(m,600,n[900])||c(m,500,n[900]),f=c(m,500,n[800])||c(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 _i=de.memo(de.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:u=false,loadingIndicator:i,loadingPosition:l="center",children:c,className:m,hoverEffect:h=true,icon:f,onClick:T,css:k,...y},x)=>{let g=j(),d=he(),p=useMemo(()=>dp(g,t),[g,t]),v=useMemo(()=>pp(g,e),[g,e]),F=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Ki(c)&&de.Children.count(c)===1,[f,n,o,c]),R=p.iconSize,E=useMemo(()=>Is(n,R),[n,R]),M=useMemo(()=>Is(o,R),[o,R]),$=useMemo(()=>i??jsx(Qn,{color:v.fg,variant:"circular",size:14,thickness:5}),[i,v]),K=useMemo(()=>F?"center":l??"center",[F,l]),W=!!u&&K==="center",S=!!u&&K==="start",A=!!u&&K==="end",I=a||u,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?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]),D=useMemo(()=>css({backgroundColor:v.bg,color:v.fg,border:v.border}),[v]),B=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:v.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[v,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:ks(p.iconSize)}:{fontSize:ks(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:ks(g.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[g,W]),b=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),C=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:C,minWidth:C,maxWidth:C,height:"1em"}),[C]),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]),_=useMemo(()=>()=>{if(F)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:L,"aria-hidden":u?true:void 0,children:[jsx("span",{css:H(!S),children:G?E||n:null}),jsx("span",{css:H(!!S),children:$})]})},[F,n,S,L,H,E,u,$]),N=useMemo(()=>()=>{if(F)return null;let G=!!o;return !G&&!A?null:jsxs("span",{css:L,"aria-hidden":u?true:void 0,children:[jsx("span",{css:H(!A),children:G?M||o:null}),jsx("span",{css:H(!!A),children:$})]})},[F,o,A,L,H,M,u,$]),U=!(a||u);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:u?-1:void 0,"aria-disabled":a||void 0,"aria-busy":u||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:w,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:b,children:F?u?$:Is(c,p.iconSize):c}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));_i.displayName="Button";var Cr=e=>isValidElement(e),mp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>mp(e)===t,Ui=e=>Ps(e,"ButtonGroup"),qi=e=>Ps(e,"DropdownMenu"),As=e=>Ps(e,"DropdownMenuTrigger"),Ln=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,fp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,gp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Fs=(e,t)=>{if(!Cr(e))return null;if(Ui(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Fs(t?n[0]:n[n.length-1],t):null}if(qi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(As);return o?Fs(o,t):null}if(As(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Vi=(e,t)=>{if(!e)return false;let n=Fs(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return gp(o)},Gi=de.memo(de.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:u=false,gap:i,width:l,className:c,role:m="group",css:h,__clipLeft:f,__clipRight:T,...k},y){let x=j(),g=a==="sm"?x.radius.sm:x.radius.md,d=u?x.radius.full:g,p=o==="vertical",v=fp(x.componentHeights.border,1),F=x.surface.border,R=n&&!!f,E=n&&!!T,M=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?Ln(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Ln(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,S=0,A=false,I=[];for(let P of $){if(!Cr(P)){I.push(P);continue}let D=S===0,B=S===W-1,z=P.props??{},w=z.disabled??s,b=z.size??a,C=0,L=0,H=0,O=0;n&&(p?(C=D?R?0:d:0,L=D?E?0:d:0,O=B?R?0:d:0,H=B?E?0:d:0):(C=D?R?0:d:0,O=D?R?0:d:0,L=B?E?0:d:0,H=B?E?0:d:0));let _=Vi(P,"left"),N=Vi(P,"right"),se=n&&!D&&!(A&&_)&&!(A||_)?css({[p?"borderTop":"borderLeft"]:`${v} solid ${F}`}):null,V=n&&!D&&A&&_?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:Ln(C),borderTopRightRadius:Ln(L),borderBottomRightRadius:Ln(H),borderBottomLeftRadius:Ln(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ue=css([Y,se,V,le]);if(!qi(P)){let ve=z.css,Ee=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Re=Ui(P)&&n?{__clipLeft:!D,__clipRight:!B}:{},Z=cloneElement(P,{...z,disabled:w,size:b,className:Ee,css:[ve,ue],...Re});I.push(Z),A=N,S+=1;continue}let pe=z.children,Me=Children.map(pe,ve=>{if(!Cr(ve)||!As(ve))return ve;let Ee=ve.props,Re=[Ee.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(ve,{...Ee,css:[Ee.css,ue],className:Re,disabled:w,size:b})}),Ce=cloneElement(P,{...z,children:Me});I.push(Ce),A=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",c||""].join(" ").trim(),css:[M,h],...k,children:I})}));Gi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Rr(n?.[e]??e)}}},Rp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Rr(n?.[e]??e)}}},Tp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},wp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},Bn=de.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:u,selectable:i,selected:l,defaultSelected:c,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:k,role:y,tabIndex:x,...g},d){let p=j(),v=p.surface??{},[F,R]=useState(!!c),E=l!=null,M=E?!!l:F,$=useMemo(()=>Tp(o,p),[o,p]),K=useMemo(()=>wp(o,p,$),[o,p,$]),W=K,S=useMemo(()=>Cp(r,p),[r,p]),A=useMemo(()=>Rp(s,p),[s,p]),I=!!u||!!i,P=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:A,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${v.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:K}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,A,o,p.componentHeights,v.border,h,f,I,K,W]),D=useCallback(()=>{if(!i)return;let b=!M;E||R(b),m?.(b);},[E,m,i,M]),B=useCallback(b=>{i&&D(),T?.(b);},[i,D,T]),z=useCallback(b=>{i&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),D()),k?.(b);},[i,D,k]),w=he();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&M?"true":void 0,"aria-pressed":i?M:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[w(),P,n],onClick:B,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...g,children:t})}));Bn.displayName="Container";var Sp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ns(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return Sp(o)}return e}}}function go(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Hs(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Ip(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function bo(e,t,n,o){let r=Ns(t,e),s=Ns(n,e),a=Ns(o,e),u={};return r&&!s&&!a&&(u.padding=r),s&&(u.paddingLeft=s,u.paddingRight=s),a&&(u.paddingTop=a,u.paddingBottom=a),u}function Xi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Yi=de.createContext("horizontal"),Ls=()=>de.useContext(Yi),Ji=de.memo(de.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:u,defaultSelected:i,onSelectedChange:l,width:c="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:k,...y},x)=>{let g=j(),d=he(),p=f==="vertical",v=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ip(h,g),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Yi.Provider,{value:f,children:jsx(Bn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:u,defaultSelected:i,onSelectedChange:l,width:c,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),v,t],onClick:k,tabIndex:k?0:void 0,...y,children:e})})}));Ji.displayName="Card";var kp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...u})=>{let i=j(),c=Ls()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:go(o),textAlign:Hs(o),...c?{width:"100%"}:{flex:1,minWidth:0},...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...u,children:e})}),Mp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...u})=>{let i=j(),c=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...c?{width:"100%"}:{},...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...u,children:e})}),Ap=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...u})=>{let i=j(),c=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...c?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...u,children:e})}),Fp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:u,size:i,color:l,...c})=>{let m=j(),h=css({fontWeight:u??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Xi(m,l)??m.text?.primary,textAlign:Hs(o),...bo(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],...c,children:e})}),Pp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:u,size:i,color:l,...c})=>{let m=j(),h=css({fontWeight:u??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Xi(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Hs(o),...bo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...c,children:e})});var Qi=e=>isValidElement(e),Lp=e=>Qi(e)?e.type?.displayName||e.type?.name:void 0,Zi=e=>Lp(e)==="Card",Bp=e=>typeof e=="number"?`${e}px`:e,el=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:u="group",css:i})=>{let l=j(),c=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:c?"column":"row",width:typeof o=="string"||typeof o=="number"?Bp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(Zi).length,x=0,g=T.map((d,p)=>{if(!Zi(d)||!Qi(d))return d;let v=d.props,F=x++,R=F===0,E=F===y-1,M=s??v.variant,$=t?c?{borderTopLeftRadius:R?v.radius:0,borderTopRightRadius:R?v.radius:0,borderBottomLeftRadius:E?v.radius:0,borderBottomRightRadius:E?v.radius:0}:{borderTopLeftRadius:R?v.radius:0,borderBottomLeftRadius:R?v.radius:0,borderTopRightRadius:E?v.radius:0,borderBottomRightRadius:E?v.radius:0}:void 0,K=t&&!R?c?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=M==="subtle"&&y>1&&!R?c?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,A=[$,K,W,t?{width:"100%"}:{width:"100%",marginBottom:c?0:void 0,marginRight:c?void 0:0}].filter(Boolean),I=[v.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...v,variant:M??v.variant,css:[v.css,...A],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:u,"aria-orientation":c?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:g})};el.displayName="CardGroup";var Pe=e=>typeof e=="number"?`${e}px`:e,nl=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&nl(n)&&(t=true));}),t},Wp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},ol=de.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:u,size:i="md",onClick:l,onDelete:c,deleteIcon:m,disabled:h,cursor:f,className:T,css:k},y){let x=j(),g=he(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Wp(x,d),[x,d]),v=!!l&&!h,F=h?"not-allowed":f||(v?"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]),M=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]:M(50),[E,M,x.neutral]),K=useMemo(()=>E==="neutral"?x.text.secondary:M(800),[E,M,x.text.secondary]),W=useMemo(()=>E==="neutral"?x.neutral[100]:M(50),[E,M,x.neutral]),S=useMemo(()=>E==="neutral"?x.text.secondary:M(800),[E,M,x.text.secondary]),A=useMemo(()=>E==="neutral"?x.neutral[400]:M(300),[E,M,x.neutral]),I=useMemo(()=>E==="neutral"?x.surface.subtleBg:M(600),[E,M,x.surface.subtleBg]),P=useMemo(()=>(x.text.onColors??{})[E]??(E==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[E,x.text.onColors,x.neutral]),D="transparent",B=useMemo(()=>E==="neutral"?x.text.secondary:M(700)??x.text.primary,[E,M,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!u&&t!=null&&!nl(t)&&de.Children.count(t)===1,[a,u,t]),w=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} ${A}`}):o==="ghost"?css({backgroundColor:D,color:B,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:K,border:"none",boxShadow:"none"}),[I,P,B,W,S,A,$,K,R,o]),b=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Pe(p.gap),padding:o==="ghost"?0:z||t==null?Pe(p.soloPadding):`${Pe(p.paddingY)} ${Pe(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(${Pe(p.iconSize)} + ${Pe(p.soloPadding)} * 2)`,minHeight:`calc(${Pe(p.iconSize)} + ${Pe(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,F,t,h,z,s,x.radius.full,o]),C=useMemo(()=>css({fontSize:Pe(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Pe(p.iconSize):void 0,height:z?Pe(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:Pe(p.iconSize),lineHeight:0,"& > svg":{width:Pe(p.iconSize),height:Pe(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Pe(p.gap),marginLeft:z||t==null?0:Pe(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Pe(p.gap),marginRight:z||t==null?0:Pe(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),_=useMemo(()=>css({marginRight:s?0:Pe(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:Pe(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{v&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[v,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",v?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[b,w,v?g({color:r??"primary"}):null,k],onClick:v?l:void 0,onKeyDown:N,role:v?"button":void 0,tabIndex:v?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":E,"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:[C,n],className:"plainframe-ui-chip-label",children:t}),u&&jsx("span",{css:[L,O],className:"plainframe-ui-chip-icon-right",children:u}),c&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||c?.();},css:[_,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));ol.displayName="Chip";var Vp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Up=de.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:u,error:i,disabled:l,ringEnabled:c,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let k=he(),y=r.neutral,x=r.text,g=r.componentHeights.border,d=useRef([]),[p,v]=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]),M=l?y[200]:i&&u==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&u==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:u==="subtle"?r.surface.subtleBg:u==="outlined"?r.surface.panelBg:"transparent",$=u==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",K=z=>css({width:E,height:E,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:M,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}},c?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"}),A=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let w=Math.max(0,Math.min(o-1,z));v(w),d.current[w]?.focus();},[o]),P=useCallback((z,w)=>{let b=A(w).slice(0,1),C=[...F];C[z]=b,n(C.join("")),b&&z<o-1&&I(z+1);},[F,o,n,I]),D=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]),B=useCallback(z=>{let w=A(z.clipboardData.getData("text")).slice(0,o);w&&(n(w),requestAnimationFrame(()=>{let b=Math.min(w.length,o-1);I(b);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,w)=>jsxs(de.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=>P(w,b.target.value),onKeyDown:b=>D(w,b),onFocus:()=>v(w),onPaste:w===0?B:void 0,className:"plainframe-ui-code-box",css:K(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))})}),qp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:u,disabled:i=false,gap:l,size:c="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:k,labelCss:y,helperRowCss:x,helperTextCss:g,css:d})=>{let p=j(),v=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(c)?c:"md",E=F[R],M=p.neutral,$=p.text,K=t!=null,[W,S]=useState(n),A=K?t:W,I=H=>{K||S(H),o?.(H);},P=Math.max(2,Math.min(h,10)),D=p.spacing.sm,B=Vp(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]:[]),w=css({fontSize:E.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??$.primary:i?M[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:B,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),C=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]:[]),L=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??$.primary:i?M[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:v,className:"plainframe-ui-codefield-label",css:w,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:b,role:"group","aria-labelledby":e?v:void 0,tabIndex:-1,children:jsx(Up,{value:A||"",onChange:I,len:P,theme:p,sizeKey:R,s:{codeFontSize:E.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:B})}),u!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:C,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:L,children:u})})]})};var ll=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},$s=e=>{if(!e||typeof e!="object")return false;let t=ll(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some($s):$s(o)},Xp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=de.useRef(null),[u,i]=de.useState(false),l=de.useCallback(C=>{i(C),o?.(C);},[o]),c=de.useCallback(()=>l(false),[l]),m=de.useRef({x:0,y:0}),h=de.useRef(null),f=de.useRef(null),T=de.useCallback(()=>{f.current=null;let C=h.current;if(!C)return;let L=Math.round(m.current.x),H=Math.round(m.current.y);C.style.transform=`translate3d(${L}px, ${H}px, 0)`;},[]),k=de.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);de.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=de.useMemo(()=>({getBoundingClientRect:()=>{let C=Math.round(m.current.x),L=Math.round(m.current.y);return {x:C,y:L,left:C,top:L,right:C,bottom:L,width:0,height:0,toJSON:()=>({x:C,y:L})}}}),[]),x=de.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=de.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=de.useRef(null),p=de.useRef(null),v=de.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),F=de.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=de.useCallback(()=>{F(),p.current=window.setTimeout(()=>l(false),0);},[F,l]),E=de.useCallback(()=>{let C=a.current?.getBoundingClientRect();return C?{x:C.left+C.width/2,y:C.top+C.height/2}:{x:0,y:0}},[]),M=de.useCallback((C,L)=>{m.current={x:C,y:L},k(),l(true);},[k,l]),$=typeof t=="function"?t({close:c}):t,K=$s($),W=C=>{if(!de.isValidElement(C))return C;let L=ll(C),H=C,O=H.props.children,_=O==null?O:Array.isArray(O)?O.map(N=>de.isValidElement(N)?W(N):N):de.isValidElement(O)?W(O):O;if(L==="DropdownMenu"){let N=H.props.onOpenChange;return de.cloneElement(H,{...H.props,open:u,onOpenChange:U=>{N?.(U),l(U);},children:_})}if(L==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return de.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{F(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:_})}return _===O?H:de.cloneElement(H,{...H.props,children:_})},S=K?W($):$,A=de.useCallback(C=>{C.preventDefault(),M(C.clientX,C.clientY);},[M]),I=de.useCallback(C=>{n==="contextmenu"&&A(C);},[n,A]),P=de.useCallback(C=>{n==="dblclick"&&A(C);},[n,A]),D=de.useCallback(C=>{n==="click"&&A(C);},[n,A]),B=de.useCallback(C=>{if(n!=="hover")return;v(),F();let L=r==="center"?E():{x:C.clientX,y:C.clientY};d.current=window.setTimeout(()=>{let H=L.x+(r==="cursor"?s:0),O=L.y+(r==="cursor"?s:0);M(H,O);},0);},[n,r,s,E,M,v,F]),z=de.useCallback(C=>{n==="hover"&&u&&r==="cursor"&&!K&&(m.current={x:C.clientX+s,y:C.clientY+s},k());},[n,u,r,K,s,k]),w=de.useCallback(()=>{n==="hover"&&(v(),R());},[n,v,R]);de.useEffect(()=>{if(n!=="hover")return;let C=()=>{if(!u)return;let L=a.current?.matches(":hover"),H=g()?.matches?.(":hover");L||H?F():R();};return window.addEventListener("pointermove",C,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",C,{capture:true})},[u,n,g,F,R]),de.useEffect(()=>{let C=()=>{if(u)if(n==="hover"){let L=a.current?.matches(":hover"),H=g()?.matches?.(":hover");if(L||H?F():R(),r==="center"&&a.current){let O=E();m.current={x:O.x,y:O.y},k();}}else l(false);};return window.addEventListener("scroll",C,true),window.addEventListener("resize",C,true),()=>{window.removeEventListener("scroll",C,true),window.removeEventListener("resize",C,true);}},[u,n,r,E,k,l,F,R,g]),de.useEffect(()=>()=>{v(),F();},[v,F]);let b=({children:C})=>u?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:C}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:P,onClick:D,onMouseEnter:B,onMouseMove:z,onMouseLeave:w,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?S:jsx(b,{children:S})]})};var zn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Qp=de.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:u="5px",insetMargin:i="10px",chip:l=false,chipVariant:c="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:k,className:y,...x},g){let d=j(),{t:p,strokeColor:v,labelTextColor:F,chipSubtleBg:R,chipOutlinedBg:E,outerM:M,padX:$,verticalStrokeMargin:K}=useMemo(()=>{let P=typeof s=="number"?`${s}px`:s,D=d.surface.border,B=d.text.secondary,z=d.surface.subtleBg,w=d.surface.panelBg,b=zn(h,"10px"),C=o==="horizontal"?n==="middle"?zn(u):n==="inset"?zn(i,"0px"):"0":"0",L=o==="vertical"?n==="middle"?zn(u):n==="inset"?zn(i,"0px"):"0":"0";return {t:P,strokeColor:D,labelTextColor:B,chipSubtleBg:z,chipOutlinedBg:w,outerM:b,padX:C,verticalStrokeMargin:L}},[s,d,o,n,u,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:M,marginRight:M}:{flexDirection:"row",width:a?zn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:M,marginBottom:M},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,M,a,$,n,f]),S=useMemo(()=>css([{background:v,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:p,flex:1}]),[v,m,d.radius.full,d.radius.xs,o,p,K]),A=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:F,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?c==="subtle"?{background:R,border:"none"}:{background:E,border:`${p} solid ${v}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,F,c,R,E,p,v,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,k]}),[S,k]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="right"&&I,!t&&I]})}));var gl=de.createContext(null),bl=()=>{let e=useContext(gl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},hl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,u]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&u(m),o?.(m);},[t,o]),c=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(gl.Provider,{value:c,children:e})},nm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=bl(),u=!!e&&de.isValidElement(t),i=useCallback(c=>{if(u){let m;de.isValidElement(t)&&(m=t.props.onClick),m?.(c);}r.onClick?.(c),c.defaultPrevented||a(true);},[u,t,r.onClick,a]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(true)),u){let m;de.isValidElement(t)&&(m=t.props.onKeyDown),m?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,a]);if(u){let c=t,m=c.props.css;return de.cloneElement(c,{...c.props||{},className:[c.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})});nm.displayName="DrawerTrigger";var vo=0,yl="",xl="",om=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function rm(){if(!(typeof document>"u")){if(vo===0){let e=document.body;yl=e.style.overflow||"",xl=e.style.paddingRight||"";let t=om();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vo+=1;}}function sm(){if(!(typeof document>"u")&&(vo>0&&(vo-=1),vo===0)){let e=document.body;e.style.overflow=yl,e.style.paddingRight=xl;}}var am=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,vl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:u,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:c=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:k,css:y,...x},g){let d=j(),{open:p,setOpen:v,lockScroll:F,closeOnEscape:R}=bl();useEffect(()=>{if(!(!F||!p))return rm(),()=>sm()},[p,F]);let E=useMemo(()=>am(a,0),[a]),M=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),K=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 V=String(d.radius.lg);switch(r){case "left":return `0 ${V} ${V} 0`;case "right":return `${V} 0 0 ${V}`;case "top":return `0 0 ${V} ${V}`;default:return `${V} ${V} 0 0`}},[r,d.radius.lg]),A=useMemo(()=>u??(s==="inset"?d.radius.lg:S),[u,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]),P=useRef(null),D=useCallback(()=>{let V=P.current;if(!V)return 1;let Y=V.getBoundingClientRect();return M==="x"?Y.width:Y.height},[M]),B=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(()=>M==="x"?{x:`${w*100}%`,y:0}:{y:`${w*100}%`,x:0},[M,w]),C=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:K,height:W,backgroundColor:d.surface.panelBg,borderRadius:A,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:M==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,K,W,d.surface,A,p,M]),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(()=>{c&&v(false);},[c,v]),O=useMemo(()=>M==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[M,$,T]),_=useMemo(()=>M==="x"?{left:0,right:0}:{top:0,bottom:0},[M]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((V,Y)=>{let le=M==="x"?Y.offset.x:Y.offset.y,ue=M==="x"?Y.velocity.x:Y.velocity.y,pe=$*le>0,Me=Math.abs(le)>=D()*N,Ce=$*ue>f;pe&&(Me||Ce)&&v(false);},[M,$,D,N,f,v]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let V=setTimeout(()=>{let ue=P.current;if(!ue)return;let pe=ue.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');pe.length>0?pe[0].focus():ue.focus();},100),Y=ue=>{let pe=P.current;if(!pe||!ue.target)return;let Me=ue.target;if(!pe.contains(Me)){ue.preventDefault();let Ce=pe.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():pe.focus();}},le=ue=>{ue.key==="Escape"&&R&&(ue.stopPropagation(),v(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",le),()=>{clearTimeout(V),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,v,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:V=>{P.current=V,typeof g=="function"?g(V):g&&(g.current=V);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[C,y],drag:M,dragConstraints:_,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:B,...se,children:t},"panel")]}):null})});vl.displayName="DrawerContent";var im=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:u,...i},l){let c=t!==void 0?t:n,m=o!==void 0?o:r,h=c!==void 0,[f,T]=useState(!!m),k=h?!!c:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(hl,{open:k,onOpenChange:y,children:jsx(vl,{ref:l,...i,children:u})})});im.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:u=false})=>{let i={opacity:o?1:0,filter:u?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=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 c=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:c,onTransitionEnd:l(),children:e})};var Cl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rl=de.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:u,height:i,...l})=>{let c=j(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:c.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Cl(u),width:u?"100%":void 0,maxHeight:Cl(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})});Rl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:u=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"},c=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(u&&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:c(k)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:c(),children:e})};var Tl={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},Rm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Tm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},On=de.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:u="left",textTransform:i="none",whiteSpace:l="normal",decoration:c="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:k,style:y,as:x})=>{let g=j(),d=Tl[e]??Tl.body,p=x??Tm[e]??"span",v=A=>A==null?d.size:typeof A=="number"?A:g?.typography?.sizes?.[A]??A,F=v(o)??v(d.size),R=r??d.weight,E=s??d.lh,M=a??d.ls,$=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",K=f??g.surface.border,W=css({boxSizing:"border-box",display:u==="left"?"inline":"block",textAlign:u==="left"?void 0:u,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:F,fontWeight:R,lineHeight:E,letterSpacing:M,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=c==="none"?css({textDecoration:"none"}):css({textDecorationLine:c,textDecorationStyle:m,textDecorationColor:K,textDecorationThickness:Rm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});On.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sm=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return qs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},El=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:u="none",label:i,labelAlign:l="center",aspectRatio:c,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:k,placeholder:y,blurDataURL:x,placeholderColor:g="#f1f1f1",fallbackSrc:d,className:p,css:v,onClick:F,onLoad:R,onError:E,...M},$){let[K,W]=useState(false),[S,A]=useState(false),[I,P]=useState(false),D=j(),B=Sm(s,D)??"0px",z=i?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:i?D.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${B})`}),b=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${B})`,maxWidth:o?qs(o):"100%",maxHeight:r?qs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:c,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:K&&(u==="rotate"||u==="scale-rotate")?"rotate(3deg)":"none",cursor:F?"pointer":void 0}),C=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"}),L=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(u==="scale"||u==="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,v],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:C}),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=>{A(true),E?.(H);},...M})]}),i&&jsx(On,{as:"figcaption",variant:"caption",align:l,children:i})]})});El.displayName="Image";var Sl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Am=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}},Fm=e=>e*Math.PI/180,Pm=(e,t,n)=>{let o=Math.abs(Fm(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Dm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Nm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,Il=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Hm={sm:150,md:200,lg:260,xl:340},Lm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Bm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Lm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var $m=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:u,maxItems:i=3,shadow:l=false,cursor:c,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:k="md",label:y,labelAlign:x="center",css:g,className:d,...p}){let v=j(),F=Am(r)??4/5,R=typeof o=="string"?o:void 0,E=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Hm[s],M=Math.max(1,E/F),K=Children.toArray(t).filter(isValidElement).slice(0,i),W=K.length,S=Dm(n,W),A=K.map((V,Y)=>Nm(n,W,Y)),I=V=>M*.6*A[V],P=V=>I(V)*F,D=0,B=0;for(let V=0;V<W;V++){let Y=P(V),le=I(V),ue=Math.max(Math.abs(S.base.ang[V]??0),Math.abs(S.exp.ang[V]??0)),pe=Math.max(Math.abs(S.base.dx[V]??0),Math.abs(S.exp.dx[V]??0)),Me=Math.max(Math.abs(S.base.dy[V]??0),Math.abs(S.exp.dy[V]??0)),Ce=a==="expand"?kl[V]??1.08:a==="reveal"?Il[V]??1.03:1,ve=Pm(Y,le,ue),Ee=ve.w*Ce,Re=ve.h*Ce,Z=pe/100*Y*Ce,ie=Me/100*le*Ce;D=Math.max(D,Ee/2+Z),B=Math.max(B,Re/2+ie);}let z=Math.max(1,2*D),w=Math.max(1,2*B),b=Math.min(1,E/z,M/w),C=u===void 0?"pointer":"controlled",L=u?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:c||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?v.spacing.xs:0}),O=css({position:"relative",width:Sl(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:Sl(M)}),_=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=Bm(k,v)??"0px",U=V=>{let Y=n==="fan"?`rotate(${S.base.ang[V]}deg) translate(${S.base.dx[V]}%, ${S.base.dy[V]}%)`:n==="slide"?`translate(${S.base.dx[V]}%, ${S.base.dy[V]}%) rotate(${S.base.ang[V]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[V]}%)`:`translate(${S.base.dx[V]}%, ${S.base.dy[V]}%) rotate(${S.base.ang[V]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[V]}deg) translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%)`:n==="slide"?`translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%) rotate(${S.exp.ang[V]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[V]}%)`:`translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%) rotate(${S.exp.ang[V]}deg)`,ue=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,pe=a==="expand"?`${le} scale(${kl[V]??1.06})`:a==="reveal"?`${Y} scale(${Il[V]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ue}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&V===1?10:V+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??v.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%) ${pe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${pe}`}})},G=V=>css({width:`${P(V)}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":C,"data-hovered":L,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:_,children:K.map((V,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(Y),children:V})},Y))})}),y&&jsx(On,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Ml=e=>typeof e=="number"?`${e}px`:e,Al={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Wm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Ml(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Ml(n)}return e}function Km(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var _m=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:u=2,css:i,className:l="plainframe-ui-kbd",...c},m){let h=j(),f=he(),T=Al[o]??Al.sm,k=Wm(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"}),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)`}}),v=n==="subtle"?g:n==="ghost"?d:p,R=s&&u>0&&Km(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+u}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,v,i],...c,children:R})});var qm=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Gs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:u,distance:i})=>{let c=qm(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${c}`:t==="right"?c:"0",h=t==="up"?c:t==="down"?`-${c}`:"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||"",u||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:g,className:d,onTransitionEnd:T(p)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",u||""].join(" ").trim(),css:k,onTransitionEnd:T(),children:e})};var Xs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Nl=de.createContext(null),Hl=()=>{let e=useContext(Nl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Qm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,u]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&u(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 c=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Nl.Provider,{value:c,children:e})},Ll=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Hl(),u=!!e&&de.isValidElement(t),i=useCallback(c=>{if(u){let m;de.isValidElement(t)&&(m=t.props.onClick),m?.(c);}r.onClick?.(c),c.defaultPrevented||a(true);},[u,t,r.onClick,a]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(true)),u){let m;de.isValidElement(t)&&(m=t.props.onKeyDown),m?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,a]);if(u){let c=t,m=c.props.css;return de.cloneElement(c,{...c.props||{},className:[c.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})});Ll.displayName="ModalTrigger";var Bl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:u=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:c="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:k,...y},x)=>{let g=j(),{open:d,setOpen:p,lockScroll:v}=Hl(),F=de.useRef(null),R=de.useRef(null);de.useEffect(()=>{if(!d)return;R.current=document.activeElement;let S=setTimeout(()=>{let I=F.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),A=I=>{let P=F.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",A,true),()=>{clearTimeout(S),document.removeEventListener("focusin",A,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),M=css({width:"100%",height:Xs(o),maxWidth:t==="inset"?`min(${Xs(n)||"100%"}, calc(100% - ${E} * 2))`:Xs(n),maxHeight:t==="inset"?`calc(100% - ${E} * 2)`:"100%",margin:t==="inset"?E:void 0}),$=jsx(Bn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[M,f],ref:S=>{F.current=S,typeof x=="function"?x(S):x&&(x.current=S);},...y,children:e}),K=c==="none"?$:c==="slide"?jsx(Gs,{on:d,direction:m,duration:h,children:$}):c==="grow"?jsx(_s,{initialScale:.75,on:d,duration:h,children:$}):jsx(Ks,{on:d,duration:h,children:$});if(!a)return jsx(Fragment,{children:K});let W=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Ss,{on:d,blur:u,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[W,T].filter(Boolean),contentCss:W,lockScroll:v,children:K})});Bl.displayName="ModalContent";var lf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:u=false,loop:i=false,variant:l="subtle",gap:c,className:m,css:h})=>{let f=j(),T=he(),k=t!==void 0,[y,x]=useState(n),g=Math.max(1,e),d=Ir(k?t:y,1,g),p=useCallback(b=>{let C=Ir(b,1,g);k||x(C),o?.(C);},[k,g,o]),v=useMemo(()=>cf({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,M=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",K=css({display:"inline-flex",alignItems:"center",gap:c??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:M,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),A=(b=false)=>css([W,T({color:b?"primary":"neutral"}),l==="outlined"?b?{background: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]),P=useCallback(()=>p(g),[p,g]),D=useCallback(()=>{d===1?i&&p(g):p(d-1);},[d,i,g,p]),B=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:K,onKeyDown:b=>{a||(b.key==="ArrowLeft"&&(b.preventDefault(),D()),b.key==="ArrowRight"&&(b.preventDefault(),B()),b.key==="Home"&&(b.preventDefault(),I()),b.key==="End"&&(b.preventDefault(),P()));},children:[u&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[A(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[A(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),v.map((b,C)=>typeof b=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":b===d?`Page ${b}, current page`:`Go to page ${b}`,"aria-current":b===d?"page":void 0,css:A(b===d),onClick:()=>p(b),children:b},b):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${C}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":w,disabled:w,css:[A(false),S],onClick:B,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),u&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":w,disabled:w,css:[A(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 cf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Sr(1,e);let s=Sr(1,Math.min(o,e)),a=Sr(Math.max(e-o+1,o+1),e),u=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=[],c=m=>{let h=l[l.length-1];h!==m&&(h==="ellipsis"&&m==="ellipsis"||l.push(m));};return s.forEach(c),u>o+2?c("ellipsis"):o+1<u&&c(o+1),Sr(u,i).forEach(c),i<e-o-1?c("ellipsis"):e-o>i&&c(e-o),a.forEach(c),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var mf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,ff=de.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=j(),u=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:mf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var Wl=createContext(null),yf=()=>{let e=useContext(Wl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},xf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},vf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:u,children:i,anchorOrigin:l,css:c})=>{let m=j(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),k=h?e:f,y=useRef([]),[x,g]=useState(0),d=()=>g(A=>A+1),p=useCallback(A=>{h||T(A),n?.(A);},[h,n]),v=useCallback(A=>(y.current.push(A),d(),y.current.length-1),[]),F=useCallback((A,I)=>{let P=y.current[A];P&&(y.current[A]={...P,...I},d());},[]),R=()=>y.current.map((A,I)=>({it:A,i:I})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),E=useCallback((A,I)=>{let P=R();if(!P.length)return;let D=Math.max(0,P.indexOf(A)),B=P[(D+I+P.length)%P.length],z=y.current[B]?.ref;if(z){z.focus();let w=y.current[B]?.value;w!==void 0&&p(w);}},[p]),M=useCallback(A=>{let I=R();if(!I.length)return;let P=A==="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 A=y.current.filter(P=>P.ref&&!P.disabled);return A.length?A.some(P=>P.value===k)?k:A[0]?.value:void 0},[k,x]),K=useMemo(()=>({selected:k,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:v,update:F,moveFocusBy:E,moveToEdge:M,focusValue:$,theme:m,anchorOrigin:xf(l)}),[k,p,o,r,s,a,v,F,E,M,$,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:u??"plainframe-ui-radio-group",css:[W,c],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(Wl.Provider,{value:K,children:i})})})},Cf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:u,size:i,register:l,update:c,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:k,anchorOrigin:y}=yf(),x=u||t,g=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,v=O=>f.palette?.primary?.[O],F=v(600),R=v(100),E=f.neutral[300],M=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],K="transparent",W=M,S=$;T==="soft"?(K=R,W=null,S=F):T==="outlined"?(K=v(50),W=M,S=F):(K=f.neutral[200],W="transparent",S=$),g&&(T==="outlined"?(K=R,W=M,S=F):T==="filled"?(K=F,W=null,S=$):(K=R,W=null,S=F));let A=T==="filled"?E:f.palette.primary[100],I=useRef(null),P=useRef(-1);useEffect(()=>{P.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{c(P.current,{ref:I.current,value:e,disabled:!!x});},[c,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||g?{}:{background:A,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${M}`:"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:K,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,_=y.vertical;return _==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),L=!x&&k===e?0:-1,H=he();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: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: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 Sf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:u=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"},c=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(u&&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:c(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:c(),children:e})};var Qs=e=>null;Qs.displayName="SelectItem";var Io=(...e)=>e.filter(Boolean).flat();function Zs(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Zs(n,t);return}if(de.isValidElement(e)){if(e.type===Qs){t.push(e);return}if(e.type===de.Fragment){Zs(e.props.children,t);return}}}}var _l=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:u=false,disabled:i=false,size:l="md",variant:c="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:k=280,wrapperCss:y,labelCss:x,triggerCss:g,menuCss:d,optionCss:p,children:v,className:F,menuSize:R="md",triggerRender:E})=>{let M=j(),$=he(),K=de.useId(),W=`${K}-label`,S=`${K}-menu`,A={sm:{minHeight:M.componentHeights.sm,radius:M.radius.sm},md:{minHeight:M.componentHeights.md,radius:M.radius.md},lg:{minHeight:M.componentHeights.lg,radius:M.radius.md}},I=A[l]||A.md,[P,D]=de.useState(false),B=Z=>D(!!Z),z=typeof e<"u",w=u||Array.isArray(e)||Array.isArray(t),[b,C]=de.useState(()=>typeof t<"u"?t:w?[]:void 0),L=z?e:b,H=Z=>{z||C(Z),n?.(Z);},O=[];Zs(v,O);let _=O.map((Z,ie)=>{let be=Z.props,X=typeof be.children=="string"||typeof be.children=="number"?String(be.children):void 0;return {key:Z.key??ie,value:be.value,startIcon:be.startIcon,endIcon:be.endIcon,node:be.children,labelText:X}}),N=Z=>w?(Array.isArray(L)?L:[]).some(be=>Object.is(be,Z)):Object.is(L,Z),U=de.useMemo(()=>{if(w){let ie=Array.isArray(L)?L:[];return _.filter(X=>ie.some(ye=>Object.is(ye,X.value))).map(X=>X.labelText??X.node)}let Z=_.find(ie=>Object.is(ie.value,L));if(Z)return Z.labelText??Z.node},[L,w,_]),G=Z=>{i||(Object.is(Z,L)||H(Z),B(false));},se=Z=>{if(i)return;let ie=Array.isArray(L)?L:[],X=ie.some(ye=>Object.is(ye,Z))?ie.filter(ye=>!Object.is(ye,Z)):[...ie,Z];H(X);},V={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},Y={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:M.typography.sizes.sm,padding:`0 ${typeof M.spacing.sm=="number"?`${M.spacing.sm}px`:M.spacing.sm} 0 ${typeof M.spacing.md=="number"?`${M.spacing.md}px`:M.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:M.text.primary,background:"transparent",whiteSpace:"nowrap"},le=c==="subtle"?{background:M.surface.subtleBg}:c==="outlined"?{background:M.surface.panelBg,border:`1px solid ${M.surface.border}`}:{background:"transparent"},ue={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Me={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Ce=jsx(ChevronsUpDown,{size:16,css:css({color:M.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),ve=()=>{if(E)return E(U);if(Array.isArray(U)){let ie=U.map(X=>typeof X=="string"?X:"").filter(Boolean),be=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:be,children:be})]})}let Z=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:typeof Z=="string"?Z:void 0,children:Z})]})},Ee={left:"start",center:"center",right:"end"},Re=Z=>{i||(Z.key==="ArrowDown"||Z.key==="ArrowUp"||Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),B(true));};return jsxs("div",{css:Io(V,y),className:["plainframe-ui-select-wrapper",F||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Io({marginBottom:6,fontSize:M.typography.sizes.sm,fontWeight:500,color:M.text.secondary},x),children:o}),jsxs(Pn,{size:R,open:P,onOpenChange:B,children:[jsx(Dn,{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:Re,onClick:()=>B(!P),className:"plainframe-ui-select-trigger",css:Io(css(Y),css(le),g,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ue),children:ve()}),a??Ce]})}),jsx(dn,{id:S,gap:"xs",align:Ee[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Io({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},d),children:_.map((Z,ie)=>{let be=N(Z.value);return jsx(Mt,{startIcon:Z.startIcon,endIcon:Z.endIcon,selected:be,disabled:i,closeOnSelect:!w,onSelect:()=>w?se(Z.value):G(Z.value),css:Io(p),className:"plainframe-ui-select-option",children:Z.node},Z.key??ie)})})]})]})};_l.displayName="Select";var ea=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Af=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 to=fe.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),T=typeof t=="number",M=Math.max(o-n,1),x=T?Xa(t,n,o):void 0,y=T?(x-n)/M*100:void 0,b=Yc(f,r),p=f.surface.subtleBg,d=f.radius?.md;return e==="circular"?jsx(Zc,{size:s,active:b,isDeterminate:T,percent:y,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Jc,{thickness:a,active:b,track:p,radius:d,isDeterminate:T,percent:y,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:x})}),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]:[]]),M=css([{position:"relative",width:"100%",height:rs(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),x=r?Math.max(s??0,Ga):Ga,y=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${x/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(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"}},p=css([{...b,left:"-35%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),d=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:M,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:y}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:p}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:d})]})})})},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,M=`${(o?Xa((r??0)/100,.01,1):.7)*f} ${f}`,x=css([{display:"inline-block",width:rs(e,`${u.componentHeights.md}`),height:rs(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),y=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:M,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${jc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),p=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(p["aria-label"]=l),jsx("span",{css:x,className:"plainframe-ui-progress-circular",...p,children:jsx("svg",{css:y,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 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(),M=useId(),x=useMemo(()=>{let D={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)?D[c]:D.md},[c,f.typography,f.radius,f.spacing]),y=f.palette??{},b=f.neutral??{},p=useMemo(()=>{let S=(v=>v==="danger"?y.danger??y.error??b:v==="warning"?y.warning??b:v==="success"?y.success??b:v==="info"?y.info??y.primary??b:b)(t),A=S?.[50]??b[50],F=S?.[300]??b[300],H=S?.[600]??S?.[500]??b[600],z=S?.[700]??H,E=S?.[800]??f.text?.primary??"#000",g=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:H,fg:g,border:void 0,iconColor:g}:n==="outlined"?{bg:A,fg:E,border:`1px solid ${F}`,iconColor:E}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:A,fg:E,border:void 0,iconColor:z}},[t,n,b,y,f.text]),d=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(to,{variant:"circular",color:p.iconColor,size:x.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):jsx(Info,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor})),[i,o,t,x.iconSize,p.iconColor]),P=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${x.paddingY} ${x.paddingX}`,gap:x.gap,borderRadius:x.radius,backgroundColor:p.bg,color:p.fg,border:p.border,fontSize:x.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[p.bg,p.border,p.fg,x.fontSize,x.gap,x.paddingX,x.paddingY,x.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:x.gap,minWidth:0,flex:1}),[x.gap]),w=useMemo(()=>[cu,{color:p.iconColor}],[p.iconColor]),I=useMemo(()=>css({display:"flex",alignItems:"center",gap:x.gap,marginLeft:x.gap,flex:"0 0 auto"}),[x.gap]),$=useMemo(()=>[uu,{color:p.fg}],[p.fg]),K=useMemo(()=>({fg:p.fg,iconColor:p.iconColor,s:x,titleId:T,descId:M}),[p.fg,p.iconColor,x,T,M]),W=fe.Children.toArray(u).some(D=>fe.isValidElement(D)&&D.type===is),k=fe.Children.toArray(u).some(D=>fe.isValidElement(D)&&D.type===ls);return jsx(Za.Provider,{value:K,children:jsxs("div",{ref:h,role:d,"aria-live":d==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":W?T:void 0,"aria-describedby":k?M:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[P,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:lu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:I,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:x.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,Zt=e=>e==null?[]:Array.isArray(e)?e:[e],Qt=(...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:M,togglePasswordVisible:x=false,showClear:y,type:b="text",step:p,focusRingMode:d="always",className:C,wrapperCss:P,inputCss:R,labelCss:w,helperRowCss:I,helperTextCss:$,startIconCss:K,endIconCss:W,css:k,onBlur:D,onFocus:S,onKeyDown:A,autoFocus:F,name:H,id:z,tabIndex:E,autoComplete:g,readOnly:v,required:B,maxLength:L,onSurfaceClick:O},_){let N=V(),U=Yo(),G=useId(),oe=useMemo(()=>{let ie={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 ie[Ee]},[m,N]),j=N.neutral,J=N.text,le=b==="number",ce=b==="password",de=n!==void 0,[Fe,Ie]=useState(o),we=de?n:Fe,Ce=useCallback(ie=>{de||Ie(ie),r?.(ie);},[de,r]),De=/^-?\d*(?:[.,]\d*)?$/,ne=le&&(p!=null&&String(p).includes(".")||/[.,]/.test(we??"")),re=le?ne?"decimal":"numeric":void 0,ue=le?ne?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ie=>{(ie===""||De.test(ie))&&Ce(ie);},[Ce]),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",Z=N.componentHeights.border,te=h==="outlined"?`${Z} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",se=Qt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?cs(u):void 0,flex:"0 0 auto",fontWeight:500}),ge=useMemo(()=>Qt({fontSize:oe.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?j[500]:J.primary,marginBottom:4,display:"inline-block"},...Zt(w)),[oe.labelFont,a,i,j,J,N.palette.danger,w]),Ne=useMemo(()=>Qt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(oe.paddingY)} ${cs(oe.paddingX)}`,background:xe,border:te,borderRadius:f?N.radius.full:N.radius.md,minHeight:oe.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Zt(P),...Zt(k)),[N,oe.minHeight,oe.paddingX,oe.paddingY,xe,te,f,i,P,k]),We=useMemo(()=>Qt({flex:1,minWidth:0,fontSize:oe.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"}},...Zt(R)),[oe.fontSize,i,j,J,a,N.palette.danger,le,xe,R]),qe=useMemo(()=>Qt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Zt(K)),[a,N.palette.danger,J.secondary,K]),Re=useMemo(()=>Qt({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},...Zt(W)),[a,N.palette.danger,J.secondary,i,W]),X$1=useMemo(()=>Qt({minHeight:16,fontSize:oe.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%"},...Zt(I)),[oe.helperFont,a,N.palette.danger,J.secondary,I]),pe=useMemo(()=>Qt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Zt($)),[$]),ae=useRef(null),me=useCallback(ie=>{ae.current=ie,_&&(typeof _=="function"?_(ie):_.current=ie);},[_]),ze=useCallback(ie=>{let Ee=ie.target.value;if(le){Y(Ee);return}L&&Ee.length>L||Ce(Ee);},[le,L,Ce,Y]),[Te,Pt]=useState(false),Ve=useCallback(()=>{i||Pt(ie=>!ie);},[i]),Ge=useCallback(()=>{i||(Ce(""),ae.current?.focus());},[i,Ce]),He=useMemo(()=>{let ie=oe.fontSize;if(typeof ie=="number")return ie;let Ee=parseFloat(String(ie));return Number.isFinite(Ee)?Ee:16},[oe.fontSize]),lt=useMemo(()=>T?jsx("span",{css:qe,children:ni(T,He)}):null,[T,qe,He]),ct=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),ut=useMemo(()=>{let ie=[];if(ce&&x){let gt=Te?jsx(Eye,{strokeWidth:2.5,size:He}):jsx(EyeOff,{strokeWidth:2.5,size:He});ie.push(jsx("button",{type:"button",css:Re,onMouseDown:Zn=>Zn.preventDefault(),onClick:Zn=>{Zn.stopPropagation(),Ve();},tabIndex:-1,"aria-label":Te?"Hide password":"Show password",disabled:i,children:gt},"pw-toggle"));}y&&we&&we.length>0&&!i&&ie.push(jsx("button",{type:"button",css:Re,onMouseDown:gt=>gt.preventDefault(),onClick:gt=>{gt.stopPropagation(),Ge();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:He})},"clear"));let Ee=M?jsx("span",{css:Re,children:ni(M,He)},"user-end"):null,rt=ie.length>0,Pe=!!Ee;return !rt&&!Pe?null:!rt&&Pe?Ee:rt&&!Pe?ie.length===1?ie[0]:jsx("span",{css:ct,children:ie}):jsxs("span",{css:ct,children:[ie,Ee]})},[ce,x,Te,He,Re,ct,i,y,we,M,Ve,Ge]),jt=c!=null?`${z??G}-help`:void 0,Jn=z??G,Je=useCallback(ie=>{if(i)return;ie.stopPropagation();let Ee=ae.current;if(!Ee)return;let rt=ie.target;if(!(Ee.contains(rt)||rt.closest("button,[role='button']"))){if(document.activeElement===Ee){ie.preventDefault();return}ie.preventDefault();}},[i]),yt=useCallback(ie=>{if(i)return;let Ee=ae.current;if(Ee&&(O?.(ie),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let rt=Ee.value?.length??0;Ee.setSelectionRange?.(rt,rt);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:se,children:[t&&jsx("label",{htmlFor:Jn,className:"plainframe-ui-textfield-label",css:ge,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:d!=="none",color:a?"danger":void 0}),Ne],onPointerDownCapture:Je,onClick:yt,"aria-invalid":!!a||void 0,children:[lt,jsx("input",{ref:me,id:Jn,className:"plainframe-ui-textfield-input",css:We,type:ce?Te?"text":"password":b==="number"?"text":b,inputMode:re,pattern:ue,value:we,maxLength:le?void 0:L,onChange:le?ie=>Y(ie.target.value):ze,placeholder:s||"",disabled:i,onBlur:D,onFocus:S,onKeyDown:A,autoFocus:F,name:H,tabIndex:E,autoComplete:g,readOnly:v,required:B,"aria-invalid":!!a||void 0,"aria-describedby":jt}),ut]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:X$1,children:jsx("span",{id:jt,className:"plainframe-ui-textfield-helper-text",css:pe,children:c})})]})}));Qo.displayName="TextField";var er=fe.createContext("ghost"),Rt=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,M]=useState(false),x=useRef(null),y=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",p=s?void 0:css({background:b,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":y,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"}}),d=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:M}),[T]),P=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(S=>Array.from(S.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(A=>{if(A.closest('[role="menu"]')!==S)return false;let F=window.getComputedStyle(A);return F.display!=="none"&&F.visibility!=="hidden"}),[]),w=useCallback(S=>{S.removeAttribute("data-keyboard-nav"),S.querySelectorAll("[data-highlighted]").forEach(A=>A.removeAttribute("data-highlighted")),M(false);},[]),I=useRef(false),$=useCallback(S=>{if(S.target!==S.currentTarget)return;if(I.current){I.current=false;return}let A=S.currentTarget,F=R(A);F.length>0&&(M(true),A.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),F[0].setAttribute("data-highlighted",""),F[0].focus({preventScroll:true}));},[R]),K=useCallback(S=>{let A=S.currentTarget,F=R(A);if(F.length===0)return;if(S.key==="Tab"){I.current=true,A.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),M(false),A.tabIndex=-1,requestAnimationFrame(()=>{A.tabIndex=0,I.current=false;});return}let H=A.querySelector("[data-highlighted]"),z=A.querySelector("[data-hovered]"),E=H||z,g=E?F.indexOf(E):-1;if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),M(true),A.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(L=>L.removeAttribute("data-hovered")),g===-1&&(g=S.key==="ArrowDown"?-1:F.length);let v=S.key==="ArrowDown"?1:-1,B=(g+v+F.length)%F.length;F[B].setAttribute("data-highlighted",""),F[B].focus({preventScroll:true});return}if(S.key==="Home"){S.preventDefault(),S.stopPropagation(),M(true),A.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),F[0].setAttribute("data-highlighted",""),F[0].focus({preventScroll:true});return}if(S.key==="End"){S.preventDefault(),S.stopPropagation(),M(true),A.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),F[F.length-1].setAttribute("data-highlighted",""),F[F.length-1].focus({preventScroll:true});return}if(S.key==="Escape"){S.preventDefault(),A.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),M(false),A.blur();return}},[R]),W=useCallback(S=>{let A=S.currentTarget;A.hasAttribute("data-keyboard-nav")&&w(A);},[w]),k=useCallback(S=>{let A=S.currentTarget;A.hasAttribute("data-keyboard-nav")&&w(A);},[w]),D=useCallback(S=>{x.current=S,typeof h=="function"?h(S):h&&(h.current=S);},[h]);return jsx(no.Provider,{value:C,children:jsx(oo.Provider,{value:P,children:jsx(Rt.Provider,{value:d,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:D,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[p,c],onFocus:$,onKeyDown:K,onPointerMove:W,onPointerDown:k,...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 ao=(...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=x=>{e===void 0&&i(x),n?.(x);},m=useRef(null),h=useRef(null),f=(x=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),x);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Ou(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let x=y=>{if(y.key!=="Tab")return;let b=document.querySelector(".plainframe-ui-popover");if(!b)return;let p=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(p.length===0)return;let d=p[0],C=p[p.length-1],P=document.activeElement;y.shiftKey&&P===d?(y.preventDefault(),C.focus()):!y.shiftKey&&P===C&&(y.preventDefault(),d.focus());};return document.addEventListener("keydown",x,true),()=>document.removeEventListener("keydown",x,true)},[s,l]);let M=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ci.Provider,{value:M,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=ao(c,o,u.ref),f=a==="click"?{onClick:M=>{M.stopPropagation(),s(!r),m.onClick?.(M);}}:{onMouseEnter:M=>{l(),r||s(true),m.onMouseEnter?.(M);},onMouseLeave:M=>{i(),m.onMouseLeave?.(M);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let M=u.props?.css;return fe.cloneElement(u,{...f,...T,ref:h,css:[M,n].filter(Boolean)})}return fe.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});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=ao(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 Ku(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:M,setOpen:x,triggerOn:y,referenceRef:b,scheduleClose:p,cancelClose:d}=or(),C=V(),P=Ku(e),{refs:R,x:w,y:I,strategy:$,context:K}=useFloating({open:M,onOpenChange:x,whileElementsMounted:autoUpdate,placement:P,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(K,{outsidePressEvent:"pointerdown",escapeKey:true}),k=useRole(K,{role:"dialog"}),{getFloatingProps:D}=useInteractions([W,k]),[S]=K.placement.split("-"),A=S,F=`${A==="left"?"right":A==="right"?"left":"center"} ${A==="top"?"bottom":A==="bottom"?"top":"center"}`,H=8,z=A==="top"?{y:H}:A==="bottom"?{y:-H}:A==="left"?{x:H}:{x:-H},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,B=`${C.componentHeights.border} solid ${C.surface.border}`,L=tr(i,C.spacing),O=tr(l,C.spacing),_=tr(u,C.spacing),N={};L&&(N.padding=L),O&&(N.paddingInline=O),_&&(N.paddingBlock=_);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)",oe=css({position:$,top:I??0,left:w??0,zIndex:1e3,transformOrigin:F,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(a)??"fit-content",height:ds(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),j=r?css({}):css({background:g,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=y==="hover"?{onMouseEnter:d,onMouseLeave:()=>p()}:{},le=ao(R.setFloating,T),ce=jsx(motion.div,{className:"plainframe-ui-popover",...D({...f,ref:le,...J}),...E,css:[oe,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:M?ce:null})})});pi.displayName="PopoverContent";var _u=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=fe.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),M=ye(),x={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},y={slideMs:250,pressMs:150,easing:"ease"},b=t!==void 0,[p,d]=useState(n),C=b?!!t:p,[P,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),y.pressMs);return ()=>clearTimeout(O)},[C,r]);let w=["sm","md","lg"].includes(s)?s:"md",I=x[w],$=`${y.slideMs}ms ${y.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],k=C?K:W,D=C?T.text.onColors.primary:"#ffffff",{trackW:S,trackH:A,thumb:F}=I,H=(A-F)/2,z=css({display:"inline-flex",alignItems:"center",gap:I.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),E=css({position:"relative",width:S,height:A,backgroundColor:k,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:H,left:C?S-F-H:H,width:F,height:F,backgroundColor:D,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:P?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),B=()=>{if(r)return;let O=!C;b||d(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:B,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,M({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[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:M,...x},y)=>{let b=V(),p=ye(),d=typeof e=="boolean",[C,P]=useState(t),R=d?e:C,w=r==="sm"||r==="lg"?r:"md",I=useMemo(()=>Ju(b,w),[b,w]),{checkedBg:$,checkColor:K,borderCol:W,hoverBg:k,gapPx:D}=useMemo(()=>{let O=b.palette||{},_=b.neutral||{},N=b.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||_,G=l):(U=O.primary||_,G="primary");let oe=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 I.gap=="number"?I.gap+2:I.gap;return {checkedBg:oe,checkColor:j,borderCol:b.surface.border,hoverBg:b.surface.panelHover,gapPx:J}},[I.gap,l,b]),S=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:D,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:k},"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,D,k,s,b.radius.sm,b.spacing.xs]),A=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),F=useMemo(()=>css({width:I.box,height:I.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${I.borderWidth} solid ${W}`,outlineOffset:`-${I.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?b.radius.full:I.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"}),[I.box,I.borderRadius,I.borderWidth,W,c,b.radius.full]),H=useMemo(()=>({w:Math.round(I.box*I.iconRatioW),h:Math.round(I.box*I.iconRatioH)}),[I.box,I.iconRatioH,I.iconRatioW]),z=useMemo(()=>css({width:H.w,height:H.h,transition:"opacity .14s ease, transform .14s ease",color:K,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[K,H.h,H.w]),E=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),g=useMemo(()=>css({fontSize:I.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:b.text.primary}),[I.labelFont,b.text.primary]),v=useMemo(()=>css({fontSize:I.labelFont,lineHeight:1.25,color:b.text.secondary,fontWeight:400,marginTop:s&&a?b.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[I.labelFont,a,s,b.spacing.xs,b.text.secondary]),B=useCallback(()=>{o||(d?n?.(!R):P(O=>{let _=!O;return n?.(_),_}));},[o,d,R,n]),L=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),B());},[o,B]);return jsxs("label",{ref:y,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",M||""].join(" ").trim(),css:[S,p({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:L,children:[jsx("input",{type:"checkbox",checked:R,onChange:B,disabled:o,css:A,...x,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[F,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:K,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(bn),td=()=>useContext(oo),nd=()=>useContext(cr),fn=null,hi=(e,t=35)=>{fn!==null&&window.clearTimeout(fn),fn=window.setTimeout(()=>{e(),fn=null;},t);},io=()=>{fn!==null&&(window.clearTimeout(fn),fn=null);},Ht=fe.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:M,...x},y){let b=ed(),p=nd(),d=lr(),C=co(),P=td(),R=V(),I=!!useContext(Rt),$=x["data-subtrigger"]!==void 0,K=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,k=typeof o=="number"?o:o===false?0:0,D=useContext(er),S=D==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],A=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:k>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${k}))`:R.spacing.md,minHeight:I?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]:S},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:S},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:S},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:S},"[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,I,k,t,n,S]),F=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),H=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),E=[];I&&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&&!$&&p?.closeAll();},v=(L,O)=>{let _=L.closest('[role="menu"]');if(!_)return;let N=Array.from(_.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(J=>{if(J.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(J);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(L),G=U>=0?U:0,oe=O(N.length,G),j=N[oe];j&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),b&&T!=null&&b.setActiveIndex(oe));},B=t?-1:P?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:B,ref:L=>{if(b&&!M){let O=b.listRef.current;L&&(T!=null?O[T]=L:O.includes(L)||O.push(L));}typeof y=="function"?y(L):y&&"current"in y&&(y.current=L);},onMouseMove:L=>{if(L.currentTarget.hasAttribute("data-hovered"))return;let O=!!L.currentTarget.closest("[data-submenu-content]");!$&&d&&!O&&hi(d.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),L.currentTarget.setAttribute("data-hovered","");let _=L.currentTarget.closest("[data-menu-id]")||L.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&b&&T!=null&&b.setActiveIndex(T),!t&&!P?.allItemsTabbable&&L.currentTarget.focus({preventScroll:true});},onMouseEnter:L=>{if($)io();else {let N=!!L.currentTarget.closest("[data-submenu-content]");d&&!N&&hi(d.closeAllSubMenus);}L.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),L.currentTarget.setAttribute("data-hovered","");let _=L.currentTarget.closest("[data-menu-id]")||L.currentTarget.closest('[role="menu"]');!t&&b&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),b.setActiveIndex(T)),!t&&!P?.allItemsTabbable&&L.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{b&&b.setActiveIndex(null);},onKeyDown:L=>{if(t)return;let O=L.currentTarget;if(L.key==="Tab"&&b&&!P?.allItemsTabbable){L.preventDefault();return}if(L.key==="Tab"&&!b){let _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(L.key==="Enter"||L.key===" "||L.key==="ArrowRight"){$||L.key!=="ArrowRight"&&(L.preventDefault(),L.stopPropagation(),g());return}if(L.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){L.preventDefault(),L.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let oe=U.closest("[data-menu-id]");oe&&oe.setAttribute("data-keyboard-nav","");}return}if(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),p?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(L.key==="ArrowDown"){L.preventDefault(),L.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(L.key==="ArrowUp"){L.preventDefault(),L.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(L.key==="Home"){L.preventDefault(),L.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(L.key==="End"){L.preventDefault(),L.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[A,...E,i].flat()),...x,onClick:L=>{t||(L.currentTarget.removeAttribute("data-highlighted"),g());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:F,children:l}),a,(f!=null||K||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:H,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:R.typography.sizes.sm,color:R.text.secondary,whiteSpace:"nowrap"}),children:f}):null,K,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,M=f.some(x=>Object.is(x,h))?f.filter(x=>!Object.is(x,h)):[...f,h];a||s(M),l.current?.(M);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(xi.Provider,{value:m,children:o})},lo=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),M=!!T&&r!==void 0,x=!M&&t!==void 0,[y,b]=useState(()=>M?T.values.some(W=>Object.is(W,r)):!!n),p=M?T.values.some(W=>Object.is(W,r)):x?!!t:y,d=V(),P=!!useContext(Rt),R=()=>{if(!c)if(M)T.toggle(r);else {let W=!p;x||b(W),o?.(W);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:P?-1:-3,borderRadius:d.radius.xs,transition:"background-color .12s ease"}),I=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(k=>{k.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(k=>{k.tabIndex=-1;}));},[]),K=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:p,css:I})}),u]});return jsx(Ht,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":p,closeOnSelect:false,onSelect:R,disabled:c,startIcon:K,endIcon:m,css:i,selected:false,children:s})});lo.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,[M,x]=useState(!!n),y=T?!!t:M,p=!!useContext(Rt),d=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:p?2:void 0}),P=()=>{if(a)return;let w=!y;T||x(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:P,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:d,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(gs,{checked:y,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})]})}),gn=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(Rt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,M=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),y=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(M,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:y,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:x,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:b,children:a})]})});gn.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 ys=ao,uo=0,ur=null,dr=null,hd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function yd(){if(!(typeof document>"u")){if(uo===0){let e=document.body;ur=e.style.overflow||"",dr=e.style.paddingRight||"";let t=hd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}uo+=1;}}function xd(){if(!(typeof document>"u")&&(uo>0&&(uo-=1),uo===0)){let e=document.body;ur!==null&&(e.style.overflow=ur),dr!==null&&(e.style.paddingRight=dr),ur=null,dr=null;}}var bn=createContext(null),pr=()=>{let e=useContext(bn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),vd=()=>useContext(mo),no=createContext(null),co=()=>useContext(no),wi=createContext(null),lr=()=>useContext(wi),Ei=createContext(false),Cd=()=>useContext(Ei),po=createContext(null),oo=createContext({allItemsTabbable:true}),cr=fe.createContext(null),xs=()=>useContext(cr);function Rd(){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 Td=()=>vd()?.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(S=>{e===void 0&&i(S),n?.(S);},[e,n]),m=V(),h=useRef(`pfui-menu-${++Si}`),f=useRef(null),T=useRef([]),M=useRef(null),[x,y]=useState(null),[b,p]=useState(false);useEffect(()=>{l||(y(null),T.current=[],p(false));},[l]);let d=useRef(null),C=useCallback((S,A)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let F=A??20;d.current=window.setTimeout(()=>u(S),F);},[o,u]),P=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>P(),[P]),useEffect(()=>{if(!(!r||!l))return yd(),()=>xd()},[l,r]);let R=xs(),[w]=useState(()=>R??Rd()),I=useRef(new Set),$=useMemo(()=>({registerSubMenu:S=>(I.current.add(S),()=>I.current.delete(S)),closeAllSubMenus:()=>{I.current.forEach(S=>S());}}),[]),K=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:f,listRef:T,floatingRef:M,setActiveIndex:y,scheduleSubmenuHover:C,clearSubmenuHover:P,menuId:h.current}),[l,u,o,y,C,P]),W=useMemo(()=>({activeIndex:x,setActiveIndex:y}),[x,y]),k=useMemo(()=>({isKeyboardNav:b,setIsKeyboardNav:p}),[b]),D=s==="sm";return jsx(po.Provider,{value:m,children:jsx(cr.Provider,{value:w,children:jsx(Rt.Provider,{value:D,children:jsx(no.Provider,{value:k,children:jsx(wi.Provider,{value:$,children:jsx(mo.Provider,{value:W,children:jsx(bn.Provider,{value:K,children:a})})})})})})})};Ln.displayName="DropdownMenu";var Bn=fe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:M,menuId:x}=pr(),y=co(),b=lr(),p=!!e&&isValidElement(t),d=p?t:null,C=d&&d.props&&typeof d.props=="object"&&"onKeyDown"in d.props?d.props.onKeyDown:void 0,P=d&&d.props&&typeof d.props=="object"&&"onClick"in d.props?d.props.onClick:void 0,{onKeyDown:R,onClick:w,...I}=s,$=useMemo(()=>ys(a,p&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,p,t,u]),K=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(F=>{let H=K();requestAnimationFrame(()=>H[F]?.focus());},[K]),k=useCallback(F=>{if(F.key==="Tab"&&c){F.preventDefault(),y?.setIsKeyboardNav(true);let H=M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=H.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');z&&(document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(F.key==="ArrowRight"&&c){let H=document.querySelector("[data-subtrigger][data-hovered]");if(H){F.preventDefault(),F.stopPropagation(),y?.setIsKeyboardNav(true),H.removeAttribute("data-hovered"),H.setAttribute("data-highlighted",""),H.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});H.dispatchEvent(z);});return}}if(F.key==="ArrowDown"||F.key==="ArrowUp"){if(y?.setIsKeyboardNav(true),!c){F.preventDefault(),i(true),requestAnimationFrame(()=>{let H=x?document.querySelector(`[data-menu-id="${x}"]`):M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=Array.from(H.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(E=>{let g=E.closest("[data-submenu-content]");if(g&&g!==H)return false;let v=window.getComputedStyle(E);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let E=F.key==="ArrowDown"?0:z.length-1;h(E),z[E]?.setAttribute("data-highlighted",""),z[E]?.focus();}}}),C?.(F),R?.(F);return}if(c){F.preventDefault();let H=document.querySelectorAll("[data-hovered]");for(let E of Array.from(H))if(E.closest("[data-submenu-content]")){let v=E.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 _=window.getComputedStyle(O);return _.display!=="none"&&_.visibility!=="hidden"}),L=B.indexOf(E);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),E.removeAttribute("data-hovered"),L!==-1&&B.length>0){let O=F.key==="ArrowDown"?1:-1,_=(L+O+B.length)%B.length;B[_]?.setAttribute("data-highlighted",""),B[_]?.focus();}return}}let z=x?document.querySelector(`[data-menu-id="${x}"]`):M?.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]"),B=-1;g?B=E.indexOf(g):v&&(B=E.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),B===-1&&(B=F.key==="ArrowDown"?-1:E.length);let L=F.key==="ArrowDown"?1:-1,O=(B+L+E.length)%E.length;h(O),E[O]?.setAttribute("data-highlighted",""),E[O]?.focus();}}C?.(F),R?.(F);return}}if((F.key==="Enter"||F.key===" ")&&!c){F.preventDefault(),y?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let H=x?document.querySelector(`[data-menu-id="${x}"]`):M?.current;if(H){H.setAttribute("data-keyboard-nav","");let z=Array.from(H.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(E=>{let g=E.closest("[data-submenu-content]");if(g&&g!==H)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?.(F),R?.(F);return}C?.(F),R?.(F);},[c,i,h,C,R,K,W,m,y,x,M,b]),D=useCallback(F=>{l==="click"&&((F.nativeEvent.composedPath?.()??[]).some(g=>{let v=g;if(!v||!("tagName"in v))return false;let B=String(v.tagName).toUpperCase();if(B==="INPUT"||B==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let L="getAttribute"in v?v.getAttribute("role"):null;return L==="textbox"||L==="combobox"})||(F.stopPropagation(),i(!c))),P?.(F),w?.(F);},[l,c,i,P,w]),S=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},A=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(p&&d){let F=d.props,H=F.css,z=typeof F.className=="string"?F.className:void 0,E=typeof F.tabIndex=="number"?F.tabIndex:0,g={ref:$,tabIndex:E,className:[z,o].filter(Boolean).join(" ")||void 0,css:[H,A,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:D,onKeyDown:k,...S,...I};return cloneElement(d,g)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),A,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:D,onKeyDown:k,...S,...I,children:t})});Bn.displayName="DropdownMenuTrigger";var xn=fe.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:M,exitPlacement:x,animateOnBusClose:y=true,gap:b,ignoreOutsidePressRefs:p,disableOutsidePressDismiss:d=false,returnFocus:C=false,...P},R)=>{let{open:w,setOpen:I,referenceRef:$,clearSubmenuHover:K,setActiveIndex:W,floatingRef:k,menuId:D}=pr(),S=useContext(po),A=V(),F=S??A,H=xs(),z=co();useEffect(()=>{if(!H)return;let X=H.registerCloser(()=>I(false));return ()=>{X&&X();}},[H,I]);let E=typeof o=="string"?parseFloat(o):o,g=typeof r=="string"?parseFloat(r):r,v=typeof s=="string"?parseFloat(s):s,B=`${t}${n==="center"?"":`-${n}`}`,L=useCallback(X=>({getBoundingClientRect:()=>{let pe=Math.round(X.x),ae=Math.round(X.y);return {x:pe,y:ae,left:pe,top:ae,right:pe,bottom:ae,width:0,height:0,toJSON:()=>({x:pe,y:ae,left:pe,top:ae,right:pe,bottom:ae,width:0,height:0})}},contextElement:void 0}),[]),O=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 L({x:X.x,y:X.y})},[e,L]),{refs:_,x:N,y:U,strategy:G,context:oe,update:j}=useFloating({open:w,onOpenChange:I,placement:B,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:E??0,crossAxis:g??0}),flip({padding:v??8}),shift({padding:v??8}),size({apply({rects:X,elements:pe}){let ae=pe.floating;ae.style.boxSizing="border-box",i!=null?ae.style.height=typeof i=="number"?`${i}px`:String(i):ae.style.removeProperty("height"),c!=null?ae.style.width=typeof c=="number"?`${c}px`:String(c):a?ae.style.width=`${Math.round(X.reference.width)}px`:ae.style.width="200px",l!=null?ae.style.maxHeight=typeof l=="number"?`${l}px`:String(l):ae.style.removeProperty("max-height");}})]});useEffect(()=>{O?_.setReference(O):$.current&&_.setReference($.current);},[_,O,$]),useEffect(()=>{if(!w)return;let X=O||$.current,pe=_.floating.current;if(!(!X||!pe))return autoUpdate(X,pe,j)},[w,O,$,_,j]),useEffect(()=>{j();},[j,a,c,i,l]),useEffect(()=>{w&&!h&&W(0);},[w,h,W]),useEffect(()=>{if(!m||!w)return;let X=()=>{let pe=document.activeElement,ae=$.current,me=_.floating.current;pe&&(ae?.contains(pe)||me?.contains(pe)||I(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,w,I,$,_.floating]);let J=useDismiss(oe,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:d?false:X=>{if(p?.length){let pe=X.target;for(let ae of p)if(ae.current?.contains(pe))return false}return true}}),le=useRole(oe,{role:"menu"}),{getFloatingProps:ce}=useInteractions([J,le]),de=useRef(false);useEffect(()=>{w?de.current=true:de.current&&$.current&&C&&(H?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[w,$,H,C]),useEffect(()=>{if(!w)return;let X=()=>{let me=k?.current;if(!me)return false;let ze=$.current;if(!ze)return false;let Te=ze.closest("[data-pfui-portal-owner]");if(Te){let Ge=Te.getAttribute("data-pfui-portal-owner");if(!Ge)return false;if(me.getAttribute("data-pfui-portal-owner")===Ge)return true;me.setAttribute("data-pfui-portal-owner",Ge);let He=Te.getAttribute("data-pfui-mode"),lt=Te.getAttribute("data-pfui-primary");He&&me.setAttribute("data-pfui-mode",He),lt&&me.setAttribute("data-pfui-primary",lt);for(let ct=0;ct<Te.style.length;ct++){let ut=Te.style[ct];ut.startsWith("--pf-")&&me.style.setProperty(ut,Te.style.getPropertyValue(ut));}return me.classList.remove("pf-light","pf-dark"),Te.classList.contains("pf-light")&&me.classList.add("pf-light"),Te.classList.contains("pf-dark")&&me.classList.add("pf-dark"),true}let Pt=ze.closest('[data-floating-ui-portal="true"]');if(Pt&&!Pt.hasAttribute("data-pfui-portal-owner"))return false;let Ve=ze.closest("[data-pfui-scope]");if(Ve){let Ge=Ve.getAttribute("data-pfui-scope");if(!Ge)return false;let He=document.querySelector(`[data-pfui-portal-owner="${Ge}"]`);if(He&&He!==me){me.setAttribute("data-pfui-portal-owner",Ge);let lt=He.getAttribute("data-pfui-mode"),ct=He.getAttribute("data-pfui-primary");lt&&me.setAttribute("data-pfui-mode",lt),ct&&me.setAttribute("data-pfui-primary",ct);for(let ut=0;ut<He.style.length;ut++){let jt=He.style[ut];jt.startsWith("--pf-")&&me.style.setProperty(jt,He.style.getPropertyValue(jt));}return me.classList.remove("pf-light","pf-dark"),He.classList.contains("pf-light")&&me.classList.add("pf-light"),He.classList.contains("pf-dark")&&me.classList.add("pf-dark"),true}}return false},pe=[0,5,15,30,60,100,150,250],ae=[];return pe.forEach(me=>{ae.push(window.setTimeout(()=>{X();},me));}),()=>{ae.forEach(me=>window.clearTimeout(me));}},[w,$,k]);let Fe=typeof F.spacing.xs=="number"?`${F.spacing.xs}px`:String(F.spacing.xs),Ie=b===void 0?void 0:typeof b=="number"?b:F.spacing[b]??b,we=u?void 0:css({boxSizing:"border-box",background:F.surface.panelBg,border:`${F.componentHeights.border} solid ${F.surface.border}`,borderRadius:F.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":Fe,padding:"var(--pfui-panel-pad)",color:F.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:Ie,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,De=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let ae=X.type?.displayName;if(ae==="DropdownMenu"||ae==="DropdownMenuSub")return X;if(ae==="MenuItem"||ae==="MenuCheckboxItem"||ae==="MenuRadioItem"||ae==="MenuSwitchItem")return Ce+=1,cloneElement(X,{__index:Ce,key:X.key??Ce});if(ae==="DropdownMenuTrigger"){let ze=X.props.children;return cloneElement(X,{children:fe.Children.map(ze,De)})}if(ae==="DropdownMenuSubTrigger"){Ce+=1;let ze=Ce;return cloneElement(X,{__index:ze,key:X.key??ze})}let me=X.props.children;return me==null?X:cloneElement(X,{children:fe.Children.map(me,De)})},ne=fe.Children.map(M,De),ue=oe.placement.split("-")[0]||"bottom",Y=ue==="bottom"?"center top":ue==="top"?"center bottom":ue==="left"?"right center":"left center",xe=ue==="bottom"?{opacity:0,y:-8,scale:.96}:ue==="top"?{opacity:0,y:8,scale:.96}:ue==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Z=x??ue,te=Z==="bottom"?{opacity:0,y:-8,scale:.96}:Z==="top"?{opacity:0,y:8,scale:.96}:Z==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ge=!!H?.isBusClosingRef.current&&!y?{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"}},Ne=css({position:G,top:U??0,left:N??0,zIndex:1e3,transformOrigin:Y}),We=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),z?.setIsKeyboardNav(true);let pe=X.currentTarget;pe.setAttribute("data-keyboard-nav","");let ae=Array.from(pe.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(me=>{if(me.closest('[role="menu"]')!==pe)return false;let ze=window.getComputedStyle(me);return ze.display!=="none"&&ze.visibility!=="hidden"});if(ae.length>0){let me=pe.querySelector("[data-highlighted]"),ze=pe.querySelector("[data-hovered]"),Te=-1;me?Te=ae.indexOf(me):ze&&(Te=ae.indexOf(ze)),document.querySelectorAll("[data-highlighted]").forEach(Ge=>Ge.removeAttribute("data-highlighted")),ze&&ze.removeAttribute("data-hovered"),Te===-1&&(Te=X.key==="ArrowDown"?-1:ae.length);let Pt=X.key==="ArrowDown"?1:-1,Ve=(Te+Pt+ae.length)%ae.length;W(Ve),ae[Ve]?.setAttribute("data-highlighted",""),ae[Ve]?.focus();}}},[z,W]),qe=useCallback(X=>{let pe=X.currentTarget;pe.removeAttribute("data-keyboard-nav"),pe.querySelectorAll("[data-highlighted]").forEach(ae=>ae.removeAttribute("data-highlighted")),z?.isKeyboardNav&&z.setIsKeyboardNav(false);},[z]),Re=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(pe=>pe.removeAttribute("data-highlighted")),z?.isKeyboardNav&&z.setIsKeyboardNav(false);},[z]);return jsx(FloatingPortal,{children:jsx(po.Provider,{value:F,children:jsx(AnimatePresence,{children:w?jsx(oo.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...ce({...P,ref:ys(R,_.setFloating,X=>{k&&(k.current=X);})}),"data-menu-id":D,"data-keyboard-nav":z?.isKeyboardNav?"":void 0,className:f,css:[we,Ne,T],initial:xe,animate:{opacity:1,x:0,y:0,scale:1},exit:te,transition:ge,onPointerMove:X=>Re(X.currentTarget),onPointerDown:X=>Re(X.currentTarget),onKeyDown:We,onMouseMove:qe,onMouseEnter:()=>{K(),H?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:ne})}):null})})})});xn.displayName="DropdownMenuContent";var Ii=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Cd(),c=useContext(po),i=V(),l=c??i,[u,m]=useState(!!t),h=e??u,f=useCallback(A=>{e===void 0&&m(A),n?.(A);},[e,n]),T=useRef(null),M=useRef(false),x=useCallback((A,F)=>{if(o!=="hover")return;window.clearTimeout(T.current??0),M.current=A;let H=F??20;T.current=window.setTimeout(()=>{M.current=false,f(A);},H);},[o,f]),y=useCallback(()=>{T.current&&(window.clearTimeout(T.current),T.current=null,M.current=false);},[]);useEffect(()=>()=>y(),[y]);let b=lr();useEffect(()=>{if(!b)return;let A=()=>{y(),f(false);};return b.registerSubMenu(A)},[b,f,y]);let p=useRef(`pfui-submenu-${++Si}`),d=useRef(null),C=useRef([]),P=useRef(null),[R,w]=useState(null),[I,$]=useState(false);useEffect(()=>{h||(w(null),C.current=[],$(false));},[h]);let K=useContext(Rt),W=r??K,k=useMemo(()=>({open:h,setOpen:f,trigger:o,referenceRef:d,listRef:C,floatingRef:P,setActiveIndex:w,scheduleSubmenuHover:x,clearSubmenuHover:y,pendingOpenRef:M,menuId:p.current}),[h,f,o,w,x,y]),D=useMemo(()=>({activeIndex:R,setActiveIndex:w}),[R,w]),S=useMemo(()=>({isKeyboardNav:I,setIsKeyboardNav:$}),[I]);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,A=>{if(!isValidElement(A))return A;let F=A.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:A})})):jsx(po.Provider,{value:l,children:jsx(Ei.Provider,{value:true,children:jsx(Rt.Provider,{value:W,children:jsx(mo.Provider,{value:D,children:jsx(no.Provider,{value:S,children:jsx(bn.Provider,{value:k,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(),M=co(),x=useCallback(k=>{k&&(k.__pfuiCloseSubmenu=()=>i(false));},[i]),y=!!e&&isValidElement(t),b=y?t:null,p=b?.props,d=p?.onKeyDown,C=p?.onClick,{onKeyDown:P,onClick:R,...w}=s,I=useMemo(()=>ys(a,y&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,x),[a,y,t,u,x]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(k=>{if(k.key==="Tab"){k.preventDefault();return}let D=k.currentTarget,S=A=>{M?.setIsKeyboardNav(true);let F=D.closest("[data-menu-id]");if(!F)return;F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let H=Array.from(F.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==F)return false;let B=window.getComputedStyle(v);return B.display!=="none"&&B.visibility!=="hidden"});if(!H.length)return;let z=H.indexOf(D),E=z>=0?z:0,g=A==="next"?(E+1)%H.length:(E-1+H.length)%H.length;H[g]?.setAttribute("data-highlighted",""),H[g]?.focus();};if(k.key==="ArrowDown"){k.preventDefault(),k.stopPropagation(),c&&i(false),S("next");return}if(k.key==="ArrowUp"){k.preventDefault(),k.stopPropagation(),c&&i(false),S("prev");return}if(k.key==="ArrowRight"||k.key==="Enter"||k.key===" "){k.preventDefault(),k.stopPropagation(),M?.setIsKeyboardNav(true);let A=k.currentTarget;i(true),requestAnimationFrame(()=>{let F=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(F){F.setAttribute("data-keyboard-nav",""),A.removeAttribute("data-highlighted"),A.removeAttribute("data-hovered");let H=F.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');H&&(H.setAttribute("data-highlighted",""),H.focus());}});return}if(k.key==="ArrowLeft"){k.preventDefault(),k.stopPropagation(),c&&i(false);let A=D.closest("[data-menu-id]");A&&A.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(F=>F.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(F=>F.removeAttribute("data-hovered")),D.setAttribute("data-highlighted",""),D.focus(),M&&M.setIsKeyboardNav(true);return}if(k.key==="Escape"){k.preventDefault(),k.stopPropagation(),d?.(k);return}d?.(k),P?.(k);},[c,i,d,P,u,M,T]),W=l==="hover"?{onMouseEnter:k=>{let D=k.currentTarget;io(),h(),document.querySelectorAll("[data-hovered]").forEach(A=>A.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(A=>A.removeAttribute("data-highlighted")),D.setAttribute("data-hovered",""),D.focus({preventScroll:true});let S=D.closest("[data-menu-id]");S?.hasAttribute("data-keyboard-nav")&&S.removeAttribute("data-keyboard-nav"),M&&M.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:k=>{let D=k.currentTarget;io(),D.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(S=>S.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),D.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:k=>{k.stopPropagation(),i(!c),C?.(k),R?.(k);}};if(y&&b){let k=p?.css,D=typeof p?.className=="string"?p.className:void 0,S=typeof p?.tabIndex=="number"?p.tabIndex:0,A={ref:I,tabIndex:S,className:[D,o].filter(Boolean).join(" ")||void 0,css:[k,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,onFocus:F=>{if(F.target.hasAttribute("data-highlighted")){let H=F.target.closest("[data-menu-id]");H&&!H.hasAttribute("data-keyboard-nav")&&(H.setAttribute("data-keyboard-nav",""),M&&M.setIsKeyboardNav(true));}p&&"onFocus"in p&&typeof p.onFocus=="function"&&p.onFocus(F);},...W,...w};return cloneElement(b,A)}return jsx("div",{ref:I,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:K,onFocus:k=>{if(k.currentTarget.hasAttribute("data-highlighted")){let D=k.currentTarget.closest("[data-menu-id]");D&&!D.hasAttribute("data-keyboard-nav")&&(D.setAttribute("data-keyboard-nav",""),M&&M.setIsKeyboardNav(true));}},...W,...w,children:t})});ki.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(xn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),io(),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(),Sd=css({display:"inline"}),Fi=css({display:"inline",fontWeight:700}),Id=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),kd=css({display:"flex",alignItems:"center",gap:4}),Md=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"}),Ad=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Fd=()=>{},Pd=e=>e,Dd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Nd=e=>{e.preventDefault(),e.stopPropagation();},Hd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Ld=e=>{e.preventDefault(),e.stopPropagation();},Di=fe.memo(({onCapture:e})=>{let t=useContext(bn),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 y=String(e.title??e.value);return s?y:a(y)},[a,e.title,e.value,s]),M=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Md,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Pi,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Ad,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Pi,children:T}),[T,e.description,h]),x=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let y=f.some(b=>Object.is(b,e.value));return s?jsx(lo,{__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,y)},e.value):jsx(lo,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:M},e.value)}return s?jsx(Ht,{__index:t,onClick:x,onSelect:x,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:x,onSelect:x,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:M},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));vs.displayName="AutocompleteRow";var 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:M,disabled:x=false,error:y=false,showClear:b=false,open:p,onOpenChange:d,openOnFocus:C=false,openOnType:P=true,openOnClick:R=true,closeOnSelect:w=true,closeOnBlur:I=true,blurOnSelect:$=false,freeSolo:K=false,customValueLabel:W=false,maxHeight:k,maxItems:D,noResultsText:S="No Items Found",highlightTypedValue:A,typedValueHighlightCss:F,showNoResults:H=true,noResultsLabelCss:z,loadingLabelCss:E,loadItems:g,loading:v,loadingText:B="Loading\u2026",debounceMs:L=200,multiple:O=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:oe=true,expandIconCss:j,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:ce,textFieldHelperRowCss:de,textFieldHelperTextCss:Fe,textFieldStartIconCss:Ie,textFieldEndIconCss:we,menuContentCss:Ce})=>{let ne=V().text.secondary,[re,ue]=useState(""),Y=typeof p=="boolean",[xe,Z]=useState(false),te=Y?p:xe,se=useRef(null),ge=useRef(null),Ne=useRef(null),We=useRef(null),qe=useRef(false),Re=useRef(null),X=useRef(false),pe=useRef(0),ae=useMemo(()=>[ge],[]),[me,ze]=useState(N??[]),Te=_??me,Pt=useRef(Te);Pt.current=Te;let[Ve,Ge]=useState(null),He=useRef(Ve);He.current=Ve;let lt=useCallback(()=>Pt.current,[]),[ct,ut]=useState([]),[jt,Jn]=useState(false),Je=typeof g=="function",yt=Je?ct:e,ie=useRef(yt);ie.current=yt;let Ee=!!v||jt&&Je,rt=useRef(d);useEffect(()=>{rt.current=d;},[d]);let Pe=useCallback(q=>{Y||Z(q),rt.current?.(q);},[Y]),gt=useRef(null);useEffect(()=>{if(!Je)return;gt.current&&window.clearTimeout(gt.current);let q=re;return gt.current=window.setTimeout(async()=>{Jn(true);try{let ee=await g(q)||[];ut(Array.isArray(ee)?ee:[]);}catch{ut([]);}finally{Jn(false);}},Math.max(0,L)),()=>{gt.current&&window.clearTimeout(gt.current);}},[re,Je,g,L]);let Zn=useMemo(()=>{let q=mr(re);return q?yt.some(ee=>mr(ee.title??ee.value)===q):false},[yt,re]),la=K&&!!W&&re.trim().length>0&&!Zn,ic=q=>{if(typeof W=="object"){let ee=Object.prototype.hasOwnProperty.call(W,"prefix"),ve=Object.prototype.hasOwnProperty.call(W,"suffix");if(ee||ve){let ke=ee?W.prefix??"":"",be=ve?W.suffix??"":"";return `${ke}${q}${be}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Je)return yt;let q=mr(re);if(!q)return yt;let ee=[],ve=[];for(let ke of yt){let be=mr(ke.title??ke.value);be.split(" ").some(Ze=>Ze.startsWith(q))?ee.push(ke):be.includes(q)&&ve.push(ke);}return ee.length>0?ee:ve},[yt,re,Je]),ca=useMemo(()=>{if(la){let q=re.trim();return [...$r,{value:q,title:ic(q),__pfui_free__:true}]}return $r},[$r,la,re]),Ut=useMemo(()=>{let q=[],ee=new Map;for(let dt of ca){let Ze=dt.group??"__ungrouped__";ee.has(Ze)||(ee.set(Ze,[]),q.push(Ze)),ee.get(Ze).push(dt);}let ke=typeof D=="number"?Math.max(0,D):1/0,be=[];for(let dt of q){if(ke<=0)break;let ln=ee.get(dt).slice(0,ke);ln.length>0&&(be.push({label:dt==="__ungrouped__"?void 0:dt,items:ln}),ke-=ln.length);}return be},[ca,D]),Mn=useMemo(()=>Ut.reduce((q,ee)=>(q.push(...ee.items),q),[]),[Ut]),Ho=Mn.length>0,zr=!Ho&&!!H&&!Ee&&re.trim().length>0,An=Ee||Ho||zr,Lo=An||Je;useEffect(()=>{!Je&&te&&!An&&(X.current=true,Pe(false),setTimeout(()=>{X.current=false;},150));},[Je,te,An,Pe]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(K&&!O){if(Wr.current){Wr.current=false;return}let q=re.trim();if(Or.current===q)return;Or.current=q,t?.({value:q,title:q});}},[re,K,O,t]);let Kr=useCallback(q=>{let ee=ie.current,ve=new Map(ee.map(be=>[be.value,be])),ke=q.map(be=>ve.get(be)??{value:be,title:be});U?.(ke);},[U]),Bo=useCallback(q=>{let ee=q.map(String);_||ze(ee),Kr(ee);},[_,Kr]),ua=useCallback(q=>{let ve=Te.includes(q)?Te.filter(ke=>ke!==q):[...Te,q];Bo(ve);},[Te,Bo]),$o=useCallback(q=>{let ee=ie.current.find(ve=>ve.value===q)??{value:q,title:q};ee.disabled||(Wr.current=true,Or.current=(ee.title??ee.value).trim(),Ge(ee),ue(ee.title??ee.value),t?.(ee),Y||(w?(qe.current=false,X.current=true,Z(false),rt.current?.(false),setTimeout(()=>{X.current=false;},150)):qe.current=true),!w&&Ne.current?.setActiveIndex&&Ne.current.setActiveIndex(null),$?(qe.current=false,setTimeout(()=>{We.current&&se.current?(We.current.tabIndex=0,We.current.focus(),We.current.blur(),We.current.tabIndex=-1):se.current?.blur();},0)):requestAnimationFrame(()=>se.current?.focus()));},[t,Y,w,$]),lc=useCallback(q=>{if(x)return;ue(q);let ee=!q.trim();O||(ee?(Ge(null),t?.(null)):K&&Ge(null)),!Y&&!ee&&P&&!te&&Pe(true);},[O,Y,P,te,Pe,x,K,t]),st=Dd,da=Fd,cc=Pd,pa=useMemo(()=>F?[Fi,F]:Fi,[F]),uc=useCallback(q=>{let ee=re.trim();if(!ee||ee.length<1)return q;let ve=ee.toLowerCase(),be=q.toLowerCase().indexOf(ve);return be<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Sd,children:[q.slice(0,be),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:pa,children:q.slice(be,be+ee.length)}),q.slice(be+ee.length)]})},[re,pa]),zo=A?uc:cc,dc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Nd,Wo=Hd,pc=useCallback(q=>{Ne.current=q;},[]),ma=useCallback(q=>{let ee=Ne.current;if(!ee)return;let ve=Mn.length;if(ve===0)return;let ke=ge.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),be=-1;if(ke){let Ze=ke.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),ln=ke.querySelector("[data-active]")||ke.querySelector("[data-hovered]");ln&&(be=Array.from(Ze).indexOf(ln));}be<0&&typeof ee.activeIndex=="number"&&(be=ee.activeIndex);let dt=be<0?q===1?0:ve-1:(be+q+ve)%ve;ee.setActiveIndex?.(dt),requestAnimationFrame(()=>{let Ze=ge.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 _r=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[dt];_r&&(_r.setAttribute("data-active",""),_r.scrollIntoView?.({block:"nearest"}));});},[Mn.length]),mc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(x||!An&&!Je)return;q.preventDefault(),!te&&!Y&&Pe(true),ma(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(x)return;let ee=Ne.current&&typeof Ne.current.activeIndex=="number"?Ne.current.activeIndex:-1,ve=ee>=0&&ee<Mn.length?Mn[ee]:null;if(te&&ve&&ee>=0){q.preventDefault(),q.stopPropagation(),O?(ua(ve.value),w||requestAnimationFrame(()=>se.current?.focus())):$o(ve.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),te&&!Y&&(X.current=true,Pe(false),q.target.focus(),setTimeout(()=>{X.current=false;},150))):q.key==="Tab"&&te&&!Y&&Pe(false);},[An,Je,te,Y,Mn,O,w,ma,ua,$o,Pe,x]),fc=useCallback(()=>{x||X.current||C&&Lo&&(pe.current=Date.now(),Y||Pe(true));},[Y,C,Lo,Pe,x]),gc=useCallback(()=>{if(qe.current){qe.current=false;return}I&&Pe(false),!K&&!O&&(Ve?ue(Ve.title??Ve.value):re.trim()&&ue(""));},[I,K,O,Ve,re,Pe]),fa=useCallback(()=>{let q=[],ee=0;return Ut.forEach((ve,ke)=>{ve.label&&q.push(jsx(gn,{className:st("group-label"),children:ve.label},`g-${ke}`)),ve.items.forEach(be=>{q.push(jsx(vs,{item:be,absIndex:ee,multiple:true,getCurrentMulti:lt,isSelected:false,renderItem:s,paint:zo,cls:st,closeOnSelect:false,pickSingle:da,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:ne},`${be.group??"__"}|${be.value}`)),ee+=1;});}),jsx(hs,{values:Te,onValuesChange:Bo,children:q},"multi-group")},[Ut,st,lt,s,zo,Te,Bo,da,Wo,Oo,ne]),ga=useCallback(()=>{let q=[],ee=0;return Ut.forEach((ve,ke)=>{ve.label&&q.push(jsx(gn,{className:st("group-label"),children:ve.label},`g-${ke}`)),ve.items.forEach(be=>{let dt=Ve?.value===be.value;q.push(jsx(vs,{item:be,absIndex:ee,multiple:false,getCurrentMulti:lt,isSelected:dt,renderItem:s,paint:zo,cls:st,closeOnSelect:w,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:ne},`${be.group??"__"}|${be.value}`)),ee+=1;});}),q},[Ut,st,Ve,lt,s,zo,w,$o,Wo,Oo,ne]),bc=useMemo(()=>Ee?jsx(gn,{css:E,className:st("label-loading"),children:B},"loading"):zr?jsx(gn,{css:z,className:st("label-empty"),children:S},"empty"):Ut.length===0?null:O?fa():ga(),[Ee,zr,Ut.length,st,B,S,O,fa,ga]),an=te?false:x||!Je&&!Ho&&!H,ba=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(an||x)&&(Y||(te?(X.current=true,Pe(false),queueMicrotask(()=>se.current?.focus()),setTimeout(()=>{X.current=false;},150)):(Pe(true),queueMicrotask(()=>se.current?.focus()))));},[te,Ho,Je,Pe,an,x,Y]),ha=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:te?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:an?"not-allowed":"pointer",userSelect:"none",opacity:an?.5:1}),[te,an]),Ko=useMemo(()=>oe?jsx("span",{ref:Re,role:"button",tabIndex:-1,css:[ha,j],"aria-disabled":an||void 0,onMouseDown:Ld,onClick:ba,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[oe,ha,j,an,ba,G]),hc=useMemo(()=>T&&Ko?jsxs("span",{css:kd,children:[T,Ko]}):T??Ko,[T,Ko]),yc=useCallback(q=>{if(!(Re.current&&Re.current.contains(q.target)||X.current||x||Date.now()-pe.current<300)){if(te){!re.trim()&&!Y&&(X.current=true,Pe(false),setTimeout(()=>{X.current=false;},150));return}R&&Lo&&(!Y||R)&&Pe(true);}},[te,re,R,Lo,Pe,x,Y]);return jsx("div",{ref:ge,className:st(""),css:[dc,l,c],children:jsxs(Ln,{open:x?false:te,onOpenChange:x?void 0:Pe,children:[jsx(Di,{onCapture:pc}),jsx(Bn,{asChild:true,children:jsx("span",{className:st("anchor"),css:Id,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:se,className:st("input"),focusRingMode:a,value:re,onChange:lc,onKeyDown:mc,onFocus:fc,onBlur:gc,onSurfaceClick:yc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:hc,size:M,width:n,fullWidth:o,disabled:x,error:y,showClear:b,css:i,wrapperCss:J,inputCss:le,labelCss:ce,helperRowCss:de,helperTextCss:Fe,startIconCss:Ie,endIconCss:we}),jsx("span",{ref:We,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(xn,{className:st("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof k=="number"?`${k}px`:k,css:Ce,ignoreOutsidePressRefs:ae,disableOutsidePressDismiss:Y,returnFocus:!$,children:bc})]})})});Ni.displayName="Autocomplete";var Wd=["sm","md","lg"],Kd=(e,t)=>typeof e=="number"?e:Wd.includes(e)?t.componentHeights[e]:t.componentHeights.md,_d=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},Vd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},jd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),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,M=T?Math.round(T*(T<=28?.55:.52)):void 0,x=r?u.radius.full:u.radius.md,y=_d(u,o),b=Vd(u,o),p=jd(c,t),d=css({width:f,height:f,borderRadius:x,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":y,color:m?"inherit":b,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),P=css({fontSize:M,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[d,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:p})})}));Hi.displayName="Avatar";var Li=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Xd=({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=ye(),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),M=typeof t=="number"&&t>=0,x=M&&T.length>t?T.slice(0,t):T,y=M&&T.length>t?T.length-t:0,b=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,p=Li(i)??"4px",d=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:x.length-R,boxShadow:`0 0 0 ${p} ${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"}),P=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[d,r,m()],children:[x.map((R,w)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:jsx("span",{css:P,children:R})},w);let I=R,$=I.props?.css,K=$==null?P:[P,$],W=cloneElement(I,{size:n,rounded:s,css:K,style:{...I.props?.style,width:"100%",height:"100%",objectFit:I.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:W},w)}),y>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":`+${y} more`,children:["+",y]})]})};var zi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Jd=(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"}},Zd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Qd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",ep=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",tp=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),np=fe.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:M,className:x,badgeClassName:y,css:b,badgeCss:p,offsetX:d,offsetY:C})=>{let P=V(),R=s==="dot",w=f??(R?8:17),I=r??(R?0:10),{scale:$,onKey:K}=Jd(P,t),W=Zd($),k=P.text?.onColors||{},D=Qd(P,k,K,n),S=ep(e,a,s),A=tp(i,s,e,c),F=css({position:"relative",display:"inline-block"}),H=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=zi(d??H),E=zi(C??H),g=l.vertical||"top",v=l.horizontal||"right",B={},L="0",O="0";g==="center"?(B.top="50%",O="-50%"):g==="top"?(B.top=E,O="-45%"):(B.bottom=E,O="45%"),v==="center"?(B.left="50%",L="-50%"):v==="right"?(B.right=z,L="45%"):(B.left=z,L="-45%");let _=A?1:.8,N=css({minWidth:R?w:w/2,height:w,background:W,color:D,fontSize:typeof I=="number"?`${I}px`:I,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 ${M??P.surface?.appBg}`}:{},opacity:A?1:0,transform:`translate(${L}, ${O}) scale(${A?_:.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",x||""].join(" ").trim(),css:[F,b],children:[m,jsx("span",{"aria-hidden":!A,className:["plainframe-ui-badge",y||""].join(" ").trim(),css:[N,p],children:S})]})});var Is=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...M})=>{let x=V(),y=useMemo(()=>r??x.surface.overlayBg,[r,x.surface.overlayBg]),[b,p]=useState(e),[d,C]=useState(e),P=useRef(null),R=useRef(null),w=useRef(null);useEffect(()=>(P.current&&(clearTimeout(P.current),P.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(p(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),P.current=setTimeout(()=>{p(false),P.current=null;},u)),()=>{P.current&&(clearTimeout(P.current),P.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let D=document.body,S=D.style.overflow,A=D.style.paddingRight,F=window.innerWidth-document.documentElement.clientWidth,H=parseFloat(getComputedStyle(D).paddingRight||"0");return D.style.overflow="hidden",F>0&&(D.style.paddingRight=`${H+F}px`),()=>{D.style.overflow=S,D.style.paddingRight=A;}},[e,T]),useEffect(()=>{if(!d||!t)return;let D=S=>{S.key==="Escape"&&t();};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[d,t]);let I=D=>{if(!d||!t||!w.current)return;let S=D.target;S&&!w.current.contains(S)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!b)return null;let K=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:d?"auto":"none",visibility:b?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:y,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:d?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:d?"auto":"none"}),k=css({position:"relative",zIndex:1,pointerEvents:d?"auto":"none"});return jsxs("div",{"aria-hidden":!b||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[K,a],onPointerDown:I,...M,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:[k,c],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function ip(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 lp=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=ye(),f=fe.useMemo(()=>fe.Children.toArray(e).flatMap(p=>{if(!fe.isValidElement(p))return [];let{type:d,props:C}=ip(p);if(!(d===hr||typeof d=="function"&&"displayName"in d&&d.displayName===hr.displayName))return [];let R=C;return [{href:R.href,disabled:R.disabled,node:R.children,className:R.className,css:R.css,onClick:R.onClick,startIcon:R.startIcon,endIcon:R.endIcon}]}),[e]),T=fe.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),M=fe.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),x=fe.useCallback((p,d,C)=>{let P=p?m.text.primary:m.text.secondary,R=i&&d&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:P,cursor:d&&!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]),y=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((p,d)=>{let C=d===f.length-1,P=!!p.href&&!p.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",P?"plainframe-ui-breadcrumb--link":"",p.className||""].join(" ").trim(),w=[x(C,P,p.disabled),o,C?r:s,P?a:void 0,h(),p.css],I=jsxs(Fragment,{children:[p.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:y,children:p.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:b,children:p.node}),p.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:y,children:p.endIcon})]});return jsxs(fe.Fragment,{children:[d!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[M,c],children:t}),P?jsx("a",{href:p.href,onClick:p.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:w,children:I}):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:I})]},d)})})});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})},Ms=e=>typeof e=="number"?`${e}px`:e,_i=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)&&_i(n)&&(t=true));}),t};function pp(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 mp(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:M,...x},y)=>{let b=V(),p=ye(),d=useMemo(()=>pp(b,t),[b,t]),C=useMemo(()=>mp(b,e),[b,e]),P=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!_i(u)&&fe.Children.count(u)===1,[f,n,o,u]),R=d.iconSize,w=useMemo(()=>ks(n,R),[n,R]),I=useMemo(()=>ks(o,R),[o,R]),$=useMemo(()=>i??jsx(to,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>P?"center":l??"center",[P,l]),W=!!c&&K==="center",k=!!c&&K==="start",D=!!c&&K==="end",S=a||c,A=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:d.minHeight,lineHeight:1,fontWeight:600,cursor:S?"not-allowed":"pointer",opacity:S?.5:1,userSelect:"none",position:"relative",borderRadius:r?b.radius.full:d.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,d,r,b,S]),F=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),H=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!S?{":hover::before":{opacity:1}}:{}}),[C,h,S]),z=useMemo(()=>css(P&&!s?{width:"100%",height:"100%",maxWidth:d.minHeight,minWidth:d.minHeight,maxHeight:d.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Ms(d.iconSize)}:{fontSize:Ms(d.fontSize),padding:n||o?`${d.paddingY} ${d.paddingXIcon}`:`${d.paddingY} ${d.paddingX}`}),[P,s,d,n,o]),E=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Ms(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 d.iconSize=="number"?d.iconSize:Math.max(12,Math.round(parseFloat(String(d.iconSize))||16)),[d.iconSize]),B=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),L=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),_=useMemo(()=>()=>{if(P)return null;let G=!!n;return !G&&!k?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:L(!k),children:G?w||n:null}),jsx("span",{css:L(!!k),children:$})]})},[P,n,k,B,L,w,c,$]),N=useMemo(()=>()=>{if(P)return null;let G=!!o;return !G&&!D?null:jsxs("span",{css:B,"aria-hidden":c?true:void 0,children:[jsx("span",{css:L(!D),children:G?I||o:null}),jsx("span",{css:L(!!D),children:$})]})},[P,o,D,B,L,I,c,$]),U=!(a||c);return jsxs("button",{ref:y,type:"type"in x&&x.type?x.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[A,p({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),F,H,z,M],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...x,children:[jsxs("span",{className:"plainframe-ui-button-content",css:E,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:g,children:P?c?$:ks(u,d.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),fp=e=>{let t=e.type;return t.displayName??t.name},Ds=(e,t)=>fp(e)===t,qi=e=>Ds(e,"ButtonGroup"),Gi=e=>Ds(e,"DropdownMenu"),Fs=e=>Ds(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,gp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,bp=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(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},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 bp(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,...M},x){let y=V(),b=a==="sm"?y.radius.sm:y.radius.md,p=c?y.radius.full:b,d=o==="vertical",C=gp(y.componentHeights.border,1),P=y.surface.border,R=n&&!!f,w=n&&!!T,I=css({display:"flex",flexDirection:d?"column":"row",width:r?"100%":l!=null?On(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:On(i??y.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,k=0,D=false,S=[];for(let A of $){if(!Cr(A)){S.push(A);continue}let F=k===0,H=k===W-1,z=A.props??{},E=z.disabled??s,g=z.size??a,v=0,B=0,L=0,O=0;n&&(d?(v=F?R?0:p:0,B=F?w?0:p:0,O=H?R?0:p:0,L=H?w?0:p:0):(v=F?R?0:p:0,O=F?R?0:p:0,B=H?w?0:p:0,L=H?w?0:p:0));let _=Ui(A,"left"),N=Ui(A,"right"),oe=n&&!F&&!(D&&_)&&!(D||_)?css({[d?"borderTop":"borderLeft"]:`${C} solid ${P}`}):null,j=n&&!F&&D&&_?css(d?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(B),borderBottomRightRadius:On(L),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ce=css([J,oe,j,le]);if(!Gi(A)){let we=z.css,Ce=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),De=qi(A)&&n?{__clipLeft:!F,__clipRight:!H}:{},ne=cloneElement(A,{...z,disabled:E,size:g,className:Ce,css:[we,ce],...De});S.push(ne),D=N,k+=1;continue}let de=z.children,Fe=Children.map(de,we=>{if(!Cr(we)||!Fs(we))return we;let Ce=we.props,De=[Ce.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(we,{...Ce,css:[Ce.css,ce],className:De,disabled:E,size:g})}),Ie=cloneElement(A,{...z,children:Fe});S.push(Ie),D=N,k+=1;}return jsx("div",{ref:x,role:m,"aria-orientation":d?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[I,h],...M,children:S})}));Xi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rp=(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)}}},Tp=(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)}}},wp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Ep=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},Wn=fe.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:M,role:x,tabIndex:y,...b},p){let d=V(),C=d.surface??{},[P,R]=useState(!!u),w=l!=null,I=w?!!l:P,$=useMemo(()=>wp(o,d),[o,d]),K=useMemo(()=>Ep(o,d,$),[o,d,$]),W=K,k=useMemo(()=>Rp(r,d),[r,d]),D=useMemo(()=>Tp(s,d),[s,d]),S=!!c||!!i,A=useMemo(()=>css({backgroundColor:$,padding:k,borderRadius:D,border:o==="outlined"?`${d.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:S?"pointer":void 0,...S?{"&:hover":{backgroundColor:K}}:{},'&[data-selected="true"]':{backgroundColor:W},...S?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,k,D,o,d.componentHeights,C.border,h,f,S,K,W]),F=useCallback(()=>{if(!i)return;let g=!I;w||R(g),m?.(g);},[w,m,i,I]),H=useCallback(g=>{i&&F(),T?.(g);},[i,F,T]),z=useCallback(g=>{i&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),F()),M?.(g);},[i,F,M]),E=ye();return jsx("div",{ref:p,"data-variant":o,"data-selected":i&&I?"true":void 0,"aria-pressed":i?I:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[E(),A,n],onClick:H,onKeyDown:z,role:i?x??"button":x,tabIndex:i?y??0:y,...b,children:t})}));Wn.displayName="Container";var Ip=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 Ip(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 kp(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:M,...x},y)=>{let b=V(),p=ye(),d=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:d?"column":"row",gap:kp(h,b),alignItems:d?"stretch":"center",transition:"all .16s ease"});return jsx(Ji.Provider,{value:f,children:jsx(Wn,{ref:y,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:[p(),C,t],onClick:M,tabIndex:M?0:void 0,...x,children:e})})}));Zi.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})}),Ap=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})}),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%"}:{},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})}),Pp=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})}),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??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),Bp=e=>el(e)?e.type?.displayName||e.type?.name:void 0,Qi=e=>Bp(e)==="Card",$p=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"?$p(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),x=T.filter(Qi).length,y=0,b=T.map((p,d)=>{if(!Qi(p)||!el(p))return p;let C=p.props,P=y++,R=P===0,w=P===x-1,I=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,K=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=I==="subtle"&&x>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,D=[$,K,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),S=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(p,{...C,variant:I??C.variant,css:[C.css,...D],className:S,key:typeof p=="object"&&"key"in p?p.key:d})});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 Be=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:M},x){let y=V(),b=ye(),p=["sm","md","lg"].includes(i)?i:"md",d=useMemo(()=>Kp(y,p),[y,p]),C=!!l&&!h,P=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(y.componentHeights?.border??"1px"),w=useMemo(()=>{let G=y.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,y.palette]),I=useCallback(G=>{let oe=y.palette;return (w==="neutral"?y.neutral[G]:oe[w]?.[G])??oe.primary?.[G]},[w,y.neutral,y.palette]),$=useMemo(()=>w==="neutral"?y.neutral[100]:I(50),[w,I,y.neutral]),K=useMemo(()=>w==="neutral"?y.text.secondary:I(800),[w,I,y.text.secondary]),W=useMemo(()=>w==="neutral"?y.neutral[100]:I(50),[w,I,y.neutral]),k=useMemo(()=>w==="neutral"?y.text.secondary:I(800),[w,I,y.text.secondary]),D=useMemo(()=>w==="neutral"?y.neutral[400]:I(300),[w,I,y.neutral]),S=useMemo(()=>w==="neutral"?y.surface.subtleBg:I(600),[w,I,y.surface.subtleBg]),A=useMemo(()=>(y.text.onColors??{})[w]??(w==="neutral"?y.neutral[900]:y.neutral[0]??"#fff"),[w,y.text.onColors,y.neutral]),F="transparent",H=useMemo(()=>w==="neutral"?y.text.secondary:I(700)??y.text.primary,[w,I,y.text.primary,y.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!ol(t)&&fe.Children.count(t)===1,[a,c,t]),E=useMemo(()=>o==="filled"?css({backgroundColor:S,color:A,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:k,border:"none",boxShadow:`inset 0 0 0 ${R} ${D}`}):o==="ghost"?css({backgroundColor:F,color:H,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:K,border:"none",boxShadow:"none"}),[S,A,H,W,k,D,$,K,R,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Be(d.gap),padding:o==="ghost"?0:z||t==null?Be(d.soloPadding):`${Be(d.paddingY)} ${Be(d.paddingX)}`,borderRadius:s?y.radius.full:d.radius,fontWeight:600,cursor:P,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Be(d.iconSize)} + ${Be(d.soloPadding)} * 2)`,minHeight:`calc(${Be(d.iconSize)} + ${Be(d.soloPadding)} * 2)`,justifyContent:"center"}:null}),[d,P,t,h,z,s,y.radius.full,o]),v=useMemo(()=>css({fontSize:Be(z?d.iconSize:d.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Be(d.iconSize):void 0,height:z?Be(d.iconSize):void 0,display:z?"block":void 0}}),[d.fontSize,d.iconSize,z]),B=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Be(d.iconSize),lineHeight:0,"& > svg":{width:Be(d.iconSize),height:Be(d.iconSize),display:"block"}}),[d.iconSize]),L=useMemo(()=>css({marginRight:z||t==null?0:Be(d.gap),marginLeft:z||t==null?0:Be(d.iconOffset)}),[d.gap,d.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Be(d.gap),marginRight:z||t==null?0:Be(s?d.iconOffsetRounded:d.iconOffset)}),[d.gap,d.iconOffset,d.iconOffsetRounded,t,z,s]),_=useMemo(()=>css({marginRight:s?0:Be(d.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:Be(d.iconSize),borderRadius:y.radius.xs}),[d.iconOffset,d.iconSize,h,s,y.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:d.iconSize,height:d.iconSize},strokeWidth:2.5}),[d.iconSize]);return jsxs("div",{ref:x,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[g,E,C?b({color:r??"primary"}):null,M],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":w,"data-size":i,"data-icon-only":z||void 0,children:[a&&jsx("span",{css:[B,L],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[B,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[_,b({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));rl.displayName="Chip";var Up=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,qp=fe.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let M=ye(),x=r.neutral,y=r.text,b=r.componentHeights.border,p=useRef([]),[d,C]=useState(0),P=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),w=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),I=l?x[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",K=z=>css({width:w,height:w,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:I,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?x[500]:i?r.palette.danger?.[800]??y.primary:y.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??y.primary:y.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??y.secondary:y.secondary,opacity:.85}},u?M({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),k=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:y.secondary,userSelect:"none"}),D=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),S=useCallback(z=>{let E=Math.max(0,Math.min(o-1,z));C(E),p.current[E]?.focus();},[o]),A=useCallback((z,E)=>{let g=D(E).slice(0,1),v=[...P];v[z]=g,n(v.join("")),g&&z<o-1&&S(z+1);},[P,o,n,S]),F=useCallback((z,E)=>{if(E.key==="Backspace")if(!P[z]&&z>0){let g=[...P];g[z-1]="",n(g.join("")),S(z-1),E.preventDefault();return}else {let g=[...P];g[z]="",n(g.join(""));return}if(E.key==="ArrowLeft"&&z>0){E.preventDefault(),S(z-1);return}if(E.key==="ArrowRight"&&z<o-1){E.preventDefault(),S(z+1);return}if(E.key==="Home"){E.preventDefault(),S(0);return}if(E.key==="End"){E.preventDefault(),S(o-1);return}},[P,o,n,S]),H=useCallback(z=>{let E=D(z.clipboardData.getData("text")).slice(0,o);E&&(n(E),requestAnimationFrame(()=>{let g=Math.min(E.length,o-1);S(g);}),z.preventDefault());},[o,n,S]);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=>{p.current[E]=g;},type:"text",inputMode:"text",maxLength:1,value:P[E]||"",placeholder:P[E]?"":R[E]||"",disabled:l,onChange:g=>A(E,g.target.value),onKeyDown:g=>F(E,g),onFocus:()=>C(E),onPaste:E===0?H:void 0,className:"plainframe-ui-code-box",css:K(E===d),"aria-label":`Code character ${E+1}`,tabIndex:E===d?0:-1}),f&&E<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:k,children:f}):null]},E))})}),Gp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:M,labelCss:x,helperRowCss:y,helperTextCss:b,css:p})=>{let d=V(),C=useId(),P=useMemo(()=>({sm:{labelFont:d.typography.sizes.xs,helperFont:d.typography.sizes.xs,minHeight:d.componentHeights.sm,paddingY:0,paddingX:d.spacing.md,codeFontSize:21},md:{labelFont:d.typography.sizes.sm,helperFont:d.typography.sizes.xs,minHeight:d.componentHeights.md,paddingY:0,paddingX:d.spacing.md,codeFontSize:24},lg:{labelFont:d.typography.sizes.md,helperFont:d.typography.sizes.sm,minHeight:d.componentHeights.lg,paddingY:0,paddingX:d.spacing.md,codeFontSize:28}}),[d]),R=["sm","md","lg"].includes(u)?u:"md",w=P[R],I=d.neutral,$=d.text,K=t!=null,[W,k]=useState(n),D=K?t:W,S=L=>{K||k(L),o?.(L);},A=Math.max(2,Math.min(h,10)),F=d.spacing.sm,H=Up(l??F)??"0px",z=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(M)?M:M?[M]:[]),E=css({fontSize:w.labelFont,fontWeight:500,color:a?d.palette.danger?.[700]??$.primary:i?I[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(x)?x:x?[x]:[]),g=css({display:"flex",alignItems:"center",justifyContent:"center",gap:H,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(p)?p:p?[p]:[]),v=css({minHeight:16,fontSize:w.helperFont,color:a?d.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(y)?y:y?[y]:[]),B=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?d.palette.danger?.[700]??$.primary:i?I[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(qp,{value:D||"",onChange:S,len:A,theme:d,sizeKey:R,s:{codeFontSize:w.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:H})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:B,children:c})})]})};var 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)},Yp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=fe.useRef(null),[c,i]=fe.useState(false),l=fe.useCallback(v=>{i(v),o?.(v);},[o]),u=fe.useCallback(()=>l(false),[l]),m=fe.useRef({x:0,y:0}),h=fe.useRef(null),f=fe.useRef(null),T=fe.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let B=Math.round(m.current.x),L=Math.round(m.current.y);v.style.transform=`translate3d(${B}px, ${L}px, 0)`;},[]),M=fe.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);fe.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let x=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})}}}),[]),y=fe.useRef(`cz-${Math.random().toString(36).slice(2)}`),b=fe.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${y.current}"]`):null,[]),p=fe.useRef(null),d=fe.useRef(null),C=fe.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),P=fe.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),R=fe.useCallback(()=>{P(),d.current=window.setTimeout(()=>l(false),0);},[P,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}},[]),I=fe.useCallback((v,B)=>{m.current={x:v,y:B},M(),l(true);},[M,l]),$=typeof t=="function"?t({close:u}):t,K=zs($),W=v=>{if(!fe.isValidElement(v))return v;let B=cl(v),L=v,O=L.props.children,_=O==null?O:Array.isArray(O)?O.map(N=>fe.isValidElement(N)?W(N):N):fe.isValidElement(O)?W(O):O;if(B==="DropdownMenu"){let N=L.props.onOpenChange;return fe.cloneElement(L,{...L.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:_})}if(B==="DropdownMenuContent"){let N=L.props.onMouseEnter,U=L.props.onMouseLeave;return fe.cloneElement(L,{...L.props,anchor:x,"data-cz-id":y.current,onMouseEnter:G=>{P(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:_})}return _===O?L:fe.cloneElement(L,{...L.props,children:_})},k=K?W($):$,D=fe.useCallback(v=>{v.preventDefault(),I(v.clientX,v.clientY);},[I]),S=fe.useCallback(v=>{n==="contextmenu"&&D(v);},[n,D]),A=fe.useCallback(v=>{n==="dblclick"&&D(v);},[n,D]),F=fe.useCallback(v=>{n==="click"&&D(v);},[n,D]),H=fe.useCallback(v=>{if(n!=="hover")return;C(),P();let B=r==="center"?w():{x:v.clientX,y:v.clientY};p.current=window.setTimeout(()=>{let L=B.x+(r==="cursor"?s:0),O=B.y+(r==="cursor"?s:0);I(L,O);},0);},[n,r,s,w,I,C,P]),z=fe.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!K&&(m.current={x:v.clientX+s,y:v.clientY+s},M());},[n,c,r,K,s,M]),E=fe.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);fe.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let B=a.current?.matches(":hover"),L=b()?.matches?.(":hover");B||L?P():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,b,P,R]),fe.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let B=a.current?.matches(":hover"),L=b()?.matches?.(":hover");if(B||L?P():R(),r==="center"&&a.current){let O=w();m.current={x:O.x,y:O.y},M();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,w,M,l,P,R,b]),fe.useEffect(()=>()=>{C(),P();},[C,P]);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"&&P(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:S,onDoubleClick:A,onClick:F,onMouseEnter:H,onMouseMove:z,onMouseLeave:E,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?k:jsx(g,{children:k})]})};var _n=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,em=fe.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:M,className:x,...y},b){let p=V(),{t:d,strokeColor:C,labelTextColor:P,chipSubtleBg:R,chipOutlinedBg:w,outerM:I,padX:$,verticalStrokeMargin:K}=useMemo(()=>{let A=typeof s=="number"?`${s}px`:s,F=p.surface.border,H=p.text.secondary,z=p.surface.subtleBg,E=p.surface.panelBg,g=_n(h,"10px"),v=o==="horizontal"?n==="middle"?_n(c):n==="inset"?_n(i,"0px"):"0":"0",B=o==="vertical"?n==="middle"?_n(c):n==="inset"?_n(i,"0px"):"0":"0";return {t:A,strokeColor:F,labelTextColor:H,chipSubtleBg:z,chipOutlinedBg:E,outerM:g,padX:v,verticalStrokeMargin:B}},[s,p,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":d,minWidth:t?"max-content":d,marginLeft:I,marginRight:I}:{flexDirection:"row",width:a?_n(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:I,marginBottom:I},...Array.isArray(f)?f:f?[f]:[]]),[o,t,d,I,a,$,n,f]),k=useMemo(()=>css([{background:C,borderRadius:m?p.radius.full:p.radius.xs},o==="vertical"?{width:d,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:d,flex:1}]),[C,m,p.radius.full,p.radius.xs,o,d,K]),D=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?p.radius.full:`calc(${p.radius.sm} * 0.75)`:`calc(${p.radius.sm} * 0.75)`,color:P,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:w,border:`${d} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,p.radius.full,p.radius.sm,P,u,R,w,d,C,T]),S=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[k,M]}),[k,M]);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",x||""].join(" ").trim(),css:W,...y,children:[t&&r!=="top"&&S,t&&jsx("span",{className:"plainframe-ui-divider-label",css:D,children:t}),t&&r!=="bottom"&&S,!t&&S]}):jsxs("div",{ref:b,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",x||""].join(" ").trim(),css:W,...y,children:[t&&r!=="left"&&S,t&&jsx("span",{className:"plainframe-ui-divider-label",css:D,children:t}),t&&r!=="right"&&S,!t&&S]})}));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})},om=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})});om.displayName="DrawerTrigger";var To=0,xl="",vl="",rm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function sm(){if(!(typeof document>"u")){if(To===0){let e=document.body;xl=e.style.overflow||"",vl=e.style.paddingRight||"";let t=rm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function am(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=xl,e.style.paddingRight=vl;}}var im=(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:M,css:x,...y},b){let p=V(),{open:d,setOpen:C,lockScroll:P,closeOnEscape:R}=hl();useEffect(()=>{if(!(!P||!d))return sm(),()=>am()},[d,P]);let w=useMemo(()=>im(a,0),[a]),I=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),K=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]),k=useMemo(()=>{let j=String(p.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,p.radius.lg]),D=useMemo(()=>c??(s==="inset"?p.radius.lg:k),[c,s,p.radius.lg,k]),S=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]),A=useRef(null),F=useCallback(()=>{let j=A.current;if(!j)return 1;let J=j.getBoundingClientRect();return I==="x"?J.width:J.height},[I]),H=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(()=>I==="x"?{x:`${E*100}%`,y:0}:{y:`${E*100}%`,x:0},[I,E]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...S,width:K,height:W,backgroundColor:p.surface.panelBg,borderRadius:D,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:d?"auto":"none",touchAction:I==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[S,K,W,p.surface,D,d,I]),B=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:p.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,p.surface]),L=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>I==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[I,$,T]),_=useMemo(()=>I==="x"?{left:0,right:0}:{top:0,bottom:0},[I]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((j,J)=>{let le=I==="x"?J.offset.x:J.offset.y,ce=I==="x"?J.velocity.x:J.velocity.y,de=$*le>0,Fe=Math.abs(le)>=F()*N,Ie=$*ce>f;de&&(Fe||Ie)&&C(false);},[I,$,F,N,f,C]),G=useRef(null);useEffect(()=>{if(!d)return;G.current=document.activeElement;let j=setTimeout(()=>{let ce=A.current;if(!ce)return;let de=ce.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');de.length>0?de[0].focus():ce.focus();},100),J=ce=>{let de=A.current;if(!de||!ce.target)return;let Fe=ce.target;if(!de.contains(Fe)){ce.preventDefault();let Ie=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ie.length>0?Ie[0].focus():de.focus();}},le=ce=>{ce.key==="Escape"&&R&&(ce.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();}},[d,C,R]);let{...oe}=y;return jsx(AnimatePresence,{children:d?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:B,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:L},"overlay"),jsx(motion.div,{ref:j=>{A.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",M||""].join(" ").trim(),css:[v,x],drag:I,dragConstraints:_,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:H,...oe,children:t},"panel")]}):null})});Cl.displayName="DrawerContent";var lm=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),M=h?!!u:f,x=useCallback(y=>{h||T(y),y||a?.(),s?.(y);},[h,a,s]);return jsx(yl,{open:M,onOpenChange:x,children:jsx(Cl,{ref:l,...i,children:c})})});lm.displayName="DrawerLegacy";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),M=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(M)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var 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],M=h.props.onTransitionEnd,x=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:x,onTransitionEnd:u(M)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var 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"}},Tm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),wm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Vn=fe.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:M,style:x,as:y})=>{let b=V(),p=wl[e]??wl.body,d=y??wm[e]??"span",C=D=>D==null?p.size:typeof D=="number"?D:b?.typography?.sizes?.[D]??D,P=C(o)??C(p.size),R=r??p.weight,w=s??p.lh,I=a??p.ls,$=n==="secondary"?b.text.secondary:n==="primary"?b.text.primary:n??"inherit",K=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:P,fontWeight:R,lineHeight:w,letterSpacing:I,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),k=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:K,textDecorationThickness:Tm(h),textDecorationSkipInk:"auto"});return jsx(d,{className:[`pfui-typo-${e}`,M||""].join(" ").trim(),css:[W,k],style:x,"data-variant":e,children:t})});Vn.displayName="Typography";var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Im=(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:M,placeholder:x,blurDataURL:y,placeholderColor:b="#f1f1f1",fallbackSrc:p,className:d,css:C,onClick:P,onLoad:R,onError:w,...I},$){let[K,W]=useState(false),[k,D]=useState(false),[S,A]=useState(false),F=V(),H=Im(s,F)??"0px",z=i?"figure":"div",E=css({display:"flex",flexDirection:"column",gap:i?F.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${H})`}),g=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${H})`,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:K&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:P?"pointer":void 0}),v=css({position:"absolute",inset:0,background:x==="color"?b:void 0,backgroundImage:x==="blur"&&y?`url(${y})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:x==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:S?0:1,pointerEvents:"none"}),B=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",d||""].join(" ").trim(),css:[E,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:P,children:[!S&&x&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:B,src:k&&p?p:t,alt:n,srcSet:T,sizes:M,loading:m,decoding:h,fetchPriority:f,onLoad:L=>{A(true),R?.(L);},onError:L=>{D(true),w?.(L);},...I})]}),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,Fm=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Pm=e=>e*Math.PI/180,Dm=(e,t,n)=>{let o=Math.abs(Pm(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 Nm(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 Hm=(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],Ml=[1.06,1.08,1.06],Lm={sm:150,md:200,lg:260,xl:340},Bm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function $m(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 Bm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var zm=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:M="md",label:x,labelAlign:y="center",css:b,className:p,...d}){let C=V(),P=Fm(r)??4/5,R=typeof o=="string"?o:void 0,w=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Lm[s],I=Math.max(1,w/P),K=Children.toArray(t).filter(isValidElement).slice(0,i),W=K.length,k=Nm(n,W),D=K.map((j,J)=>Hm(n,W,J)),S=j=>I*.6*D[j],A=j=>S(j)*P,F=0,H=0;for(let j=0;j<W;j++){let J=A(j),le=S(j),ce=Math.max(Math.abs(k.base.ang[j]??0),Math.abs(k.exp.ang[j]??0)),de=Math.max(Math.abs(k.base.dx[j]??0),Math.abs(k.exp.dx[j]??0)),Fe=Math.max(Math.abs(k.base.dy[j]??0),Math.abs(k.exp.dy[j]??0)),Ie=a==="expand"?Ml[j]??1.08:a==="reveal"?kl[j]??1.03:1,we=Dm(J,le,ce),Ce=we.w*Ie,De=we.h*Ie,ne=de/100*J*Ie,re=Fe/100*le*Ie;F=Math.max(F,Ce/2+ne),H=Math.max(H,De/2+re);}let z=Math.max(1,2*F),E=Math.max(1,2*H),g=Math.min(1,w/z,I/E),v=c===void 0?"pointer":"controlled",B=c?"true":void 0,L=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:x?C.spacing.xs:0}),O=css({position:"relative",width:Il(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:Il(I)}),_=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=$m(M,C)??"0px",U=j=>{let J=n==="fan"?`rotate(${k.base.ang[j]}deg) translate(${k.base.dx[j]}%, ${k.base.dy[j]}%)`:n==="slide"?`translate(${k.base.dx[j]}%, ${k.base.dy[j]}%) rotate(${k.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${k.base.dy[j]}%)`:`translate(${k.base.dx[j]}%, ${k.base.dy[j]}%) rotate(${k.base.ang[j]}deg)`,le=n==="fan"?`rotate(${k.exp.ang[j]}deg) translate(${k.exp.dx[j]}%, ${k.exp.dy[j]}%)`:n==="slide"?`translate(${k.exp.dx[j]}%, ${k.exp.dy[j]}%) rotate(${k.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${k.exp.dy[j]}%)`:`translate(${k.exp.dx[j]}%, ${k.exp.dy[j]}%) rotate(${k.exp.ang[j]}deg)`,ce=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,de=a==="expand"?`${le} scale(${Ml[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%) ${ce}`,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%) ${de}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${de}`}})},G=j=>css({width:`${A(j)}px`,aspectRatio:`${P}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(x?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",p||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":B,css:[L,b],tabIndex:-1,...d,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:K.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))})}),x&&jsx(Vn,{as:"figcaption",variant:"caption",align:y,children:x})]})});var Al=e=>typeof e=="number"?`${e}px`:e,Fl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Km(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Al(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Al(n)}return e}function _m(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var Vm=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=ye(),T=Fl[o]??Fl.sm,M=Km(r,h),x={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},y=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:M,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),b=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:x.txt}}),p=css({"&&":{background:"transparent",color:x.txt,border:"none",boxShadow:"none"}}),d=css({"&&":{background:h.surface.panelBg,color:x.txt,border:`1px solid ${x.br}`,boxShadow:`inset 0 1px 0 ${x.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?b:n==="ghost"?p:d,R=s&&c>0&&_m(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(),y,C,i],...u,children:R})});var Gm=(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=Gm(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=x=>y=>{y.target===y.currentTarget&&y.propertyName==="transform"&&s?.(),x?.(y);};if(a&&isValidElement(e)){let x=e,y=x.props.css,b=Array.isArray(y)?[...y,f]:y?[y,f]:[f],p=["plainframe-ui-transition-slide",x.props.className||"",c||""].join(" ").trim(),d=x.props.onTransitionEnd;return cloneElement(x,{...x.props,css:b,className:p,onTransitionEnd:T(d)})}let M=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:M,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},ef=({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:M,...x},y)=>{let b=V(),{open:p,setOpen:d,lockScroll:C}=Ll(),P=fe.useRef(null),R=fe.useRef(null);fe.useEffect(()=>{if(!p)return;R.current=document.activeElement;let k=setTimeout(()=>{let S=P.current;if(!S)return;let A=S.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');A.length>0?A[0].focus():S.focus();},100),D=S=>{let A=P.current;if(!A||!S.target)return;let F=S.target;if(!A.contains(F)){S.preventDefault();let H=A.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');H.length>0?H[0].focus():A.focus();}};return document.addEventListener("focusin",D,true),()=>{clearTimeout(k),document.removeEventListener("focusin",D,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[p]);let w=typeof b.spacing.sm=="number"?`${b.spacing.sm}px`:String(b.spacing.sm),I=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",M||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[I,f],ref:k=>{P.current=k,typeof y=="function"?y(k):y&&(y.current=k);},...x,children:e}),K=u==="none"?$:u==="slide"?jsx(Xs,{on:p,direction:m,duration:h,children:$}):u==="grow"?jsx(Vs,{initialScale:.75,on:p,duration:h,children:$}):jsx(_s,{on:p,duration:h,children:$});if(!a)return jsx(Fragment,{children:K});let W=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Is,{on:p,blur:c,blurDepth:i,onClickAway:l?()=>d(false):void 0,css:[W,T].filter(Boolean),contentCss:W,lockScroll:C,children:K})});$l.displayName="ModalContent";var cf=({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=ye(),M=t!==void 0,[x,y]=useState(n),b=Math.max(1,e),p=Ir(M?t:x,1,b),d=useCallback(g=>{let v=Ir(g,1,b);M||y(v),o?.(v);},[M,b,o]),C=useMemo(()=>uf({count:b,page:p,siblingCount:r,boundaryCount:s}),[b,p,r,s]),P=f.palette?.primary?.[600],R=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,I=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",K=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:I,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}),k=css({width:28,minWidth:28,height:28,padding:0}),D=(g=false)=>css([W,T({color:g?"primary":"neutral"}),l==="outlined"?g?{background:P,color:f.text.onColors.primary,borderColor:P}:{background:"transparent",borderColor:R,":hover":{background:w}}:l==="ghost"?g?{background:P,color:f.text.onColors.primary}:{":hover":{background:w}}:g?{background:P,color:f.text.onColors.primary,borderColor:P}:{":hover":{background:w}}]),S=useCallback(()=>d(1),[d]),A=useCallback(()=>d(b),[d,b]),F=useCallback(()=>{p===1?i&&d(b):d(p-1);},[p,i,b,d]),H=useCallback(()=>{p===b?i&&d(1):d(p+1);},[p,i,b,d]),z=a||p===1&&!i,E=a||p===b&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",m||""].join(" ").trim(),css:K,onKeyDown:g=>{a||(g.key==="ArrowLeft"&&(g.preventDefault(),F()),g.key==="ArrowRight"&&(g.preventDefault(),H()),g.key==="Home"&&(g.preventDefault(),S()),g.key==="End"&&(g.preventDefault(),A()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[D(false),k],onClick:S,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:[D(false),k],onClick:F,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===p?`Page ${g}, current page`:`Go to page ${g}`,"aria-current":g===p?"page":void 0,css:D(g===p),onClick:()=>d(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:[D(false),k],onClick:H,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":E,disabled:E,css:[D(false),k],onClick:A,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 uf({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 ff=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,gf=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:ff(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 Kl=createContext(null),xf=()=>{let e=useContext(Kl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},vf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Cf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),M=h?e:f,x=useRef([]),[y,b]=useState(0),p=()=>b(D=>D+1),d=useCallback(D=>{h||T(D),n?.(D);},[h,n]),C=useCallback(D=>(x.current.push(D),p(),x.current.length-1),[]),P=useCallback((D,S)=>{let A=x.current[D];A&&(x.current[D]={...A,...S},p());},[]),R=()=>x.current.map((D,S)=>({it:D,i:S})).filter(({it:D})=>D.ref&&!D.disabled).map(({i:D})=>D),w=useCallback((D,S)=>{let A=R();if(!A.length)return;let F=Math.max(0,A.indexOf(D)),H=A[(F+S+A.length)%A.length],z=x.current[H]?.ref;if(z){z.focus();let E=x.current[H]?.value;E!==void 0&&d(E);}},[d]),I=useCallback(D=>{let S=R();if(!S.length)return;let A=D==="first"?S[0]:S[S.length-1],F=x.current[A]?.ref;if(F){F.focus();let H=x.current[A]?.value;H!==void 0&&d(H);}},[d]),$=useMemo(()=>{let D=x.current.filter(A=>A.ref&&!A.disabled);return D.length?D.some(A=>A.value===M)?M:D[0]?.value:void 0},[M,y]),K=useMemo(()=>({selected:M,setSelected:d,disabled:o,size:r,direction:s,variant:a,register:C,update:P,moveFocusBy:w,moveToEdge:I,focusValue:$,theme:m,anchorOrigin:vf(l)}),[M,d,o,r,s,a,C,P,w,I,$,m,l]),W=css({width:"fit-content"}),k=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:k,children:jsx(Kl.Provider,{value:K,children:i})})})},Rf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:M,anchorOrigin:x}=xf(),y=c||t,b=s===e,p=["sm","md","lg"].includes(i)?i:"md",d=p==="sm"?16:p==="lg"?24:20,C=O=>f.palette?.primary?.[O],P=C(600),R=C(100),w=f.neutral[300],I=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],K="transparent",W=I,k=$;T==="soft"?(K=R,W=null,k=P):T==="outlined"?(K=C(50),W=I,k=P):(K=f.neutral[200],W="transparent",k=$),b&&(T==="outlined"?(K=R,W=I,k=P):T==="filled"?(K=P,W=null,k=$):(K=R,W=null,k=P));let D=T==="filled"?w:f.palette.primary[100],S=useRef(null),A=useRef(-1);useEffect(()=>{A.current=l({ref:S.current,value:e,disabled:!!y});},[l]),useEffect(()=>{u(A.current,{ref:S.current,value:e,disabled:!!y});},[u,y,e]);let F=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:x.vertical==="center"?f.spacing.sm:0,rowGap:x.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:y?.5:1,borderRadius:f.radius.md,cursor:y?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":y||b?{}:{background:D,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${I}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),H=css({width:d,height:d,minWidth:d,minHeight:d,borderRadius:f.radius.full,background:K,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?d*.45:0,height:b?d*.45:0,borderRadius:f.radius.full,background:b?k:"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=x.horizontal,_=x.vertical;return _==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),B=!y&&M===e?0:-1,L=ye();return jsxs("button",{ref:S,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":b,"aria-disabled":y||void 0,disabled:y,tabIndex:B,onClick:()=>{y||a(e);},onKeyDown:O=>{y||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(A.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(A.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[F,L({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[H,css({gridColumn: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 If=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],M=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),x=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:M,onTransitionEnd:u(x)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var ea=e=>null;ea.displayName="SelectItem";var Ao=(...e)=>e.filter(Boolean).flat();function Qs(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Qs(n,t);return}if(fe.isValidElement(e)){if(e.type===ea){t.push(e);return}if(e.type===fe.Fragment){Qs(e.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:M=280,wrapperCss:x,labelCss:y,triggerCss:b,menuCss:p,optionCss:d,children:C,className:P,menuSize:R="md",triggerRender:w})=>{let I=V(),$=ye(),K=fe.useId(),W=`${K}-label`,k=`${K}-menu`,D={sm:{minHeight:I.componentHeights.sm,radius:I.radius.sm},md:{minHeight:I.componentHeights.md,radius:I.radius.md},lg:{minHeight:I.componentHeights.lg,radius:I.radius.md}},S=D[l]||D.md,[A,F]=fe.useState(false),H=ne=>F(!!ne),z=typeof e<"u",E=c||Array.isArray(e)||Array.isArray(t),[g,v]=fe.useState(()=>typeof t<"u"?t:E?[]:void 0),B=z?e:g,L=ne=>{z||v(ne),n?.(ne);},O=[];Qs(C,O);let _=O.map((ne,re)=>{let ue=ne.props,Y=typeof ue.children=="string"||typeof ue.children=="number"?String(ue.children):void 0;return {key:ne.key??re,value:ue.value,startIcon:ue.startIcon,endIcon:ue.endIcon,node:ue.children,labelText:Y}}),N=ne=>E?(Array.isArray(B)?B:[]).some(ue=>Object.is(ue,ne)):Object.is(B,ne),U=fe.useMemo(()=>{if(E){let re=Array.isArray(B)?B:[];return _.filter(Y=>re.some(xe=>Object.is(xe,Y.value))).map(Y=>Y.labelText??Y.node)}let ne=_.find(re=>Object.is(re.value,B));if(ne)return ne.labelText??ne.node},[B,E,_]),G=ne=>{i||(Object.is(ne,B)||L(ne),H(false));},oe=ne=>{if(i)return;let re=Array.isArray(B)?B:[],Y=re.some(xe=>Object.is(xe,ne))?re.filter(xe=>!Object.is(xe,ne)):[...re,ne];L(Y);},j={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},J={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:S.radius,minHeight:S.minHeight,fontSize:I.typography.sizes.sm,padding:`0 ${typeof I.spacing.sm=="number"?`${I.spacing.sm}px`:I.spacing.sm} 0 ${typeof I.spacing.md=="number"?`${I.spacing.md}px`:I.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:I.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:I.surface.subtleBg}:u==="outlined"?{background:I.surface.panelBg,border:`1px solid ${I.surface.border}`}:{background:"transparent"},ce={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},de={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Fe={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Ie=jsx(ChevronsUpDown,{size:16,css:css({color:I.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),we=()=>{if(w)return w(U);if(Array.isArray(U)){let re=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),ue=re.length>0?re.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(de),children:s}),jsx("span",{css:css(Fe),title:ue,children:ue})]})}let ne=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(de),children:s}),jsx("span",{css:css(Fe),title:typeof ne=="string"?ne:void 0,children:ne})]})},Ce={left:"start",center:"center",right:"end"},De=ne=>{i||(ne.key==="ArrowDown"||ne.key==="ArrowUp"||ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),H(true));};return jsxs("div",{css:Ao(j,x),className:["plainframe-ui-select-wrapper",P||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Ao({marginBottom:6,fontSize:I.typography.sizes.sm,fontWeight:500,color:I.text.secondary},y),children:o}),jsxs(Ln,{size:R,open:A,onOpenChange:H,children:[jsx(Bn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":A||void 0,"aria-controls":k,"aria-labelledby":o?W:void 0,onKeyDown:De,onClick:()=>H(!A),className:"plainframe-ui-select-trigger",css:Ao(css(J),css(le),b,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ce),children:we()}),a??Ie]})}),jsx(xn,{id:k,gap:"xs",align:Ce[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Ao({maxHeight:typeof M=="number"?`${M}px`:M,overflowY:"auto"},p),children:_.map((ne,re)=>{let ue=N(ne.value);return jsx(Ht,{startIcon:ne.startIcon,endIcon:ne.endIcon,selected:ue,disabled:i,closeOnSelect:!E,onSelect:()=>E?oe(ne.value):G(ne.value),css:Ao(d),className:"plainframe-ui-select-option",children:ne.node},ne.key??re)})})]})]})};Vl.displayName="Select";var ta=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ff=keyframes`
|
|
14
14
|
0% { background-position: -200% 0; }
|
|
15
15
|
100% { background-position: 200% 0; }
|
|
16
|
-
`,
|
|
16
|
+
`,Pf=keyframes`
|
|
17
17
|
0% { opacity: .6; }
|
|
18
18
|
50% { opacity: 1; }
|
|
19
19
|
100% { opacity: .6; }
|
|
20
|
-
`,Pf=de.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:u,css:i})=>{let l=j(),c=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:c,willChange:"background-position, opacity"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${c} 25%, ${m} 50%, ${c} 75%)`,backgroundSize:"200% 100%",animation:`${Af} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Ff} 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",u||""].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 Mr=8,ta=20,jn=4,Gl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:u=false,showValue:i=false,showStepper:l=false,label:c,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:k="horizontal",className:y,...x})=>{let g=j(),d=k==="vertical",p=useRef(null),[v,F]=useState(false),[R,E]=useState(false),[M,$]=useState(false),K=e!==void 0,W=useCallback(X=>Math.min(r,Math.max(o,X)),[o,r]),S=useCallback(X=>W(Math.round((X-o)/s)*s+o),[o,s,W]),[A,I]=useState(()=>S(t??o)),P=K?S(e):A;useEffect(()=>{K||I(X=>S(X));},[o,r,s,K,S]);let D=g.palette.primary[600];g.surface.panelBg;let z=g.neutral[500],w=useMemo(()=>{let X=r-o||1;return (P-o)/X*100},[P,o,r]),b=useCallback(X=>{K||I(X),n?.(X);},[K,n]),C=useCallback((X,ye)=>{let Q=p.current;if(!Q)return P;let ne=Q.getBoundingClientRect(),ae=d?(ne.bottom-ye)/ne.height:(X-ne.left)/ne.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[P,d,o,r,S]),L=useCallback(X=>{a||(X.currentTarget.setPointerCapture?.(X.pointerId),b(C(X.clientX,X.clientY)),F(true));},[a,b,C]),H=useCallback(X=>{a||(X.currentTarget.setPointerCapture?.(X.pointerId),F(true));},[a]),O=useCallback(X=>{!v||a||b(C(X.clientX,X.clientY));},[v,a,b,C]),_=useCallback(()=>F(false),[]);useEffect(()=>{if(v)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[v,O,_]);let N=useCallback(X=>{if(a)return;let ye=P;if(X.key==="ArrowRight"||X.key==="ArrowUp")ye=P+s;else if(X.key==="ArrowLeft"||X.key==="ArrowDown")ye=P-s;else if(X.key==="Home")ye=o;else if(X.key==="End")ye=r;else return;X.preventDefault(),b(S(ye));},[a,P,s,o,r,b,S]),U=v||R||M,G=(R||v)&&!a,se=`color-mix(in srgb, ${D} 25%, transparent)`,V=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"}),Y=css({marginBottom:d?0:4,marginRight:d?8:0,color:g.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Mr:"100%",height:d?"100%":Mr,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ue=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Mr:`calc(100% - ${jn*.5}px)`,height:d?`calc(100% - ${jn*.5}px)`:Mr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),pe=css({width:jn,height:jn,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),Me=css({position:"absolute",left:0,top:d?`calc(${100-w}% )`:0,bottom:0,width:d?"100%":`${w}%`,height:d?`${w}%`:"100%",backgroundColor:a?z:D,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:g.text.onColors.primary,width:ta,height:ta,left:d?"50%":`calc(${w}% - ${ta/2}px)`,bottom:d?`${w}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:u?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${a?z:D}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${v?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),ve=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ee=css({position:"absolute",top:d?`calc(50% - ${jn*2.5}px)`:0,left:d?"auto":`calc(50% - ${jn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:g.neutral[800],color:g.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:g.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Re=h,Z=f,ie=T,be=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":c,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[V,Re],"data-orientation":d?"vertical":"horizontal",children:[c&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:Y,children:c}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[le,Z],onPointerDown:L,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ue,children:Array.from({length:be}).map((X,ye)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:pe},ye))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Me}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":P,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:H,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>E(true),onMouseLeave:()=>E(false),className:"plainframe-ui-slider-thumb",css:[Ce,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:ve,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ee,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]})]}),c&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[Y,{marginLeft:8}],children:c})]})};Gl.displayName="Slider";var $f=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),zf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Of=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),Wf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Kf=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),_f=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),jf=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),Vf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Xl=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),Uf=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),qf=de.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:u,completed:i,disabled:l,connectorColor:c,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:k}){let y=j(),x=he(),{MAIN:g,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:v,COMPLETE_FG:F,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:E,UPCOMING_FG:M}=r,$="transparent",K=M,W=E;s==="subtle"?i?($=v,K=F,W=v):u?($=g,K=d,W=g):($=R,K=M,W=R):i?($=v,K=F,W=v):u?($="transparent",K=p,W=g):($="transparent",K=M,W=E);let S=n.label,A=n.icon??jsx("span",{css:Vf,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:Of(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[jf(o,$,K,W,String(y.radius.full)),!l&&x({color:u?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":u?"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:Xl(!i),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Xl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Uf(i||u,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:_f,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Wf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Kf(i?1:0,c,h),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),ra=()=>null;ra.displayName="PlainframeUIStep";var Gf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:u,activeBgColor:i,activeColor:l,completeBgColor:c,completeColor:m,separator:h,titlePosition:f="right",width:T,css:k,className:y,children:x,...g})=>{let d=j(),p=e==="outlined"?"outlined":"subtle",v=de.useMemo(()=>{let C=de.Children.toArray(x).filter(L=>de.isValidElement(L)&&L.type===ra);return C.length?C.map((L,H)=>({index:H,...L.props})):[{value:1},{value:2},{value:3}]},[x]),F=de.useCallback((C,L)=>C?d.palette?.[C]??C:L,[d.palette]),R=de.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(c,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,c,m,d.palette.primary,d.neutral,d.text]),E=de.useMemo(()=>{let C=F(u,d.palette.primary[600]);return typeof C=="string"?C:String(C)},[F,u,d.palette.primary]),[M,$]=de.useState(()=>v.some(L=>L?.value===n)?n:v[0]?.value),K=t!==void 0,W=K?t:M,{activeIndex:S,afterLast:A}=de.useMemo(()=>{let C=v.findIndex(L=>L.value===W);if(C!==-1)return {activeIndex:C,afterLast:false};if(typeof W=="number"){let L=Math.floor(W)-1;if(L>=v.length)return {activeIndex:v.length-1,afterLast:true};if(L>=0)return {activeIndex:L,afterLast:false}}return {activeIndex:0,afterLast:false}},[v,W]),I=de.useCallback(C=>{r||(K||$(C),o?.(C));},[r,K,o]),P=de.useCallback(C=>a||!!v[C]?.complete||(A?true:C<S),[a,v,A,S]),D=de.useCallback(C=>{if(r)return false;let L=v[C];if(!L||L.disabled)return false;if(typeof s=="boolean"){if(s===false&&C>S)return false}else if(typeof s=="function"&&!s(S,C))return false;return true},[r,v,s,S]),[B,z]=de.useState(false);de.useEffect(()=>{let C=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(C)},[]);let w=de.useCallback(C=>{if(!v.length||r)return;let L=S;if(C.key==="ArrowRight")L=Math.min(v.length-1,S+1);else if(C.key==="ArrowLeft")L=Math.max(0,S-1);else if(C.key==="Home")L=0;else if(C.key==="End")L=v.length-1;else return;C.preventDefault(),D(L)&&I(v[L].value);},[v,r,S,D,I]),b=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[$f(T),k],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:w,css:zf,children:v.map((C,L)=>jsx(de.Fragment,{children:jsx(qf,{i:L,item:C,size:b,tokens:R,variant:p,titlePosition:f,isActive:!A&&L===S,completed:P(L),disabled:r||!!C.disabled,connectorColor:E,showConnector:L<v.length-1,animate:B,separator:h,canGoToIndex:D,setSelected:I})},String(C.value??L)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function Yf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Jf=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:u=false,width:i,fullWidth:l=false,rounded:c=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:k,activeTabCss:y,activeIndicatorCss:x})=>{let g=j(),d=he(),p=s==="vertical",v=l||i!=null,F=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:E,contents:M}=de.useMemo(()=>{let Q=[],ne=[];return de.Children.forEach(e,ae=>{if(!de.isValidElement(ae))return;let{type:me,props:Fe}=Yf(ae),He=me===Fr||me?.displayName===Fr.displayName,J=me===Pr||me?.displayName===Pr.displayName;if(He){let oe=Fe;if(oe?.value===void 0)return;Q.push({value:oe.value,disabled:oe.disabled,node:oe.children,className:oe.className,css:oe.css,activeCss:oe.activeCss});}else if(J){let oe=Fe;if(oe?.value===void 0)return;ne.push({value:oe.value,node:oe.children,className:oe.className,css:oe.css});}}),{tabs:Q,contents:ne}},[e]),$=de.useMemo(()=>E.find(Q=>!Q.disabled)?.value,[E]),[K,W]=de.useState(()=>t!==void 0&&E.some(ne=>ne.value===t&&!ne.disabled)?t:$),S=n!==void 0,A=S?n:K,I=de.useRef(null),P=de.useRef([]),D=Math.max(0,E.findIndex(Q=>Q.value===A)),[B,z]=de.useState({left:0,top:0,width:0,height:0}),[w,b]=de.useState(false),[C,L]=de.useState(false),H=de.useCallback(()=>{let Q=I.current,ne=P.current[D];if(!Q||!ne)return;let ae=Q.getBoundingClientRect(),me=ne.getBoundingClientRect();z({left:me.left-ae.left,top:me.top-ae.top,width:me.width,height:me.height});},[D]);de.useLayoutEffect(()=>{H(),w||(b(true),requestAnimationFrame(()=>L(true)));},[H,w]),de.useEffect(()=>{let Q=new ResizeObserver(()=>H());I.current&&Q.observe(I.current);let ne=P.current[D];ne&&Q.observe(ne);let ae=()=>H();return window.addEventListener("resize",ae),()=>{Q.disconnect(),window.removeEventListener("resize",ae);}},[H,D]);let O=(Q,ne)=>{if(!E.length)return Q;let ae=Q;for(let me=0;me<E.length;me++)if(ae=(ae+ne+E.length)%E.length,!E[ae].disabled)return ae;return Q},_=Q=>{S||W(Q),o?.(Q);},N=Q=>{if(!E.length)return;let ne=D;if(Q.key===(p?"ArrowDown":"ArrowRight"))ne=O(D,1);else if(Q.key===(p?"ArrowUp":"ArrowLeft"))ne=O(D,-1);else if(Q.key==="Home")ne=E.findIndex(me=>!me.disabled);else if(Q.key==="End"){let me=[...E].reverse().findIndex(Fe=>!Fe.disabled);ne=me===-1?D:E.length-1-me;}else return;Q.preventDefault();let ae=E[ne]?.value;ae!==void 0&&_(ae),requestAnimationFrame(()=>P.current[ne]?.focus());},U=g.text.primary,G=g.text.secondary,se=g.neutral[500],V=r==="subtle"?g.surface.subtleBg:"transparent",Y=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",le=g.text.primary,ue=r==="subtle"||r==="ghost"||r==="underlined",pe=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Me=r==="subtle",Ce=css({position:"relative",display:v?"flex":"inline-flex",width:v?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:Me?g.spacing.xs:0,background:V,borderRadius:r==="subtle"?c?p?g.radius.lg:g.radius.full:g.radius.lg:"none"}),ve=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:w?1:0,visibility:w?"visible":"hidden",transition:C?`${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"?c?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":Y,...p?{top:`${B.top}px`,height:`${B.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${B.left}px`,width:`${B.width}px`,top:g.spacing.xs,bottom:g.spacing.xs},boxShadow:u&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ee=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}),Re=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${g.spacing.md}`:r==="ghost"&&s!=="vertical"?`${g.spacing.md}`:`${g.spacing.xs} ${g.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&c?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:v?"100%":"auto",flex:"0 0 auto",textAlign:F}:v?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:g.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Z=css({display:"inline-flex",alignItems:"center",justifyContent: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%"}),be=de.useId(),X=new Map;M.forEach((Q,ne)=>X.set(Q.value,`${be}-panel-${ne}`));let ye=Q=>`${be}-tab-${Q}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[pe,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Ce,T],children:[ue&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[ve,Ee,k,x]}),E.map((Q,ne)=>{let ae=A===Q.value;return jsx("button",{ref:me=>{P.current[ne]=me;},role:"tab",id:ye(ne),"aria-selected":ae,"aria-controls":X.get(Q.value),"aria-disabled":Q.disabled||void 0,disabled:Q.disabled,tabIndex:Q.disabled?-1:ne===D?0:-1,className:["plainframe-ui-tab",Q.className||""].join(" ").trim(),onClick:()=>{Q.disabled||_(Q.value);},css:[Re,!Q.disabled&&d(),Q.css,ae?Q.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Z,children:Q.node})},String(Q.value??ne))})]}),M.map((Q,ne)=>{let ae=Q.value===A;if(!ae)return null;let me=E.findIndex(He=>He.value===Q.value),Fe=me>=0?ye(me):void 0;return console.log("rendering panel for",Q.value,"active:",ae),jsx("div",{role:"tabpanel",id:X.get(Q.value),"aria-labelledby":Fe,className:["plainframe-ui-tab-panel",Q.className||""].join(" ").trim(),css:[ie,Q.css],children:Q.node},ne)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,xn=e=>e==null?[]:Array.isArray(e)?e:[e],Ao=(...e)=>css(e.filter(Boolean)),og=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:u=false,fullWidth:i=false,width:l=235,size:c="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:k,showCharCount:y,focusRingMode:x="always",resizable:g=false,className:d,wrapperCss:p,inputCss:v,labelCss:F,helperRowCss:R,helperTextCss:E,charCountCss:M,css:$,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:A,name:I,id:P,tabIndex:D,autoComplete:B,readOnly:z,required:w})=>{let b=j(),C=Xo(),L=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(c)?c:"md",_=H[O],N=b.neutral,U=b.text,G=t!==void 0,[se,V]=useState(n),Y=G?t:se,le=useCallback(ae=>{G||V(ae),o?.(ae);},[G,o]),ue=useMemo(()=>u?N[200]:s&&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",[u,s,m,N,b.surface,b.palette.danger]),pe=b.componentHeights.border,Me=useMemo(()=>m==="outlined"?`${pe} solid ${s?b.palette.danger?.[300]??b.surface.border:b.surface.border}`:"none",[m,pe,s,b.palette.danger,b.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Mo(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),ve=useMemo(()=>Ao({fontSize:_.labelFont,fontWeight:500,color:s?b.palette.danger?.[700]??U.primary:u?N[500]:U.primary,marginBottom:4,display:"inline-block"},...xn(F)),[_.labelFont,s,u,N,U,b.palette.danger,F]),Ee=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:b.spacing.sm,padding:`${Mo(_.paddingY)} 0 ${Mo(_.paddingY)} ${Mo(_.paddingX)}`,background:ue,border:Me,borderRadius:h?b.radius.full:b.radius.md,minHeight:_.minHeight,width:"100%",cursor:u?"not-allowed":"text",opacity:u?.65:1,transition:"box-shadow .18s, border-color .16s"},...xn(p),...xn($)],[b,_,ue,Me,pe,h,u,p,$]),Re=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,Z=useMemo(()=>Ao({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:u?N[500]:s?b.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Mo(_.paddingX),overflowY:"auto",minHeight:Re,"&::placeholder":{color:s?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 ${ue} 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((${Re} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...xn(v)),[g,_,u,s,N,U,b.palette.danger,Re,ue,f,v]),ie=useMemo(()=>Ao({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...xn(R)),[R]),be=useMemo(()=>Ao({fontSize:_.helperFont,color:s?b.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...xn(E)),[_.helperFont,s,b.palette.danger,U,E]),X=useMemo(()=>Ao({fontSize:_.helperFont,color:k&&Y.length>k?b.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...xn(M)),[_.helperFont,k,Y.length,b.palette.danger,U,M]),ye=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=ye.current;if(!ae)return;if(g){let Fe=window.getComputedStyle(ae),He=parseFloat(Fe.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);return}(()=>{let Fe=window.getComputedStyle(ae),He=parseFloat(Fe.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);let re=T?He*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,re)}px`;})();},[Y,f,T,_.minHeight,g]);let Q=a!=null||y?`${P??L}-help`:void 0,ne=P??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:ne,className:"plainframe-ui-textarea-label",css:ve,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[C({enabled:x!=="none",disabled:u,color:s?"danger":void 0}),Ee],"aria-invalid":!!s||void 0,"aria-disabled":u||void 0,onClick:()=>!u&&ye.current?.focus(),children:jsx("textarea",{ref:ye,id:ne,className:"plainframe-ui-textarea-input",css:Z,rows:f,value:Y,onChange:ae=>{let me=ae.target.value;k&&me.length>k||le(me);},placeholder:r||"",disabled:u,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:A,name:I,tabIndex:D,autoComplete:B,readOnly:z,required:w,"aria-invalid":!!s||void 0,"aria-describedby":Q})}),(a!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:Q,className:"plainframe-ui-textarea-helper-text",css:be,children:a}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:X,children:[Y.length,"/",k]})]})]})};var dg=jo,pg={type:"spring",stiffness:920,damping:100},Zl="__toast_root__",mg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Nr=(e,t)=>{for(let n of t){let o=mg(e,n);if(o!=null&&o!=="")return o}},aa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function fg(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 gg=fg(dg),Bt=null,Vn=null,ge={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function tc(){typeof document>"u"||(Bt||(Bt=document.getElementById("toast-host"),Bt||(Bt=document.createElement("div"),Bt.id="toast-host",document.body.appendChild(Bt))),Vn||(Vn=Bt[Zl]??null,Vn||(Vn=createRoot(Bt),Bt[Zl]=Vn,Vn.render(jsx(Na,{children:jsx(Sg,{})})))));}var ee={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},vn=()=>{ee.sync(),ee.notify();},bg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Hr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||ee.timers.has(e.id))return;let o=Date.now(),r=ee.remaining.get(e.id),s=r!=null?Math.max(0,r):n;ee.expiry.set(e.id,o+s);let a=window.setTimeout(()=>De.dismiss(e.id),s);ee.timers.set(e.id,a);}function Lr(e){let t=ee.timers.get(e);t&&(clearTimeout(t),ee.timers.delete(e));}function hg(){let e=false;for(;ee.displayed.length<ge.max&&ee.queue.length;){let t=ee.queue.shift();ee.displayed=[t,...ee.displayed],ee.enterFrom[t.id]="head",ee.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete ee.entering[t.id],vn();}),Hr(t);}e&&vn();}function yg(){if(ee.displayed.length<ge.max)return;let e=ee.displayed.filter(o=>!ee.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=ee.expiry.get(t.id);n!=null&&ee.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),ee.exiting[t.id]=true,ee.displayed=ee.displayed.filter(o=>o.id!==t.id),delete ee.enterFrom[t.id],ee.queue.push(t),vn();}var xg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function vg(e,t){let n=xg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",u=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:u,border:i};let l=s?.onColors??{},c=(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"?c("success","#22C55E","#fff"):n==="warning"?c("warning","#F59E0B","#fff"):n==="error"?c("error","#EF4444","#fff"):{bg:a,fg:u,border:i}}var De=Object.assign((e,t)=>{tc();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&&!de.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(de.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??bg(),a=i=>{let l=i.findIndex(h=>h.id===s);if(l===-1)return false;let c=i[l],m={...c,status:r.status??c.status,content:r.content??c.content,title:r.title??c.title,description:r.description??c.description,startIcon:r.startIcon??c.startIcon,endIcon:r.endIcon??c.endIcon,action:r.action??c.action,onClose:r.onClose??c.onClose,duration:r.duration===void 0?c.duration:r.duration,pauseOnHover:r.pauseOnHover??c.pauseOnHover,showDismiss:r.showDismiss??c.showDismiss,render:r.render??c.render,bare:r.bare??c.bare,onClick:r.onClick??c.onClick,width:r.width??c.width};return i[l]=m,Lr(s),ee.remaining.delete(s),ee.paused.has(s)||Hr(m),vn(),true};if(a(ee.displayed)||a(ee.queue))return s;let u={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?ge.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return ee.displayed.length>=ge.max&&yg(),ee.displayed=[...ee.displayed,u],ee.enterFrom[u.id]="tail",ee.entering[u.id]=true,requestAnimationFrame(()=>{delete ee.entering[u.id],vn();}),vn(),Hr(u),s},{success:(e,t={})=>De(e,{...t,status:"success"}),error:(e,t={})=>De(e,{...t,status:"error"}),warning:(e,t={})=>De(e,{...t,status:"warning"}),info:(e,t={})=>De(e,{...t,status:"info"}),custom:(e,t={})=>De(e,{...t}),update:(e,t)=>De({id:e,...t}),dismiss:e=>{if(!e){let n=ee.displayed.find(o=>!ee.exiting[o.id])?.id;n&&De.dismiss(n);return}Lr(e),ee.remaining.delete(e),ee.paused.delete(e),ee.exiting[e]=true;let t=ee.displayed.find(n=>n.id===e);ee.displayed=ee.displayed.filter(n=>n.id!==e),delete ee.enterFrom[e],vn(),window.setTimeout(()=>t?.onClose?.(),120),hg();},clear:()=>{[...ee.displayed.map(t=>t.id)].forEach(t=>De.dismiss(t));},pause:e=>{if(ee.paused.has(e))return;let t=ee.expiry.get(e);t!=null&&ee.remaining.set(e,Math.max(0,t-Date.now())),ee.paused.add(e),Lr(e);},resume:e=>{if(!ee.paused.has(e))return;ee.paused.delete(e);let t=ee.displayed.find(o=>o.id===e)??ee.queue.find(o=>o.id===e),n=ee.remaining.get(e);t&&Hr(t,n??void 0),ee.remaining.delete(e);},pauseLatest:()=>{let e=ee.displayed.at(-1);e&&De.pause(e.id);},resumeLatest:()=>{let e=ee.displayed.at(-1);e&&De.resume(e.id);},promise:(e,t,n={})=>{let o=De(t.loading,{...n,status:"info",duration:null});return e.then(r=>{De.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{De.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ge.max=e.max),e.position&&(ge.position=e.position),e.gutter!=null&&(ge.gutter=e.gutter),e.zIndex!=null&&(ge.zIndex=e.zIndex),e.duration!==void 0&&(ge.duration=e.duration),e.showDismiss&&(ge.showDismiss=e.showDismiss),e.styles&&(ge.styles={...ge.styles,...e.styles}),e.renderer!==void 0&&(ge.renderer=e.renderer),e.bareRenderer!==void 0&&(ge.bareRenderer=e.bareRenderer);}});function Cg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ge.showDismiss}function Rg(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var Tg=css({display:"flex",alignItems:"flex-start",gap:10}),Ql=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),wg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Eg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Sg=de.memo(function(){let t=useSyncExternalStore(ee.subscribe.bind(ee),()=>ee.snapshot,()=>ee.snapshot),n=j(),o=ge.position.startsWith("bottom"),r=de.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=de.useMemo(()=>({position:"fixed",zIndex:ge.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Rg(ge.position),...ge.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,u)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,c=u>0?ge.gutter:0,m={toast:a,close:De.dismiss,pause:De.pause,resume:De.resume},{bg:h,fg:f,border:T}=vg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:gg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:h,color:f,cursor:a.onClick?"pointer":"default",border:T?`1px solid ${T}`:"1px solid transparent"},y=typeof ge.styles.surface=="function"?ge.styles.surface(a):ge.styles.surface??{},x=Cg(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 v=css({...k,...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",...ge.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:M=>a.onClick?.(a.id,M),children:E});}else if(ge.bareRenderer&&ge.renderer){let E=typeof ge.renderer=="function"?ge.renderer(m):ge.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>a.onClick?.(a.id,M),children:E});}else {let E;ge.renderer?E=typeof ge.renderer=="function"?ge.renderer(m):ge.renderer:a.render&&!a.bare?E=typeof a.render=="function"?a.render(m):a.render:E=jsxs(Fragment,{children:[jsxs("div",{css:Tg,children:[a.startIcon&&jsx("div",{css:Ql,children:a.startIcon}),jsx("div",{css:wg,children:a.content}),a.endIcon&&jsx("div",{css:Ql,children:a.endIcon})]}),a.action&&jsx("div",{css:Eg,children:a.action})]}),R=jsxs("div",{css:v,onClick:M=>a.onClick?.(a.id,M),children:[E,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:F,onClick:M=>{M.stopPropagation(),De.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Ig,{id:a.id,isBottom:o,mt:c,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Ig=de.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:u,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:pg});},[l]);let c={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:a!=null?typeof a=="number"?`${a}px`:a:"none",...ge.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(c),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(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(()=>De.dismiss(n));},onMouseEnter:u?()=>De.pause(n):void 0,onMouseLeave:u?()=>De.resume(n):void 0,children:i})}),ec=false;(function(){ec||(ec=true,tc());})();var Yg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},rc=createContext(null),sc=()=>{let e=useContext(rc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Jg=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:u=false,disableHoverListener:i=false})=>{let[l,c]=useState(!!o),m=n??l,h=R=>{n===void 0&&c(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}),g=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([k,y,x,g]),v=useId(),F=useMemo(()=>({open:m,setOpen:h,id:v,placement:T.placement,autoWidth:u,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,u,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(rc.Provider,{value:F,children:e})},Zg=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=sc(),u=de.isValidElement(t),i=u&&typeof t.type=="string";if(e&&u&&i){let l=t,c="ref"in l?l.ref:void 0,m=s({...l.props,"aria-describedby":a,ref:Yg(c,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return de.cloneElement(l,{...m,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},Qg=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:u,getFloatingProps:i,placement:l,id:c,autoWidth:m,allowArrow:h,arrowRef:f}=sc(),T=j(),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},g=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}),v=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),F=u.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:c,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[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:[v,o],style:{left:F?.x!=null?`${F.x}px`:void 0,top:F?.y!=null?`${F.y}px`:void 0,[R]:"-3px"}})]})})})};function ob(){let e=j();return jsx(Global,{styles:css`
|
|
20
|
+
`,Df=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"}),M=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Ff} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Pf} 1.2s ease-in-out infinite`}):css({}),x=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,M]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:x,children:o})]})});var Mr=8,na=20,Gn=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:M="horizontal",className:x,...y})=>{let b=V(),p=M==="vertical",d=useRef(null),[C,P]=useState(false),[R,w]=useState(false),[I,$]=useState(false),K=e!==void 0,W=useCallback(Y=>Math.min(r,Math.max(o,Y)),[o,r]),k=useCallback(Y=>W(Math.round((Y-o)/s)*s+o),[o,s,W]),[D,S]=useState(()=>k(t??o)),A=K?k(e):D;useEffect(()=>{K||S(Y=>k(Y));},[o,r,s,K,k]);let F=b.palette.primary[600];b.surface.panelBg;let z=b.neutral[500],E=useMemo(()=>{let Y=r-o||1;return (A-o)/Y*100},[A,o,r]),g=useCallback(Y=>{K||S(Y),n?.(Y);},[K,n]),v=useCallback((Y,xe)=>{let Z=d.current;if(!Z)return A;let te=Z.getBoundingClientRect(),se=p?(te.bottom-xe)/te.height:(Y-te.left)/te.width;return se=Math.max(0,Math.min(1,se)),k(o+se*(r-o))},[A,p,o,r,k]),B=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),g(v(Y.clientX,Y.clientY)),P(true));},[a,g,v]),L=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),P(true));},[a]),O=useCallback(Y=>{!C||a||g(v(Y.clientX,Y.clientY));},[C,a,g,v]),_=useCallback(()=>P(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[C,O,_]);let N=useCallback(Y=>{if(a)return;let xe=A;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")xe=A+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")xe=A-s;else if(Y.key==="Home")xe=o;else if(Y.key==="End")xe=r;else return;Y.preventDefault(),g(k(xe));},[a,A,s,o,r,g,k]),U=C||R||I,G=(R||C)&&!a,oe=`color-mix(in srgb, ${F} 25%, transparent)`,j=css({display:"flex",flexDirection:p?"row":"column",alignItems:"center",padding:p?"1rem":"1rem 0",width:p?"fit-content":m?"100%":350,height:p?250:"auto",boxSizing:"border-box"}),J=css({marginBottom:p?0:4,marginRight:p?8:0,color:b.text.primary,userSelect:"none"}),le=css({position:"relative",width:p?Mr:"100%",height:p?"100%":Mr,backgroundColor:b.neutral[200],borderRadius:b.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ce=css({position:"absolute",left:p?"50%":0,top:p?2:"50%",transform:p?"translateX(-50%)":"translateY(-50%)",width:p?Mr:`calc(100% - ${Gn*.5}px)`,height:p?`calc(100% - ${Gn*.5}px)`:Mr,display:"flex",flexDirection:p?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),de=css({width:Gn,height:Gn,borderRadius:"50%",backgroundColor:b.text.primary,opacity:.15,flex:"0 0 auto"}),Fe=css({position:"absolute",left:0,top:p?`calc(${100-E}% )`:0,bottom:0,width:p?"100%":`${E}%`,height:p?`${E}%`:"100%",backgroundColor:a?z:F,borderRadius:b.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ie=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:b.text.onColors.primary,width:na,height:na,left:p?"50%":`calc(${E}% - ${na/2}px)`,bottom:p?`${E}%`:"auto",top:p?"auto":"50%",transform:p?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?b.radius.full:`calc(${b.radius.md} * 0.75)`,border:`2px solid ${a?z:F}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${oe}`:`0 0 0 0px ${oe}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${oe}`,outline:"none"}}),we=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:p?-7.5:-28,left:p?9:-7.5,pointerEvents:"none"}),Ce=css({position:"absolute",top:p?`calc(50% - ${Gn*2.5}px)`:0,left:p?"auto":`calc(50% - ${Gn*3}px)`,transform:p?"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:p?"50%":-2,left:p?-2.5:"50%",transform:p?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),De=h,ne=f,re=T,ue=Math.floor((r-o)/s)+1;return jsxs("div",{...y,role:"group","aria-label":u,className:["plainframe-ui-slider",x||""].join(" ").trim(),css:[j,De],"data-orientation":p?"vertical":"horizontal",children:[u&&!p&&jsx("div",{className:"plainframe-ui-slider-label",css:J,children:u}),jsxs("div",{ref:d,className:"plainframe-ui-slider-track",css:[le,ne],onPointerDown:B,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ce,children:Array.from({length:ue}).map((Y,xe)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:de},xe))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Fe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":A,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:L,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Ie,re],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:we,initial:{opacity:0,scale:.9,y:p?0:4,x:p?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:p?0:4,x:p?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ce,initial:{opacity:0,y:p?0:4,x:p?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:p?0:4,x:p?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:A})})}),null]})]}),u&&p&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Xl.displayName="Slider";var zf=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%"}),Of=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Wf=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"}),Kf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),_f=(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"}),Vf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),jf=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),Uf=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"}),qf=(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}),Gf=fe.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:M}){let x=V(),y=ye(),{MAIN:b,ACTIVE_TEXT:p,ACTIVE_TEXT_OUTLINED:d,COMPLETE_BG:C,COMPLETE_FG:P,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:w,UPCOMING_FG:I}=r,$="transparent",K=I,W=w;s==="subtle"?i?($=C,K=P,W=C):c?($=b,K=p,W=b):($=R,K=I,W=R):i?($=C,K=P,W=C):c?($="transparent",K=d,W=b):($="transparent",K=I,W=w);let k=n.label,D=n.icon??jsx("span",{css:Uf,children:typeof k=="number"?k:t+1}),S=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Wf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[jf(o,$,K,W,String(x.radius.full)),!l&&y({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&M(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof k=="string"?k:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Yl(!i),children:D}),jsx("span",{className:"plainframe-ui-step-check",css:Yl(!!i),children:S})]}),k&&jsx("span",{className:"plainframe-ui-step-label",css:qf(i||c,x.text.primary,x.text.secondary,String(x.radius.xs),Number(x.spacing.xs)),children:k})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:Vf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Kf(x.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:_f(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 Xf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:M,className:x,children:y,...b})=>{let p=V(),d=e==="outlined"?"outlined":"subtle",C=fe.useMemo(()=>{let v=fe.Children.toArray(y).filter(B=>fe.isValidElement(B)&&B.type===sa);return v.length?v.map((B,L)=>({index:L,...B.props})):[{value:1},{value:2},{value:3}]},[y]),P=fe.useCallback((v,B)=>v?p.palette?.[v]??v:B,[p.palette]),R=fe.useMemo(()=>({MAIN:String(P(i,typeof p.palette.primary[600]=="string"?p.palette.primary[600]:"")),ACTIVE_TEXT:String(P(l,typeof p.text.onColors?.primary=="string"?p.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(P(l,typeof p.text.primary=="string"?p.text.primary:"")),COMPLETE_BG:String(P(u,typeof p.palette.primary[600]=="string"?p.palette.primary[600]:"")),COMPLETE_FG:String(P(m,typeof p.text.onColors?.primary=="string"?p.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof p.neutral[100]=="string"?p.neutral[100]:""),UPCOMING_OUTLINE:String(typeof p.neutral[300]=="string"?p.neutral[300]:""),UPCOMING_FG:String(typeof p.text.secondary=="string"?p.text.secondary:"")}),[P,i,l,u,m,p.palette.primary,p.neutral,p.text]),w=fe.useMemo(()=>{let v=P(c,p.palette.primary[600]);return typeof v=="string"?v:String(v)},[P,c,p.palette.primary]),[I,$]=fe.useState(()=>C.some(B=>B?.value===n)?n:C[0]?.value),K=t!==void 0,W=K?t:I,{activeIndex:k,afterLast:D}=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]),S=fe.useCallback(v=>{r||(K||$(v),o?.(v));},[r,K,o]),A=fe.useCallback(v=>a||!!C[v]?.complete||(D?true:v<k),[a,C,D,k]),F=fe.useCallback(v=>{if(r)return false;let B=C[v];if(!B||B.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>k)return false}else if(typeof s=="function"&&!s(k,v))return false;return true},[r,C,s,k]),[H,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 B=k;if(v.key==="ArrowRight")B=Math.min(C.length-1,k+1);else if(v.key==="ArrowLeft")B=Math.max(0,k-1);else if(v.key==="Home")B=0;else if(v.key==="End")B=C.length-1;else return;v.preventDefault(),F(B)&&S(C[B].value);},[C,r,k,F,S]),g=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",x||""].join(" ").trim(),css:[zf(T),M],...b,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:E,css:Of,children:C.map((v,B)=>jsx(fe.Fragment,{children:jsx(Gf,{i:B,item:v,size:g,tokens:R,variant:d,titlePosition:f,isActive:!D&&B===k,completed:A(B),disabled:r||!!v.disabled,connectorColor:w,showConnector:B<C.length-1,animate:H,separator:h,canGoToIndex:F,setSelected:S})},String(v.value??B)))})})};var Fr=()=>null;Fr.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function Jf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Zf=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:M,activeTabCss:x,activeIndicatorCss:y})=>{let b=V(),p=ye(),d=s==="vertical",C=l||i!=null,P=h??(d?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:I}=fe.useMemo(()=>{let Z=[],te=[];return fe.Children.forEach(e,se=>{if(!fe.isValidElement(se))return;let{type:ge,props:Ne}=Jf(se),We=ge===Fr||ge?.displayName===Fr.displayName,qe=ge===Pr||ge?.displayName===Pr.displayName;if(We){let Re=Ne;if(Re?.value===void 0)return;Z.push({value:Re.value,disabled:Re.disabled,node:Re.children,className:Re.className,css:Re.css,activeCss:Re.activeCss});}else if(qe){let Re=Ne;if(Re?.value===void 0)return;te.push({value:Re.value,node:Re.children,className:Re.className,css:Re.css});}}),{tabs:Z,contents:te}},[e]),$=fe.useMemo(()=>w.find(Z=>!Z.disabled)?.value,[w]),[K,W]=fe.useState(()=>t!==void 0&&w.some(te=>te.value===t&&!te.disabled)?t:$),k=n!==void 0,D=k?n:K,S=fe.useRef(null),A=fe.useRef([]),F=Math.max(0,w.findIndex(Z=>Z.value===D)),[H,z]=fe.useState({left:0,top:0,width:0,height:0}),[E,g]=fe.useState(false),[v,B]=fe.useState(false),L=fe.useCallback(()=>{let Z=S.current,te=A.current[F];if(!Z||!te)return;let se=Z.getBoundingClientRect(),ge=te.getBoundingClientRect();z({left:ge.left-se.left,top:ge.top-se.top,width:ge.width,height:ge.height});},[F]);fe.useLayoutEffect(()=>{L(),E||(g(true),requestAnimationFrame(()=>B(true)));},[L,E]),fe.useEffect(()=>{let Z=new ResizeObserver(()=>L());S.current&&Z.observe(S.current);let te=A.current[F];te&&Z.observe(te);let se=()=>L();return window.addEventListener("resize",se),()=>{Z.disconnect(),window.removeEventListener("resize",se);}},[L,F]);let O=(Z,te)=>{if(!w.length)return Z;let se=Z;for(let ge=0;ge<w.length;ge++)if(se=(se+te+w.length)%w.length,!w[se].disabled)return se;return Z},_=Z=>{k||W(Z),o?.(Z);},N=Z=>{if(!w.length)return;let te=F;if(Z.key===(d?"ArrowDown":"ArrowRight"))te=O(F,1);else if(Z.key===(d?"ArrowUp":"ArrowLeft"))te=O(F,-1);else if(Z.key==="Home")te=w.findIndex(ge=>!ge.disabled);else if(Z.key==="End"){let ge=[...w].reverse().findIndex(Ne=>!Ne.disabled);te=ge===-1?F:w.length-1-ge;}else return;Z.preventDefault();let se=w[te]?.value;se!==void 0&&_(se),requestAnimationFrame(()=>A.current[te]?.focus());},U=b.text.primary,G=b.text.secondary,oe=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,ce=r==="subtle"||r==="ghost"||r==="underlined",de=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}),Fe=r==="subtle",Ie=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:d?"column":"row",alignItems:d?"stretch":"center",flexWrap:"nowrap",gap:b.spacing.xs,padding:Fe?b.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?d?b.radius.lg:b.radius.full:b.radius.lg:"none"}),we=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:E?1:0,visibility:E?"visible":"hidden",transition:v?`${d?"top":"left"} .24s var(--pf-ease), ${d?"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,...d?{top:`${H.top}px`,height:`${H.height}px`,left:b.spacing.xs,right:b.spacing.xs}:{left:`${H.left}px`,width:`${H.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"}),Ce=css(r!=="underlined"?{}:d?{background:"transparent",top:`${H.top}px`,height:`${H.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${H.left}px`,width:`${H.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),De=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",...d?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:P}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize: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:oe}}),ne=css({display:"inline-flex",alignItems:"center",justifyContent:d?R[P]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),re=css({marginTop:b.spacing.sm,width:"100%"}),ue=fe.useId(),Y=new Map;I.forEach((Z,te)=>Y.set(Z.value,`${ue}-panel-${te}`));let xe=Z=>`${ue}-tab-${Z}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[de,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:S,role:"tablist","aria-orientation":d?"vertical":"horizontal",onKeyDown:N,css:[Ie,T],children:[ce&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[we,Ce,M,y]}),w.map((Z,te)=>{let se=D===Z.value;return jsx("button",{ref:ge=>{A.current[te]=ge;},role:"tab",id:xe(te),"aria-selected":se,"aria-controls":Y.get(Z.value),"aria-disabled":Z.disabled||void 0,disabled:Z.disabled,tabIndex:Z.disabled?-1:te===F?0:-1,className:["plainframe-ui-tab",Z.className||""].join(" ").trim(),onClick:()=>{Z.disabled||_(Z.value);},css:[De,!Z.disabled&&p(),Z.css,se?Z.activeCss??x:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:ne,children:Z.node})},String(Z.value??te))})]}),I.map((Z,te)=>{let se=Z.value===D;if(!se)return null;let ge=w.findIndex(We=>We.value===Z.value),Ne=ge>=0?xe(ge):void 0;return console.log("rendering panel for",Z.value,"active:",se),jsx("div",{role:"tabpanel",id:Y.get(Z.value),"aria-labelledby":Ne,className:["plainframe-ui-tab-panel",Z.className||""].join(" ").trim(),css:[re,Z.css],children:Z.node},te)})]})};var Po=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,In=e=>e==null?[]:Array.isArray(e)?e:[e],Do=(...e)=>css(e.filter(Boolean)),rg=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:M,showCharCount:x,focusRingMode:y="always",resizable:b=false,className:p,wrapperCss:d,inputCss:C,labelCss:P,helperRowCss:R,helperTextCss:w,charCountCss:I,css:$,onBlur:K,onFocus:W,onKeyDown:k,autoFocus:D,name:S,id:A,tabIndex:F,autoComplete:H,readOnly:z,required:E})=>{let g=V(),v=Yo(),B=useId(),L=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",_=L[O],N=g.neutral,U=g.text,G=t!==void 0,[oe,j]=useState(n),J=G?t:oe,le=useCallback(se=>{G||j(se),o?.(se);},[G,o]),ce=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]),de=g.componentHeights.border,Fe=useMemo(()=>m==="outlined"?`${de} solid ${s?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[m,de,s,g.palette.danger,g.surface.border]),Ie=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]),we=useMemo(()=>Do({fontSize:_.labelFont,fontWeight:500,color:s?g.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...In(P)),[_.labelFont,s,c,N,U,g.palette.danger,P]),Ce=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Po(_.paddingY)} 0 ${Po(_.paddingY)} ${Po(_.paddingX)}`,background:ce,border:Fe,borderRadius:h?g.radius.full:g.radius.md,minHeight:_.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...In(d),...In($)],[g,_,ce,Fe,de,h,c,d,$]),De=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,ne=useMemo(()=>Do({width:"100%",minWidth:0,flex:1,resize:b?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.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(_.paddingX),overflowY:"auto",minHeight:De,"&::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 ${ce} 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((${De} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...In(C)),[b,_,c,s,N,U,g.palette.danger,De,ce,f,C]),re=useMemo(()=>Do({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...In(R)),[R]),ue=useMemo(()=>Do({fontSize:_.helperFont,color:s?g.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...In(w)),[_.helperFont,s,g.palette.danger,U,w]),Y=useMemo(()=>Do({fontSize:_.helperFont,color:M&&J.length>M?g.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...In(I)),[_.helperFont,M,J.length,g.palette.danger,U,I]),xe=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let se=xe.current;if(!se)return;if(b){let Ne=window.getComputedStyle(se),We=parseFloat(Ne.lineHeight||"20"),qe=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),Re=Math.max(We*(f??1),qe);se.style.setProperty("--pf-minh",`${Re}px`);return}(()=>{let Ne=window.getComputedStyle(se),We=parseFloat(Ne.lineHeight||"20"),qe=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),Re=Math.max(We*(f??1),qe);se.style.setProperty("--pf-minh",`${Re}px`);let X=T?We*T:1/0;se.style.height="auto",se.style.height=`${Math.min(se.scrollHeight,X)}px`;})();},[J,f,T,_.minHeight,b]);let Z=a!=null||x?`${A??B}-help`:void 0,te=A??B;return jsxs("div",{className:["plainframe-ui-textarea",p||""].join(" ").trim(),css:Ie,children:[e&&jsx("label",{htmlFor:te,className:"plainframe-ui-textarea-label",css:we,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:y!=="none",disabled:c,color:s?"danger":void 0}),Ce],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&xe.current?.focus(),children:jsx("textarea",{ref:xe,id:te,className:"plainframe-ui-textarea-input",css:ne,rows:f,value:J,onChange:se=>{let ge=se.target.value;M&&ge.length>M||le(ge);},placeholder:r||"",disabled:c,onBlur:K,onFocus:W,onKeyDown:k,autoFocus:D,name:S,tabIndex:F,autoComplete:H,readOnly:z,required:E,"aria-invalid":!!s||void 0,"aria-describedby":Z})}),(a!=null||x&&M!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:re,children:[jsx("span",{id:Z,className:"plainframe-ui-textarea-helper-text",css:ue,children:a}),x&&M!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",M]})]})]})};var pg=jo,mg={type:"spring",stiffness:920,damping:100},Ql="__toast_root__",fg=(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=fg(e,n);if(o!=null&&o!=="")return o}},ia=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function gg(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 bg=gg(pg),Vt=null,Xn=null,he={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function nc(){typeof document>"u"||(Vt||(Vt=document.getElementById("toast-host"),Vt||(Vt=document.createElement("div"),Vt.id="toast-host",document.body.appendChild(Vt))),Xn||(Xn=Vt[Ql]??null,Xn||(Xn=createRoot(Vt),Vt[Ql]=Xn,Xn.render(jsx(Ha,{children:jsx(Ig,{})})))));}var Q={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}};}},kn=()=>{Q.sync(),Q.notify();},hg=()=>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||Q.timers.has(e.id))return;let o=Date.now(),r=Q.remaining.get(e.id),s=r!=null?Math.max(0,r):n;Q.expiry.set(e.id,o+s);let a=window.setTimeout(()=>$e.dismiss(e.id),s);Q.timers.set(e.id,a);}function Lr(e){let t=Q.timers.get(e);t&&(clearTimeout(t),Q.timers.delete(e));}function yg(){let e=false;for(;Q.displayed.length<he.max&&Q.queue.length;){let t=Q.queue.shift();Q.displayed=[t,...Q.displayed],Q.enterFrom[t.id]="head",Q.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete Q.entering[t.id],kn();}),Hr(t);}e&&kn();}function xg(){if(Q.displayed.length<he.max)return;let e=Q.displayed.filter(o=>!Q.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=Q.expiry.get(t.id);n!=null&&Q.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),Q.exiting[t.id]=true,Q.displayed=Q.displayed.filter(o=>o.id!==t.id),delete Q.enterFrom[t.id],Q.queue.push(t),kn();}var vg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function Cg(e,t){let n=vg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,M=o.palette;return {bg:T?.[m]??M?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var $e=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??hg(),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),Q.remaining.delete(s),Q.paused.has(s)||Hr(m),kn(),true};if(a(Q.displayed)||a(Q.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?he.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 Q.displayed.length>=he.max&&xg(),Q.displayed=[...Q.displayed,c],Q.enterFrom[c.id]="tail",Q.entering[c.id]=true,requestAnimationFrame(()=>{delete Q.entering[c.id],kn();}),kn(),Hr(c),s},{success:(e,t={})=>$e(e,{...t,status:"success"}),error:(e,t={})=>$e(e,{...t,status:"error"}),warning:(e,t={})=>$e(e,{...t,status:"warning"}),info:(e,t={})=>$e(e,{...t,status:"info"}),custom:(e,t={})=>$e(e,{...t}),update:(e,t)=>$e({id:e,...t}),dismiss:e=>{if(!e){let n=Q.displayed.find(o=>!Q.exiting[o.id])?.id;n&&$e.dismiss(n);return}Lr(e),Q.remaining.delete(e),Q.paused.delete(e),Q.exiting[e]=true;let t=Q.displayed.find(n=>n.id===e);Q.displayed=Q.displayed.filter(n=>n.id!==e),delete Q.enterFrom[e],kn(),window.setTimeout(()=>t?.onClose?.(),120),yg();},clear:()=>{[...Q.displayed.map(t=>t.id)].forEach(t=>$e.dismiss(t));},pause:e=>{if(Q.paused.has(e))return;let t=Q.expiry.get(e);t!=null&&Q.remaining.set(e,Math.max(0,t-Date.now())),Q.paused.add(e),Lr(e);},resume:e=>{if(!Q.paused.has(e))return;Q.paused.delete(e);let t=Q.displayed.find(o=>o.id===e)??Q.queue.find(o=>o.id===e),n=Q.remaining.get(e);t&&Hr(t,n??void 0),Q.remaining.delete(e);},pauseLatest:()=>{let e=Q.displayed.at(-1);e&&$e.pause(e.id);},resumeLatest:()=>{let e=Q.displayed.at(-1);e&&$e.resume(e.id);},promise:(e,t,n={})=>{let o=$e(t.loading,{...n,status:"info",duration:null});return e.then(r=>{$e.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{$e.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(he.max=e.max),e.position&&(he.position=e.position),e.gutter!=null&&(he.gutter=e.gutter),e.zIndex!=null&&(he.zIndex=e.zIndex),e.duration!==void 0&&(he.duration=e.duration),e.showDismiss&&(he.showDismiss=e.showDismiss),e.styles&&(he.styles={...he.styles,...e.styles}),e.renderer!==void 0&&(he.renderer=e.renderer),e.bareRenderer!==void 0&&(he.bareRenderer=e.bareRenderer);}});function Rg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":he.showDismiss}function Tg(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 wg=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"}}),Eg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Sg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Ig=fe.memo(function(){let t=useSyncExternalStore(Q.subscribe.bind(Q),()=>Q.snapshot,()=>Q.snapshot),n=V(),o=he.position.startsWith("bottom"),r=fe.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=fe.useMemo(()=>({position:"fixed",zIndex:he.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Tg(he.position),...he.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?he.gutter:0,m={toast:a,close:$e.dismiss,pause:$e.pause,resume:$e.resume},{bg:h,fg:f,border:T}=Cg(n,a.status),M={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:bg.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"},x=typeof he.styles.surface=="function"?he.styles.surface(a):he.styles.surface??{},y=Rg(a.showDismiss),b={},p="& .plainframe-ui-toast-close",d="&:hover .plainframe-ui-toast-close";y==="hover"?(b[p]={opacity:0,pointerEvents:"none"},b[d]={opacity:1,pointerEvents:"auto"}):y==="always"?b[p]={opacity:1,pointerEvents:"auto"}:y==="never"&&(b[p]={display:"none"});let C=css({...M,...x,...b}),P=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...he.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:I=>a.onClick?.(a.id,I),children:w});}else if(he.bareRenderer&&he.renderer){let w=typeof he.renderer=="function"?he.renderer(m):he.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:I=>a.onClick?.(a.id,I),children:w});}else {let w;he.renderer?w=typeof he.renderer=="function"?he.renderer(m):he.renderer:a.render&&!a.bare?w=typeof a.render=="function"?a.render(m):a.render:w=jsxs(Fragment,{children:[jsxs("div",{css:wg,children:[a.startIcon&&jsx("div",{css:ec,children:a.startIcon}),jsx("div",{css:Eg,children:a.content}),a.endIcon&&jsx("div",{css:ec,children:a.endIcon})]}),a.action&&jsx("div",{css:Sg,children:a.action})]}),R=jsxs("div",{css:C,onClick:I=>a.onClick?.(a.id,I),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:P,onClick:I=>{I.stopPropagation(),$e.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(kg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),kg=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:mg});},[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",...he.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 y=(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:y,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:b}}).then(()=>$e.dismiss(n));},onMouseEnter:c?()=>$e.pause(n):void 0,onMouseLeave:c?()=>$e.resume(n):void 0,children:i})}),tc=false;(function(){tc||(tc=true,nc());})();var Jg=(...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},Zg=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),M=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),x=useFocus(T.context),y=useDismiss(T.context,{escapeKey:true,outsidePress:true}),b=useRole(T.context,{role:"tooltip"}),{getReferenceProps:p,getFloatingProps:d}=useInteractions([M,x,y,b]),C=useId(),P=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:p,getFloatingProps:d,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,p,d]);return jsx(sc.Provider,{value:P,children:e})},Qg=({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:Jg(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})},eb=({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(),M=l.split("-")[0]||"top",y=M==="bottom"?{opacity:0,y:-8,scale:.98}:M==="top"?{opacity:0,y:8,scale:.98}:M==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},b=y,p=M==="bottom"?"center top":M==="top"?"center bottom":M==="left"?"right center":"left center",d=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:p}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),P=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[M];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[d,n],style:a,initial:y,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:P?.x!=null?`${P.x}px`:void 0,top:P?.y!=null?`${P.y}px`:void 0,[R]:"-3px"}})]})})})};function rb(){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 @@ ${b}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F()
|
|
|
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{Ka as Accordion,os as AccordionDetails,ja as AccordionGroup,ns as AccordionSummary,qa as ActionBar,ei as Alert,ls as AlertDescription,is as AlertTitle,Ni as Autocomplete,Hi as Avatar,Xd as AvatarGroup,Is as Backdrop,np as Badge,hr as BreadCrumbItem,lp as BreadCrumbs,Vi as Button,Xi as ButtonGroup,Zi as Card,Mp as CardContent,Dp as CardDescription,Fp as CardEnd,tl as CardGroup,Ap as CardStart,Pp as CardTitle,sr as Checkbox,rl as Chip,Gp as CodeField,Wn as Container,Yp as ContextZone,rb as CssBaseline,em as Divider,yl as Drawer,Ln as DropdownMenu,xn as DropdownMenuContent,Ii as DropdownMenuSub,Mi as DropdownMenuSubContent,ki as DropdownMenuSubTrigger,Bn as DropdownMenuTrigger,_s as Fade,Tl as Flex,Vs as Grow,Sl as Image,zm as ImageStack,Vm as Kbd,ii as Menu,hs as MenuCheckboxGroup,lo as MenuCheckboxItem,Ht as MenuItem,gn as MenuLabel,Ri as MenuRadioGroup,od as MenuRadioItem,rd as MenuSeparator,vi as MenuSwitchItem,er as MenuVariantCtx,ef as Modal,$l as ModalContent,Bl as ModalTrigger,cf as Pagination,Wu as Popover,di as PopoverAnchor,pi as PopoverContent,ui as PopoverTrigger,to as Progress,gf as Quote,Cf as RadioGroup,Rf as RadioItem,If as Rotate,Vl as Select,ea as SelectItem,Df as Skeleton,Xs as Slide,Xl as Slider,sa as Step,Xf as Stepper,gs as Switch,Fr as Tab,Pr as TabContent,Zf as Tabs,rg as TextArea,Qo as TextField,Ha as ThemeProvider,Zg as Tooltip,eb as TooltipContent,Qg as TooltipTrigger,Vn as Typography,Sa as defaultDarkTheme,jo as defaultLightTheme,Qn as surfaceFromNeutral,Vo as textDark,_o as textLight,$e as toast,Rc as useColorMode,Td as useDropdownMenuActiveIndex,V as usePlainframeUITheme,_u as usePopoverContext,Tc as usePrimary,ub as usePrimitives};
|