plainframe-ui 0.1.75 → 0.1.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import me,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,useLayoutEffect,Children,memo,useSyncExternalStore}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var va={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},Ca={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},Ra={sm:32,md:36,lg:40,border:"1px"},Ta={fonts:{sans:"system-ui, -apple-system, Segoe UI, Roboto, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},sizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px","6xl":"60px"}},Vr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},jr={0:"#080808",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ya={mono:{0:"#FFFFFF",50:"#FAFAFA",100:"#F2F2F2",200:"#E6E6E6",300:"#D1D1D1",400:"#8A8A8A",500:"#2A2A2A",600:"#1A1A1A",700:"#121212",800:"#0B0B0B",900:"#000000"},danger:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},success:{0:"#FFFFFF",50:"#EEFFF3",100:"#D7FFE8",200:"#d6ffe7ff",300:"#8EF5BB",400:"#5BEA9A",500:"#0FD45D",600:"#00C853",700:"#109C47",800:"#0E8242",900:"#064D2B"},warning:{0:"#FFFFFF",50:"#FFF7EB",100:"#FFEFC6",200:"#FFE094",300:"#FFC552",400:"#FFB83A",500:"#FFA414",600:"#FF9F0A",700:"#D97500",800:"#AF5E00",900:"#6E3600"},info:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},sky:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},red:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},amber:{0:"#FFFFFF",50:"#FFF3EA",100:"#FFE3D1",200:"#FFC7A6",300:"#FFAC80",400:"#FF874D",500:"#FF6C1F",600:"#FF5A00",700:"#D24500",800:"#B63C00",900:"#6F2300"},orange:{0:"#FFFFFF",50:"#FFF4EB",100:"#FFE6CC",200:"#FFCE9E",300:"#FFAE66",400:"#FF8B33",500:"#FF7310",600:"#FF6B00",700:"#CC4400",800:"#AF3F00",900:"#6B2400"},yellow:{0:"#FFFFFF",50:"#FFFAE6",100:"#FFF2BF",200:"#FFE780",300:"#FFDB3D",400:"#FFD000",500:"#FFE03F",600:"#FFD60A",700:"#B38600",800:"#8E6D00",900:"#534300"},lime:{0:"#FFFFFF",50:"#F6FFE8",100:"#E7FFC2",200:"#CCFF83",300:"#A8FA3D",400:"#8BE11C",500:"#87DE10",600:"#7ACC00",700:"#4A8C00",800:"#3B7100",900:"#224300"},green:{0:"#FFFFFF",50:"#F0FFF5",100:"#DBFFE9",200:"#BDF7CF",300:"#8FE7A8",400:"#5BD57D",500:"#1DAE52",600:"#16A34A",700:"#168A40",800:"#136A34",900:"#0B3D1F"},teal:{0:"#FFFFFF",50:"#EDFFFB",100:"#D2FFF4",200:"#A6FAEA",300:"#74EEDC",400:"#41DECB",500:"#00CFAA",600:"#00BFA5",700:"#0C8C7F",800:"#0B786C",900:"#084741"},cyan:{0:"#FFFFFF",50:"#EFFFFF",100:"#D4FCFF",200:"#AFF5FD",300:"#7FE8F6",400:"#45D3EB",500:"#09C6E7",600:"#00B8D9",700:"#0A7C92",800:"#0B6E81",900:"#0A4250"},blue:{0:"#FFFFFF",50:"#EFF6FF",100:"#DBE8FF",200:"#B8D3FF",300:"#90BAFF",400:"#5E97FF",500:"#406FFF",600:"#2F66FF",700:"#2452DE",800:"#2248C8",900:"#172C80"},indigo:{0:"#FFFFFF",50:"#EEF2FF",100:"#E0E6FF",200:"#C5D0FF",300:"#A3B5FF",400:"#879CFF",500:"#707AF5",600:"#5A63F3",700:"#4951DA",800:"#3E40BF",900:"#2A2A82"},purple:{0:"#FFFFFF",50:"#F4F0FF",100:"#E8DBFF",200:"#D2B8FF",300:"#B590FF",400:"#996AF5",500:"#7A52F1",600:"#6B3CF0",700:"#592FBE",800:"#4D27A3",900:"#2F1767"},magenta:{0:"#FFFFFF",50:"#FFF0FE",100:"#FCE0FF",200:"#F7BCFF",300:"#F393FD",400:"#E85FF8",500:"#C645D6",600:"#C026D3",700:"#951CAB",800:"#801790",900:"#4C0C59"},pink:{0:"#FFFFFF",50:"#FFF0F7",100:"#FFE0F0",200:"#FFC0E2",300:"#FF9ACE",400:"#FF6CB3",500:"#ED5CA2",600:"#EC4899",700:"#AB236F",800:"#96205D",900:"#5A1238"},rose:{0:"#FFFFFF",50:"#FFF0F3",100:"#FFE1E9",200:"#FFC1D3",300:"#FF98B8",400:"#FF6B98",500:"#EE4278",600:"#E52E69",700:"#B52156",800:"#991A43",900:"#5B0F28"}},xa={mono:{0:"#0B0B0C",50:"#0F0F10",100:"#151515",200:"#1B1B1C",300:"#232323",400:"#DADADA",500:"#E0E0E0",600:"#EDEDED",700:"#F5F5F5",800:"#FCFCFC",900:"#FFFFFF"},danger:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},success:{0:"#06150B",50:"#0A1B10",100:"#0E2416",200:"#11301C",300:"#143B21",400:"#16502C",500:"#22D85A",600:"#00C853",700:"#2FE976",800:"#7FF1AE",900:"#D6FADF"},warning:{0:"#150E05",50:"#1C1408",100:"#261B0B",200:"#31240E",300:"#3D2C12",400:"#583C16",500:"#FFA61A",600:"#FF9F0A",700:"#FFB347",800:"#FFD089",900:"#FFF0C9"},info:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},sky:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},red:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},amber:{0:"#150D07",50:"#1C120A",100:"#26180E",200:"#311F12",300:"#3E2716",400:"#59361C",500:"#FF6A1E",600:"#FF5A00",700:"#FF8747",800:"#FFB98A",900:"#FFE2CC"},orange:{0:"#140D07",50:"#1B120A",100:"#25190D",200:"#302010",300:"#3B2813",400:"#553817",500:"#FF7F22",600:"#FF6B00",700:"#FF9247",800:"#FFBE8A",900:"#FFE1CC"},yellow:{0:"#141303",50:"#1B1906",100:"#25210A",200:"#2F2A0D",300:"#383212",400:"#524717",500:"#FFE042",600:"#FFD60A",700:"#FFE457",800:"#FFF194",900:"#FFF8CF"},lime:{0:"#0C1306",50:"#101A08",100:"#14210B",200:"#1A2B0F",300:"#203614",400:"#2A4A1A",500:"#86E21A",600:"#7ACC00",700:"#9EEA3B",800:"#C9F57F",900:"#EAFCC4"},green:{0:"#07140C",50:"#0B1B11",100:"#0E2416",200:"#112C1B",300:"#143722",400:"#17502F",500:"#20BF55",600:"#16A34A",700:"#39C964",800:"#86E5A5",900:"#D4F6E1"},teal:{0:"#081815",50:"#0B1F1C",100:"#0F2824",200:"#13322E",300:"#173E39",400:"#14584F",500:"#14CEBD",600:"#00BFA5",700:"#2CD6C6",800:"#7FEAE3",900:"#CFF7F3"},cyan:{0:"#07171C",50:"#0A1E24",100:"#0E2830",200:"#11333D",300:"#153E4A",400:"#165B6A",500:"#20CBE6",600:"#00B8D9",700:"#3FD2E9",800:"#93EBF6",900:"#D5F7FC"},blue:{0:"#081421",50:"#0A1829",100:"#0E2139",200:"#112A4B",300:"#153660",400:"#184A86",500:"#4A78FF",600:"#2F66FF",700:"#5A8AFF",800:"#A7C3FF",900:"#D9E7FF"},indigo:{0:"#0B1023",50:"#0E162C",100:"#141F3F",200:"#1C2A56",300:"#24366E",400:"#2F4894",500:"#707CF6",600:"#5A63F3",700:"#7D86FF",800:"#B5C0FF",900:"#E0E6FF"},purple:{0:"#100B1F",50:"#130E26",100:"#1A1638",200:"#231F4E",300:"#2E2A67",400:"#3C388D",500:"#8256F3",600:"#6B3CF0",700:"#8B66FA",800:"#C1B0FF",900:"#E4DCFF"},magenta:{0:"#160A18",50:"#1C0C21",100:"#25102E",200:"#321544",300:"#421A5C",400:"#58247C",500:"#CB44DB",600:"#C026D3",700:"#D960EB",800:"#F0B5FA",900:"#F9E4FE"},pink:{0:"#170911",50:"#1D0C18",100:"#271220",200:"#371830",300:"#462042",400:"#622C5C",500:"#F067AE",600:"#EC4899",700:"#F679BB",800:"#FFC2E1",900:"#FFE6F3"},rose:{0:"#17090E",50:"#1F0C13",100:"#2A121B",200:"#3A1B28",300:"#4B2636",400:"#673449",500:"#EE457B",600:"#E52E69",700:"#FF558A",800:"#FFA9C6",900:"#FFE0EA"}},wa=e=>({...e,red:e.danger,error:e.danger,green:e.success,success:e.success,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),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]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),vc=["danger","success","warning","info","red","amber","orange","yellow","lime","green","teal","cyan","sky","blue","indigo","purple","magenta","pink","rose","mono"],Ea=e=>vc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),Vo={spacing:va,radius:Ca,componentHeights:Ra,typography:Ta,neutral:Vr,palette:{...wa(ya),primary:ya.mono},surface:Qn("light",Vr),text:{...Ko(Vr),onColors:{primary:"#FFFFFF",...Ea({yellow:"#000000"})}}},Sa={spacing:va,radius:Ca,componentHeights:Ra,typography:Ta,neutral:jr,palette:{...wa(xa),primary:xa.mono},surface:Qn("dark",jr),text:{..._o(jr),onColors:{primary:"#000000",...Ea({yellow:"#000000",mono:"#000000"})}}};function ka(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>{n.delete(o);})}}var Fa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ht=e=>Fa[e]??e;function un(e){let t={...e};return Object.entries(Fa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var qr=me.createContext(null),Pa=me.createContext(null),Gr=me.createContext({setMode:e=>{},toggleMode:()=>{}}),Da=me.createContext({setPrimary:e=>{}}),Na=me.createContext(null);function V(){return useTheme()}function Tc(){let e=me.useContext(qr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=me.useContext(Gr),[n,o]=me.useState(()=>e.get());return me.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function wc(){let e=me.useContext(Pa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=me.useContext(Da),[n,o]=me.useState(()=>e.get());return me.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function pb(e){let t=me.useContext(Na);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Tc(),{primary:o}=wc(),r=me.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ht(o)]??s.palette.primary,c=un(s.text.onColors)[ht(o)]??Xr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...un(s.text.onColors),primary:c,[ht(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function jo(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 Xr(e){let t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16),s=c=>{let i=c/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function Aa(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Ur(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Yr(e,t,n){let o=[],r=i=>i.startsWith("var(")?i.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():i;o.push(`--pf-font-sans:${r(e.typography.fonts.sans)};`),o.push(`--pf-font-mono:${r(e.typography.fonts.mono)};`),o.push(`--pf-text-primary:${e.text.primary};`),o.push(`--pf-text-secondary:${e.text.secondary};`),o.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([i,l])=>o.push(`--pf-text-on-${i}:${l};`)),Object.entries(e.spacing).forEach(([i,l])=>o.push(`--pf-space-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([i,l])=>o.push(`--pf-radius-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([i,l])=>o.push(`--pf-fontSize-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([i,l])=>o.push(`--pf-cmph-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([i,l])=>o.push(`--pf-neutral-${i}:${l};`)),o.push(`--pf-surface-appBg:${e.surface.appBg};`),o.push(`--pf-surface-panelBg:${e.surface.panelBg};`),o.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),o.push(`--pf-surface-panelHover:${e.surface.panelHover};`),o.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),o.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),o.push(`--pf-surface-border:${e.surface.border};`),o.push("--pf-focus-main:var(--pf-neutral-400);"),o.push(n==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([i,l])=>{Object.entries(l).forEach(([u,m])=>{o.push(`--pf-palette-${i}-${u}:${m};`);});});let s="300";Object.keys(e.palette).forEach(i=>{o.push(`--pf-focus-${i}-main: var(--pf-palette-${i}-${s});`),o.push(`--pf-focus-${i}-soft: transparent;`);});let a=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(i=>o.push(`--pf-primary-${i}:var(--pf-palette-${a}-${i});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let c=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),u=parseInt(l.slice(0,2),16),m=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=k=>{let y=k/255;return y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)};return .2126*f(u)+.7152*f(m)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${c};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return Yr(e,t,n).join("")}var Jr=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)=>{Jr(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");},Ha=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",c=me.useContext(qr),i=me.useContext(Gr),l=!!c,m=useRef((()=>{if(!s)try{let S=JSON.parse(localStorage.getItem(o)||"null");if(S?.mode==="light"||S?.mode==="dark")return S.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),h=me.useMemo(()=>c??ka(m.current),[c]),f=me.useMemo(()=>ka(a),[]);me.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),k=useRef(0),y=useRef(r??"__root__");me.useLayoutEffect(()=>{let S=0,g=T.current;for(;g&&g!==document.body;)g.hasAttribute("data-pfui-scope")&&S++,g=g.parentElement;k.current=S;},[r]);let x=useMemo(()=>{let S=jo(Vo,t),g=jo(S,t?.light),v=t?.light?.primaryKey??a,$=ht(v),N=g.palette.primary??g.palette[$]??g.palette.mono,O=un({...Ko(g.neutral).onColors,...g.text.onColors}),_=O[$]??Xr(N[600]),H=t?.surface||t?.light?.surface?g.surface:Qn("light",g.neutral),U={...t?.text||t?.light?.text?g.text:Ko(g.neutral),onColors:un({...O,primary:_,[$]:_})};return {...g,palette:{...g.palette,primary:N},surface:H,text:U}},[t,a]),b=useMemo(()=>{let S=jo(Sa,t),g=jo(S,t?.dark),v=t?.dark?.primaryKey??a,$=ht(v),N=g.palette.primary??g.palette[$]??g.palette.mono,O=un({..._o(g.neutral).onColors,...g.text.onColors}),_=O[$]??Xr(N[600]),H=t?.surface||t?.dark?.surface?g.surface:Qn("dark",g.neutral),U={...t?.text||t?.dark?.text?g.text:_o(g.neutral),onColors:un({...O,primary:_,[$]:_})};return {...g,palette:{...g.palette,primary:N},surface:H,text:U}},[t,a]),d=useRef(null),p=useRef(null),C=me.useInsertionEffect||me.useLayoutEffect,M=useCallback(()=>{let S=Ur(r);Aa(p,s?`pfui-guard-${r}`:"pfui-guard-root"),p.current.textContent=`${S} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{p.current.textContent="";});},[r,s]);C(()=>{Aa(d,s?`pfui-vars-${r}`:"pfui-vars-root");let S=t?.light?.primaryKey??t?.primaryKey??a,g=t?.dark?.primaryKey??t?.primaryKey??a,v=Ur(r),$=Uo(x,ht(S),"light"),N=Uo(b,ht(g),"dark");d.current.textContent=`${v}.pf-light{${$}}
2
- ${v}.pf-dark{${N}}`+(s?`
3
- ${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[x,b,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,a]);let R=useRef(false);me.useLayoutEffect(()=>{if(R.current)return;R.current=true;let S=s?T.current:document.documentElement;if(!S)return;let g=h.get();Jr(S),qo(S,g),S.setAttribute("data-pfui-mode",g),S.setAttribute("data-pfui-primary",f.get()),l||h.set(g);},[s,h,f,l]);let w=useCallback(()=>{window.__pfuiActiveScope={id:y.current,depth:k.current,ts:Date.now()};},[]),D=useCallback(()=>{let S=s?T.current:document.documentElement,g={capture:true},v=()=>w();return S?.addEventListener("pointerdown",v,g),S?.addEventListener("mouseenter",v,g),S?.addEventListener("focusin",v,g),S?.addEventListener("keydown",v,g),()=>{S?.removeEventListener("pointerdown",v,g),S?.removeEventListener("mouseenter",v,g),S?.removeEventListener("focusin",v,g),S?.removeEventListener("keydown",v,g);}},[s,w]),L=useCallback(S=>{let g=window.__pfuiActiveScope,v=g&&Date.now()-g.ts<1500;if(!g||!v||g.id!==y.current)return;let $=h.get(),N=f.get(),_=Yr($==="light"?x:b,ht(N),$);Ma(S,_),qo(S,$),S.setAttribute("data-pfui-portal-owner",y.current),S.setAttribute("data-pfui-mode",$),S.setAttribute("data-pfui-primary",N);},[h,f,x,b]),K=S=>{if(S.getAttribute("data-floating-ui-portal")==="true"||S.getAttribute("data-radix-portal")==="true"||S.getAttribute("data-portal")==="true")return true;let g=S.getAttribute("role");if(g==="tooltip"||g==="dialog")return true;let v=window.getComputedStyle(S);return v.position==="fixed"||v.position==="absolute"},W=useCallback(()=>{let S=new MutationObserver(g=>{for(let v of g)v.addedNodes.forEach($=>{$ instanceof HTMLElement&&(K($)&&L($),$.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(N=>L(N)));});});return S.observe(document.body,{childList:true,subtree:true}),()=>S.disconnect()},[L]);me.useEffect(()=>{let S=D(),g=W();return ()=>{S(),g();}},[D,W]);let E=useCallback(S=>{let g=s?T.current:document.documentElement;g&&(Jr(g),qo(g,S),g.setAttribute("data-pfui-mode",S),g.setAttribute("data-pfui-primary",f.get()));},[s,f]),A=useCallback(S=>{let g=ht(f.get()),$=Yr(S==="light"?x:b,g,S);document.querySelectorAll(`[data-pfui-portal-owner="${y.current}"]`).forEach(N=>{Ma(N,$),qo(N,S),N.setAttribute("data-pfui-mode",S),N.setAttribute("data-pfui-primary",g);});},[x,b,f]);me.useLayoutEffect(()=>{A(h.get());},[A,x,b,a,h]),me.useLayoutEffect(()=>{if(!l)return;let S=()=>{let v=h.get();M(),E(v),A(v);};S();let g=h.subscribe(S);return ()=>g()},[l,h,M,E,A]);let I=useCallback(S=>{if(h.get()!==S&&(M(),h.set(S),E(S),A(S),!s))try{let g=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...g,mode:S}));}catch{}},[h,s,o,M,E,A]),F=useCallback(()=>I(h.get()==="light"?"dark":"light"),[I,h]),P=useCallback(S=>{f.set(S);let g=Ur(r),v=Uo(x,ht(S),"light"),$=Uo(b,ht(S),"dark");d.current&&(d.current.textContent=`${g}.pf-light{${v}}
4
- ${g}.pf-dark{${$}}`+(s?`
5
- ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),M();let N=h.get();if(E(N),A(N),!s)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:S}));}catch{}},[x,b,r,s,h,f,M,E,A]),B=l?i:{setMode:I,toggleMode:F},z=jsx(Na.Provider,{value:{light:x,dark:b},children:jsx(qr.Provider,{value:h,children:jsx(Pa.Provider,{value:f,children:jsx(Gr.Provider,{value:B,children:jsx(Da.Provider,{value:{setPrimary:P},children:jsx(ThemeProvider,{theme:Ec(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 Ec(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 Sc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},La=(e,t)=>{let n=Sc(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 Xo(){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||""},ts=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:a},c)=>{let i=V(),l=i.typography.sizes.sm,u=20,m=10,h=i.spacing.lg,f=i.spacing.md,T=Number(i.componentHeights?.md),k=i.text,y=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:T,padding:`${f} ${h}`,gap:m,fontSize:l,color:k.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),b=css({marginRight:0,marginLeft:-2,lineHeight:0,color:i.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:i.text.secondary});return jsxs("div",{ref:c,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[y,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[b,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})})]})});ts.__PFUI_SLOT="AccordionSummary";ts.displayName="AccordionSummary";var ns=({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})};ns.__PFUI_SLOT="AccordionDetails";ns.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,k=u.componentHeights?.border??1,y=Oa(k)??"1px",x=e!==void 0,[b,d]=useState(!!t),p=x?!!e:b,C=ye(),[M,R]=useState(0),[w,D]=useState(false),L=useRef(null),K=useRef(null),W=useRef(null),E=()=>{if(!p)return;let H=document.activeElement;K.current?.contains(H)&&W.current?.focus();},A=()=>{s||(E(),x?n?.(!e):d(H=>{let q=!H;return n?.(q),q}));},I=me.Children.toArray(l).filter(H=>isValidElement(H)),F=I.findIndex(H=>Wa(H)==="AccordionSummary"),P=I.findIndex(H=>Wa(H)==="AccordionDetails");F===-1&&I.length&&(F=0),P===-1&&(P=I.findIndex((H,q)=>q!==F),P===-1&&I.length>=2&&(P=1));let B=I[F]??null,z=I[P]??null,S=r==="subtle"?u.surface.subtleBg:r==="outlined"?u.surface.panelBg:"transparent",g=css({backgroundColor:S,color:T.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${u.surface.border}`:"none",outline:"none",marginBottom:u.spacing.sm,maxWidth:a!=null?Oa(a):void 0,width:c?"100%":a!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let H=L.current;H&&R(H.scrollHeight);},[p,l]),useEffect(()=>{let H=L.current;if(!H)return;let q=new ResizeObserver(()=>R(H.scrollHeight));return q.observe(H),()=>q.disconnect()},[]),useEffect(()=>{M>0&&!w&&D(true);},[M,w]),useLayoutEffect(()=>{if(!p&&K.current){let H=document.activeElement;K.current.contains(H)&&W.current?.focus();}},[p]),useLayoutEffect(()=>{let H=K.current;if(!H)return;let q=Array.from(H.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));p?(q.forEach(U=>{let ae=U.dataset.accordionTabindex;ae!=null&&(ae===""?U.removeAttribute("tabindex"):U.tabIndex=Number(ae),delete U.dataset.accordionTabindex);}),H.removeAttribute("inert")):(q.forEach(U=>{U.dataset.accordionTabindex==null&&(U.dataset.accordionTabindex=U.hasAttribute("tabindex")?U.getAttribute("tabindex")??"":""),U.tabIndex=-1;}),H.setAttribute("inert",""));},[p]);let v=css({maxHeight:p?M||"none":0,overflow:p&&!w?"visible":"hidden",transition:w?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:w?"max-height":void 0}),$=css({opacity:p?1:0,transform:p?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),N=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:[C(),g,i],tabIndex:s?-1:0,ref:W,role:"button","aria-expanded":p,"aria-controls":m,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:H=>{H.detail===0&&document.activeElement!==W.current||A();},onKeyDown:H=>{s||document.activeElement===W.current&&H.target===W.current&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),A());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),N],children:O}),jsx("div",{id:m,"aria-hidden":!p,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:K,onClick:H=>H.stopPropagation(),children:jsx("div",{ref:L,className:"plainframe-ui-accordion-details-inner",css:$,children:_})})]})};Ka.displayName="Accordion";var Bc=e=>isValidElement(e),$c=e=>Bc(e)?e.type?.displayName||e.type?.name:void 0,Va=e=>$c(e)==="Accordion",zc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Oc=(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),k=Children.toArray(e),y=k.filter(Va),x=y.length,b=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}),C=o?b?r??null:d:null,M=Oc(f.componentHeights?.border,1),R=f.surface.border,w=f.radius.md,D=n,L=D==="outlined";useEffect(()=>{let A=T.current;if(!A)return;let I=F=>{if(F.key!=="ArrowDown"&&F.key!=="ArrowUp"&&F.key!=="Home"&&F.key!=="End")return;let B=Array.from(A.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(B.length===0)return;let z=document.activeElement,S=B.findIndex(v=>v.contains(z));if(S===-1)return;F.preventDefault();let g=S;F.key==="ArrowDown"?g=(S+1)%B.length:F.key==="ArrowUp"?g=(S-1+B.length)%B.length:F.key==="Home"?g=0:F.key==="End"&&(g=B.length-1),B[g]?.focus();};return A.addEventListener("keydown",I),()=>A.removeEventListener("keydown",I)},[x]);let K=css({display:"flex",flexDirection:"column",maxWidth:i!=null?zc(i):void 0,width:l?"100%":i!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&L?`${M} solid ${R}`:"none",borderRadius:t&&L?w:void 0,background:t&&L?f.surface.panelBg:"transparent"}),W=0,E=[];return k.forEach((A,I)=>{if(!Va(A)){E.push(A);return}let F=A.props,P=W++,B=P===0,z=P===x-1,S=c||!!F.disabled,g=D??F.variant,v=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:B?w:0,borderTopRightRadius:B?w:0,borderBottomLeftRadius:z?w:0,borderBottomRightRadius:z?w:0}):css({width:"100%",marginBottom:0}),$=!B&&x>1&&t?css({borderTop:`${M} solid ${R}`}):null,N=L?css({border:"1px solid transparent"}):null,O={variant:g,disabled:S,width:"100%",css:[F.css,v,N,$],className:[F.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=F.onChange,H=C===P;O.open=H,O.defaultOpen=void 0,O.onChange=q=>{let U=q?P:null;b||p(U),a?.(U),_?.(q);};}E.push(cloneElement(A,{...F,...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",u||""].join(" ").trim(),css:[K,h],children:E})};ja.displayName="AccordionGroup";var qt=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:k="toolbar","aria-label":y,onClose:x})=>{let b=V(),d=useRef(null),p=useRef(null),C=useRef(false),M=useRef(t),R=n.horizontal??"center",w=n.vertical??"bottom",D=g=>typeof g=="string"?b.spacing[g]??g:g,L=g=>typeof g=="string"?b.radius[g]??g:g,K=qt(D(c)),W=qt(D(i)),E=qt(D(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:w==="top"?"flex-start":w==="bottom"?"flex-end":"center"},I=()=>`${R==="left"?"left":R==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,F=()=>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)",P=()=>w==="center"&&R==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",B=24,z={margin:B,marginTop:w==="top"?`calc(${B}px + ${K} + ${E})`:B,marginBottom:w==="bottom"?`calc(${B}px + ${K} + ${E})`:B,marginLeft:R==="left"?`calc(${B}px + ${K} + ${W})`:B,marginRight:R==="right"?`calc(${B}px + ${K} + ${W})`:B,padding:m?0:qt(D(r)),background:m?"transparent":b.surface.panelBg,border:m?"none":`1px solid ${b.surface.border}`,borderRadius:m?0:qt(L(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:qt(D(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?qt(f):"auto",height:T?qt(T):"auto",maxWidth:h?"100%":"none"},S=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let g=d.current;if(!g)return;let v=F(),$=P();if(!C.current){C.current=true,M.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?$:v;return}if(M.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?$:v;return}M.current=t,p.current&&p.current.cancel();let N=t?[{opacity:0,transform:v},{opacity:1,transform:$}]:[{opacity:1,transform:$},{opacity:0,transform:v}];return p.current=g.animate(N,{duration:250,easing:"ease",fill:"forwards"}),()=>{p.current&&p.current.cancel();}},[t,R,w]),useEffect(()=>{if(!t||!x)return;let g=v=>{v.key==="Escape"&&x();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t,x]),jsx("div",{css:A,children:jsx("div",{ref:d,css:S,style:z,role:k,"aria-label":y,"aria-hidden":!t,...!t&&{inert:true},children:e})})};qa.displayName="ActionBar";var Xa=(e,t,n)=>Math.min(n,Math.max(t,e)),os=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ga=1,Uc=keyframes`100% { transform: rotate(360deg); }`,qc=keyframes`
1
+ import me,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,useLayoutEffect,Children,memo,useSyncExternalStore}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var va={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},Ca={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},Ra={sm:32,md:36,lg:40,border:"1px"},Ta={fonts:{sans:"system-ui, -apple-system, Segoe UI, Roboto, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},sizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px","6xl":"60px"}},Vr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},jr={0:"#080808",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ya={mono:{0:"#FFFFFF",50:"#FAFAFA",100:"#F2F2F2",200:"#E6E6E6",300:"#D1D1D1",400:"#8A8A8A",500:"#2A2A2A",600:"#1A1A1A",700:"#121212",800:"#0B0B0B",900:"#000000"},danger:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},success:{0:"#FFFFFF",50:"#EEFFF3",100:"#D7FFE8",200:"#d6ffe7ff",300:"#8EF5BB",400:"#5BEA9A",500:"#0FD45D",600:"#00C853",700:"#109C47",800:"#0E8242",900:"#064D2B"},warning:{0:"#FFFFFF",50:"#FFF7EB",100:"#FFEFC6",200:"#FFE094",300:"#FFC552",400:"#FFB83A",500:"#FFA414",600:"#FF9F0A",700:"#D97500",800:"#AF5E00",900:"#6E3600"},info:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},sky:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},red:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},amber:{0:"#FFFFFF",50:"#FFF3EA",100:"#FFE3D1",200:"#FFC7A6",300:"#FFAC80",400:"#FF874D",500:"#FF6C1F",600:"#FF5A00",700:"#D24500",800:"#B63C00",900:"#6F2300"},orange:{0:"#FFFFFF",50:"#FFF4EB",100:"#FFE6CC",200:"#FFCE9E",300:"#FFAE66",400:"#FF8B33",500:"#FF7310",600:"#FF6B00",700:"#CC4400",800:"#AF3F00",900:"#6B2400"},yellow:{0:"#FFFFFF",50:"#FFFAE6",100:"#FFF2BF",200:"#FFE780",300:"#FFDB3D",400:"#FFD000",500:"#FFE03F",600:"#FFD60A",700:"#B38600",800:"#8E6D00",900:"#534300"},lime:{0:"#FFFFFF",50:"#F6FFE8",100:"#E7FFC2",200:"#CCFF83",300:"#A8FA3D",400:"#8BE11C",500:"#87DE10",600:"#7ACC00",700:"#4A8C00",800:"#3B7100",900:"#224300"},green:{0:"#FFFFFF",50:"#F0FFF5",100:"#DBFFE9",200:"#BDF7CF",300:"#8FE7A8",400:"#5BD57D",500:"#1DAE52",600:"#16A34A",700:"#168A40",800:"#136A34",900:"#0B3D1F"},teal:{0:"#FFFFFF",50:"#EDFFFB",100:"#D2FFF4",200:"#A6FAEA",300:"#74EEDC",400:"#41DECB",500:"#00CFAA",600:"#00BFA5",700:"#0C8C7F",800:"#0B786C",900:"#084741"},cyan:{0:"#FFFFFF",50:"#EFFFFF",100:"#D4FCFF",200:"#AFF5FD",300:"#7FE8F6",400:"#45D3EB",500:"#09C6E7",600:"#00B8D9",700:"#0A7C92",800:"#0B6E81",900:"#0A4250"},blue:{0:"#FFFFFF",50:"#EFF6FF",100:"#DBE8FF",200:"#B8D3FF",300:"#90BAFF",400:"#5E97FF",500:"#406FFF",600:"#2F66FF",700:"#2452DE",800:"#2248C8",900:"#172C80"},indigo:{0:"#FFFFFF",50:"#EEF2FF",100:"#E0E6FF",200:"#C5D0FF",300:"#A3B5FF",400:"#879CFF",500:"#707AF5",600:"#5A63F3",700:"#4951DA",800:"#3E40BF",900:"#2A2A82"},purple:{0:"#FFFFFF",50:"#F4F0FF",100:"#E8DBFF",200:"#D2B8FF",300:"#B590FF",400:"#996AF5",500:"#7A52F1",600:"#6B3CF0",700:"#592FBE",800:"#4D27A3",900:"#2F1767"},magenta:{0:"#FFFFFF",50:"#FFF0FE",100:"#FCE0FF",200:"#F7BCFF",300:"#F393FD",400:"#E85FF8",500:"#C645D6",600:"#C026D3",700:"#951CAB",800:"#801790",900:"#4C0C59"},pink:{0:"#FFFFFF",50:"#FFF0F7",100:"#FFE0F0",200:"#FFC0E2",300:"#FF9ACE",400:"#FF6CB3",500:"#ED5CA2",600:"#EC4899",700:"#AB236F",800:"#96205D",900:"#5A1238"},rose:{0:"#FFFFFF",50:"#FFF0F3",100:"#FFE1E9",200:"#FFC1D3",300:"#FF98B8",400:"#FF6B98",500:"#EE4278",600:"#E52E69",700:"#B52156",800:"#991A43",900:"#5B0F28"}},xa={mono:{0:"#0B0B0C",50:"#0F0F10",100:"#151515",200:"#1B1B1C",300:"#232323",400:"#DADADA",500:"#E0E0E0",600:"#EDEDED",700:"#F5F5F5",800:"#FCFCFC",900:"#FFFFFF"},danger:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},success:{0:"#06150B",50:"#0A1B10",100:"#0E2416",200:"#11301C",300:"#143B21",400:"#16502C",500:"#22D85A",600:"#00C853",700:"#2FE976",800:"#7FF1AE",900:"#D6FADF"},warning:{0:"#150E05",50:"#1C1408",100:"#261B0B",200:"#31240E",300:"#3D2C12",400:"#583C16",500:"#FFA61A",600:"#FF9F0A",700:"#FFB347",800:"#FFD089",900:"#FFF0C9"},info:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},sky:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},red:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},amber:{0:"#150D07",50:"#1C120A",100:"#26180E",200:"#311F12",300:"#3E2716",400:"#59361C",500:"#FF6A1E",600:"#FF5A00",700:"#FF8747",800:"#FFB98A",900:"#FFE2CC"},orange:{0:"#140D07",50:"#1B120A",100:"#25190D",200:"#302010",300:"#3B2813",400:"#553817",500:"#FF7F22",600:"#FF6B00",700:"#FF9247",800:"#FFBE8A",900:"#FFE1CC"},yellow:{0:"#141303",50:"#1B1906",100:"#25210A",200:"#2F2A0D",300:"#383212",400:"#524717",500:"#FFE042",600:"#FFD60A",700:"#FFE457",800:"#FFF194",900:"#FFF8CF"},lime:{0:"#0C1306",50:"#101A08",100:"#14210B",200:"#1A2B0F",300:"#203614",400:"#2A4A1A",500:"#86E21A",600:"#7ACC00",700:"#9EEA3B",800:"#C9F57F",900:"#EAFCC4"},green:{0:"#07140C",50:"#0B1B11",100:"#0E2416",200:"#112C1B",300:"#143722",400:"#17502F",500:"#20BF55",600:"#16A34A",700:"#39C964",800:"#86E5A5",900:"#D4F6E1"},teal:{0:"#081815",50:"#0B1F1C",100:"#0F2824",200:"#13322E",300:"#173E39",400:"#14584F",500:"#14CEBD",600:"#00BFA5",700:"#2CD6C6",800:"#7FEAE3",900:"#CFF7F3"},cyan:{0:"#07171C",50:"#0A1E24",100:"#0E2830",200:"#11333D",300:"#153E4A",400:"#165B6A",500:"#20CBE6",600:"#00B8D9",700:"#3FD2E9",800:"#93EBF6",900:"#D5F7FC"},blue:{0:"#081421",50:"#0A1829",100:"#0E2139",200:"#112A4B",300:"#153660",400:"#184A86",500:"#4A78FF",600:"#2F66FF",700:"#5A8AFF",800:"#A7C3FF",900:"#D9E7FF"},indigo:{0:"#0B1023",50:"#0E162C",100:"#141F3F",200:"#1C2A56",300:"#24366E",400:"#2F4894",500:"#707CF6",600:"#5A63F3",700:"#7D86FF",800:"#B5C0FF",900:"#E0E6FF"},purple:{0:"#100B1F",50:"#130E26",100:"#1A1638",200:"#231F4E",300:"#2E2A67",400:"#3C388D",500:"#8256F3",600:"#6B3CF0",700:"#8B66FA",800:"#C1B0FF",900:"#E4DCFF"},magenta:{0:"#160A18",50:"#1C0C21",100:"#25102E",200:"#321544",300:"#421A5C",400:"#58247C",500:"#CB44DB",600:"#C026D3",700:"#D960EB",800:"#F0B5FA",900:"#F9E4FE"},pink:{0:"#170911",50:"#1D0C18",100:"#271220",200:"#371830",300:"#462042",400:"#622C5C",500:"#F067AE",600:"#EC4899",700:"#F679BB",800:"#FFC2E1",900:"#FFE6F3"},rose:{0:"#17090E",50:"#1F0C13",100:"#2A121B",200:"#3A1B28",300:"#4B2636",400:"#673449",500:"#EE457B",600:"#E52E69",700:"#FF558A",800:"#FFA9C6",900:"#FFE0EA"}},wa=e=>({...e,red:e.danger,error:e.danger,green:e.success,success:e.success,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),eo=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),vc=["danger","success","warning","info","red","amber","orange","yellow","lime","green","teal","cyan","sky","blue","indigo","purple","magenta","pink","rose","mono"],Ea=e=>vc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),Vo={spacing:va,radius:Ca,componentHeights:Ra,typography:Ta,neutral:Vr,palette:{...wa(ya),primary:ya.mono},surface:eo("light",Vr),text:{...Ko(Vr),onColors:{primary:"#FFFFFF",...Ea({yellow:"#000000"})}}},Sa={spacing:va,radius:Ca,componentHeights:Ra,typography:Ta,neutral:jr,palette:{...wa(xa),primary:xa.mono},surface:eo("dark",jr),text:{..._o(jr),onColors:{primary:"#000000",...Ea({yellow:"#000000",mono:"#000000"})}}};function ka(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>{n.delete(o);})}}var Fa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ht=e=>Fa[e]??e;function un(e){let t={...e};return Object.entries(Fa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var qr=me.createContext(null),Pa=me.createContext(null),Gr=me.createContext({setMode:e=>{},toggleMode:()=>{}}),Da=me.createContext({setPrimary:e=>{}}),Na=me.createContext(null);function j(){return useTheme()}function Tc(){let e=me.useContext(qr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=me.useContext(Gr),[n,o]=me.useState(()=>e.get());return me.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function wc(){let e=me.useContext(Pa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=me.useContext(Da),[n,o]=me.useState(()=>e.get());return me.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function pb(e){let t=me.useContext(Na);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Tc(),{primary:o}=wc(),r=me.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ht(o)]??s.palette.primary,c=un(s.text.onColors)[ht(o)]??Xr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...un(s.text.onColors),primary:c,[ht(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function jo(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 Xr(e){let t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16),s=c=>{let i=c/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function Aa(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Ur(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Yr(e,t,n){let o=[],r=i=>i.startsWith("var(")?i.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():i;o.push(`--pf-font-sans:${r(e.typography.fonts.sans)};`),o.push(`--pf-font-mono:${r(e.typography.fonts.mono)};`),o.push(`--pf-text-primary:${e.text.primary};`),o.push(`--pf-text-secondary:${e.text.secondary};`),o.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([i,l])=>o.push(`--pf-text-on-${i}:${l};`)),Object.entries(e.spacing).forEach(([i,l])=>o.push(`--pf-space-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([i,l])=>o.push(`--pf-radius-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([i,l])=>o.push(`--pf-fontSize-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([i,l])=>o.push(`--pf-cmph-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([i,l])=>o.push(`--pf-neutral-${i}:${l};`)),o.push(`--pf-surface-appBg:${e.surface.appBg};`),o.push(`--pf-surface-panelBg:${e.surface.panelBg};`),o.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),o.push(`--pf-surface-panelHover:${e.surface.panelHover};`),o.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),o.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),o.push(`--pf-surface-border:${e.surface.border};`),o.push("--pf-focus-main:var(--pf-neutral-400);"),o.push(n==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([i,l])=>{Object.entries(l).forEach(([u,m])=>{o.push(`--pf-palette-${i}-${u}:${m};`);});});let s="300";Object.keys(e.palette).forEach(i=>{o.push(`--pf-focus-${i}-main: var(--pf-palette-${i}-${s});`),o.push(`--pf-focus-${i}-soft: transparent;`);});let a=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(i=>o.push(`--pf-primary-${i}:var(--pf-palette-${a}-${i});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let c=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),u=parseInt(l.slice(0,2),16),m=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=k=>{let y=k/255;return y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)};return .2126*f(u)+.7152*f(m)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${c};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return Yr(e,t,n).join("")}var Jr=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)=>{Jr(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");},Ha=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",c=me.useContext(qr),i=me.useContext(Gr),l=!!c,m=useRef((()=>{if(!s)try{let w=JSON.parse(localStorage.getItem(o)||"null");if(w?.mode==="light"||w?.mode==="dark")return w.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),h=me.useMemo(()=>c??ka(m.current),[c]),f=me.useMemo(()=>ka(a),[]);me.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),k=useRef(0),y=useRef(r??"__root__");me.useLayoutEffect(()=>{let w=0,g=T.current;for(;g&&g!==document.body;)g.hasAttribute("data-pfui-scope")&&w++,g=g.parentElement;k.current=w;},[r]);let x=useMemo(()=>{let w=jo(Vo,t),g=jo(w,t?.light),v=t?.light?.primaryKey??a,L=ht(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=un({...Ko(g.neutral).onColors,...g.text.onColors}),_=O[L]??Xr(H[600]),N=t?.surface||t?.light?.surface?g.surface:eo("light",g.neutral),G={...t?.text||t?.light?.text?g.text:Ko(g.neutral),onColors:un({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),b=useMemo(()=>{let w=jo(Sa,t),g=jo(w,t?.dark),v=t?.dark?.primaryKey??a,L=ht(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=un({..._o(g.neutral).onColors,...g.text.onColors}),_=O[L]??Xr(H[600]),N=t?.surface||t?.dark?.surface?g.surface:eo("dark",g.neutral),G={...t?.text||t?.dark?.text?g.text:_o(g.neutral),onColors:un({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),d=useRef(null),p=useRef(null),C=me.useInsertionEffect||me.useLayoutEffect,F=useCallback(()=>{let w=Ur(r);Aa(p,s?`pfui-guard-${r}`:"pfui-guard-root"),p.current.textContent=`${w} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{p.current.textContent="";});},[r,s]);C(()=>{Aa(d,s?`pfui-vars-${r}`:"pfui-vars-root");let w=t?.light?.primaryKey??t?.primaryKey??a,g=t?.dark?.primaryKey??t?.primaryKey??a,v=Ur(r),L=Uo(x,ht(w),"light"),H=Uo(b,ht(g),"dark");d.current.textContent=`${v}.pf-light{${L}}
2
+ ${v}.pf-dark{${H}}`+(s?`
3
+ ${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[x,b,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,a]);let R=useRef(false);me.useLayoutEffect(()=>{if(R.current)return;R.current=true;let w=s?T.current:document.documentElement;if(!w)return;let g=h.get();Jr(w),qo(w,g),w.setAttribute("data-pfui-mode",g),w.setAttribute("data-pfui-primary",f.get()),l||h.set(g);},[s,h,f,l]);let E=useCallback(()=>{window.__pfuiActiveScope={id:y.current,depth:k.current,ts:Date.now()};},[]),A=useCallback(()=>{let w=s?T.current:document.documentElement,g={capture:true},v=()=>E();return w?.addEventListener("pointerdown",v,g),w?.addEventListener("mouseenter",v,g),w?.addEventListener("focusin",v,g),w?.addEventListener("keydown",v,g),()=>{w?.removeEventListener("pointerdown",v,g),w?.removeEventListener("mouseenter",v,g),w?.removeEventListener("focusin",v,g),w?.removeEventListener("keydown",v,g);}},[s,E]),$=useCallback(w=>{let g=window.__pfuiActiveScope,v=g&&Date.now()-g.ts<1500;if(!g||!v||g.id!==y.current)return;let L=h.get(),H=f.get(),_=Yr(L==="light"?x:b,ht(H),L);Ma(w,_),qo(w,L),w.setAttribute("data-pfui-portal-owner",y.current),w.setAttribute("data-pfui-mode",L),w.setAttribute("data-pfui-primary",H);},[h,f,x,b]),K=w=>{if(w.getAttribute("data-floating-ui-portal")==="true"||w.getAttribute("data-radix-portal")==="true"||w.getAttribute("data-portal")==="true")return true;let g=w.getAttribute("role");if(g==="tooltip"||g==="dialog")return true;let v=window.getComputedStyle(w);return v.position==="fixed"||v.position==="absolute"},W=useCallback(()=>{let w=new MutationObserver(g=>{for(let v of g)v.addedNodes.forEach(L=>{L instanceof HTMLElement&&(K(L)&&$(L),L.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(H=>$(H)));});});return w.observe(document.body,{childList:true,subtree:true}),()=>w.disconnect()},[$]);me.useEffect(()=>{let w=A(),g=W();return ()=>{w(),g();}},[A,W]);let S=useCallback(w=>{let g=s?T.current:document.documentElement;g&&(Jr(g),qo(g,w),g.setAttribute("data-pfui-mode",w),g.setAttribute("data-pfui-primary",f.get()));},[s,f]),M=useCallback(w=>{let g=ht(f.get()),L=Yr(w==="light"?x:b,g,w);document.querySelectorAll(`[data-pfui-portal-owner="${y.current}"]`).forEach(H=>{Ma(H,L),qo(H,w),H.setAttribute("data-pfui-mode",w),H.setAttribute("data-pfui-primary",g);});},[x,b,f]);me.useLayoutEffect(()=>{M(h.get());},[M,x,b,a,h]),me.useLayoutEffect(()=>{if(!l)return;let w=()=>{let v=h.get();F(),S(v),M(v);};w();let g=h.subscribe(w);return ()=>g()},[l,h,F,S,M]);let I=useCallback(w=>{if(h.get()!==w&&(F(),h.set(w),S(w),M(w),!s))try{let g=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...g,mode:w}));}catch{}},[h,s,o,F,S,M]),P=useCallback(()=>I(h.get()==="light"?"dark":"light"),[I,h]),D=useCallback(w=>{f.set(w);let g=Ur(r),v=Uo(x,ht(w),"light"),L=Uo(b,ht(w),"dark");d.current&&(d.current.textContent=`${g}.pf-light{${v}}
4
+ ${g}.pf-dark{${L}}`+(s?`
5
+ ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F();let H=h.get();if(S(H),M(H),!s)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:w}));}catch{}},[x,b,r,s,h,f,F,S,M]),B=l?i:{setMode:I,toggleMode:P},z=jsx(Na.Provider,{value:{light:x,dark:b},children:jsx(qr.Provider,{value:h,children:jsx(Pa.Provider,{value:f,children:jsx(Gr.Provider,{value:B,children:jsx(Da.Provider,{value:{setPrimary:D},children:jsx(ThemeProvider,{theme:Ec(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 Ec(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 Sc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},La=(e,t)=>{let n=Sc(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=j();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 Xo(){let e=j();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||""},ts=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:a},c)=>{let i=j(),l=i.typography.sizes.sm,u=20,m=10,h=i.spacing.lg,f=i.spacing.md,T=Number(i.componentHeights?.md),k=i.text,y=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:T,padding:`${f} ${h}`,gap:m,fontSize:l,color:k.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),b=css({marginRight:0,marginLeft:-2,lineHeight:0,color:i.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:i.text.secondary});return jsxs("div",{ref:c,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[y,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[b,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})})]})});ts.__PFUI_SLOT="AccordionSummary";ts.displayName="AccordionSummary";var ns=({children:e,className:t,css:n})=>{let o=j(),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})};ns.__PFUI_SLOT="AccordionDetails";ns.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=j(),m=useId(),h=useId(),f=u.radius?.md,T=u.text,k=u.componentHeights?.border??1,y=Oa(k)??"1px",x=e!==void 0,[b,d]=useState(!!t),p=x?!!e:b,C=ye(),[F,R]=useState(0),[E,A]=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();},M=()=>{s||(S(),x?n?.(!e):d(N=>{let q=!N;return n?.(q),q}));},I=me.Children.toArray(l).filter(N=>isValidElement(N)),P=I.findIndex(N=>Wa(N)==="AccordionSummary"),D=I.findIndex(N=>Wa(N)==="AccordionDetails");P===-1&&I.length&&(P=0),D===-1&&(D=I.findIndex((N,q)=>q!==P),D===-1&&I.length>=2&&(D=1));let B=I[P]??null,z=I[D]??null,w=r==="subtle"?u.surface.subtleBg:r==="outlined"?u.surface.panelBg:"transparent",g=css({backgroundColor:w,color:T.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${u.surface.border}`:"none",outline:"none",marginBottom:u.spacing.sm,maxWidth:a!=null?Oa(a):void 0,width:c?"100%":a!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let N=$.current;N&&R(N.scrollHeight);},[p,l]),useEffect(()=>{let N=$.current;if(!N)return;let q=new ResizeObserver(()=>R(N.scrollHeight));return q.observe(N),()=>q.disconnect()},[]),useEffect(()=>{F>0&&!E&&A(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 q=Array.from(N.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));p?(q.forEach(G=>{let se=G.dataset.accordionTabindex;se!=null&&(se===""?G.removeAttribute("tabindex"):G.tabIndex=Number(se),delete G.dataset.accordionTabindex);}),N.removeAttribute("inert")):(q.forEach(G=>{G.dataset.accordionTabindex==null&&(G.dataset.accordionTabindex=G.hasAttribute("tabindex")?G.getAttribute("tabindex")??"":""),G.tabIndex=-1;}),N.setAttribute("inert",""));},[p]);let v=css({maxHeight:p?F||"none":0,overflow:p&&!E?"visible":"hidden",transition:E?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:E?"max-height":void 0}),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:[C(),g,i],tabIndex:s?-1:0,ref:W,role:"button","aria-expanded":p,"aria-controls":m,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==W.current||M();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),M());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),H],children:O}),jsx("div",{id:m,"aria-hidden":!p,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:K,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:L,children:_})})]})};Ka.displayName="Accordion";var Bc=e=>isValidElement(e),$c=e=>Bc(e)?e.type?.displayName||e.type?.name:void 0,Va=e=>$c(e)==="Accordion",zc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Oc=(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=j(),T=useRef(null),k=Children.toArray(e),y=k.filter(Va),x=y.length,b=o&&r!==void 0,[d,p]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let M=0;M<y.length;M++){let I=y[M].props;if(I.open||I.defaultOpen)return M}return null}),C=o?b?r??null:d:null,F=Oc(f.componentHeights?.border,1),R=f.surface.border,E=f.radius.md,A=n,$=A==="outlined";useEffect(()=>{let M=T.current;if(!M)return;let I=P=>{if(P.key!=="ArrowDown"&&P.key!=="ArrowUp"&&P.key!=="Home"&&P.key!=="End")return;let B=Array.from(M.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(B.length===0)return;let z=document.activeElement,w=B.findIndex(v=>v.contains(z));if(w===-1)return;P.preventDefault();let g=w;P.key==="ArrowDown"?g=(w+1)%B.length:P.key==="ArrowUp"?g=(w-1+B.length)%B.length:P.key==="Home"?g=0:P.key==="End"&&(g=B.length-1),B[g]?.focus();};return M.addEventListener("keydown",I),()=>M.removeEventListener("keydown",I)},[x]);let K=css({display:"flex",flexDirection:"column",maxWidth:i!=null?zc(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((M,I)=>{if(!Va(M)){S.push(M);return}let P=M.props,D=W++,B=D===0,z=D===x-1,w=c||!!P.disabled,g=A??P.variant,v=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:g,disabled:w,width:"100%",css:[P.css,v,H,L],className:[P.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=P.onChange,N=C===D;O.open=N,O.defaultOpen=void 0,O.onChange=q=>{let G=q?D:null;b||p(G),a?.(G),_?.(q);};}S.push(cloneElement(M,{...P,...O,key:M?.key??I}));}),jsx("div",{ref:T,role:m,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",u||""].join(" ").trim(),css:[K,h],children:S})};ja.displayName="AccordionGroup";var qt=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:k="toolbar","aria-label":y,onClose:x})=>{let b=j(),d=useRef(null),p=useRef(null),C=useRef(false),F=useRef(t),R=n.horizontal??"center",E=n.vertical??"bottom",A=g=>typeof g=="string"?b.spacing[g]??g:g,$=g=>typeof g=="string"?b.radius[g]??g:g,K=qt(A(c)),W=qt(A(i)),S=qt(A(l)),M={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:R==="left"?"flex-start":R==="right"?"flex-end":"center",alignItems:E==="top"?"flex-start":E==="bottom"?"flex-end":"center"},I=()=>`${R==="left"?"left":R==="right"?"right":"center"} ${E==="top"?"top":E==="bottom"?"bottom":"center"}`,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:qt(A(r)),background:m?"transparent":b.surface.panelBg,border:m?"none":`1px solid ${b.surface.border}`,borderRadius:m?0:qt($(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:qt(A(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?qt(f):"auto",height:T?qt(T):"auto",maxWidth:h?"100%":"none"},w=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let g=d.current;if(!g)return;let v=P(),L=D();if(!C.current){C.current=true,F.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}if(F.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}F.current=t,p.current&&p.current.cancel();let H=t?[{opacity:0,transform:v},{opacity:1,transform:L}]:[{opacity:1,transform:L},{opacity:0,transform:v}];return p.current=g.animate(H,{duration:250,easing:"ease",fill:"forwards"}),()=>{p.current&&p.current.cancel();}},[t,R,E]),useEffect(()=>{if(!t||!x)return;let g=v=>{v.key==="Escape"&&x();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t,x]),jsx("div",{css:M,children:jsx("div",{ref:d,css:w,style:z,role:k,"aria-label":y,"aria-hidden":!t,...!t&&{inert:true},children:e})})};qa.displayName="ActionBar";var Xa=(e,t,n)=>Math.min(n,Math.max(t,e)),os=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ga=1,Uc=keyframes`100% { transform: rotate(360deg); }`,qc=keyframes`
6
6
  0% { left: -35%; right: 100%; }
7
7
  60% { left: 100%; right: -90%; }
8
8
  100% { left: 100%; right: -90%; }
@@ -10,14 +10,14 @@ ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),M()
10
10
  0% { left: -200%; right: 100%; }
11
11
  60% { left: 107%; right: -8%; }
12
12
  100% { left: 107%; right: -8%; }
13
- `,Xc=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("),Yc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Jc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Xc(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]&&Yc.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=me.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),T=typeof t=="number",k=Math.max(o-n,1),y=T?Xa(t,n,o):void 0,x=T?(y-n)/k*100:void 0,b=Jc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Qc,{size:s,active:b,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Zc,{thickness:a,active:b,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Zc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),k=css([{position:"relative",width:"100%",height:os(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,Ga):Ga,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),b={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...b,left:"-35%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...b,left:"-200%",right:"100%",animation:`${Gc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:k,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Qc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),m=40,h=(m-t)/2,f=2*Math.PI*h,k=`${(o?Xa((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:os(e,`${u.componentHeights.md}`),height:os(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),b=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:k,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${Uc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:b})})})};var Za=createContext(null),Qa=()=>{let e=useContext(Za);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},cu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),uu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),du=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(),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(c)?A[c]:A.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},b=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??b:v==="warning"?x.warning??b:v==="success"?x.success??b:v==="info"?x.info??x.primary??b:b)(t),F=I?.[50]??b[50],P=I?.[300]??b[300],B=I?.[600]??I?.[500]??b[600],z=I?.[700]??B,S=I?.[800]??f.text?.primary??"#000",g=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:B,fg:g,border:void 0,iconColor:g}:n==="outlined"?{bg:F,fg:S,border:`1px solid ${P}`,iconColor:S}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:F,fg:S,border:void 0,iconColor:z}},[t,n,b,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(to,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),M=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),w=useMemo(()=>[uu,{color:d.iconColor}],[d.iconColor]),D=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),L=useMemo(()=>[du,{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=me.Children.toArray(u).some(A=>me.isValidElement(A)&&A.type===as),E=me.Children.toArray(u).some(A=>me.isValidElement(A)&&A.type===is);return jsx(Za.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":E?k:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[M,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:cu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:D,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:L,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});ei.displayName="Alert";var as=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})});as.displayName="AlertTitle";var is=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})});is.displayName="AlertDescription";var ls=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Jt=e=>e==null?[]:Array.isArray(e)?e:[e],Zt=(...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 Zo=me.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:k,togglePasswordVisible:y=false,showClear:x,type:b="text",step:d,focusRingMode:p="always",className:C,wrapperCss:M,inputCss:R,labelCss:w,helperRowCss:D,helperTextCss:L,startIconCss:K,endIconCss:W,css:E,onBlur:A,onFocus:I,onKeyDown:F,autoFocus:P,name:B,id:z,tabIndex:S,autoComplete:g,readOnly:v,required:$,maxLength:N,onSurfaceClick:O},_){let H=V(),q=Xo(),U=useId(),ae=useMemo(()=>{let ue={sm:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.sm,labelFont:H.typography.sizes.xs,helperFont:H.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:21},md:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.md,labelFont:H.typography.sizes.sm,helperFont:H.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:24},lg:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.lg,labelFont:H.typography.sizes.md,helperFont:H.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:28}},Ee=["sm","md","lg"].includes(m)?m:"md";return ue[Ee]},[m,H]),j=H.neutral,Z=H.text,ie=b==="number",de=b==="password",ge=n!==void 0,[Pe,Ce]=useState(o),ve=ge?n:Pe,Te=useCallback(ue=>{ge||Ce(ue),r?.(ue);},[ge,r]),Re=/^-?\d*(?:[.,]\d*)?$/,we=ie&&(d!=null&&String(d).includes(".")||/[.,]/.test(ve??"")),he=ie?we?"decimal":"numeric":void 0,je=ie?we?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,te=useCallback(ue=>{(ue===""||Re.test(ue))&&Te(ue);},[Te]),Q=i?j[200]:a&&h==="outlined"?H.palette.danger?.[50]??H.surface.panelBg:a&&h==="subtle"?H.palette.danger?.[50]??H.surface.subtleBg:h==="outlined"?H.surface.panelBg:h==="subtle"?H.surface.subtleBg:"transparent",J=H.componentHeights.border,X$1=h==="outlined"?`${J} solid ${a?H.palette.danger?.[300]??H.surface.border:H.surface.border}`:"none",re=Zt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?ls(u):void 0,flex:"0 0 auto",fontWeight:500}),le=useMemo(()=>Zt({fontSize:ae.labelFont,fontWeight:500,color:a?H.palette.danger?.[700]??Z.primary:i?j[500]:Z.primary,marginBottom:4,display:"inline-block"},...Jt(w)),[ae.labelFont,a,i,j,Z,H.palette.danger,w]),De=useMemo(()=>Zt({display:"flex",alignItems:"center",gap:H.spacing.sm,padding:`${ls(ae.paddingY)} ${ls(ae.paddingX)}`,background:Q,border:X$1,borderRadius:f?H.radius.full:H.radius.md,minHeight:ae.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Jt(M),...Jt(E)),[H,ae.minHeight,ae.paddingX,ae.paddingY,Q,X$1,f,i,M,E]),$e=useMemo(()=>Zt({flex:1,minWidth:0,fontSize:ae.fontSize,fontWeight:500,fontFamily:"inherit",color:i?j[500]:a?H.palette.danger?.[800]??Z.primary:Z.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:ie?"textfield":"auto","&::placeholder":{color:a?H.palette.danger?.[700]??Z.secondary:Z.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?H.palette.danger?.[800]??Z.primary:Z.primary} !important`,boxShadow:`0 0 0 1000px ${Q} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?H.palette.danger?.[800]??Z.primary:Z.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Jt(R)),[ae.fontSize,i,j,Z,a,H.palette.danger,ie,Q,R]),Y=useMemo(()=>Zt({display:"inline-flex",alignItems:"center",color:a?H.palette.danger?.[800]??Z.secondary:Z.secondary,marginLeft:-3},...Jt(K)),[a,H.palette.danger,Z.secondary,K]),se=useMemo(()=>Zt({display:"inline-flex",alignItems:"center",color:a?H.palette.danger?.[800]??Z.secondary:Z.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Jt(W)),[a,H.palette.danger,Z.secondary,i,W]),ee=useMemo(()=>Zt({minHeight:16,fontSize:ae.helperFont,color:a?H.palette.danger?.[700]??Z.secondary:Z.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Jt(D)),[ae.helperFont,a,H.palette.danger,Z.secondary,D]),ce=useMemo(()=>Zt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Jt(L)),[L]),pe=useRef(null),Ue=useCallback(ue=>{pe.current=ue,_&&(typeof _=="function"?_(ue):_.current=ue);},[_]),ze=useCallback(ue=>{let Ee=ue.target.value;if(ie){te(Ee);return}N&&Ee.length>N||Te(Ee);},[ie,N,Te,te]),[Ie,st]=useState(false),Ne=useCallback(()=>{i||st(ue=>!ue);},[i]),nt=useCallback(()=>{i||(Te(""),pe.current?.focus());},[i,Te]),qe=useMemo(()=>{let ue=ae.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[ae.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:Y,children:ni(T,qe)}):null,[T,Y,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ue=[];if(de&&y){let bt=Ie?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ue.push(jsx("button",{type:"button",css:se,onMouseDown:Zn=>Zn.preventDefault(),onClick:Zn=>{Zn.stopPropagation(),Ne();},tabIndex:-1,"aria-label":Ie?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&ve&&ve.length>0&&!i&&ue.push(jsx("button",{type:"button",css:se,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=k?jsx("span",{css:se,children:ni(k,qe)},"user-end"):null,at=ue.length>0,Fe=!!Ee;return !at&&!Fe?null:!at&&Fe?Ee:at&&!Fe?ue.length===1?ue[0]:jsx("span",{css:ot,children:ue}):jsxs("span",{css:ot,children:[ue,Ee]})},[de,y,Ie,qe,se,ot,i,x,ve,k,Ne,nt]),sn=c!=null?`${z??U}-help`:void 0,Jn=z??U,Je=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=pe.current;if(!Ee)return;let at=ue.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),xt=useCallback(ue=>{if(i)return;let Ee=pe.current;if(Ee&&(O?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:re,children:[t&&jsx("label",{htmlFor:Jn,className:"plainframe-ui-textfield-label",css:le,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[q({enabled:p!=="none",color:a?"danger":void 0}),De],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Jn,className:"plainframe-ui-textfield-input",css:$e,type:de?Ie?"text":"password":b==="number"?"text":b,inputMode:he,pattern:je,value:ve,maxLength:ie?void 0:N,onChange:ie?ue=>te(ue.target.value):ze,placeholder:s||"",disabled:i,onBlur:A,onFocus:I,onKeyDown:F,autoFocus:P,name:B,tabIndex:S,autoComplete:g,readOnly:v,required:$,"aria-invalid":!!a||void 0,"aria-describedby":sn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:ee,children:jsx("span",{id:sn,className:"plainframe-ui-textfield-helper-text",css:ce,children:c})})]})}));Zo.displayName="TextField";var Qo=me.createContext("ghost"),Tt=me.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,k]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),b=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:b,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:k}),[T]),M=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(F=>{if(F.closest('[role="menu"]')!==I)return false;let P=window.getComputedStyle(F);return P.display!=="none"&&P.visibility!=="hidden"}),[]),w=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(F=>F.removeAttribute("data-highlighted")),k(false);},[]),D=useRef(false),L=useCallback(I=>{if(I.target!==I.currentTarget)return;if(D.current){D.current=false;return}let F=I.currentTarget,P=R(F);P.length>0&&(k(true),F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(B=>B.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(B=>B.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true}));},[R]),K=useCallback(I=>{let F=I.currentTarget,P=R(F);if(P.length===0)return;if(I.key==="Tab"){D.current=true,F.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),F.tabIndex=-1,requestAnimationFrame(()=>{F.tabIndex=0,D.current=false;});return}let B=F.querySelector("[data-highlighted]"),z=F.querySelector("[data-hovered]"),S=B||z,g=S?P.indexOf(S):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),k(true),F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),g===-1&&(g=I.key==="ArrowDown"?-1:P.length);let v=I.key==="ArrowDown"?1:-1,$=(g+v+P.length)%P.length;P[$].setAttribute("data-highlighted",""),P[$].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),k(true),F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[0].setAttribute("data-highlighted",""),P[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),k(true),F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),P[P.length-1].setAttribute("data-highlighted",""),P[P.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),F.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),F.blur();return}},[R]),W=useCallback(I=>{let F=I.currentTarget;F.hasAttribute("data-keyboard-nav")&&w(F);},[w]),E=useCallback(I=>{let F=I.currentTarget;F.hasAttribute("data-keyboard-nav")&&w(F);},[w]),A=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(no.Provider,{value:C,children:jsx(oo.Provider,{value:M,children:jsx(Tt.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,c],onFocus:L,onKeyDown:K,onPointerMove:W,onPointerDown:E,...m,children:i})]})})})})})});ii.displayName="Menu";var ci=createContext(null),nr=()=>{let e=useContext(ci);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Ou(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ao=(...e)=>t=>{for(let n of e)Ou(n,t);},us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Wu=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}},Ku=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Wu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let b=document.querySelector(".plainframe-ui-popover");if(!b)return;let d=Array.from(b.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(R=>{let w=window.getComputedStyle(R);return w.display!=="none"&&w.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],M=document.activeElement;x.shiftKey&&M===p?(x.preventDefault(),C.focus()):!x.shiftKey&&M===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let k=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ci.Provider,{value:k,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}=nr(),u=me.Children.only(t),m=u.props||{},h=ao(c,o,u.ref),f=a==="click"?{onClick:k=>{k.stopPropagation(),s(!r),m.onClick?.(k);}}:{onMouseEnter:k=>{l(),r||s(true),m.onMouseEnter?.(k);},onMouseLeave:k=>{i(),m.onMouseLeave?.(k);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let k=u.props?.css;return me.cloneElement(u,{...f,...T,ref:h,css:[k,n].filter(Boolean)})}return me.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}=nr(),a=me.Children.only(o),c=ao(s,r,a.ref);if(e){let l=a.props?.css;return me.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:us(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});di.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var pi=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:k,setOpen:y,triggerOn:x,referenceRef:b,scheduleClose:d,cancelClose:p}=nr(),C=V(),M=_u(e),{refs:R,x:w,y:D,strategy:L,context:K}=useFloating({open:k,onOpenChange:y,whileElementsMounted:autoUpdate,placement:M,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{b.current&&R.setReference(b.current);},[R,b]);let W=useDismiss(K,{outsidePressEvent:"pointerdown",escapeKey:true}),E=useRole(K,{role:"dialog"}),{getFloatingProps:A}=useInteractions([W,E]),[I]=K.placement.split("-"),F=I,P=`${F==="left"?"right":F==="right"?"left":"center"} ${F==="top"?"bottom":F==="bottom"?"top":"center"}`,B=8,z=F==="top"?{y:B}:F==="bottom"?{y:-B}:F==="left"?{x:B}:{x:-B},S={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,$=`${C.componentHeights.border} solid ${C.surface.border}`,N=er(i,C.spacing),O=er(l,C.spacing),_=er(u,C.spacing),H={};N&&(H.padding=N),O&&(H.paddingInline=O),_&&(H.paddingBlock=_);let q=er(m,C.radius)??C.radius.md,U="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",ae=css({position:L,top:D??0,left:w??0,zIndex:1e3,transformOrigin:P,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:us(a)??"fit-content",height:us(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),j=r?css({}):css({background:g,color:v,border:$,borderRadius:q,boxShadow:U,...H,...H.padding||H.paddingInline||H.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),Z=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},ie=ao(R.setFloating,T),de=jsx(motion.div,{className:"plainframe-ui-popover",...A({...f,ref:ie,...Z}),...S,css:[ae,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?de:null})})});pi.displayName="PopoverContent";var Vu=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var fs=me.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),k=ye(),y={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},x={slideMs:250,pressMs:150,easing:"ease"},b=t!==void 0,[d,p]=useState(n),C=b?!!t:d,[M,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let w=["sm","md","lg"].includes(s)?s:"md",D=y[w],L=`${x.slideMs}ms ${x.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],E=C?K:W,A=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:F,thumb:P}=D,B=(F-P)/2,z=css({display:"inline-flex",alignItems:"center",gap:D.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),S=css({position:"relative",width:I,height:F,backgroundColor:E,borderRadius:T.radius.xl,transition:`background-color ${L}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),g=css({position:"absolute",top:B,left:C?I-P-B:B,width:P,height:P,backgroundColor:A,borderRadius:T.radius.xl,transition:`left ${L}, transform ${L}, background-color 0.25s ease`,transform:M?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),$=()=>{if(r)return;let O=!C;b||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:$,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),$());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,k({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[S,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 Zu=(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=me.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:k,...y},x)=>{let b=V(),d=ye(),p=typeof e=="boolean",[C,M]=useState(t),R=p?e:C,w=r==="sm"||r==="lg"?r:"md",D=useMemo(()=>Zu(b,w),[b,w]),{checkedBg:L,checkColor:K,borderCol:W,hoverBg:E,gapPx:A}=useMemo(()=>{let O=b.palette||{},_=b.neutral||{},H=b.text?.onColors||{},q,U;l==="neutral"||l==="secondary"?(q=_,U="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(q=O[l]||O.primary||_,U=l):(q=O.primary||_,U="primary");let ae=q[600]??q[500]??q[400]??Object.values(q)[0]??b.palette.primary[600],j=H[U]??H.primary??b.text?.onColors?.primary??b.text.primary,Z=typeof D.gap=="number"?D.gap+2:D.gap;return {checkedBg:ae,checkColor:j,borderCol:b.surface.border,hoverBg:b.surface.panelHover,gapPx:Z}},[D.gap,l,b]),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: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:E},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:L,outlineColor:L,"--pfui-bleed":L},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:L,backgroundColor:L,"--pfui-bleed":L},".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,L,a,o,A,E,s,b.radius.sm,b.spacing.xs]),F=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),P=useMemo(()=>css({width:D.box,height:D.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${D.borderWidth} solid ${W}`,outlineOffset:`-${D.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?b.radius.full:D.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"}),[D.box,D.borderRadius,D.borderWidth,W,c,b.radius.full]),B=useMemo(()=>({w:Math.round(D.box*D.iconRatioW),h:Math.round(D.box*D.iconRatioH)}),[D.box,D.iconRatioH,D.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]),S=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),g=useMemo(()=>css({fontSize:D.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:b.text.primary}),[D.labelFont,b.text.primary]),v=useMemo(()=>css({fontSize:D.labelFont,lineHeight:1.25,color:b.text.secondary,fontWeight:400,marginTop:s&&a?b.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[D.labelFont,a,s,b.spacing.xs,b.text.secondary]),$=useCallback(()=>{o||(p?n?.(!R):M(O=>{let _=!O;return n?.(_),_}));},[o,p,R,n]),N=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),$());},[o,$]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",k||""].join(" ").trim(),css:[I,d({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:N,children:[jsx("input",{type:"checkbox",checked:R,onChange:$,disabled:o,css:F,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[P,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke: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:S,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})]})]})}));rr.displayName="Checkbox";var td=()=>useContext(bn),nd=()=>useContext(oo),od=()=>useContext(lr),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);},Lt=me.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:k,...y},x){let b=td(),d=od(),p=ir(),C=co(),M=nd(),R=V(),D=!!useContext(Tt),L=y["data-subtrigger"]!==void 0,K=L&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,E=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],F=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:E>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${E}))`:R.spacing.md,minHeight:D?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,D,E,t,n,I]),P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),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]),S=[];D&&S.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&&!L&&d?.closeAll();},v=(N,O)=>{let _=N.closest('[role="menu"]');if(!_)return;let H=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(Z=>{if(Z.closest('[role="menu"]')!==_)return false;let ie=window.getComputedStyle(Z);return ie.display!=="none"&&ie.visibility!=="hidden"});if(!H.length)return;let q=H.indexOf(N),U=q>=0?q:0,ae=O(H.length,U),j=H[ae];j&&(document.querySelectorAll("[data-highlighted]").forEach(Z=>{Z.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),b&&T!=null&&b.setActiveIndex(ae));},$=t?-1:M?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:$,ref:N=>{if(b&&!k){let O=b.listRef.current;N&&(T!=null?O[T]=N:O.includes(N)||O.push(N));}typeof x=="function"?x(N):x&&"current"in x&&(x.current=N);},onMouseMove:N=>{if(N.currentTarget.hasAttribute("data-hovered"))return;let O=!!N.currentTarget.closest("[data-submenu-content]");!L&&p&&!O&&hi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(H=>{H.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(H=>{H.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(H=>{H.removeAttribute("data-active");}),N.currentTarget.setAttribute("data-hovered","");let _=N.currentTarget.closest("[data-menu-id]")||N.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&b&&T!=null&&b.setActiveIndex(T),!t&&!M?.allItemsTabbable&&N.currentTarget.focus({preventScroll:true});},onMouseEnter:N=>{if(L)io();else {let H=!!N.currentTarget.closest("[data-submenu-content]");p&&!H&&hi(p.closeAllSubMenus);}N.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(H=>{H.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(H=>{H.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(H=>{H.removeAttribute("data-active");})),N.currentTarget.setAttribute("data-hovered","");let _=N.currentTarget.closest("[data-menu-id]")||N.currentTarget.closest('[role="menu"]');!t&&b&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),b.setActiveIndex(T)),!t&&!M?.allItemsTabbable&&N.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{b&&b.setActiveIndex(null);},onKeyDown:N=>{if(t)return;let O=N.currentTarget;if(N.key==="Tab"&&b&&!M?.allItemsTabbable){N.preventDefault();return}if(N.key==="Tab"&&!b){let _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(q=>q.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(q=>q.removeAttribute("data-hovered"));let H=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=H>=0?H:0;});}C&&C.setIsKeyboardNav(false);return}if(N.key==="Enter"||N.key===" "||N.key==="ArrowRight"){L||N.key!=="ArrowRight"&&(N.preventDefault(),N.stopPropagation(),g());return}if(N.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){N.preventDefault(),N.stopPropagation();let q=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(q){let U=q.__pfuiCloseSubmenu;U&&U(),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered")),q.setAttribute("data-highlighted",""),q.focus();let ae=q.closest("[data-menu-id]");ae&&ae.setAttribute("data-keyboard-nav","");}return}if(N.key==="Escape"){N.preventDefault(),N.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(N.key==="ArrowDown"){N.preventDefault(),N.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(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),v(O,(H,q)=>(q+1)%H);return}if(N.key==="ArrowUp"){N.preventDefault(),N.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(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),v(O,(H,q)=>(q-1+H)%H);return}if(N.key==="Home"){N.preventDefault(),N.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),v(O,()=>0);return}if(N.key==="End"){N.preventDefault(),N.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),v(O,H=>H-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[F,...S,i].flat()),...y,onClick:N=>{t||(N.currentTarget.removeAttribute("data-highlighted"),g());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:P,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})})]})]})}),xi=me.createContext(null),bs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,k=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(k),l.current?.(k);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(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),k=!!T&&r!==void 0,y=!k&&t!==void 0,[x,b]=useState(()=>k?T.values.some(W=>Object.is(W,r)):!!n),d=k?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=V(),M=!!useContext(Tt),R=()=>{if(!c)if(k)T.toggle(r);else {let W=!d;y||b(W),o?.(W);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:M?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),D=css({pointerEvents:"none"}),L=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(E=>{E.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(E=>{E.tabIndex=-1;}));},[]),K=jsxs(Fragment,{children:[jsx("span",{ref:L,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:w,"aria-hidden":"true",children:jsx(rr,{size:"sm",checked:d,css:D})}),u]});return jsx(Lt,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon: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,[k,y]=useState(!!n),x=T?!!t:k,d=!!useContext(Tt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),M=()=>{if(a)return;let w=!x;T||y(w),o?.(w);},R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(Lt,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:M,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(fs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});vi.displayName="MenuSwitchItem";var Ci=me.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 rd=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(Lt,{...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(Tt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,k=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),b=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(k,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:b,children:a})]})});gn.displayName="MenuLabel";var sd=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var wi=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},hs=ao,uo=0,cr=null,ur=null,xd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function vd(){if(!(typeof document>"u")){if(uo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=xd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}uo+=1;}}function Cd(){if(!(typeof document>"u")&&(uo>0&&(uo-=1),uo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var bn=createContext(null),dr=()=>{let e=useContext(bn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},po=createContext(null),Rd=()=>useContext(po),no=createContext(null),co=()=>useContext(no),Ei=createContext(null),ir=()=>useContext(Ei),Si=createContext(false),Td=()=>useContext(Si),oo=createContext({allItemsTabbable:true}),lr=me.createContext(null),ys=()=>useContext(lr);function wd(){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 Ed=()=>Rd()?.activeIndex??null,Ii=0,Bn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(A=>{A&&wi(h.current),e===void 0&&i(A),n?.(A);},[e,n]),m=useRef(`pfui-menu-${++Ii}`),h=useRef(null),f=useRef([]),T=useRef(null),[k,y]=useState(null),[x,b]=useState(false);useEffect(()=>{l||(y(null),f.current=[],b(false));},[l]);let d=useRef(null),p=useCallback((A,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let F=I??20;d.current=window.setTimeout(()=>u(A),F);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return vd(),()=>Cd()},[l,r]);let M=ys(),[R]=useState(()=>M??wd()),w=useRef(new Set),D=useMemo(()=>({registerSubMenu:A=>(w.current.add(A),()=>w.current.delete(A)),closeAllSubMenus:()=>{w.current.forEach(A=>A());}}),[]),L=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),K=useMemo(()=>({activeIndex:k,setActiveIndex:y}),[k,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:b}),[x]),E=s==="sm";return jsx(lr.Provider,{value:R,children:jsx(Tt.Provider,{value:E,children:jsx(no.Provider,{value:W,children:jsx(Ei.Provider,{value:D,children:jsx(po.Provider,{value:K,children:jsx(bn.Provider,{value:L,children:a})})})})})})};Bn.displayName="DropdownMenu";var $n=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:k,menuId:y}=dr(),x=co(),b=ir(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,M=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:w,...D}=s,L=useMemo(()=>hs(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),K=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(P=>{let B=K();requestAnimationFrame(()=>B[P]?.focus());},[K]),E=useCallback(P=>{if(P.key==="Tab"&&c){P.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(S=>S.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(P.key==="ArrowRight"&&c){let B=document.querySelector("[data-subtrigger][data-hovered]");if(B){P.preventDefault(),P.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(P.key==="ArrowDown"||P.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){P.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(S=>{let g=S.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(S);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let S=P.key==="ArrowDown"?0:z.length-1;h(S),z[S]?.setAttribute("data-highlighted",""),z[S]?.focus();}}}),C?.(P),R?.(P);return}if(c){P.preventDefault();let B=document.querySelectorAll("[data-hovered]");for(let S of Array.from(B))if(S.closest("[data-submenu-content]")){let v=S.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let $=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"}),N=$.indexOf(S);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),S.removeAttribute("data-hovered"),N!==-1&&$.length>0){let O=P.key==="ArrowDown"?1:-1,_=(N+O+$.length)%$.length;$[_]?.setAttribute("data-highlighted",""),$[_]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(z){z.setAttribute("data-keyboard-nav",""),b?.closeAllSubMenus();let S=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(S.length>0){let g=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),$=-1;g?$=S.indexOf(g):v&&($=S.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),$===-1&&($=P.key==="ArrowDown"?-1:S.length);let N=P.key==="ArrowDown"?1:-1,O=($+N+S.length)%S.length;h(O),S[O]?.setAttribute("data-highlighted",""),S[O]?.focus();}}C?.(P),R?.(P);return}}if((P.key==="Enter"||P.key===" ")&&!c){P.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(S=>{let g=S.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(S);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(P),R?.(P);return}C?.(P),R?.(P);},[c,i,h,C,R,K,W,m,x,y,k,b]),A=useCallback(P=>{l==="click"&&((P.nativeEvent.composedPath?.()??[]).some(g=>{let v=g;if(!v||!("tagName"in v))return false;let $=String(v.tagName).toUpperCase();if($==="INPUT"||$==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let N="getAttribute"in v?v.getAttribute("role"):null;return N==="textbox"||N==="combobox"})||(P.stopPropagation(),i(!c))),M?.(P),w?.(P);},[l,c,i,M,w]),I=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},F=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&p){let P=p.props,B=P.css,z=typeof P.className=="string"?P.className:void 0,S=typeof P.tabIndex=="number"?P.tabIndex:0,g={ref:L,tabIndex:S,className:[z,o].filter(Boolean).join(" ")||void 0,css:[B,F,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:A,onKeyDown:E,...I,...D};return cloneElement(p,g)}return jsx("button",{ref:L,className:o,css:[css({display:"inline-block"}),F,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:A,onKeyDown:E,...I,...D,children:t})});$n.displayName="DropdownMenuTrigger";var xn=me.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:k,exitPlacement:y,animateOnBusClose:x=true,gap:b,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...M},R)=>{let{open:w,setOpen:D,referenceRef:L,clearSubmenuHover:K,setActiveIndex:W,floatingRef:E,menuId:A}=dr(),I=V(),F=ys(),P=co();useEffect(()=>{if(!F)return;let Y=F.registerCloser(()=>D(false));return ()=>{Y&&Y();}},[F,D]);let B=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,S=typeof s=="string"?parseFloat(s):s,g=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(Y=>({getBoundingClientRect:()=>{let se=Math.round(Y.x),ee=Math.round(Y.y);return {x:se,y:ee,left:se,top:ee,right:se,bottom:ee,width:0,height:0,toJSON:()=>({x:se,y:ee,left:se,top:ee,right:se,bottom:ee,width:0,height:0})}},contextElement:void 0}),[]),$=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let Y=e;return v({x:Y.x,y:Y.y})},[e,v]),{refs:N,x:O,y:_,strategy:H,context:q,update:U}=useFloating({open:w,onOpenChange:D,placement:g,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:B??0,crossAxis:z??0}),flip({padding:S??8}),shift({padding:S??8}),size({apply({rects:Y,elements:se}){let ee=se.floating;ee.style.boxSizing="border-box",i!=null?ee.style.height=typeof i=="number"?`${i}px`:String(i):ee.style.removeProperty("height"),c!=null?ee.style.width=typeof c=="number"?`${c}px`:String(c):a?ee.style.width=`${Math.round(Y.reference.width)}px`:ee.style.width="200px",l!=null?ee.style.maxHeight=typeof l=="number"?`${l}px`:String(l):ee.style.removeProperty("max-height");}})]});useEffect(()=>{$?N.setReference($):L.current&&N.setReference(L.current);},[N,$,L]),useEffect(()=>{if(!w)return;let Y=$||L.current,se=N.floating.current;if(!(!Y||!se))return autoUpdate(Y,se,U)},[w,$,L,N,U]),useEffect(()=>{U();},[U,a,c,i,l]),useEffect(()=>{w&&!h&&W(0);},[w,h,W]),useEffect(()=>{if(!m||!w)return;let Y=()=>{let se=document.activeElement,ee=L.current,ce=N.floating.current;se&&(ee?.contains(se)||ce?.contains(se)||D(false));};return document.addEventListener("focusin",Y,true),()=>document.removeEventListener("focusin",Y,true)},[m,w,D,L,N.floating]);let ae=useDismiss(q,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:Y=>{if(d?.length){let se=Y.target;for(let ee of d)if(ee.current?.contains(se))return false}return true}}),j=useRole(q,{role:"menu"}),{getFloatingProps:Z}=useInteractions([ae,j]),ie=useRef(false);useEffect(()=>{w?ie.current=true:ie.current&&L.current&&C&&(F?.isBusClosingRef.current||requestAnimationFrame(()=>{L.current?.focus();}));},[w,L,F,C]),useLayoutEffect(()=>{if(!w)return;let Y=()=>{let ce=E?.current;if(!ce)return false;let pe=ce.closest('[data-floating-ui-portal="true"]')??ce,Ue=L?.current;if(!Ue)return false;let ze=Ue.closest("[data-pfui-portal-owner]");if(ze){let Ne=ze.getAttribute("data-pfui-portal-owner");if(!Ne)return false;if(pe.getAttribute("data-pfui-portal-owner")===Ne&&ce.getAttribute("data-pfui-portal-owner")===Ne)return true;pe.setAttribute("data-pfui-portal-owner",Ne),ce.setAttribute("data-pfui-portal-owner",Ne);let nt=ze.getAttribute("data-pfui-mode"),qe=ze.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<ze.style.length;Ge++){let ot=ze.style[Ge];if(ot.startsWith("--pf-")){let dt=ze.style.getPropertyValue(ot);pe.style.setProperty(ot,dt),ce.style.setProperty(ot,dt);}}return pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),ze.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),ze.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark")),true}let Ie=Ue.closest('[data-floating-ui-portal="true"]');if(Ie&&!Ie.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let Ne=st.getAttribute("data-pfui-scope");if(!Ne)return false;pe.setAttribute("data-pfui-portal-owner",Ne),ce.setAttribute("data-pfui-portal-owner",Ne);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe)),pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),st.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${Ne}"]`);if(Ge&&Ge!==pe)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let sn=Ge.style.getPropertyValue(dt);pe.style.setProperty(dt,sn),ce.style.setProperty(dt,sn);}}return true}return false},se=[0,5,15,30,60,100,150,250],ee=[];for(let ce of se)ee.push(window.setTimeout(()=>Y(),ce));return ()=>{for(let ce of ee)window.clearTimeout(ce);}},[w,L]);let de=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),ge=b===void 0?void 0:typeof b=="number"?b:I.spacing[b]??b,Pe=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":de,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:ge,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,ve=Y=>{if(!Y||typeof Y!="object"||!isValidElement(Y))return Y;let ee=Y.type?.displayName;if(ee==="DropdownMenu"||ee==="DropdownMenuSub")return Y;if(ee==="MenuItem"||ee==="MenuCheckboxItem"||ee==="MenuRadioItem"||ee==="MenuSwitchItem")return Ce+=1,cloneElement(Y,{__index:Ce,key:Y.key??Ce});if(ee==="DropdownMenuTrigger"){let pe=Y.props.children;return cloneElement(Y,{children:me.Children.map(pe,ve)})}if(ee==="DropdownMenuSubTrigger"){Ce+=1;let pe=Ce;return cloneElement(Y,{__index:pe,key:Y.key??pe})}let ce=Y.props.children;return ce==null?Y:cloneElement(Y,{children:me.Children.map(ce,ve)})},Te=me.Children.map(k,ve),we=q.placement.split("-")[0]||"bottom",he=we==="bottom"?"center top":we==="top"?"center bottom":we==="left"?"right center":"left center",je=we==="bottom"?{opacity:0,y:-8,scale:.96}:we==="top"?{opacity:0,y:8,scale:.96}:we==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},te=y??we,Q=te==="bottom"?{opacity:0,y:-8,scale:.96}:te==="top"?{opacity:0,y:8,scale:.96}:te==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},X=!!F?.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"}},re=css({position:H,top:_??0,left:O??0,zIndex:1e3,transformOrigin:he}),le=useCallback(Y=>{if(Y.key==="Tab"){Y.preventDefault();return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault(),P?.setIsKeyboardNav(true);let se=Y.currentTarget;se.setAttribute("data-keyboard-nav","");let ee=Array.from(se.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(ce=>{if(ce.closest('[role="menu"]')!==se)return false;let pe=window.getComputedStyle(ce);return pe.display!=="none"&&pe.visibility!=="hidden"});if(ee.length>0){let ce=se.querySelector("[data-highlighted]"),pe=se.querySelector("[data-hovered]"),Ue=-1;ce?Ue=ee.indexOf(ce):pe&&(Ue=ee.indexOf(pe)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),pe&&pe.removeAttribute("data-hovered"),Ue===-1&&(Ue=Y.key==="ArrowDown"?-1:ee.length);let ze=Y.key==="ArrowDown"?1:-1,Ie=(Ue+ze+ee.length)%ee.length;W(Ie),ee[Ie]?.setAttribute("data-highlighted",""),ee[Ie]?.focus();}}},[P,W]),De=useCallback(Y=>{let se=Y.currentTarget;se.removeAttribute("data-keyboard-nav"),se.querySelectorAll("[data-highlighted]").forEach(ee=>ee.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]),$e=useCallback(Y=>{Y.removeAttribute("data-keyboard-nav"),Y.querySelectorAll("[data-highlighted]").forEach(se=>se.removeAttribute("data-highlighted")),P?.isKeyboardNav&&P.setIsKeyboardNav(false);},[P]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(oo.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...Z({...M,ref:hs(R,N.setFloating,Y=>{if(E&&(E.current=Y),Y&&L.current){let ee=L.current.closest("[data-pfui-portal-owner]");if(ee){let ce=ee.getAttribute("data-pfui-portal-owner");if(ce){Y.setAttribute("data-pfui-portal-owner",ce);let pe=ee.getAttribute("data-pfui-mode"),Ue=ee.getAttribute("data-pfui-primary");pe&&Y.setAttribute("data-pfui-mode",pe),Ue&&Y.setAttribute("data-pfui-primary",Ue);for(let ze=0;ze<ee.style.length;ze++){let Ie=ee.style[ze];Ie.startsWith("--pf-")&&Y.style.setProperty(Ie,ee.style.getPropertyValue(Ie));}ee.classList.contains("pf-light")&&Y.classList.add("pf-light"),ee.classList.contains("pf-dark")&&Y.classList.add("pf-dark");}}}})}),"data-menu-id":A,"data-keyboard-nav":P?.isKeyboardNav?"":void 0,className:f,css:[Pe,re,T],initial:je,animate:{opacity:1,x:0,y:0,scale:1},exit:Q,transition:X,onPointerMove:Y=>$e(Y.currentTarget),onPointerDown:Y=>$e(Y.currentTarget),onKeyDown:le,onMouseMove:De,onMouseEnter:()=>{K(),F?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(Y=>Y.removeAttribute("data-hovered"));},children:Te})}):null})})});xn.displayName="DropdownMenuContent";var ki=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Td(),[c,i]=useState(!!t),l=e??c,u=useCallback(E=>{E&&wi(x.current),e===void 0&&i(E),n?.(E);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((E,A)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=E;let I=A??20;m.current=window.setTimeout(()=>{h.current=false,u(E);},I);},[o,u]),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 E=()=>{T(),u(false);};return k.registerSubMenu(E)},[k,u,T]);let y=useRef(`pfui-submenu-${++Ii}`),x=useRef(null),b=useRef([]),d=useRef(null),[p,C]=useState(null),[M,R]=useState(false);useEffect(()=>{l||(C(null),b.current=[],R(false));},[l]);let w=useContext(Tt),D=r??w,L=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:b,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),K=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:M,setIsKeyboardNav:R}),[M]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:me.Children.map(s,E=>{if(!isValidElement(E))return E;let A=E.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:E})})):jsx(Si.Provider,{value:true,children:jsx(Tt.Provider,{value:D,children:jsx(po.Provider,{value:K,children:jsx(no.Provider,{value:W,children:jsx(bn.Provider,{value:L,children:s})})})})})};ki.displayName="DropdownMenuSub";var Ai=me.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}=dr(),k=co(),y=useCallback(E=>{E&&(E.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),b=x?t:null,d=b?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:M,onClick:R,...w}=s,D=useMemo(()=>hs(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),L=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(E=>{if(E.key==="Tab"){E.preventDefault();return}let A=E.currentTarget,I=F=>{k?.setIsKeyboardNav(true);let P=A.closest("[data-menu-id]");if(!P)return;P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let B=Array.from(P.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==P)return false;let $=window.getComputedStyle(v);return $.display!=="none"&&$.visibility!=="hidden"});if(!B.length)return;let z=B.indexOf(A),S=z>=0?z:0,g=F==="next"?(S+1)%B.length:(S-1+B.length)%B.length;B[g]?.setAttribute("data-highlighted",""),B[g]?.focus();};if(E.key==="ArrowDown"){E.preventDefault(),E.stopPropagation(),c&&i(false),I("next");return}if(E.key==="ArrowUp"){E.preventDefault(),E.stopPropagation(),c&&i(false),I("prev");return}if(E.key==="ArrowRight"||E.key==="Enter"||E.key===" "){E.preventDefault(),E.stopPropagation(),k?.setIsKeyboardNav(true);let F=E.currentTarget;i(true),requestAnimationFrame(()=>{let P=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(P){P.setAttribute("data-keyboard-nav",""),F.removeAttribute("data-highlighted"),F.removeAttribute("data-hovered");let B=P.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');B&&(B.setAttribute("data-highlighted",""),B.focus());}});return}if(E.key==="ArrowLeft"){E.preventDefault(),E.stopPropagation(),c&&i(false);let F=A.closest("[data-menu-id]");F&&F.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),k&&k.setIsKeyboardNav(true);return}if(E.key==="Escape"){E.preventDefault(),E.stopPropagation(),p?.(E);return}p?.(E),M?.(E);},[c,i,p,M,u,k,T]),W=l==="hover"?{onMouseEnter:E=>{let A=E.currentTarget;io(),h(),document.querySelectorAll("[data-hovered]").forEach(F=>F.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(F=>F.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),c||m(true,90);},onMouseMove:E=>{let A=E.currentTarget;io(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),A.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:E=>{E.stopPropagation(),i(!c),C?.(E),R?.(E);}};if(x&&b){let E=d?.css,A=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,F={ref:D,tabIndex:I,className:[A,o].filter(Boolean).join(" ")||void 0,css:[E,L,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,onFocus:P=>{if(P.target.hasAttribute("data-highlighted")){let B=P.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(P);},...W,...w};return cloneElement(b,F)}return jsx("div",{ref:D,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),L,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:K,onFocus:E=>{if(E.currentTarget.hasAttribute("data-highlighted")){let A=E.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...W,...w,children:t})});Ai.displayName="DropdownMenuSubTrigger";var Mi=me.forwardRef((e,t)=>{let n=ys(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=dr(),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 pr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),kd=css({display:"inline"}),Pi=css({display:"inline",fontWeight:700}),Ad=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Md=css({display:"flex",alignItems:"center",gap:4}),Fd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Di=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Pd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Dd=()=>{},Nd=e=>e,Hd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Ld=e=>{e.preventDefault(),e.stopPropagation();},Bd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},$d=e=>{e.preventDefault(),e.stopPropagation();},Ni=me.memo(({onCapture:e})=>{let t=useContext(bn),n=useContext(po),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Ni.displayName="CtxCapture";var xs=me.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),k=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Fd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Pd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(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,x)},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:k},e.value)}return s?jsx(Lt,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Lt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:k},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));xs.displayName="AutocompleteRow";var Hi=me.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:k,disabled:y=false,error:x=false,showClear:b=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:M=true,openOnClick:R=true,closeOnSelect:w=true,closeOnBlur:D=true,blurOnSelect:L=false,freeSolo:K=false,customValueLabel:W=false,maxHeight:E,maxItems:A,noResultsText:I="No Items Found",highlightTypedValue:F,typedValueHighlightCss:P,showNoResults:B=true,noResultsLabelCss:z,loadingLabelCss:S,loadItems:g,loading:v,loadingText:$="Loading\u2026",debounceMs:N=200,multiple:O=false,selectedValues:_,defaultSelectedValues:H,onChangeSelected:q,expandIcon:U,showExpandIcon:ae=true,expandIconCss:j,textFieldWrapperCss:Z,textFieldInputCss:ie,textFieldLabelCss:de,textFieldHelperRowCss:ge,textFieldHelperTextCss:Pe,textFieldStartIconCss:Ce,textFieldEndIconCss:ve,menuContentCss:Te})=>{let we=V().text.secondary,[he,je]=useState(""),te=typeof d=="boolean",[Q,J]=useState(false),X=te?d:Q,re=useRef(null),le=useRef(null),De=useRef(null),$e=useRef(null),Y=useRef(false),se=useRef(null),ee=useRef(false),ce=useRef(0),pe=useMemo(()=>[le],[]),[Ue,ze]=useState(H??[]),Ie=_??Ue,st=useRef(Ie);st.current=Ie;let[Ne,nt]=useState(null),qe=useRef(Ne);qe.current=Ne;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[sn,Jn]=useState(false),Je=typeof g=="function",xt=Je?ot:e,ue=useRef(xt);ue.current=xt;let Ee=!!v||sn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let Fe=useCallback(G=>{te||J(G),at.current?.(G);},[te]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let G=he;return bt.current=window.setTimeout(async()=>{Jn(true);try{let oe=await g(G)||[];dt(Array.isArray(oe)?oe:[]);}catch{dt([]);}finally{Jn(false);}},Math.max(0,N)),()=>{bt.current&&window.clearTimeout(bt.current);}},[he,Je,g,N]);let Zn=useMemo(()=>{let G=pr(he);return G?xt.some(oe=>pr(oe.title??oe.value)===G):false},[xt,he]),la=K&&!!W&&he.trim().length>0&&!Zn,lc=G=>{if(typeof W=="object"){let oe=Object.prototype.hasOwnProperty.call(W,"prefix"),xe=Object.prototype.hasOwnProperty.call(W,"suffix");if(oe||xe){let ke=oe?W.prefix??"":"",fe=xe?W.suffix??"":"";return `${ke}${G}${fe}`}return `Add "${G}"`}return `Add "${G}"`},Br=useMemo(()=>{if(Je)return xt;let G=pr(he);if(!G)return xt;let oe=[],xe=[];for(let ke of xt){let fe=pr(ke.title??ke.value);fe.split(" ").some(Ze=>Ze.startsWith(G))?oe.push(ke):fe.includes(G)&&xe.push(ke);}return oe.length>0?oe:xe},[xt,he,Je]),ca=useMemo(()=>{if(la){let G=he.trim();return [...Br,{value:G,title:lc(G),__pfui_free__:true}]}return Br},[Br,la,he]),jt=useMemo(()=>{let G=[],oe=new Map;for(let pt of ca){let Ze=pt.group??"__ungrouped__";oe.has(Ze)||(oe.set(Ze,[]),G.push(Ze)),oe.get(Ze).push(pt);}let ke=typeof A=="number"?Math.max(0,A):1/0,fe=[];for(let pt of G){if(ke<=0)break;let ln=oe.get(pt).slice(0,ke);ln.length>0&&(fe.push({label:pt==="__ungrouped__"?void 0:pt,items:ln}),ke-=ln.length);}return fe},[ca,A]),An=useMemo(()=>jt.reduce((G,oe)=>(G.push(...oe.items),G),[]),[jt]),No=An.length>0,$r=!No&&!!B&&!Ee&&he.trim().length>0,Mn=Ee||No||$r,Ho=Mn||Je;useEffect(()=>{!Je&&X&&!Mn&&(ee.current=true,Fe(false),setTimeout(()=>{ee.current=false;},150));},[Je,X,Mn,Fe]);let zr=useRef(null),Or=useRef(false);useEffect(()=>{if(K&&!O){if(Or.current){Or.current=false;return}let G=he.trim();if(zr.current===G)return;zr.current=G,t?.({value:G,title:G});}},[he,K,O,t]);let Wr=useCallback(G=>{let oe=ue.current,xe=new Map(oe.map(fe=>[fe.value,fe])),ke=G.map(fe=>xe.get(fe)??{value:fe,title:fe});q?.(ke);},[q]),Lo=useCallback(G=>{let oe=G.map(String);_||ze(oe),Wr(oe);},[_,Wr]),ua=useCallback(G=>{let xe=Ie.includes(G)?Ie.filter(ke=>ke!==G):[...Ie,G];Lo(xe);},[Ie,Lo]),Bo=useCallback(G=>{let oe=ue.current.find(xe=>xe.value===G)??{value:G,title:G};oe.disabled||(Or.current=true,zr.current=(oe.title??oe.value).trim(),nt(oe),je(oe.title??oe.value),t?.(oe),te||(w?(Y.current=false,ee.current=true,J(false),at.current?.(false),setTimeout(()=>{ee.current=false;},150)):Y.current=true),!w&&De.current?.setActiveIndex&&De.current.setActiveIndex(null),L?(Y.current=false,setTimeout(()=>{$e.current&&re.current?($e.current.tabIndex=0,$e.current.focus(),$e.current.blur(),$e.current.tabIndex=-1):re.current?.blur();},0)):requestAnimationFrame(()=>re.current?.focus()));},[t,te,w,L]),cc=useCallback(G=>{if(y)return;je(G);let oe=!G.trim();O||(oe?(nt(null),t?.(null)):K&&nt(null)),!te&&!oe&&M&&!X&&Fe(true);},[O,te,M,X,Fe,y,K,t]),it=Hd,da=Dd,uc=Nd,pa=useMemo(()=>P?[Pi,P]:Pi,[P]),dc=useCallback(G=>{let oe=he.trim();if(!oe||oe.length<1)return G;let xe=oe.toLowerCase(),fe=G.toLowerCase().indexOf(xe);return fe<0?G:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:kd,children:[G.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:pa,children:G.slice(fe,fe+oe.length)}),G.slice(fe+oe.length)]})},[he,pa]),$o=F?dc:uc,pc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Ld,Oo=Bd,mc=useCallback(G=>{De.current=G;},[]),ma=useCallback(G=>{let oe=De.current;if(!oe)return;let xe=An.length;if(xe===0)return;let ke=le.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(ke){let Ze=ke.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),ln=ke.querySelector("[data-active]")||ke.querySelector("[data-hovered]");ln&&(fe=Array.from(Ze).indexOf(ln));}fe<0&&typeof oe.activeIndex=="number"&&(fe=oe.activeIndex);let pt=fe<0?G===1?0:xe-1:(fe+G+xe)%xe;oe.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=le.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(_r=>_r.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(_r=>_r.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[An.length]),fc=useCallback(G=>{if(G.key===" "||G.code==="Space"||G.key==="Spacebar"){G.stopPropagation();return}if(G.key==="ArrowDown"||G.key==="ArrowUp"){if(y||!Mn&&!Je)return;G.preventDefault(),!X&&!te&&Fe(true),ma(G.key==="ArrowDown"?1:-1);return}if(G.key==="Enter"){if(y)return;let oe=De.current&&typeof De.current.activeIndex=="number"?De.current.activeIndex:-1,xe=oe>=0&&oe<An.length?An[oe]:null;if(X&&xe&&oe>=0){G.preventDefault(),G.stopPropagation(),O?(ua(xe.value),w||requestAnimationFrame(()=>re.current?.focus())):Bo(xe.value);return}}else G.key==="Escape"?(G.preventDefault(),G.stopPropagation(),X&&!te&&(ee.current=true,Fe(false),G.target.focus(),setTimeout(()=>{ee.current=false;},150))):G.key==="Tab"&&X&&!te&&Fe(false);},[Mn,Je,X,te,An,O,w,ma,ua,Bo,Fe,y]),gc=useCallback(()=>{y||ee.current||C&&Ho&&(ce.current=Date.now(),te||Fe(true));},[te,C,Ho,Fe,y]),bc=useCallback(()=>{if(Y.current){Y.current=false;return}D&&Fe(false),!K&&!O&&(Ne?je(Ne.title??Ne.value):he.trim()&&je(""));},[D,K,O,Ne,he,Fe]),fa=useCallback(()=>{let G=[],oe=0;return jt.forEach((xe,ke)=>{xe.label&&G.push(jsx(gn,{className:it("group-label"),children:xe.label},`g-${ke}`)),xe.items.forEach(fe=>{G.push(jsx(xs,{item:fe,absIndex:oe,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:$o,cls:it,closeOnSelect:false,pickSingle:da,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:we},`${fe.group??"__"}|${fe.value}`)),oe+=1;});}),jsx(bs,{values:Ie,onValuesChange:Lo,children:G},"multi-group")},[jt,it,Ge,s,$o,Ie,Lo,da,Oo,zo,we]),ga=useCallback(()=>{let G=[],oe=0;return jt.forEach((xe,ke)=>{xe.label&&G.push(jsx(gn,{className:it("group-label"),children:xe.label},`g-${ke}`)),xe.items.forEach(fe=>{let pt=Ne?.value===fe.value;G.push(jsx(xs,{item:fe,absIndex:oe,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:$o,cls:it,closeOnSelect:w,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:we},`${fe.group??"__"}|${fe.value}`)),oe+=1;});}),G},[jt,it,Ne,Ge,s,$o,w,Bo,Oo,zo,we]),hc=useMemo(()=>Ee?jsx(gn,{css:S,className:it("label-loading"),children:$},"loading"):$r?jsx(gn,{css:z,className:it("label-empty"),children:I},"empty"):jt.length===0?null:O?fa():ga(),[Ee,$r,jt.length,it,$,I,O,fa,ga]),an=X?false:y||!Je&&!No&&!B,ba=useCallback(G=>{G.preventDefault(),G.stopPropagation(),!(an||y)&&(te||(X?(ee.current=true,Fe(false),queueMicrotask(()=>re.current?.focus()),setTimeout(()=>{ee.current=false;},150)):(Fe(true),queueMicrotask(()=>re.current?.focus()))));},[X,No,Je,Fe,an,y,te]),ha=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:X?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:an?"not-allowed":"pointer",userSelect:"none",opacity:an?.5:1}),[X,an]),Wo=useMemo(()=>ae?jsx("span",{ref:se,role:"button",tabIndex:-1,css:[ha,j],"aria-disabled":an||void 0,onMouseDown:$d,onClick:ba,children:U??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[ae,ha,j,an,ba,U]),yc=useMemo(()=>T&&Wo?jsxs("span",{css:Md,children:[T,Wo]}):T??Wo,[T,Wo]),xc=useCallback(G=>{if(!(se.current&&se.current.contains(G.target)||ee.current||y||Date.now()-ce.current<300)){if(X){!he.trim()&&!te&&(ee.current=true,Fe(false),setTimeout(()=>{ee.current=false;},150));return}R&&Ho&&(!te||R)&&Fe(true);}},[X,he,R,Ho,Fe,y,te]);return jsx("div",{ref:le,className:it(""),css:[pc,l,c],children:jsxs(Bn,{open:y?false:X,onOpenChange:y?void 0:Fe,children:[jsx(Ni,{onCapture:mc}),jsx($n,{asChild:true,children:jsx("span",{className:it("anchor"),css:Ad,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:re,className:it("input"),focusRingMode:a,value:he,onChange:cc,onKeyDown:fc,onFocus:gc,onBlur:bc,onSurfaceClick:xc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:yc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:b,css:i,wrapperCss:Z,inputCss:ie,labelCss:de,helperRowCss:ge,helperTextCss:Pe,startIconCss:Ce,endIconCss:ve}),jsx("span",{ref:$e,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}}),Mn&&jsx(xn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof E=="number"?`${E}px`:E,css:Te,ignoreOutsidePressRefs:pe,disableOutsidePressDismiss:te,returnFocus:!L,children:hc})]})})});Hi.displayName="Autocomplete";var _d=["sm","md","lg"],Vd=(e,t)=>typeof e=="number"?e:_d.includes(e)?t.componentHeights[e]:t.componentHeights.md,jd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},Ud=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},qd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Li=me.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=Vd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=jd(u,o),b=Ud(u,o),d=qd(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":b,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),M=css({fontSize:k,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[p,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:M,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:M,children:d})})}));Li.displayName="Avatar";var Bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Jd=({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 Bi(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),k=typeof t=="number"&&t>=0,y=k&&T.length>t?T.slice(0,t):T,x=k&&T.length>t?T.length-t:0,b=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Bi(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${b}`,backgroundColor:b,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),M=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[p,r,m()],children:[y.map((R,w)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:jsx("span",{css:M,children:R})},w);let D=R,L=D.props?.css,K=L==null?M:[M,L],W=cloneElement(D,{size:n,rounded:s,css:K,style:{...D.props?.style,width:"100%",height:"100%",objectFit:D.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:W},w)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var Oi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Qd=(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"}},ep=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",tp=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",np=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",op=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),rp=me.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:k,className:y,badgeClassName:x,css:b,badgeCss:d,offsetX:p,offsetY:C})=>{let M=V(),R=s==="dot",w=f??(R?8:17),D=r??(R?0:10),{scale:L,onKey:K}=Qd(M,t),W=ep(L),E=M.text?.onColors||{},A=tp(M,E,K,n),I=np(e,a,s),F=op(i,s,e,c),P=css({position:"relative",display:"inline-block"}),B=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Oi(p??B),S=Oi(C??B),g=l.vertical||"top",v=l.horizontal||"right",$={},N="0",O="0";g==="center"?($.top="50%",O="-50%"):g==="top"?($.top=S,O="-45%"):($.bottom=S,O="45%"),v==="center"?($.left="50%",N="-50%"):v==="right"?($.right=z,N="45%"):($.left=z,N="-45%");let _=F?1:.8,H=css({minWidth:R?w:w/2,height:w,background:W,color:A,fontSize:typeof D=="number"?`${D}px`:D,fontWeight:o,borderRadius:999,padding:R?0:`0 ${w/4}px`,boxShadow:"0 2px 8px rgba(0,0,0,0.04)",lineHeight:1,position:"absolute",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",...T?{boxShadow:`0 0 0 2px ${k??M.surface?.appBg}`}:{},opacity:F?1:0,transform:`translate(${N}, ${O}) scale(${F?_:.5})`,...h?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...$});return jsxs("div",{className:["plainframe-ui-badge-wrapper",y||""].join(" ").trim(),css:[P,b],children:[m,jsx("span",{"aria-hidden":!F,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[H,d],children:I})]})});var Ss=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...k})=>{let y=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[b,d]=useState(e),[p,C]=useState(e),M=useRef(null),R=useRef(null),w=useRef(null);useEffect(()=>(M.current&&(clearTimeout(M.current),M.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),M.current=setTimeout(()=>{d(false),M.current=null;},u)),()=>{M.current&&(clearTimeout(M.current),M.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let A=document.body,I=A.style.overflow,F=A.style.paddingRight,P=window.innerWidth-document.documentElement.clientWidth,B=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",P>0&&(A.style.paddingRight=`${B+P}px`),()=>{A.style.overflow=I,A.style.paddingRight=F;}},[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 D=A=>{if(!p||!t||!w.current)return;let I=A.target;I&&!w.current.contains(I)&&t();},L=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:p?"auto":"none",visibility:b?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:L?`blur(${L})`:void 0,WebkitBackdropFilter:L?`blur(${L})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),E=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!b||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[K,a],onPointerDown:D,...k,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,i],role:"presentation"}),jsx("div",{ref:w,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[E,c],children:l})]})};var br=()=>null;Object.defineProperty(br,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function cp(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 up=me.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=me.useMemo(()=>me.Children.toArray(e).flatMap(d=>{if(!me.isValidElement(d))return [];let{type:p,props:C}=cp(d);if(!(p===br||typeof p=="function"&&"displayName"in p&&p.displayName===br.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=me.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),k=me.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=me.useCallback((d,p,C)=>{let M=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:M,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=me.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),b=me.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,M=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",M?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),w=[y(C,M,d.disabled),o,C?r:s,M?a:void 0,h(),d.css],D=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:b,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(me.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,c],children:t}),M?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:w,children:D}):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:D})]},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,Vi=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Vi(n)&&(t=true));}),t};function fp(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 gp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var ji=me.memo(me.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:k,...y},x)=>{let b=V(),d=ye(),p=useMemo(()=>fp(b,t),[b,t]),C=useMemo(()=>gp(b,e),[b,e]),M=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Vi(u)&&me.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,w=useMemo(()=>Is(n,R),[n,R]),D=useMemo(()=>Is(o,R),[o,R]),L=useMemo(()=>i??jsx(to,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>M?"center":l??"center",[M,l]),W=!!c&&K==="center",E=!!c&&K==="start",A=!!c&&K==="end",I=a||c,F=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?b.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,b,I]),P=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),B=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(M&&!s?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:ks(p.iconSize)}:{fontSize:ks(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[M,s,p,n,o]),S=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:ks(b.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[b,W]),g=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),$=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),N=useMemo(()=>U=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:U?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(M)return null;let U=!!n;return !U&&!E?null:jsxs("span",{css:$,"aria-hidden":c?true:void 0,children:[jsx("span",{css:N(!E),children:U?w||n:null}),jsx("span",{css:N(!!E),children:L})]})},[M,n,E,$,N,w,c,L]),H=useMemo(()=>()=>{if(M)return null;let U=!!o;return !U&&!A?null:jsxs("span",{css:$,"aria-hidden":c?true:void 0,children:[jsx("span",{css:N(!A),children:U?D||o:null}),jsx("span",{css:N(!!A),children:L})]})},[M,o,A,$,N,D,c,L]),q=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[F,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),P,B,z,k],onClick:q?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:S,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:g,children:M?c?L:Is(u,p.iconSize):u}),H()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?L:null})]})}));ji.displayName="Button";var vr=e=>isValidElement(e),bp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>bp(e)===t,Gi=e=>Ps(e,"ButtonGroup"),Xi=e=>Ps(e,"DropdownMenu"),Ms=e=>Ps(e,"DropdownMenuTrigger"),Wn=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,hp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,yp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Fs=(e,t)=>{if(!vr(e))return null;if(Gi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Fs(t?n[0]:n[n.length-1],t):null}if(Xi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Ms);return o?Fs(o,t):null}if(Ms(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},qi=(e,t)=>{if(!e)return false;let n=Fs(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return yp(o)},Yi=me.memo(me.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...k},y){let x=V(),b=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:b,p=o==="vertical",C=hp(x.componentHeights.border,1),M=x.surface.border,R=n&&!!f,w=n&&!!T,D=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?Wn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Wn(i??x.spacing.sm)}),L=Children.toArray(t),W=L.filter(vr).length,E=0,A=false,I=[];for(let F of L){if(!vr(F)){I.push(F);continue}let P=E===0,B=E===W-1,z=F.props??{},S=z.disabled??s,g=z.size??a,v=0,$=0,N=0,O=0;n&&(p?(v=P?R?0:d:0,$=P?w?0:d:0,O=B?R?0:d:0,N=B?w?0:d:0):(v=P?R?0:d:0,O=P?R?0:d:0,$=B?w?0:d:0,N=B?w?0:d:0));let _=qi(F,"left"),H=qi(F,"right"),ae=n&&!P&&!(A&&_)&&!(A||_)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${M}`}):null,j=n&&!P&&A&&_?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,Z=n?css({borderTopLeftRadius:Wn(v),borderTopRightRadius:Wn($),borderBottomRightRadius:Wn(N),borderBottomLeftRadius:Wn(O)}):null,ie=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([Z,ae,j,ie]);if(!Xi(F)){let ve=z.css,Te=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Re=Gi(F)&&n?{__clipLeft:!P,__clipRight:!B}:{},we=cloneElement(F,{...z,disabled:S,size:g,className:Te,css:[ve,de],...Re});I.push(we),A=H,E+=1;continue}let ge=z.children,Pe=Children.map(ge,ve=>{if(!vr(ve)||!Ms(ve))return ve;let Te=ve.props,Re=[Te.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(ve,{...Te,css:[Te.css,de],className:Re,disabled:S,size:g})}),Ce=cloneElement(F,{...z,children:Pe});I.push(Ce),A=H,E+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[D,h],...k,children:I})}));Yi.displayName="ButtonGroup";var Cr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Cr(n?.[e]??e)}}},Ep=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Cr(n?.[e]??e)}}},Sp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Ip=(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},Kn=me.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:k,role:y,tabIndex:x,...b},d){let p=V(),C=p.surface??{},[M,R]=useState(!!u),w=l!=null,D=w?!!l:M,L=useMemo(()=>Sp(o,p),[o,p]),K=useMemo(()=>Ip(o,p,L),[o,p,L]),W=K,E=useMemo(()=>wp(r,p),[r,p]),A=useMemo(()=>Ep(s,p),[s,p]),I=!!c||!!i,F=useMemo(()=>css({backgroundColor:L,padding:E,borderRadius:A,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Cr(h),height:Cr(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}}:{}}),[L,E,A,o,p.componentHeights,C.border,h,f,I,K,W]),P=useCallback(()=>{if(!i)return;let g=!D;w||R(g),m?.(g);},[w,m,i,D]),B=useCallback(g=>{i&&P(),T?.(g);},[i,P,T]),z=useCallback(g=>{i&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),P()),k?.(g);},[i,P,k]),S=ye();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&D?"true":void 0,"aria-pressed":i?D:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[S(),F,n],onClick:B,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...b,children:t})}));Kn.displayName="Container";var Ap=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 Ap(o)}return e}}}function ho(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 Mp(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 yo(e,t,n,o){let r=Ns(t,e),s=Ns(n,e),a=Ns(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Ji(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Zi=me.createContext("horizontal"),Ls=()=>me.useContext(Zi),Qi=me.memo(me.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:k,...y},x)=>{let b=V(),d=ye(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Mp(h,b),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Zi.Provider,{value:f,children:jsx(Kn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:k,tabIndex:k?0:void 0,...y,children:e})})}));Qi.displayName="Card";var Fp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Ls()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:ho(o),textAlign:Hs(o),...u?{width:"100%"}:{flex:1,minWidth:0},...yo(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})}),Pp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:ho(o),alignItems:ho(o),...u?{width:"100%"}:{},...yo(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})}),Dp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:ho(o),alignItems:ho(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...yo(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})}),Np=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Ji(m,l)??m.text?.primary,textAlign:Hs(o),...yo(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})}),Hp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Ji(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Hs(o),...yo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var tl=e=>isValidElement(e),zp=e=>tl(e)?e.type?.displayName||e.type?.name:void 0,el=e=>zp(e)==="Card",Op=e=>typeof e=="number"?`${e}px`:e,nl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?Op(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(el).length,x=0,b=T.map((d,p)=>{if(!el(d)||!tl(d))return d;let C=d.props,M=x++,R=M===0,w=M===y-1,D=s??C.variant,L=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=D==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,A=[L,K,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:D??C.variant,css:[C.css,...A],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:b})};nl.displayName="CardGroup";var He=e=>typeof e=="number"?`${e}px`:e,rl=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&rl(n)&&(t=true));}),t},Vp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},sl=me.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:k},y){let x=V(),b=ye(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Vp(x,d),[x,d]),C=!!l&&!h,M=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),w=useMemo(()=>{let U=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&U[r]?r:"primary"},[r,x.palette]),D=useCallback(U=>{let ae=x.palette;return (w==="neutral"?x.neutral[U]:ae[w]?.[U])??ae.primary?.[U]},[w,x.neutral,x.palette]),L=useMemo(()=>w==="neutral"?x.neutral[100]:D(50),[w,D,x.neutral]),K=useMemo(()=>w==="neutral"?x.text.secondary:D(800),[w,D,x.text.secondary]),W=useMemo(()=>w==="neutral"?x.neutral[100]:D(50),[w,D,x.neutral]),E=useMemo(()=>w==="neutral"?x.text.secondary:D(800),[w,D,x.text.secondary]),A=useMemo(()=>w==="neutral"?x.neutral[400]:D(300),[w,D,x.neutral]),I=useMemo(()=>w==="neutral"?x.surface.subtleBg:D(600),[w,D,x.surface.subtleBg]),F=useMemo(()=>(x.text.onColors??{})[w]??(w==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[w,x.text.onColors,x.neutral]),P="transparent",B=useMemo(()=>w==="neutral"?x.text.secondary:D(700)??x.text.primary,[w,D,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!rl(t)&&me.Children.count(t)===1,[a,c,t]),S=useMemo(()=>o==="filled"?css({backgroundColor:I,color:F,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:E,border:"none",boxShadow:`inset 0 0 0 ${R} ${A}`}):o==="ghost"?css({backgroundColor:P,color:B,border:"none",boxShadow:"none"}):css({backgroundColor:L,color:K,border:"none",boxShadow:"none"}),[I,F,B,W,E,A,L,K,R,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:He(p.gap),padding:o==="ghost"?0:z||t==null?He(p.soloPadding):`${He(p.paddingY)} ${He(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:M,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${He(p.iconSize)} + ${He(p.soloPadding)} * 2)`,minHeight:`calc(${He(p.iconSize)} + ${He(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,M,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:He(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?He(p.iconSize):void 0,height:z?He(p.iconSize):void 0,display:z?"block":void 0}}),[p.fontSize,p.iconSize,z]),$=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:He(p.iconSize),lineHeight:0,"& > svg":{width:He(p.iconSize),height:He(p.iconSize),display:"block"}}),[p.iconSize]),N=useMemo(()=>css({marginRight:z||t==null?0:He(p.gap),marginLeft:z||t==null?0:He(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:He(p.gap),marginRight:z||t==null?0:He(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),_=useMemo(()=>css({marginRight:s?0:He(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:He(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),H=useCallback(U=>{C&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),l?.());},[C,l]),q=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[g,S,C?b({color:r??"primary"}):null,k],onClick:C?l:void 0,onKeyDown:H,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:[$,N],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:[$,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:U=>{U.stopPropagation(),h||u?.();},css:[_,b({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||q})]})}));sl.displayName="Chip";var Gp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Xp=me.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let k=ye(),y=r.neutral,x=r.text,b=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),M=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),w=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),D=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",L=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:D,border:L,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?k({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),E=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 S=Math.max(0,Math.min(o-1,z));C(S),d.current[S]?.focus();},[o]),F=useCallback((z,S)=>{let g=A(S).slice(0,1),v=[...M];v[z]=g,n(v.join("")),g&&z<o-1&&I(z+1);},[M,o,n,I]),P=useCallback((z,S)=>{if(S.key==="Backspace")if(!M[z]&&z>0){let g=[...M];g[z-1]="",n(g.join("")),I(z-1),S.preventDefault();return}else {let g=[...M];g[z]="",n(g.join(""));return}if(S.key==="ArrowLeft"&&z>0){S.preventDefault(),I(z-1);return}if(S.key==="ArrowRight"&&z<o-1){S.preventDefault(),I(z+1);return}if(S.key==="Home"){S.preventDefault(),I(0);return}if(S.key==="End"){S.preventDefault(),I(o-1);return}},[M,o,n,I]),B=useCallback(z=>{let S=A(z.clipboardData.getData("text")).slice(0,o);S&&(n(S),requestAnimationFrame(()=>{let g=Math.min(S.length,o-1);I(g);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,S)=>jsxs(me.Fragment,{children:[jsx("input",{ref:g=>{d.current[S]=g;},type:"text",inputMode:"text",maxLength:1,value:M[S]||"",placeholder:M[S]?"":R[S]||"",disabled:l,onChange:g=>F(S,g.target.value),onKeyDown:g=>P(S,g),onFocus:()=>C(S),onPaste:S===0?B:void 0,className:"plainframe-ui-code-box",css:K(S===p),"aria-label":`Code character ${S+1}`,tabIndex:S===p?0:-1}),f&&S<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:E,children:f}):null]},S))})}),Yp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:k,labelCss:y,helperRowCss:x,helperTextCss:b,css:d})=>{let p=V(),C=useId(),M=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",w=M[R],D=p.neutral,L=p.text,K=t!=null,[W,E]=useState(n),A=K?t:W,I=N=>{K||E(N),o?.(N);},F=Math.max(2,Math.min(h,10)),P=p.spacing.sm,B=Gp(l??P)??"0px",z=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(k)?k:k?[k]:[]),S=css({fontSize:w.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??L.primary:i?D[500]:L.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),g=css({display:"flex",alignItems:"center",justifyContent:"center",gap:B,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:w.helperFont,color:a?p.palette.danger?.[700]??L.secondary:L.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),$=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??L.primary:i?D[500]:L.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:S,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:g,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Xp,{value:A||"",onChange:I,len:F,theme:p,sizeKey:R,s:{codeFontSize:w.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:B})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:$,children:c})})]})};var ul=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},$s=e=>{if(!e||typeof e!="object")return false;let t=ul(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some($s):$s(o)},Zp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=me.useRef(null),[c,i]=me.useState(false),l=me.useCallback(v=>{i(v),o?.(v);},[o]),u=me.useCallback(()=>l(false),[l]),m=me.useRef({x:0,y:0}),h=me.useRef(null),f=me.useRef(null),T=me.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let $=Math.round(m.current.x),N=Math.round(m.current.y);v.style.transform=`translate3d(${$}px, ${N}px, 0)`;},[]),k=me.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);me.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=me.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),$=Math.round(m.current.y);return {x:v,y:$,left:v,top:$,right:v,bottom:$,width:0,height:0,toJSON:()=>({x:v,y:$})}}}),[]),x=me.useRef(`cz-${Math.random().toString(36).slice(2)}`),b=me.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=me.useRef(null),p=me.useRef(null),C=me.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),M=me.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=me.useCallback(()=>{M(),p.current=window.setTimeout(()=>l(false),0);},[M,l]),w=me.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),D=me.useCallback((v,$)=>{m.current={x:v,y:$},k(),l(true);},[k,l]),L=typeof t=="function"?t({close:u}):t,K=$s(L),W=v=>{if(!me.isValidElement(v))return v;let $=ul(v),N=v,O=N.props.children,_=O==null?O:Array.isArray(O)?O.map(H=>me.isValidElement(H)?W(H):H):me.isValidElement(O)?W(O):O;if($==="DropdownMenu"){let H=N.props.onOpenChange;return me.cloneElement(N,{...N.props,open:c,onOpenChange:q=>{H?.(q),l(q);},children:_})}if($==="DropdownMenuContent"){let H=N.props.onMouseEnter,q=N.props.onMouseLeave;return me.cloneElement(N,{...N.props,anchor:y,"data-cz-id":x.current,onMouseEnter:U=>{M(),H?.(U);},onMouseLeave:U=>{R(),q?.(U);},children:_})}return _===O?N:me.cloneElement(N,{...N.props,children:_})},E=K?W(L):L,A=me.useCallback(v=>{v.preventDefault(),D(v.clientX,v.clientY);},[D]),I=me.useCallback(v=>{n==="contextmenu"&&A(v);},[n,A]),F=me.useCallback(v=>{n==="dblclick"&&A(v);},[n,A]),P=me.useCallback(v=>{n==="click"&&A(v);},[n,A]),B=me.useCallback(v=>{if(n!=="hover")return;C(),M();let $=r==="center"?w():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let N=$.x+(r==="cursor"?s:0),O=$.y+(r==="cursor"?s:0);D(N,O);},0);},[n,r,s,w,D,C,M]),z=me.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!K&&(m.current={x:v.clientX+s,y:v.clientY+s},k());},[n,c,r,K,s,k]),S=me.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);me.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let $=a.current?.matches(":hover"),N=b()?.matches?.(":hover");$||N?M():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,b,M,R]),me.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let $=a.current?.matches(":hover"),N=b()?.matches?.(":hover");if($||N?M():R(),r==="center"&&a.current){let O=w();m.current={x:O.x,y:O.y},k();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,w,k,l,M,R,b]),me.useEffect(()=>()=>{C(),M();},[C,M]);let g=({children:v})=>c?jsx("div",{ref:h,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(m.current.x)}px, ${Math.round(m.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&M(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:F,onClick:P,onMouseEnter:B,onMouseMove:z,onMouseLeave:S,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?E:jsx(g,{children:E})]})};var Vn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,nm=me.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:k,className:y,...x},b){let d=V(),{t:p,strokeColor:C,labelTextColor:M,chipSubtleBg:R,chipOutlinedBg:w,outerM:D,padX:L,verticalStrokeMargin:K}=useMemo(()=>{let F=typeof s=="number"?`${s}px`:s,P=d.surface.border,B=d.text.secondary,z=d.surface.subtleBg,S=d.surface.panelBg,g=Vn(h,"10px"),v=o==="horizontal"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0",$=o==="vertical"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0";return {t:F,strokeColor:P,labelTextColor:B,chipSubtleBg:z,chipOutlinedBg:S,outerM:g,padX:v,verticalStrokeMargin:$}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:D,marginRight:D}:{flexDirection:"row",width:a?Vn(a):"100%",minWidth:0,paddingLeft:L,paddingRight:n==="middle"?L:"0",marginTop:D,marginBottom:D},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,D,a,L,n,f]),E=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:p,flex:1}]),[C,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:M,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:w,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,M,u,R,w,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[E,k]}),[E,k]);return o==="vertical"?jsxs("div",{ref:b,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:b,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="right"&&I,!t&&I]})}));var hl=me.createContext(null),yl=()=>{let e=useContext(hl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},xl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(hl.Provider,{value:u,children:e})},sm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=yl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let m;me.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;me.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 me.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})});sm.displayName="DrawerTrigger";var Ro=0,vl="",Cl="",am=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function im(){if(!(typeof document>"u")){if(Ro===0){let e=document.body;vl=e.style.overflow||"",Cl=e.style.paddingRight||"";let t=am();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}Ro+=1;}}function lm(){if(!(typeof document>"u")&&(Ro>0&&(Ro-=1),Ro===0)){let e=document.body;e.style.overflow=vl,e.style.paddingRight=Cl;}}var cm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Rl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:k,css:y,...x},b){let d=V(),{open:p,setOpen:C,lockScroll:M,closeOnEscape:R}=yl();useEffect(()=>{if(!(!M||!p))return im(),()=>lm()},[p,M]);let w=useMemo(()=>cm(a,0),[a]),D=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),L=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]),E=useMemo(()=>{let j=String(d.radius.lg);switch(r){case "left":return `0 ${j} ${j} 0`;case "right":return `${j} 0 0 ${j}`;case "top":return `0 0 ${j} ${j}`;default:return `${j} ${j} 0 0`}},[r,d.radius.lg]),A=useMemo(()=>c??(s==="inset"?d.radius.lg:E),[c,s,d.radius.lg,E]),I=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:w,bottom:r==="top"?void 0:w,left:r==="right"?void 0:w,right:r==="left"?void 0:w}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,w]),F=useRef(null),P=useCallback(()=>{let j=F.current;if(!j)return 1;let Z=j.getBoundingClientRect();return D==="x"?Z.width:Z.height},[D]),B=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(m??280)/1e3,ease:[.22,1,.36,1]}),[m]),S=useMemo(()=>L*1.1,[L]),g=useMemo(()=>D==="x"?{x:`${S*100}%`,y:0}:{y:`${S*100}%`,x:0},[D,S]),v=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:D==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,K,W,d.surface,A,p,D]),$=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]),N=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>D==="x"?{left:L===-1?T:0,right:L===1?T:0}:{top:L===-1?T:0,bottom:L===1?T:0},[D,L,T]),_=useMemo(()=>D==="x"?{left:0,right:0}:{top:0,bottom:0},[D]),H=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),q=useCallback((j,Z)=>{let ie=D==="x"?Z.offset.x:Z.offset.y,de=D==="x"?Z.velocity.x:Z.velocity.y,ge=L*ie>0,Pe=Math.abs(ie)>=P()*H,Ce=L*de>f;ge&&(Pe||Ce)&&C(false);},[D,L,P,H,f,C]),U=useRef(null);useEffect(()=>{if(!p)return;U.current=document.activeElement;let j=setTimeout(()=>{let de=F.current;if(!de)return;let ge=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');ge.length>0?ge[0].focus():de.focus();},100),Z=de=>{let ge=F.current;if(!ge||!de.target)return;let Pe=de.target;if(!ge.contains(Pe)){de.preventDefault();let Ce=ge.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():ge.focus();}},ie=de=>{de.key==="Escape"&&R&&(de.stopPropagation(),C(false));};return document.addEventListener("focusin",Z,true),window.addEventListener("keydown",ie),()=>{clearTimeout(j),document.removeEventListener("focusin",Z,true),window.removeEventListener("keydown",ie),U.current&&typeof U.current.focus=="function"&&U.current.focus();}},[p,C,R]);let{...ae}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:$,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:N},"overlay"),jsx(motion.div,{ref:j=>{F.current=j,typeof b=="function"?b(j):b&&(b.current=j);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[v,y],drag:D,dragConstraints:_,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:q,initial:{...g,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...g,opacity:.98},transition:m?z:B,...ae,children:t},"panel")]}):null})});Rl.displayName="DrawerContent";var um=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),k=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(xl,{open:k,onOpenChange:y,children:jsx(Rl,{ref:l,...i,children:c})})});um.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),k=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(k)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Tl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wl=me.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Tl(c),width:c?"100%":void 0,maxHeight:Tl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});wl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(k)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var El={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},Em=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Sm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},jn=me.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:k,style:y,as:x})=>{let b=V(),d=El[e]??El.body,p=x??Sm[e]??"span",C=A=>A==null?d.size:typeof A=="number"?A:b?.typography?.sizes?.[A]??A,M=C(o)??C(d.size),R=r??d.weight,w=s??d.lh,D=a??d.ls,L=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:M,fontWeight:R,lineHeight:w,letterSpacing:D,color:L,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),E=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:K,textDecorationThickness:Em(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,E],style:y,"data-variant":e,children:t})});jn.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Am=(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}}},Il=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:k,placeholder:y,blurDataURL:x,placeholderColor:b="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:M,onLoad:R,onError:w,...D},L){let[K,W]=useState(false),[E,A]=useState(false),[I,F]=useState(false),P=V(),B=Am(s,P)??"0px",z=i?"figure":"div",S=css({display:"flex",flexDirection:"column",gap:i?P.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${B})`}),g=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: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:M?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?b:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),$=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",p||""].join(" ").trim(),css:[S,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:M,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:L,className:"plainframe-ui-image-img",css:$,src:E&&d?d:t,alt:n,srcSet:T,sizes:k,loading:m,decoding:h,fetchPriority:f,onLoad:N=>{F(true),R?.(N);},onError:N=>{A(true),w?.(N);},...D})]}),i&&jsx(jn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Il.displayName="Image";var kl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Dm=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}},Nm=e=>e*Math.PI/180,Hm=(e,t,n)=>{let o=Math.abs(Nm(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 Lm(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 Bm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,Al=[1.02,1.03,1.02],Ml=[1.06,1.08,1.06],$m={sm:150,md:200,lg:260,xl:340},zm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Om(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 zm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Wm=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:k="md",label:y,labelAlign:x="center",css:b,className:d,...p}){let C=V(),M=Dm(r)??4/5,R=typeof o=="string"?o:void 0,w=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):$m[s],D=Math.max(1,w/M),K=Children.toArray(t).filter(isValidElement).slice(0,i),W=K.length,E=Lm(n,W),A=K.map((j,Z)=>Bm(n,W,Z)),I=j=>D*.6*A[j],F=j=>I(j)*M,P=0,B=0;for(let j=0;j<W;j++){let Z=F(j),ie=I(j),de=Math.max(Math.abs(E.base.ang[j]??0),Math.abs(E.exp.ang[j]??0)),ge=Math.max(Math.abs(E.base.dx[j]??0),Math.abs(E.exp.dx[j]??0)),Pe=Math.max(Math.abs(E.base.dy[j]??0),Math.abs(E.exp.dy[j]??0)),Ce=a==="expand"?Ml[j]??1.08:a==="reveal"?Al[j]??1.03:1,ve=Hm(Z,ie,de),Te=ve.w*Ce,Re=ve.h*Ce,we=ge/100*Z*Ce,he=Pe/100*ie*Ce;P=Math.max(P,Te/2+we),B=Math.max(B,Re/2+he);}let z=Math.max(1,2*P),S=Math.max(1,2*B),g=Math.min(1,w/z,D/S),v=c===void 0?"pointer":"controlled",$=c?"true":void 0,N=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:kl(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:kl(D)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${S}px`,transform:`translate(-50%, -50%) scale(${g})`,transformOrigin:"center center"}),H=Om(k,C)??"0px",q=j=>{let Z=n==="fan"?`rotate(${E.base.ang[j]}deg) translate(${E.base.dx[j]}%, ${E.base.dy[j]}%)`:n==="slide"?`translate(${E.base.dx[j]}%, ${E.base.dy[j]}%) rotate(${E.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${E.base.dy[j]}%)`:`translate(${E.base.dx[j]}%, ${E.base.dy[j]}%) rotate(${E.base.ang[j]}deg)`,ie=n==="fan"?`rotate(${E.exp.ang[j]}deg) translate(${E.exp.dx[j]}%, ${E.exp.dy[j]}%)`:n==="slide"?`translate(${E.exp.dx[j]}%, ${E.exp.dy[j]}%) rotate(${E.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${E.exp.dy[j]}%)`:`translate(${E.exp.dx[j]}%, ${E.exp.dy[j]}%) rotate(${E.exp.ang[j]}deg)`,de=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Z} scale(1)`,ge=a==="expand"?`${ie} scale(${Ml[j]??1.06})`:a==="reveal"?`${Z} scale(${Al[j]??1.03})`:`${Z} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${de}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&j===1?10:j+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${ge}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${ge}`}})},U=j=>css({width:`${F(j)}px`,aspectRatio:`${M}`,position:"relative",overflow:"hidden",borderRadius:H,"--pfui-image-radius":H,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":$,css:[N,b],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((j,Z)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:q(Z),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:U(Z),children:j})},Z))})}),y&&jsx(jn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Pl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Vm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function jm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var Um=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=Pl[o]??Pl.sm,k=Vm(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:k,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),b=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?b:n==="ghost"?d:p,R=s&&c>0&&jm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var Ym=(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:c,distance:i})=>{let u=Ym(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,b=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:b,className:d,onTransitionEnd:T(p)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:k,onTransitionEnd:T(),children:e})};var Xs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ll=me.createContext(null),Bl=()=>{let e=useContext(Ll);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},nf=({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(Ll.Provider,{value:u,children:e})},$l=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Bl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let m;me.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;me.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 me.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})});$l.displayName="ModalTrigger";var zl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:k,...y},x)=>{let b=V(),{open:d,setOpen:p,lockScroll:C}=Bl(),M=me.useRef(null),R=me.useRef(null);me.useEffect(()=>{if(!d)return;R.current=document.activeElement;let E=setTimeout(()=>{let I=M.current;if(!I)return;let F=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');F.length>0?F[0].focus():I.focus();},100),A=I=>{let F=M.current;if(!F||!I.target)return;let P=I.target;if(!F.contains(P)){I.preventDefault();let B=F.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');B.length>0?B[0].focus():F.focus();}};return document.addEventListener("focusin",A,true),()=>{clearTimeout(E),document.removeEventListener("focusin",A,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let w=typeof b.spacing.sm=="number"?`${b.spacing.sm}px`:String(b.spacing.sm),D=css({width:"100%",height:Xs(o),maxWidth:t==="inset"?`min(${Xs(n)||"100%"}, calc(100% - ${w} * 2))`:Xs(n),maxHeight:t==="inset"?`calc(100% - ${w} * 2)`:"100%",margin:t==="inset"?w:void 0}),L=jsx(Kn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[D,f],ref:E=>{M.current=E,typeof x=="function"?x(E):x&&(x.current=E);},...y,children:e}),K=u==="none"?L:u==="slide"?jsx(Gs,{on:d,direction:m,duration:h,children:L}):u==="grow"?jsx(_s,{initialScale:.75,on:d,duration:h,children:L}):jsx(Ks,{on:d,duration:h,children:L});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:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[W,T].filter(Boolean),contentCss:W,lockScroll:C,children:K})});zl.displayName="ModalContent";var df=({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(),k=t!==void 0,[y,x]=useState(n),b=Math.max(1,e),d=Sr(k?t:y,1,b),p=useCallback(g=>{let v=Sr(g,1,b);k||x(v),o?.(v);},[k,b,o]),C=useMemo(()=>pf({count:b,page:d,siblingCount:r,boundaryCount:s}),[b,d,r,s]),M=f.palette?.primary?.[600],R=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,D=f.text?.primary??"#111",L=l==="subtle"?f.surface?.subtleBg:"transparent",K=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:L,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:D,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}),E=css({width:28,minWidth:28,height:28,padding:0}),A=(g=false)=>css([W,T({color:g?"primary":"neutral"}),l==="outlined"?g?{background:M,color:f.text.onColors.primary,borderColor:M}:{background:"transparent",borderColor:R,":hover":{background:w}}:l==="ghost"?g?{background:M,color:f.text.onColors.primary}:{":hover":{background:w}}:g?{background:M,color:f.text.onColors.primary,borderColor:M}:{":hover":{background:w}}]),I=useCallback(()=>p(1),[p]),F=useCallback(()=>p(b),[p,b]),P=useCallback(()=>{d===1?i&&p(b):p(d-1);},[d,i,b,p]),B=useCallback(()=>{d===b?i&&p(1):p(d+1);},[d,i,b,p]),z=a||d===1&&!i,S=a||d===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(),P()),g.key==="ArrowRight"&&(g.preventDefault(),B()),g.key==="Home"&&(g.preventDefault(),I()),g.key==="End"&&(g.preventDefault(),F()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[A(false),E],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),E],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((g,v)=>typeof g=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":g===d?`Page ${g}, current page`:`Go to page ${g}`,"aria-current":g===d?"page":void 0,css:A(g===d),onClick:()=>p(g),children:g},g):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":S,disabled:S,css:[A(false),E],onClick:B,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":S,disabled:S,css:[A(false),E],onClick:F,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function pf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Er(1,e);let s=Er(1,Math.min(o,e)),a=Er(Math.max(e-o+1,o+1),e),c=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Sr(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),Er(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Er(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var bf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,hf=me.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:bf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var _l=createContext(null),Cf=()=>{let e=useContext(_l);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Rf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Tf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),k=h?e:f,y=useRef([]),[x,b]=useState(0),d=()=>b(A=>A+1),p=useCallback(A=>{h||T(A),n?.(A);},[h,n]),C=useCallback(A=>(y.current.push(A),d(),y.current.length-1),[]),M=useCallback((A,I)=>{let F=y.current[A];F&&(y.current[A]={...F,...I},d());},[]),R=()=>y.current.map((A,I)=>({it:A,i:I})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),w=useCallback((A,I)=>{let F=R();if(!F.length)return;let P=Math.max(0,F.indexOf(A)),B=F[(P+I+F.length)%F.length],z=y.current[B]?.ref;if(z){z.focus();let S=y.current[B]?.value;S!==void 0&&p(S);}},[p]),D=useCallback(A=>{let I=R();if(!I.length)return;let F=A==="first"?I[0]:I[I.length-1],P=y.current[F]?.ref;if(P){P.focus();let B=y.current[F]?.value;B!==void 0&&p(B);}},[p]),L=useMemo(()=>{let A=y.current.filter(F=>F.ref&&!F.disabled);return A.length?A.some(F=>F.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:C,update:M,moveFocusBy:w,moveToEdge:D,focusValue:L,theme:m,anchorOrigin:Rf(l)}),[k,p,o,r,s,a,C,M,w,D,L,m,l]),W=css({width:"fit-content"}),E=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:E,children:jsx(_l.Provider,{value:K,children:i})})})},wf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:k,anchorOrigin:y}=Cf(),x=c||t,b=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],M=C(600),R=C(100),w=f.neutral[300],D=f.palette.primary[300],L=f.text.onColors?.primary??f.neutral[0],K="transparent",W=D,E=L;T==="soft"?(K=R,W=null,E=M):T==="outlined"?(K=C(50),W=D,E=M):(K=f.neutral[200],W="transparent",E=L),b&&(T==="outlined"?(K=R,W=D,E=M):T==="filled"?(K=M,W=null,E=L):(K=R,W=null,E=M));let A=T==="filled"?w:f.palette.primary[100],I=useRef(null),F=useRef(-1);useEffect(()=>{F.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(F.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let P=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||b?{}:{background:A,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${D}`:"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:b?p*.45:0,height:b?p*.45:0,borderRadius:f.radius.full,background:b?E:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:b?"scale(1)":"scale(0.6)",opacity:b?1:0}),S=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),g=(()=>{let O=y.horizontal,_=y.vertical;return _==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),$=!x&&k===e?0:-1,N=ye();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":b,"aria-disabled":x||void 0,disabled:x,tabIndex:$,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(F.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(F.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[P,N({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[B,css({gridColumn:g.col,gridRow:g.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:S,children:o})]})};var Af=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:k,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var Ao=(...e)=>e.filter(Boolean).flat();function Zs(e){if(!(e==null||typeof e=="boolean")){if(typeof e=="string"||typeof e=="number"){let t=String(e).trim();return t||void 0}if(Array.isArray(e)){for(let t of e){let n=Zs(t);if(n)return n}return}if(me.isValidElement(e))return Zs(e.props?.children)}}var ea=e=>null;ea.displayName="SelectItem";function Qs(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Qs(n,t);return}if(me.isValidElement(e)){if(e.type===ea){t.push(e);return}if(e.type===me.Fragment){Qs(e.props.children,t);return}}}}var jl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:k=280,css:y,wrapperCss:x,labelCss:b,triggerCss:d,menuCss:p,optionCss:C,children:M,className:R,menuSize:w="md",triggerRender:D})=>{let L=V(),K=ye(),W=me.useId(),E=`${W}-label`,A=`${W}-menu`,I={sm:{minHeight:L.componentHeights.sm,radius:L.radius.sm},md:{minHeight:L.componentHeights.md,radius:L.radius.md},lg:{minHeight:L.componentHeights.lg,radius:L.radius.md}},F=I[l]||I.md,[P,B]=me.useState(false),z=Q=>B(!!Q),S=typeof e<"u",g=c||Array.isArray(e)||Array.isArray(t),[v,$]=me.useState(()=>typeof t<"u"?t:g?[]:void 0),N=S?e:v,O=Q=>{S||$(Q),n?.(Q);},_=[];Qs(M,_);let H=_.map((Q,J)=>{let X=Q.props,re=X.textValue??(typeof X.label=="string"?X.label:void 0)??Zs(X.children),le=X.label??re;return {key:Q.key??J,value:X.value,startIcon:X.startIcon,endIcon:X.endIcon,node:X.children,disabled:!!X.disabled,optionCss:X.css,optionClassName:X.className,textValue:re,triggerNode:le}}),q=Q=>g?(Array.isArray(N)?N:[]).some(X=>Object.is(X,Q)):Object.is(N,Q),U=me.useMemo(()=>{if(g){let J=Array.isArray(N)?N:[];return H.filter(X=>J.some(re=>Object.is(re,X.value)))}let Q=H.find(J=>Object.is(J.value,N));return Q?[Q]:[]},[N,g,H]),ae=me.useMemo(()=>U.map(Q=>Q.textValue).filter(Q=>!!Q),[U]),j=me.useMemo(()=>U.length?g?ae.length===U.length?ae.join(", "):`${U.length} selected`:ae[0]:typeof r=="string"?r:void 0,[U.length,g,ae,r]),Z=me.useMemo(()=>{if(U.length){if(!g){let Q=U[0];return Q.triggerNode??Q.textValue}if(ae.length===U.length)return ae}},[U,g,ae]),ie=Q=>{i||(Object.is(Q,N)||O(Q),z(false));},de=Q=>{if(i)return;let J=Array.isArray(N)?N:[],re=J.some(le=>Object.is(le,Q))?J.filter(le=>!Object.is(le,Q)):[...J,Q];O(re);},ge={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},Pe={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:F.radius,minHeight:F.minHeight,fontSize:L.typography.sizes.sm,padding:`0 ${typeof L.spacing.sm=="number"?`${L.spacing.sm}px`:L.spacing.sm} 0 ${typeof L.spacing.md=="number"?`${L.spacing.md}px`:L.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:L.text.primary,background:"transparent",whiteSpace:"nowrap"},Ce=u==="subtle"?{background:L.surface.subtleBg}:u==="outlined"?{background:L.surface.panelBg,border:`1px solid ${L.surface.border}`}:{background:"transparent"},ve={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},Te={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Re={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},we=jsx(ChevronsUpDown,{size:16,css:css({color:L.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),he=()=>{if(D){let J=Array.isArray(Z)||typeof Z=="string"?Z:void 0;return D(J)}if(g){let X=Array.isArray(Z)?Z.join(", "):U.length?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(Te),children:s}),jsx("span",{css:css(Re),title:X,children:X})]})}let Q=Z??(typeof r=="string"||typeof r=="number"?String(r):r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(Te),children:s}),jsx("span",{css:css(Re),title:j,children:Q})]})},je={left:"start",center:"center",right:"end"},te=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),z(true));};return jsxs("div",{css:Ao(ge,x,y),className:["plainframe-ui-select-wrapper",R||""].join(" ").trim(),children:[o&&jsx("div",{id:E,className:"plainframe-ui-select-label",css:Ao({marginBottom:6,fontSize:L.typography.sizes.sm,fontWeight:500,color:L.text.secondary},b),children:o}),jsxs(Bn,{size:w,open:P,onOpenChange:z,children:[jsx($n,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":P||void 0,"aria-controls":A,"aria-labelledby":o?E:void 0,onKeyDown:te,onClick:()=>z(!P),className:"plainframe-ui-select-trigger",css:Ao(css(Pe),css(Ce),d,K()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ve),children:he()}),a??we]})}),jsx(xn,{id:A,gap:"xs",align:je[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Ao({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},p),children:H.map((Q,J)=>{let X=q(Q.value),re=i||Q.disabled;return jsx(Lt,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:X,disabled:re,closeOnSelect:!g,onSelect:()=>{re||(g?de(Q.value):ie(Q.value));},css:Ao(C,Q.optionCss),className:["plainframe-ui-select-option",Q.optionClassName||""].join(" ").trim(),children:Q.node},Q.key??J)})})]})]})};jl.displayName="Select";var ta=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Df=keyframes`
13
+ `,Xc=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("),Yc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Jc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Xc(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]&&Yc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=me.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=j(),T=typeof t=="number",k=Math.max(o-n,1),y=T?Xa(t,n,o):void 0,x=T?(y-n)/k*100:void 0,b=Jc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Qc,{size:s,active:b,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Zc,{thickness:a,active:b,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Zc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),k=css([{position:"relative",width:"100%",height:os(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,Ga):Ga,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),b={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...b,left:"-35%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...b,left:"-200%",right:"100%",animation:`${Gc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:k,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Qc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=j(),m=40,h=(m-t)/2,f=2*Math.PI*h,k=`${(o?Xa((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:os(e,`${u.componentHeights.md}`),height:os(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),b=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:k,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${Uc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:b})})})};var Za=createContext(null),Qa=()=>{let e=useContext(Za);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},cu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),uu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),du=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=j(),T=useId(),k=useId(),y=useMemo(()=>{let M={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?M[c]:M.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},b=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??b:v==="warning"?x.warning??b:v==="success"?x.success??b:v==="info"?x.info??x.primary??b:b)(t),P=I?.[50]??b[50],D=I?.[300]??b[300],B=I?.[600]??I?.[500]??b[600],z=I?.[700]??B,w=I?.[800]??f.text?.primary??"#000",g=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:B,fg:g,border:void 0,iconColor:g}:n==="outlined"?{bg:P,fg: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,b,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),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(()=>[uu,{color:d.iconColor}],[d.iconColor]),A=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[du,{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=me.Children.toArray(u).some(M=>me.isValidElement(M)&&M.type===as),S=me.Children.toArray(u).some(M=>me.isValidElement(M)&&M.type===is);return jsx(Za.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:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:E,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:cu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:A,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});ei.displayName="Alert";var as=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})});as.displayName="AlertTitle";var is=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})});is.displayName="AlertDescription";var ls=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Jt=e=>e==null?[]:Array.isArray(e)?e:[e],Zt=(...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 Zo=me.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:k,togglePasswordVisible:y=false,showClear:x,type:b="text",step:d,focusRingMode:p="always",className:C,wrapperCss:F,inputCss:R,labelCss:E,helperRowCss:A,helperTextCss:$,startIconCss:K,endIconCss:W,css:S,onBlur:M,onFocus:I,onKeyDown:P,autoFocus:D,name:B,id:z,tabIndex:w,autoComplete:g,readOnly:v,required:L,maxLength:H,onSurfaceClick:O},_){let N=j(),q=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}},Ee=["sm","md","lg"].includes(m)?m:"md";return ce[Ee]},[m,N]),U=N.neutral,Z=N.text,ae=b==="number",ue=b==="password",ge=n!==void 0,[Pe,Ce]=useState(o),xe=ge?n:Pe,Re=useCallback(ce=>{ge||Ce(ce),r?.(ce);},[ge,r]),Te=/^-?\d*(?:[.,]\d*)?$/,we=ae&&(d!=null&&String(d).includes(".")||/[.,]/.test(xe??"")),he=ae?we?"decimal":"numeric":void 0,je=ae?we?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,V=useCallback(ce=>{(ce===""||Te.test(ce))&&Re(ce);},[Re]),ie=i?U[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",X$1=N.componentHeights.border,Q=h==="outlined"?`${X$1} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",re=Zt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?ls(u):void 0,flex:"0 0 auto",fontWeight:500}),pe=useMemo(()=>Zt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??Z.primary:i?U[500]:Z.primary,marginBottom:4,display:"inline-block"},...Jt(E)),[se.labelFont,a,i,U,Z,N.palette.danger,E]),De=useMemo(()=>Zt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${ls(se.paddingY)} ${ls(se.paddingX)}`,background:ie,border:Q,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,ie,Q,f,i,F,S]),$e=useMemo(()=>Zt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?U[500]:a?N.palette.danger?.[800]??Z.primary:Z.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:ae?"textfield":"auto","&::placeholder":{color:a?N.palette.danger?.[700]??Z.secondary:Z.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??Z.primary:Z.primary} !important`,boxShadow:`0 0 0 1000px ${ie} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??Z.primary:Z.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Jt(R)),[se.fontSize,i,U,Z,a,N.palette.danger,ae,ie,R]),J=useMemo(()=>Zt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??Z.secondary:Z.secondary,marginLeft:-3},...Jt(K)),[a,N.palette.danger,Z.secondary,K]),oe=useMemo(()=>Zt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??Z.secondary:Z.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Jt(W)),[a,N.palette.danger,Z.secondary,i,W]),ee=useMemo(()=>Zt({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??Z.secondary:Z.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Jt(A)),[se.helperFont,a,N.palette.danger,Z.secondary,A]),le=useMemo(()=>Zt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Jt($)),[$]),de=useRef(null),Ue=useCallback(ce=>{de.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),ze=useCallback(ce=>{let Ee=ce.target.value;if(ae){V(Ee);return}H&&Ee.length>H||Re(Ee);},[ae,H,Re,V]),[Ie,st]=useState(false),Ne=useCallback(()=>{i||st(ce=>!ce);},[i]),nt=useCallback(()=>{i||(Re(""),de.current?.focus());},[i,Re]),qe=useMemo(()=>{let ce=se.fontSize;if(typeof ce=="number")return ce;let Ee=parseFloat(String(ce));return Number.isFinite(Ee)?Ee:16},[se.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:J,children:ni(T,qe)}):null,[T,J,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ce=[];if(ue&&y){let bt=Ie?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Qn=>Qn.preventDefault(),onClick:Qn=>{Qn.stopPropagation(),Ne();},tabIndex:-1,"aria-label":Ie?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&xe&&xe.length>0&&!i&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=k?jsx("span",{css:oe,children:ni(k,qe)},"user-end"):null,at=ce.length>0,Fe=!!Ee;return !at&&!Fe?null:!at&&Fe?Ee:at&&!Fe?ce.length===1?ce[0]:jsx("span",{css:ot,children:ce}):jsxs("span",{css:ot,children:[ce,Ee]})},[ue,y,Ie,qe,oe,ot,i,x,xe,k,Ne,nt]),sn=c!=null?`${z??G}-help`:void 0,Zn=z??G,Je=useCallback(ce=>{if(i)return;ce.stopPropagation();let Ee=de.current;if(!Ee)return;let at=ce.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ce.preventDefault();return}ce.preventDefault();}},[i]),vt=useCallback(ce=>{if(i)return;let Ee=de.current;if(Ee&&(O?.(ce),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:re,children:[t&&jsx("label",{htmlFor:Zn,className:"plainframe-ui-textfield-label",css:pe,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[q({enabled:p!=="none",color:a?"danger":void 0}),De],onPointerDownCapture:Je,onClick:vt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Zn,className:"plainframe-ui-textfield-input",css:$e,type:ue?Ie?"text":"password":b==="number"?"text":b,inputMode:he,pattern:je,value:xe,maxLength:ae?void 0:H,onChange:ae?ce=>V(ce.target.value):ze,placeholder:s||"",disabled:i,onBlur:M,onFocus:I,onKeyDown:P,autoFocus:D,name:B,tabIndex:w,autoComplete:g,readOnly:v,required:L,"aria-invalid":!!a||void 0,"aria-describedby":sn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:ee,children:jsx("span",{id:sn,className:"plainframe-ui-textfield-helper-text",css:le,children:c})})]})}));Zo.displayName="TextField";var Qo=me.createContext("ghost"),wt=me.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=j(),[T,k]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),b=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:b,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:k}),[T]),F=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(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);},[]),A=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(A.current){A.current=false;return}let P=I.currentTarget,D=R(P);D.length>0&&(k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(B=>B.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(B=>B.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true}));},[R]),K=useCallback(I=>{let P=I.currentTarget,D=R(P);if(D.length===0)return;if(I.key==="Tab"){A.current=true,P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.tabIndex=-1,requestAnimationFrame(()=>{P.tabIndex=0,A.current=false;});return}let B=P.querySelector("[data-highlighted]"),z=P.querySelector("[data-hovered]"),w=B||z,g=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")),g===-1&&(g=I.key==="ArrowDown"?-1:D.length);let v=I.key==="ArrowDown"?1:-1,L=(g+v+D.length)%D.length;D[L].setAttribute("data-highlighted",""),D[L].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[D.length-1].setAttribute("data-highlighted",""),D[D.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.blur();return}},[R]),W=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&E(P);},[E]),S=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&E(P);},[E]),M=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:F,children:jsx(wt.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:M,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:K,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ii.displayName="Menu";var ci=createContext(null),nr=()=>{let e=useContext(ci);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Ou(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)Ou(n,t);},us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Wu=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}},Ku=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};Wu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let b=document.querySelector(".plainframe-ui-popover");if(!b)return;let d=Array.from(b.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(R=>{let E=window.getComputedStyle(R);return E.display!=="none"&&E.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],F=document.activeElement;x.shiftKey&&F===p?(x.preventDefault(),C.focus()):!x.shiftKey&&F===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let k=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ci.Provider,{value:k,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}=nr(),u=me.Children.only(t),m=u.props||{},h=io(c,o,u.ref),f=a==="click"?{onClick:k=>{k.stopPropagation(),s(!r),m.onClick?.(k);}}:{onMouseEnter:k=>{l(),r||s(true),m.onMouseEnter?.(k);},onMouseLeave:k=>{i(),m.onMouseLeave?.(k);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let k=u.props?.css;return me.cloneElement(u,{...f,...T,ref:h,css:[k,n].filter(Boolean)})}return me.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}=nr(),a=me.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return me.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:us(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});di.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var pi=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:k,setOpen:y,triggerOn:x,referenceRef:b,scheduleClose:d,cancelClose:p}=nr(),C=j(),F=_u(e),{refs:R,x:E,y:A,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(()=>{b.current&&R.setReference(b.current);},[R,b]);let W=useDismiss(K,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(K,{role:"dialog"}),{getFloatingProps:M}=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"}}},g=C.surface.panelBg,v=C.text.primary,L=`${C.componentHeights.border} solid ${C.surface.border}`,H=er(i,C.spacing),O=er(l,C.spacing),_=er(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),_&&(N.paddingBlock=_);let q=er(m,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:A??0,left:E??0,zIndex:1e3,transformOrigin:D,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:us(a)??"fit-content",height:us(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),U=r?css({}):css({background:g,color:v,border:L,borderRadius:q,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"}`}}),Z=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},ae=io(R.setFloating,T),ue=jsx(motion.div,{className:"plainframe-ui-popover",...M({...f,ref:ae,...Z}),...w,css:[se,U,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?ue:null})})});pi.displayName="PopoverContent";var Vu=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var fs=me.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=j(),k=ye(),y={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},x={slideMs:250,pressMs:150,easing:"ease"},b=t!==void 0,[d,p]=useState(n),C=b?!!t:d,[F,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let E=["sm","md","lg"].includes(s)?s:"md",A=y[E],$=`${x.slideMs}ms ${x.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?K:W,M=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:P,thumb:D}=A,B=(P-D)/2,z=css({display:"inline-flex",alignItems:"center",gap:A.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),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}),g=css({position:"absolute",top:B,left:C?I-D-B:B,width:D,height:D,backgroundColor:M,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:F?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),L=()=>{if(r)return;let O=!C;b||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:L,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,k({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[w,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 Zu=(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=me.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:k,...y},x)=>{let b=j(),d=ye(),p=typeof e=="boolean",[C,F]=useState(t),R=p?e:C,E=r==="sm"||r==="lg"?r:"md",A=useMemo(()=>Zu(b,E),[b,E]),{checkedBg:$,checkColor:K,borderCol:W,hoverBg:S,gapPx:M}=useMemo(()=>{let O=b.palette||{},_=b.neutral||{},N=b.text?.onColors||{},q,G;l==="neutral"||l==="secondary"?(q=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(q=O[l]||O.primary||_,G=l):(q=O.primary||_,G="primary");let se=q[600]??q[500]??q[400]??Object.values(q)[0]??b.palette.primary[600],U=N[G]??N.primary??b.text?.onColors?.primary??b.text.primary,Z=typeof A.gap=="number"?A.gap+2:A.gap;return {checkedBg:se,checkColor:U,borderCol:b.surface.border,hoverBg:b.surface.panelHover,gapPx:Z}},[A.gap,l,b]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:M,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:b.radius.sm,padding:b.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:W,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[W,$,a,o,M,S,s,b.radius.sm,b.spacing.xs]),P=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),D=useMemo(()=>css({width:A.box,height:A.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${A.borderWidth} solid ${W}`,outlineOffset:`-${A.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?b.radius.full:A.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, box-shadow .16s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden",transform:"translateZ(0)",backfaceVisibility:"hidden"}),[A.box,A.borderRadius,A.borderWidth,W,c,b.radius.full]),B=useMemo(()=>({w:Math.round(A.box*A.iconRatioW),h:Math.round(A.box*A.iconRatioH)}),[A.box,A.iconRatioH,A.iconRatioW]),z=useMemo(()=>css({width:B.w,height:B.h,transition:"opacity .14s ease, transform .14s ease",color: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"}),[]),g=useMemo(()=>css({fontSize:A.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:b.text.primary}),[A.labelFont,b.text.primary]),v=useMemo(()=>css({fontSize:A.labelFont,lineHeight:1.25,color:b.text.secondary,fontWeight:400,marginTop:s&&a?b.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[A.labelFont,a,s,b.spacing.xs,b.text.secondary]),L=useCallback(()=>{o||(p?n?.(!R):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"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:R,onChange:L,disabled:o,css:P,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[D,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke: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:[g,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,T],children:a})]})]})}));rr.displayName="Checkbox";var td=()=>useContext(bn),nd=()=>useContext(ro),od=()=>useContext(lr),fn=null,hi=(e,t=35)=>{fn!==null&&window.clearTimeout(fn),fn=window.setTimeout(()=>{e(),fn=null;},t);},lo=()=>{fn!==null&&(window.clearTimeout(fn),fn=null);},Lt=me.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:k,...y},x){let b=td(),d=od(),p=ir(),C=uo(),F=nd(),R=j(),A=!!useContext(wt),$=y["data-subtrigger"]!==void 0,K=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,M=useContext(Qo),I=M==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],P=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:S>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${S}))`:R.spacing.md,minHeight:A?R.componentHeights.sm:R.componentHeights.md,display:"flex",alignItems:"center",gap:R.spacing.sm,fontWeight:500,fontSize:R.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?R.palette.danger[800]:R.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?R.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:I},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:R.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[R,A,S,t,n,I]),D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),B=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),w=[];A&&w.push({minHeight:R.componentHeights.sm,paddingLeft:R.spacing.sm,paddingRight:R.spacing.xs,paddingTop:R.spacing.xs,paddingBottom:R.spacing.xs});let g=()=>{s?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let _=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(Z=>{if(Z.closest('[role="menu"]')!==_)return false;let ae=window.getComputedStyle(Z);return ae.display!=="none"&&ae.visibility!=="hidden"});if(!N.length)return;let q=N.indexOf(H),G=q>=0?q:0,se=O(N.length,G),U=N[se];U&&(document.querySelectorAll("[data-highlighted]").forEach(Z=>{Z.removeAttribute("data-highlighted");}),U.setAttribute("data-highlighted",""),U.focus(),b&&T!=null&&b.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(b&&!k){let O=b.listRef.current;H&&(T!=null?O[T]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&hi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&b&&T!=null&&b.setActiveIndex(T),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)lo();else {let N=!!H.currentTarget.closest("[data-submenu-content]");p&&!N&&hi(p.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&b&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),b.setActiveIndex(T)),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{b&&b.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&b&&!F?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!b){let _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(q=>q.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(q=>q.removeAttribute("data-hovered"));let N=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),g());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let q=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(q){let G=q.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered")),q.setAttribute("data-highlighted",""),q.focus();let se=q.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",""),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,q)=>(q+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",""),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,q)=>(q-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")),v(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")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[P,...w,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),g());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:D,children:l}),a,(f!=null||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})})]})]})}),xi=me.createContext(null),bs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,k=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(k),l.current?.(k);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(xi.Provider,{value:m,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:m,...h},f){let T=useContext(xi),k=!!T&&r!==void 0,y=!k&&t!==void 0,[x,b]=useState(()=>k?T.values.some(W=>Object.is(W,r)):!!n),d=k?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=j(),F=!!useContext(wt),R=()=>{if(!c)if(k)T.toggle(r);else {let W=!d;y||b(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"}),A=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),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:A})}),u]});return jsx(Lt,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon:K,endIcon:m,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var vi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:m,...h},f){let T=t!==void 0,[k,y]=useState(!!n),x=T?!!t:k,d=!!useContext(wt),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),F=()=>{if(a)return;let E=!x;T||y(E),o?.(E);},R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(Lt,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:F,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(fs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});vi.displayName="MenuSwitchItem";var Ci=me.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 rd=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=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: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(Lt,{...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=j(),f=!!useContext(wt),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,k=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),b=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(k,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:b,children:a})]})});gn.displayName="MenuLabel";var sd=({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)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var wi=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},hs=io,po=0,cr=null,ur=null,xd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function vd(){if(!(typeof document>"u")){if(po===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=xd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function Cd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var bn=createContext(null),dr=()=>{let e=useContext(bn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),Rd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Ei=createContext(null),ir=()=>useContext(Ei),Si=createContext(false),Td=()=>useContext(Si),ro=createContext({allItemsTabbable:true}),lr=me.createContext(null),ys=()=>useContext(lr);function wd(){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 Ed=()=>Rd()?.activeIndex??null,Ii=0,Bn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(M=>{M&&wi(h.current),e===void 0&&i(M),n?.(M);},[e,n]),m=useRef(`pfui-menu-${++Ii}`),h=useRef(null),f=useRef([]),T=useRef(null),[k,y]=useState(null),[x,b]=useState(false);useEffect(()=>{l||(y(null),f.current=[],b(false));},[l]);let d=useRef(null),p=useCallback((M,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let P=I??20;d.current=window.setTimeout(()=>u(M),P);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return vd(),()=>Cd()},[l,r]);let F=ys(),[R]=useState(()=>F??wd()),E=useRef(new Set),A=useMemo(()=>({registerSubMenu:M=>(E.current.add(M),()=>E.current.delete(M)),closeAllSubMenus:()=>{E.current.forEach(M=>M());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),K=useMemo(()=>({activeIndex:k,setActiveIndex:y}),[k,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:b}),[x]),S=s==="sm";return jsx(lr.Provider,{value:R,children:jsx(wt.Provider,{value:S,children:jsx(oo.Provider,{value:W,children:jsx(Ei.Provider,{value:A,children:jsx(mo.Provider,{value:K,children:jsx(bn.Provider,{value:$,children:a})})})})})})};Bn.displayName="DropdownMenu";var $n=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:k,menuId:y}=dr(),x=uo(),b=ir(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,F=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:E,...A}=s,$=useMemo(()=>hs(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),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"&&c){D.preventDefault(),x?.setIsKeyboardNav(true);let B=k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=B.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');z&&(document.querySelectorAll("[data-highlighted]").forEach(w=>w.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(D.key==="ArrowRight"&&c){let B=document.querySelector("[data-subtrigger][data-hovered]");if(B){D.preventDefault(),D.stopPropagation(),x?.setIsKeyboardNav(true),B.removeAttribute("data-hovered"),B.setAttribute("data-highlighted",""),B.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});B.dispatchEvent(z);});return}}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){D.preventDefault(),i(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=Array.from(B.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let g=w.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.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();}}}),C?.(D),R?.(D);return}if(c){D.preventDefault();let B=document.querySelectorAll("[data-hovered]");for(let w of Array.from(B))if(w.closest("[data-submenu-content]")){let v=w.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let L=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let _=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",""),b?.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(g=>{if(g.closest('[role="menu"]')!==z)return false;let v=window.getComputedStyle(g);return v.display!=="none"&&v.visibility!=="hidden"});if(w.length>0){let g=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),L=-1;g?L=w.indexOf(g):v&&(L=w.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),v&&v.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();}}C?.(D),R?.(D);return}}if((D.key==="Enter"||D.key===" ")&&!c){D.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=Array.from(B.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let g=w.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(D),R?.(D);return}C?.(D),R?.(D);},[c,i,h,C,R,K,W,m,x,y,k,b]),M=useCallback(D=>{l==="click"&&((D.nativeEvent.composedPath?.()??[]).some(g=>{let v=g;if(!v||!("tagName"in v))return false;let L=String(v.tagName).toUpperCase();if(L==="INPUT"||L==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(D.stopPropagation(),i(!c))),F?.(D),E?.(D);},[l,c,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,g={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[B,P,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...A};return cloneElement(p,g)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),P,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:M,onKeyDown:S,...I,...A,children:t})});$n.displayName="DropdownMenuTrigger";var xn=me.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:k,exitPlacement:y,animateOnBusClose:x=true,gap:b,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...F},R)=>{let{open:E,setOpen:A,referenceRef:$,clearSubmenuHover:K,setActiveIndex:W,floatingRef:S,menuId:M}=dr(),I=j(),P=ys(),D=uo();useEffect(()=>{if(!P)return;let J=P.registerCloser(()=>A(false));return ()=>{J&&J();}},[P,A]);let B=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,w=typeof s=="string"?parseFloat(s):s,g=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),ee=Math.round(J.y);return {x:oe,y:ee,left:oe,top:ee,right:oe,bottom:ee,width:0,height:0,toJSON:()=>({x:oe,y:ee,left:oe,top:ee,right:oe,bottom:ee,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 v({x:J.x,y:J.y})},[e,v]),{refs:H,x:O,y:_,strategy:N,context:q,update:G}=useFloating({open:E,onOpenChange:A,placement:g,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 ee=oe.floating;ee.style.boxSizing="border-box",i!=null?ee.style.height=typeof i=="number"?`${i}px`:String(i):ee.style.removeProperty("height"),c!=null?ee.style.width=typeof c=="number"?`${c}px`:String(c):a?ee.style.width=`${Math.round(J.reference.width)}px`:ee.style.width="200px",l!=null?ee.style.maxHeight=typeof l=="number"?`${l}px`:String(l):ee.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,c,i,l]),useEffect(()=>{E&&!h&&W(0);},[E,h,W]),useEffect(()=>{if(!m||!E)return;let J=()=>{let oe=document.activeElement,ee=$.current,le=H.floating.current;oe&&(ee?.contains(oe)||le?.contains(oe)||A(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[m,E,A,$,H.floating]);let se=useDismiss(q,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:J=>{if(d?.length){let oe=J.target;for(let ee of d)if(ee.current?.contains(oe))return false}return true}}),U=useRole(q,{role:"menu"}),{getFloatingProps:Z}=useInteractions([se,U]),ae=useRef(false);useEffect(()=>{E?ae.current=true:ae.current&&$.current&&C&&(P?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[E,$,P,C]),useLayoutEffect(()=>{if(!E)return;let J=()=>{let le=S?.current;if(!le)return false;let de=le.closest('[data-floating-ui-portal="true"]')??le,Ue=$?.current;if(!Ue)return false;let ze=Ue.closest("[data-pfui-portal-owner]");if(ze){let Ne=ze.getAttribute("data-pfui-portal-owner");if(!Ne)return false;if(de.getAttribute("data-pfui-portal-owner")===Ne&&le.getAttribute("data-pfui-portal-owner")===Ne)return true;de.setAttribute("data-pfui-portal-owner",Ne),le.setAttribute("data-pfui-portal-owner",Ne);let nt=ze.getAttribute("data-pfui-mode"),qe=ze.getAttribute("data-pfui-primary");nt&&(de.setAttribute("data-pfui-mode",nt),le.setAttribute("data-pfui-mode",nt)),qe&&(de.setAttribute("data-pfui-primary",qe),le.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<ze.style.length;Ge++){let ot=ze.style[Ge];if(ot.startsWith("--pf-")){let dt=ze.style.getPropertyValue(ot);de.style.setProperty(ot,dt),le.style.setProperty(ot,dt);}}return de.classList.remove("pf-light","pf-dark"),le.classList.remove("pf-light","pf-dark"),ze.classList.contains("pf-light")&&(de.classList.add("pf-light"),le.classList.add("pf-light")),ze.classList.contains("pf-dark")&&(de.classList.add("pf-dark"),le.classList.add("pf-dark")),true}let Ie=Ue.closest('[data-floating-ui-portal="true"]');if(Ie&&!Ie.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let Ne=st.getAttribute("data-pfui-scope");if(!Ne)return false;de.setAttribute("data-pfui-portal-owner",Ne),le.setAttribute("data-pfui-portal-owner",Ne);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(de.setAttribute("data-pfui-mode",nt),le.setAttribute("data-pfui-mode",nt)),qe&&(de.setAttribute("data-pfui-primary",qe),le.setAttribute("data-pfui-primary",qe)),de.classList.remove("pf-light","pf-dark"),le.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(de.classList.add("pf-light"),le.classList.add("pf-light")),st.classList.contains("pf-dark")&&(de.classList.add("pf-dark"),le.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${Ne}"]`);if(Ge&&Ge!==de)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let sn=Ge.style.getPropertyValue(dt);de.style.setProperty(dt,sn),le.style.setProperty(dt,sn);}}return true}return false},oe=[0,5,15,30,60,100,150,250],ee=[];for(let le of oe)ee.push(window.setTimeout(()=>J(),le));return ()=>{for(let le of ee)window.clearTimeout(le);}},[E,$]);let ue=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),ge=b===void 0?void 0:typeof b=="number"?b:I.spacing[b]??b,Pe=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ue,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:ge,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,xe=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let ee=J.type?.displayName;if(ee==="DropdownMenu"||ee==="DropdownMenuSub")return J;if(ee==="MenuItem"||ee==="MenuCheckboxItem"||ee==="MenuRadioItem"||ee==="MenuSwitchItem")return Ce+=1,cloneElement(J,{__index:Ce,key:J.key??Ce});if(ee==="DropdownMenuTrigger"){let de=J.props.children;return cloneElement(J,{children:me.Children.map(de,xe)})}if(ee==="DropdownMenuSubTrigger"){Ce+=1;let de=Ce;return cloneElement(J,{__index:de,key:J.key??de})}let le=J.props.children;return le==null?J:cloneElement(J,{children:me.Children.map(le,xe)})},Re=me.Children.map(k,xe),we=q.placement.split("-")[0]||"bottom",he=we==="bottom"?"center top":we==="top"?"center bottom":we==="left"?"right center":"left center",je=we==="bottom"?{opacity:0,y:-8,scale:.96}:we==="top"?{opacity:0,y:8,scale:.96}:we==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},V=y??we,ie=V==="bottom"?{opacity:0,y:-8,scale:.96}:V==="top"?{opacity:0,y:8,scale:.96}:V==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Q=!!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"}},re=css({position:N,top:_??0,left:O??0,zIndex:1e3,transformOrigin:he}),pe=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 ee=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(le=>{if(le.closest('[role="menu"]')!==oe)return false;let de=window.getComputedStyle(le);return de.display!=="none"&&de.visibility!=="hidden"});if(ee.length>0){let le=oe.querySelector("[data-highlighted]"),de=oe.querySelector("[data-hovered]"),Ue=-1;le?Ue=ee.indexOf(le):de&&(Ue=ee.indexOf(de)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),de&&de.removeAttribute("data-hovered"),Ue===-1&&(Ue=J.key==="ArrowDown"?-1:ee.length);let ze=J.key==="ArrowDown"?1:-1,Ie=(Ue+ze+ee.length)%ee.length;W(Ie),ee[Ie]?.setAttribute("data-highlighted",""),ee[Ie]?.focus();}}},[D,W]),De=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(ee=>ee.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]),$e=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(ro.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...Z({...F,ref:hs(R,H.setFloating,J=>{if(S&&(S.current=J),J&&$.current){let ee=$.current.closest("[data-pfui-portal-owner]");if(ee){let le=ee.getAttribute("data-pfui-portal-owner");if(le){J.setAttribute("data-pfui-portal-owner",le);let de=ee.getAttribute("data-pfui-mode"),Ue=ee.getAttribute("data-pfui-primary");de&&J.setAttribute("data-pfui-mode",de),Ue&&J.setAttribute("data-pfui-primary",Ue);for(let ze=0;ze<ee.style.length;ze++){let Ie=ee.style[ze];Ie.startsWith("--pf-")&&J.style.setProperty(Ie,ee.style.getPropertyValue(Ie));}ee.classList.contains("pf-light")&&J.classList.add("pf-light"),ee.classList.contains("pf-dark")&&J.classList.add("pf-dark");}}}})}),"data-menu-id":M,"data-keyboard-nav":D?.isKeyboardNav?"":void 0,className:f,css:[Pe,re,T],initial:je,animate:{opacity:1,x:0,y:0,scale:1},exit:ie,transition:Q,onPointerMove:J=>$e(J.currentTarget),onPointerDown:J=>$e(J.currentTarget),onKeyDown:pe,onMouseMove:De,onMouseEnter:()=>{K(),P?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:Re})}):null})})});xn.displayName="DropdownMenuContent";var ki=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Td(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&wi(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,M)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=M??20;m.current=window.setTimeout(()=>{h.current=false,u(S);},I);},[o,u]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let k=ir();useEffect(()=>{if(!k)return;let S=()=>{T(),u(false);};return k.registerSubMenu(S)},[k,u,T]);let y=useRef(`pfui-submenu-${++Ii}`),x=useRef(null),b=useRef([]),d=useRef(null),[p,C]=useState(null),[F,R]=useState(false);useEffect(()=>{l||(C(null),b.current=[],R(false));},[l]);let E=useContext(wt),A=r??E,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:b,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),K=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:F,setIsKeyboardNav:R}),[F]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:me.Children.map(s,S=>{if(!isValidElement(S))return S;let M=S.type;return M?.displayName==="DropdownMenuSubTrigger"||M?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Si.Provider,{value:true,children:jsx(wt.Provider,{value:A,children:jsx(mo.Provider,{value:K,children:jsx(oo.Provider,{value:W,children:jsx(bn.Provider,{value:$,children:s})})})})})};ki.displayName="DropdownMenuSub";var Ai=me.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}=dr(),k=uo(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),b=x?t:null,d=b?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:F,onClick:R,...E}=s,A=useMemo(()=>hs(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let M=S.currentTarget,I=P=>{k?.setIsKeyboardNav(true);let D=M.closest("[data-menu-id]");if(!D)return;D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let B=Array.from(D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==D)return false;let L=window.getComputedStyle(v);return L.display!=="none"&&L.visibility!=="hidden"});if(!B.length)return;let z=B.indexOf(M),w=z>=0?z:0,g=P==="next"?(w+1)%B.length:(w-1+B.length)%B.length;B[g]?.setAttribute("data-highlighted",""),B[g]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),k?.setIsKeyboardNav(true);let P=S.currentTarget;i(true),requestAnimationFrame(()=>{let D=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(D){D.setAttribute("data-keyboard-nav",""),P.removeAttribute("data-highlighted"),P.removeAttribute("data-hovered");let B=D.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');B&&(B.setAttribute("data-highlighted",""),B.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let P=M.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")),M.setAttribute("data-highlighted",""),M.focus(),k&&k.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),F?.(S);},[c,i,p,F,u,k,T]),W=l==="hover"?{onMouseEnter:S=>{let M=S.currentTarget;lo(),h(),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),M.setAttribute("data-hovered",""),M.focus({preventScroll:true});let I=M.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),k&&k.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let M=S.currentTarget;lo(),M.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),M.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&b){let S=d?.css,M=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,P={ref:A,tabIndex:I,className:[M,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown: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(b,P)}return jsx("div",{ref:A,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:K,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let M=S.currentTarget.closest("[data-menu-id]");M&&!M.hasAttribute("data-keyboard-nav")&&(M.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...W,...E,children:t})});Ai.displayName="DropdownMenuSubTrigger";var Mi=me.forwardRef((e,t)=>{let n=ys(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=dr(),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(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});Mi.displayName="DropdownMenuSubContent";var pr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),kd=css({display:"inline"}),Pi=css({display:"inline",fontWeight:700}),Ad=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Md=css({display:"flex",alignItems:"center",gap:4}),Fd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Di=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Pd=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Dd=()=>{},Nd=e=>e,Hd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Ld=e=>{e.preventDefault(),e.stopPropagation();},Bd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},$d=e=>{e.preventDefault(),e.stopPropagation();},Ni=me.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});Ni.displayName="CtxCapture";var xs=me.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),k=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Fd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Pd,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Di,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(b=>Object.is(b,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:k},e.value)}return s?jsx(Lt,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(Lt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:k},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));xs.displayName="AutocompleteRow";var Hi=me.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:k,disabled:y=false,error:x=false,showClear:b=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:F=true,openOnClick:R=true,closeOnSelect:E=true,closeOnBlur:A=true,blurOnSelect:$=false,freeSolo:K=false,customValueLabel:W=false,maxHeight:S,maxItems:M,noResultsText:I="No Items Found",highlightTypedValue:P,typedValueHighlightCss:D,showNoResults:B=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:g,loading:v,loadingText:L="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:q,expandIcon:G,showExpandIcon:se=true,expandIconCss:U,textFieldWrapperCss:Z,textFieldInputCss:ae,textFieldLabelCss:ue,textFieldHelperRowCss:ge,textFieldHelperTextCss:Pe,textFieldStartIconCss:Ce,textFieldEndIconCss:xe,menuContentCss:Re})=>{let we=j().text.secondary,[he,je]=useState(""),V=typeof d=="boolean",[ie,X]=useState(false),Q=V?d:ie,re=useRef(null),pe=useRef(null),De=useRef(null),$e=useRef(null),J=useRef(false),oe=useRef(null),ee=useRef(false),le=useRef(0),de=useMemo(()=>[pe],[]),[Ue,ze]=useState(N??[]),Ie=_??Ue,st=useRef(Ie);st.current=Ie;let[Ne,nt]=useState(null),qe=useRef(Ne);qe.current=Ne;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[sn,Zn]=useState(false),Je=typeof g=="function",vt=Je?ot:e,ce=useRef(vt);ce.current=vt;let Ee=!!v||sn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let Fe=useCallback(Y=>{V||X(Y),at.current?.(Y);},[V]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let Y=he;return bt.current=window.setTimeout(async()=>{Zn(true);try{let ne=await g(Y)||[];dt(Array.isArray(ne)?ne:[]);}catch{dt([]);}finally{Zn(false);}},Math.max(0,H)),()=>{bt.current&&window.clearTimeout(bt.current);}},[he,Je,g,H]);let Qn=useMemo(()=>{let Y=pr(he);return Y?vt.some(ne=>pr(ne.title??ne.value)===Y):false},[vt,he]),la=K&&!!W&&he.trim().length>0&&!Qn,lc=Y=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),ve=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||ve){let ke=ne?W.prefix??"":"",fe=ve?W.suffix??"":"";return `${ke}${Y}${fe}`}return `Add "${Y}"`}return `Add "${Y}"`},Br=useMemo(()=>{if(Je)return vt;let Y=pr(he);if(!Y)return vt;let ne=[],ve=[];for(let ke of vt){let fe=pr(ke.title??ke.value);fe.split(" ").some(Ze=>Ze.startsWith(Y))?ne.push(ke):fe.includes(Y)&&ve.push(ke);}return ne.length>0?ne:ve},[vt,he,Je]),ca=useMemo(()=>{if(la){let Y=he.trim();return [...Br,{value:Y,title:lc(Y),__pfui_free__:true}]}return Br},[Br,la,he]),jt=useMemo(()=>{let Y=[],ne=new Map;for(let pt of ca){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),Y.push(Ze)),ne.get(Ze).push(pt);}let ke=typeof M=="number"?Math.max(0,M):1/0,fe=[];for(let pt of Y){if(ke<=0)break;let ln=ne.get(pt).slice(0,ke);ln.length>0&&(fe.push({label:pt==="__ungrouped__"?void 0:pt,items:ln}),ke-=ln.length);}return fe},[ca,M]),An=useMemo(()=>jt.reduce((Y,ne)=>(Y.push(...ne.items),Y),[]),[jt]),No=An.length>0,$r=!No&&!!B&&!Ee&&he.trim().length>0,Mn=Ee||No||$r,Ho=Mn||Je;useEffect(()=>{!Je&&Q&&!Mn&&(ee.current=true,Fe(false),setTimeout(()=>{ee.current=false;},150));},[Je,Q,Mn,Fe]);let zr=useRef(null),Or=useRef(false);useEffect(()=>{if(K&&!O){if(Or.current){Or.current=false;return}let Y=he.trim();if(zr.current===Y)return;zr.current=Y,t?.({value:Y,title:Y});}},[he,K,O,t]);let Wr=useCallback(Y=>{let ne=ce.current,ve=new Map(ne.map(fe=>[fe.value,fe])),ke=Y.map(fe=>ve.get(fe)??{value:fe,title:fe});q?.(ke);},[q]),Lo=useCallback(Y=>{let ne=Y.map(String);_||ze(ne),Wr(ne);},[_,Wr]),ua=useCallback(Y=>{let ve=Ie.includes(Y)?Ie.filter(ke=>ke!==Y):[...Ie,Y];Lo(ve);},[Ie,Lo]),Bo=useCallback(Y=>{let ne=ce.current.find(ve=>ve.value===Y)??{value:Y,title:Y};ne.disabled||(Or.current=true,zr.current=(ne.title??ne.value).trim(),nt(ne),je(ne.title??ne.value),t?.(ne),V||(E?(J.current=false,ee.current=true,X(false),at.current?.(false),setTimeout(()=>{ee.current=false;},150)):J.current=true),!E&&De.current?.setActiveIndex&&De.current.setActiveIndex(null),$?(J.current=false,setTimeout(()=>{$e.current&&re.current?($e.current.tabIndex=0,$e.current.focus(),$e.current.blur(),$e.current.tabIndex=-1):re.current?.blur();},0)):requestAnimationFrame(()=>re.current?.focus()));},[t,V,E,$]),cc=useCallback(Y=>{if(y)return;je(Y);let ne=!Y.trim();O||(ne?(nt(null),t?.(null)):K&&nt(null)),!V&&!ne&&F&&!Q&&Fe(true);},[O,V,F,Q,Fe,y,K,t]),it=Hd,da=Dd,uc=Nd,pa=useMemo(()=>D?[Pi,D]:Pi,[D]),dc=useCallback(Y=>{let ne=he.trim();if(!ne||ne.length<1)return Y;let ve=ne.toLowerCase(),fe=Y.toLowerCase().indexOf(ve);return fe<0?Y:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:kd,children:[Y.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:pa,children:Y.slice(fe,fe+ne.length)}),Y.slice(fe+ne.length)]})},[he,pa]),$o=P?dc:uc,pc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Ld,Oo=Bd,mc=useCallback(Y=>{De.current=Y;},[]),ma=useCallback(Y=>{let ne=De.current;if(!ne)return;let ve=An.length;if(ve===0)return;let ke=pe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(ke){let Ze=ke.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),ln=ke.querySelector("[data-active]")||ke.querySelector("[data-hovered]");ln&&(fe=Array.from(Ze).indexOf(ln));}fe<0&&typeof ne.activeIndex=="number"&&(fe=ne.activeIndex);let pt=fe<0?Y===1?0:ve-1:(fe+Y+ve)%ve;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=pe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(_r=>_r.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(_r=>_r.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[An.length]),fc=useCallback(Y=>{if(Y.key===" "||Y.code==="Space"||Y.key==="Spacebar"){Y.stopPropagation();return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){if(y||!Mn&&!Je)return;Y.preventDefault(),!Q&&!V&&Fe(true),ma(Y.key==="ArrowDown"?1:-1);return}if(Y.key==="Enter"){if(y)return;let ne=De.current&&typeof De.current.activeIndex=="number"?De.current.activeIndex:-1,ve=ne>=0&&ne<An.length?An[ne]:null;if(Q&&ve&&ne>=0){Y.preventDefault(),Y.stopPropagation(),O?(ua(ve.value),E||requestAnimationFrame(()=>re.current?.focus())):Bo(ve.value);return}}else Y.key==="Escape"?(Y.preventDefault(),Y.stopPropagation(),Q&&!V&&(ee.current=true,Fe(false),Y.target.focus(),setTimeout(()=>{ee.current=false;},150))):Y.key==="Tab"&&Q&&!V&&Fe(false);},[Mn,Je,Q,V,An,O,E,ma,ua,Bo,Fe,y]),gc=useCallback(()=>{y||ee.current||C&&Ho&&(le.current=Date.now(),V||Fe(true));},[V,C,Ho,Fe,y]),bc=useCallback(()=>{if(J.current){J.current=false;return}A&&Fe(false),!K&&!O&&(Ne?je(Ne.title??Ne.value):he.trim()&&je(""));},[A,K,O,Ne,he,Fe]),fa=useCallback(()=>{let Y=[],ne=0;return jt.forEach((ve,ke)=>{ve.label&&Y.push(jsx(gn,{className:it("group-label"),children:ve.label},`g-${ke}`)),ve.items.forEach(fe=>{Y.push(jsx(xs,{item:fe,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:$o,cls:it,closeOnSelect:false,pickSingle:da,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:we},`${fe.group??"__"}|${fe.value}`)),ne+=1;});}),jsx(bs,{values:Ie,onValuesChange:Lo,children:Y},"multi-group")},[jt,it,Ge,s,$o,Ie,Lo,da,Oo,zo,we]),ga=useCallback(()=>{let Y=[],ne=0;return jt.forEach((ve,ke)=>{ve.label&&Y.push(jsx(gn,{className:it("group-label"),children:ve.label},`g-${ke}`)),ve.items.forEach(fe=>{let pt=Ne?.value===fe.value;Y.push(jsx(xs,{item:fe,absIndex:ne,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:$o,cls:it,closeOnSelect:E,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:we},`${fe.group??"__"}|${fe.value}`)),ne+=1;});}),Y},[jt,it,Ne,Ge,s,$o,E,Bo,Oo,zo,we]),hc=useMemo(()=>Ee?jsx(gn,{css:w,className:it("label-loading"),children:L},"loading"):$r?jsx(gn,{css:z,className:it("label-empty"),children:I},"empty"):jt.length===0?null:O?fa():ga(),[Ee,$r,jt.length,it,L,I,O,fa,ga]),an=Q?false:y||!Je&&!No&&!B,ba=useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),!(an||y)&&(V||(Q?(ee.current=true,Fe(false),queueMicrotask(()=>re.current?.focus()),setTimeout(()=>{ee.current=false;},150)):(Fe(true),queueMicrotask(()=>re.current?.focus()))));},[Q,No,Je,Fe,an,y,V]),ha=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:Q?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:an?"not-allowed":"pointer",userSelect:"none",opacity:an?.5:1}),[Q,an]),Wo=useMemo(()=>se?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[ha,U],"aria-disabled":an||void 0,onMouseDown:$d,onClick:ba,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ha,U,an,ba,G]),yc=useMemo(()=>T&&Wo?jsxs("span",{css:Md,children:[T,Wo]}):T??Wo,[T,Wo]),xc=useCallback(Y=>{if(!(oe.current&&oe.current.contains(Y.target)||ee.current||y||Date.now()-le.current<300)){if(Q){!he.trim()&&!V&&(ee.current=true,Fe(false),setTimeout(()=>{ee.current=false;},150));return}R&&Ho&&(!V||R)&&Fe(true);}},[Q,he,R,Ho,Fe,y,V]);return jsx("div",{ref:pe,className:it(""),css:[pc,l,c],children:jsxs(Bn,{open:y?false:Q,onOpenChange:y?void 0:Fe,children:[jsx(Ni,{onCapture:mc}),jsx($n,{asChild:true,children:jsx("span",{className:it("anchor"),css:Ad,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:re,className:it("input"),focusRingMode:a,value:he,onChange:cc,onKeyDown:fc,onFocus:gc,onBlur:bc,onSurfaceClick:xc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:yc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:b,css:i,wrapperCss:Z,inputCss:ae,labelCss:ue,helperRowCss:ge,helperTextCss:Pe,startIconCss:Ce,endIconCss:xe}),jsx("span",{ref:$e,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}}),Mn&&jsx(xn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Re,ignoreOutsidePressRefs:de,disableOutsidePressDismiss:V,returnFocus:!$,children:hc})]})})});Hi.displayName="Autocomplete";var _d=["sm","md","lg"],Vd=(e,t)=>typeof e=="number"?e:_d.includes(e)?t.componentHeights[e]:t.componentHeights.md,jd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},Ud=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},qd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Li=me.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=j(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Vd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=jd(u,o),b=Ud(u,o),d=qd(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":b,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),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:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:d})})}));Li.displayName="Avatar";var Bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Jd=({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=j(),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 Bi(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),k=typeof t=="number"&&t>=0,y=k&&T.length>t?T.slice(0,t):T,x=k&&T.length>t?T.length-t:0,b=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Bi(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${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"}),F=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[p,r,m()],children:[y.map((R,E)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:jsx("span",{css:F,children:R})},E);let A=R,$=A.props?.css,K=$==null?F:[F,$],W=cloneElement(A,{size:n,rounded:s,css:K,style:{...A.props?.style,width:"100%",height:"100%",objectFit:A.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:W},E)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var Oi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Qd=(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"}},ep=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",tp=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",np=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",op=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),rp=me.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:k,className:y,badgeClassName:x,css:b,badgeCss:d,offsetX:p,offsetY:C})=>{let F=j(),R=s==="dot",E=f??(R?8:17),A=r??(R?0:10),{scale:$,onKey:K}=Qd(F,t),W=ep($),S=F.text?.onColors||{},M=tp(F,S,K,n),I=np(e,a,s),P=op(i,s,e,c),D=css({position:"relative",display:"inline-block"}),B=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=Oi(p??B),w=Oi(C??B),g=l.vertical||"top",v=l.horizontal||"right",L={},H="0",O="0";g==="center"?(L.top="50%",O="-50%"):g==="top"?(L.top=w,O="-45%"):(L.bottom=w,O="45%"),v==="center"?(L.left="50%",H="-50%"):v==="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:M,fontSize:typeof A=="number"?`${A}px`:A,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,b],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:c,overlayCss:i,children:l,transitionDuration:u=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]),[b,d]=useState(e),[p,C]=useState(e),F=useRef(null),R=useRef(null),E=useRef(null);useEffect(()=>(F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),F.current=setTimeout(()=>{d(false),F.current=null;},u)),()=>{F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let M=document.body,I=M.style.overflow,P=M.style.paddingRight,D=window.innerWidth-document.documentElement.clientWidth,B=parseFloat(getComputedStyle(M).paddingRight||"0");return M.style.overflow="hidden",D>0&&(M.style.paddingRight=`${B+D}px`),()=>{M.style.overflow=I,M.style.paddingRight=P;}},[e,T]),useEffect(()=>{if(!p||!t)return;let M=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,t]);let A=M=>{if(!p||!t||!E.current)return;let I=M.target;I&&!E.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!b)return null;let K=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:p?"auto":"none",visibility:b?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!b||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[K,a],onPointerDown:A,...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,c],children:l})]})};var br=()=>null;Object.defineProperty(br,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function cp(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 up=me.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=j(),h=ye(),f=me.useMemo(()=>me.Children.toArray(e).flatMap(d=>{if(!me.isValidElement(d))return [];let{type:p,props:C}=cp(d);if(!(p===br||typeof p=="function"&&"displayName"in p&&p.displayName===br.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=me.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),k=me.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=me.useCallback((d,p,C)=>{let F=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:F,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=me.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),b=me.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,F=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",F?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,F,d.disabled),o,C?r:s,F?a:void 0,h(),d.css],A=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:b,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(me.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,c],children:t}),F?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:E,children:A}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:R,css:E,children:A})]},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,Vi=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Vi(n)&&(t=true));}),t};function fp(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 gp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var ji=me.memo(me.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:k,...y},x)=>{let b=j(),d=ye(),p=useMemo(()=>fp(b,t),[b,t]),C=useMemo(()=>gp(b,e),[b,e]),F=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Vi(u)&&me.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,E=useMemo(()=>Is(n,R),[n,R]),A=useMemo(()=>Is(o,R),[o,R]),$=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>F?"center":l??"center",[F,l]),W=!!c&&K==="center",S=!!c&&K==="start",M=!!c&&K==="end",I=a||c,P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?b.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,b,I]),D=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),B=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(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(b.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[b,W]),g=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),L=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),_=useMemo(()=>()=>{if(F)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?E||n:null}),jsx("span",{css:H(!!S),children:$})]})},[F,n,S,L,H,E,c,$]),N=useMemo(()=>()=>{if(F)return null;let G=!!o;return !G&&!M?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!M),children:G?A||o:null}),jsx("span",{css:H(!!M),children:$})]})},[F,o,M,L,H,A,c,$]),q=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[P,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),D,B,z,k],onClick:q?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:w,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:g,children:F?c?$:Is(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));ji.displayName="Button";var vr=e=>isValidElement(e),bp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>bp(e)===t,Gi=e=>Ps(e,"ButtonGroup"),Xi=e=>Ps(e,"DropdownMenu"),Ms=e=>Ps(e,"DropdownMenuTrigger"),Wn=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,hp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,yp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Fs=(e,t)=>{if(!vr(e))return null;if(Gi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Fs(t?n[0]:n[n.length-1],t):null}if(Xi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Ms);return o?Fs(o,t):null}if(Ms(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},qi=(e,t)=>{if(!e)return false;let n=Fs(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return yp(o)},Yi=me.memo(me.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...k},y){let x=j(),b=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:b,p=o==="vertical",C=hp(x.componentHeights.border,1),F=x.surface.border,R=n&&!!f,E=n&&!!T,A=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?Wn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Wn(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(vr).length,S=0,M=false,I=[];for(let P of $){if(!vr(P)){I.push(P);continue}let D=S===0,B=S===W-1,z=P.props??{},w=z.disabled??s,g=z.size??a,v=0,L=0,H=0,O=0;n&&(p?(v=D?R?0:d:0,L=D?E?0:d:0,O=B?R?0:d:0,H=B?E?0:d:0):(v=D?R?0:d:0,O=D?R?0:d:0,L=B?E?0:d:0,H=B?E?0:d:0));let _=qi(P,"left"),N=qi(P,"right"),se=n&&!D&&!(M&&_)&&!(M||_)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${F}`}):null,U=n&&!D&&M&&_?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,Z=n?css({borderTopLeftRadius:Wn(v),borderTopRightRadius:Wn(L),borderBottomRightRadius:Wn(H),borderBottomLeftRadius:Wn(O)}):null,ae=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ue=css([Z,se,U,ae]);if(!Xi(P)){let xe=z.css,Re=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Te=Gi(P)&&n?{__clipLeft:!D,__clipRight:!B}:{},we=cloneElement(P,{...z,disabled:w,size:g,className:Re,css:[xe,ue],...Te});I.push(we),M=N,S+=1;continue}let ge=z.children,Pe=Children.map(ge,xe=>{if(!vr(xe)||!Ms(xe))return xe;let Re=xe.props,Te=[Re.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(xe,{...Re,css:[Re.css,ue],className:Te,disabled:w,size:g})}),Ce=cloneElement(P,{...z,children:Pe});I.push(Ce),M=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[A,h],...k,children:I})}));Yi.displayName="ButtonGroup";var Cr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Cr(n?.[e]??e)}}},Ep=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Cr(n?.[e]??e)}}},Sp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Ip=(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},Kn=me.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:k,role:y,tabIndex:x,...b},d){let p=j(),C=p.surface??{},[F,R]=useState(!!u),E=l!=null,A=E?!!l:F,$=useMemo(()=>Sp(o,p),[o,p]),K=useMemo(()=>Ip(o,p,$),[o,p,$]),W=K,S=useMemo(()=>wp(r,p),[r,p]),M=useMemo(()=>Ep(s,p),[s,p]),I=!!c||!!i,P=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:M,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Cr(h),height:Cr(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,M,o,p.componentHeights,C.border,h,f,I,K,W]),D=useCallback(()=>{if(!i)return;let g=!A;E||R(g),m?.(g);},[E,m,i,A]),B=useCallback(g=>{i&&D(),T?.(g);},[i,D,T]),z=useCallback(g=>{i&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),D()),k?.(g);},[i,D,k]),w=ye();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&A?"true":void 0,"aria-pressed":i?A:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[w(),P,n],onClick:B,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...b,children:t})}));Kn.displayName="Container";var Ap=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 Ap(o)}return e}}}function yo(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 Mp(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=Ns(t,e),s=Ns(n,e),a=Ns(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Ji(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Zi=me.createContext("horizontal"),Ls=()=>me.useContext(Zi),Qi=me.memo(me.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:k,...y},x)=>{let b=j(),d=ye(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Mp(h,b),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Zi.Provider,{value:f,children:jsx(Kn,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:k,tabIndex:k?0:void 0,...y,children:e})})}));Qi.displayName="Card";var Fp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=j(),u=Ls()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Hs(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})}),Pp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=j(),u=Ls()==="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})}),Dp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=j(),u=Ls()==="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})}),Np=me.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=j(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Ji(m,l)??m.text?.primary,textAlign:Hs(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})}),Hp=me.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=j(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Ji(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Hs(o),...xo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var tl=e=>isValidElement(e),zp=e=>tl(e)?e.type?.displayName||e.type?.name:void 0,el=e=>zp(e)==="Card",Op=e=>typeof e=="number"?`${e}px`:e,nl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=j(),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"?Op(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(el).length,x=0,b=T.map((d,p)=>{if(!el(d)||!tl(d))return d;let C=d.props,F=x++,R=F===0,E=F===y-1,A=s??C.variant,$=t?u?{borderTopLeftRadius:R?C.radius:0,borderTopRightRadius:R?C.radius:0,borderBottomLeftRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:{borderTopLeftRadius:R?C.radius:0,borderBottomLeftRadius:R?C.radius:0,borderTopRightRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:void 0,K=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=A==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,M=[$,K,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:A??C.variant,css:[C.css,...M],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:b})};nl.displayName="CardGroup";var He=e=>typeof e=="number"?`${e}px`:e,rl=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&rl(n)&&(t=true));}),t},Vp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},sl=me.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:k},y){let x=j(),b=ye(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Vp(x,d),[x,d]),C=!!l&&!h,F=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),E=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),A=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]:A(50),[E,A,x.neutral]),K=useMemo(()=>E==="neutral"?x.text.secondary:A(800),[E,A,x.text.secondary]),W=useMemo(()=>E==="neutral"?x.neutral[100]:A(50),[E,A,x.neutral]),S=useMemo(()=>E==="neutral"?x.text.secondary:A(800),[E,A,x.text.secondary]),M=useMemo(()=>E==="neutral"?x.neutral[400]:A(300),[E,A,x.neutral]),I=useMemo(()=>E==="neutral"?x.surface.subtleBg:A(600),[E,A,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:A(700)??x.text.primary,[E,A,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!rl(t)&&me.Children.count(t)===1,[a,c,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} ${M}`}):o==="ghost"?css({backgroundColor:D,color:B,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:K,border:"none",boxShadow:"none"}),[I,P,B,W,S,M,$,K,R,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:He(p.gap),padding:o==="ghost"?0:z||t==null?He(p.soloPadding):`${He(p.paddingY)} ${He(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(${He(p.iconSize)} + ${He(p.soloPadding)} * 2)`,minHeight:`calc(${He(p.iconSize)} + ${He(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,F,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:He(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?He(p.iconSize):void 0,height:z?He(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:He(p.iconSize),lineHeight:0,"& > svg":{width:He(p.iconSize),height:He(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:He(p.gap),marginLeft:z||t==null?0:He(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:He(p.gap),marginRight:z||t==null?0:He(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),_=useMemo(()=>css({marginRight:s?0:He(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:He(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),q=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[g,w,C?b({color:r??"primary"}):null,k],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":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:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[L,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[_,b({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||q})]})}));sl.displayName="Chip";var Gp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Xp=me.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let k=ye(),y=r.neutral,x=r.text,b=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),F=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),E=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),A=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${b} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",K=z=>css({width:E,height:E,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:A,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?k({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),M=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let w=Math.max(0,Math.min(o-1,z));C(w),d.current[w]?.focus();},[o]),P=useCallback((z,w)=>{let g=M(w).slice(0,1),v=[...F];v[z]=g,n(v.join("")),g&&z<o-1&&I(z+1);},[F,o,n,I]),D=useCallback((z,w)=>{if(w.key==="Backspace")if(!F[z]&&z>0){let g=[...F];g[z-1]="",n(g.join("")),I(z-1),w.preventDefault();return}else {let g=[...F];g[z]="",n(g.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=M(z.clipboardData.getData("text")).slice(0,o);w&&(n(w),requestAnimationFrame(()=>{let g=Math.min(w.length,o-1);I(g);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,w)=>jsxs(me.Fragment,{children:[jsx("input",{ref:g=>{d.current[w]=g;},type:"text",inputMode:"text",maxLength:1,value:F[w]||"",placeholder:F[w]?"":R[w]||"",disabled:l,onChange:g=>P(w,g.target.value),onKeyDown:g=>D(w,g),onFocus:()=>C(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))})}),Yp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:k,labelCss:y,helperRowCss:x,helperTextCss:b,css:d})=>{let p=j(),C=useId(),F=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",E=F[R],A=p.neutral,$=p.text,K=t!=null,[W,S]=useState(n),M=K?t:W,I=H=>{K||S(H),o?.(H);},P=Math.max(2,Math.min(h,10)),D=p.spacing.sm,B=Gp(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?A[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),g=css({display:"flex",alignItems:"center",justifyContent:"center",gap:B,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize: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?A[500]:$.primary},...Array.isArray(b)?b:b?[b]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:w,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:g,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Xp,{value:M||"",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})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:L,children:c})})]})};var ul=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},$s=e=>{if(!e||typeof e!="object")return false;let t=ul(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some($s):$s(o)},Zp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=me.useRef(null),[c,i]=me.useState(false),l=me.useCallback(v=>{i(v),o?.(v);},[o]),u=me.useCallback(()=>l(false),[l]),m=me.useRef({x:0,y:0}),h=me.useRef(null),f=me.useRef(null),T=me.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let L=Math.round(m.current.x),H=Math.round(m.current.y);v.style.transform=`translate3d(${L}px, ${H}px, 0)`;},[]),k=me.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);me.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=me.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),L=Math.round(m.current.y);return {x:v,y:L,left:v,top:L,right:v,bottom:L,width:0,height:0,toJSON:()=>({x:v,y:L})}}}),[]),x=me.useRef(`cz-${Math.random().toString(36).slice(2)}`),b=me.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=me.useRef(null),p=me.useRef(null),C=me.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),F=me.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=me.useCallback(()=>{F(),p.current=window.setTimeout(()=>l(false),0);},[F,l]),E=me.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),A=me.useCallback((v,L)=>{m.current={x:v,y:L},k(),l(true);},[k,l]),$=typeof t=="function"?t({close:u}):t,K=$s($),W=v=>{if(!me.isValidElement(v))return v;let L=ul(v),H=v,O=H.props.children,_=O==null?O:Array.isArray(O)?O.map(N=>me.isValidElement(N)?W(N):N):me.isValidElement(O)?W(O):O;if(L==="DropdownMenu"){let N=H.props.onOpenChange;return me.cloneElement(H,{...H.props,open:c,onOpenChange:q=>{N?.(q),l(q);},children:_})}if(L==="DropdownMenuContent"){let N=H.props.onMouseEnter,q=H.props.onMouseLeave;return me.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{F(),N?.(G);},onMouseLeave:G=>{R(),q?.(G);},children:_})}return _===O?H:me.cloneElement(H,{...H.props,children:_})},S=K?W($):$,M=me.useCallback(v=>{v.preventDefault(),A(v.clientX,v.clientY);},[A]),I=me.useCallback(v=>{n==="contextmenu"&&M(v);},[n,M]),P=me.useCallback(v=>{n==="dblclick"&&M(v);},[n,M]),D=me.useCallback(v=>{n==="click"&&M(v);},[n,M]),B=me.useCallback(v=>{if(n!=="hover")return;C(),F();let L=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=L.x+(r==="cursor"?s:0),O=L.y+(r==="cursor"?s:0);A(H,O);},0);},[n,r,s,E,A,C,F]),z=me.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!K&&(m.current={x:v.clientX+s,y:v.clientY+s},k());},[n,c,r,K,s,k]),w=me.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);me.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");L||H?F():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,b,F,R]),me.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let L=a.current?.matches(":hover"),H=b()?.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",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,E,k,l,F,R,b]),me.useEffect(()=>()=>{C(),F();},[C,F]);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"&&F(),onMouseLeave:()=>n==="hover"&&R(),children:v}):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(g,{children:S})]})};var Vn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,nm=me.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:k,className:y,...x},b){let d=j(),{t:p,strokeColor:C,labelTextColor:F,chipSubtleBg:R,chipOutlinedBg:E,outerM:A,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,g=Vn(h,"10px"),v=o==="horizontal"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0",L=o==="vertical"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0";return {t:P,strokeColor:D,labelTextColor:B,chipSubtleBg:z,chipOutlinedBg:w,outerM:g,padX:v,verticalStrokeMargin:L}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:A,marginRight:A}:{flexDirection:"row",width:a?Vn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:A,marginBottom:A},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,A,a,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:p,flex:1}]),[C,m,d.radius.full,d.radius.xs,o,p,K]),M=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:F,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:E,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,F,u,R,E,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,k]}),[S,k]);return o==="vertical"?jsxs("div",{ref:b,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:b,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:M,children:t}),t&&r!=="right"&&I,!t&&I]})}));var hl=me.createContext(null),yl=()=>{let e=useContext(hl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},xl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(hl.Provider,{value:u,children:e})},sm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=yl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let m;me.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;me.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 me.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})});sm.displayName="DrawerTrigger";var To=0,vl="",Cl="",am=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function im(){if(!(typeof document>"u")){if(To===0){let e=document.body;vl=e.style.overflow||"",Cl=e.style.paddingRight||"";let t=am();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function lm(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=vl,e.style.paddingRight=Cl;}}var cm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Rl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:k,css:y,...x},b){let d=j(),{open:p,setOpen:C,lockScroll:F,closeOnEscape:R}=yl();useEffect(()=>{if(!(!F||!p))return im(),()=>lm()},[p,F]);let E=useMemo(()=>cm(a,0),[a]),A=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 U=String(d.radius.lg);switch(r){case "left":return `0 ${U} ${U} 0`;case "right":return `${U} 0 0 ${U}`;case "top":return `0 0 ${U} ${U}`;default:return `${U} ${U} 0 0`}},[r,d.radius.lg]),M=useMemo(()=>c??(s==="inset"?d.radius.lg:S),[c,s,d.radius.lg,S]),I=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:E,bottom:r==="top"?void 0:E,left:r==="right"?void 0:E,right:r==="left"?void 0:E}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,E]),P=useRef(null),D=useCallback(()=>{let U=P.current;if(!U)return 1;let Z=U.getBoundingClientRect();return A==="x"?Z.width:Z.height},[A]),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,[$]),g=useMemo(()=>A==="x"?{x:`${w*100}%`,y:0}:{y:`${w*100}%`,x:0},[A,w]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:K,height:W,backgroundColor:d.surface.panelBg,borderRadius:M,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:A==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,K,W,d.surface,M,p,A]),L=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,d.surface]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>A==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[A,$,T]),_=useMemo(()=>A==="x"?{left:0,right:0}:{top:0,bottom:0},[A]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),q=useCallback((U,Z)=>{let ae=A==="x"?Z.offset.x:Z.offset.y,ue=A==="x"?Z.velocity.x:Z.velocity.y,ge=$*ae>0,Pe=Math.abs(ae)>=D()*N,Ce=$*ue>f;ge&&(Pe||Ce)&&C(false);},[A,$,D,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let U=setTimeout(()=>{let ue=P.current;if(!ue)return;let ge=ue.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');ge.length>0?ge[0].focus():ue.focus();},100),Z=ue=>{let ge=P.current;if(!ge||!ue.target)return;let Pe=ue.target;if(!ge.contains(Pe)){ue.preventDefault();let Ce=ge.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():ge.focus();}},ae=ue=>{ue.key==="Escape"&&R&&(ue.stopPropagation(),C(false));};return document.addEventListener("focusin",Z,true),window.addEventListener("keydown",ae),()=>{clearTimeout(U),document.removeEventListener("focusin",Z,true),window.removeEventListener("keydown",ae),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,C,R]);let{...se}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:L,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:U=>{P.current=U,typeof b=="function"?b(U):b&&(b.current=U);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[v,y],drag:A,dragConstraints:_,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:q,initial:{...g,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...g,opacity:.98},transition:m?z:B,...se,children:t},"panel")]}):null})});Rl.displayName="DrawerContent";var um=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),k=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(xl,{open:k,onOpenChange:y,children:jsx(Rl,{ref:l,...i,children:c})})});um.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),k=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(k)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Tl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wl=me.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=j(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Tl(c),width:c?"100%":void 0,maxHeight:Tl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});wl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(k)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var El={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},Em=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Sm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},jn=me.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:k,style:y,as:x})=>{let b=j(),d=El[e]??El.body,p=x??Sm[e]??"span",C=M=>M==null?d.size:typeof M=="number"?M:b?.typography?.sizes?.[M]??M,F=C(o)??C(d.size),R=r??d.weight,E=s??d.lh,A=a??d.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:F,fontWeight:R,lineHeight:E,letterSpacing:A,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:K,textDecorationThickness:Em(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});jn.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Am=(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}}},Il=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:k,placeholder:y,blurDataURL:x,placeholderColor:b="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:F,onLoad:R,onError:E,...A},$){let[K,W]=useState(false),[S,M]=useState(false),[I,P]=useState(false),D=j(),B=Am(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})`}),g=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: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:F?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?b:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),L=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",p||""].join(" ").trim(),css:[w,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:F,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css: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=>{M(true),E?.(H);},...A})]}),i&&jsx(jn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Il.displayName="Image";var kl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Dm=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}},Nm=e=>e*Math.PI/180,Hm=(e,t,n)=>{let o=Math.abs(Nm(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 Lm(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 Bm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,Al=[1.02,1.03,1.02],Ml=[1.06,1.08,1.06],$m={sm:150,md:200,lg:260,xl:340},zm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Om(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 zm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Wm=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:k="md",label:y,labelAlign:x="center",css:b,className:d,...p}){let C=j(),F=Dm(r)??4/5,R=typeof o=="string"?o:void 0,E=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):$m[s],A=Math.max(1,E/F),K=Children.toArray(t).filter(isValidElement).slice(0,i),W=K.length,S=Lm(n,W),M=K.map((U,Z)=>Bm(n,W,Z)),I=U=>A*.6*M[U],P=U=>I(U)*F,D=0,B=0;for(let U=0;U<W;U++){let Z=P(U),ae=I(U),ue=Math.max(Math.abs(S.base.ang[U]??0),Math.abs(S.exp.ang[U]??0)),ge=Math.max(Math.abs(S.base.dx[U]??0),Math.abs(S.exp.dx[U]??0)),Pe=Math.max(Math.abs(S.base.dy[U]??0),Math.abs(S.exp.dy[U]??0)),Ce=a==="expand"?Ml[U]??1.08:a==="reveal"?Al[U]??1.03:1,xe=Hm(Z,ae,ue),Re=xe.w*Ce,Te=xe.h*Ce,we=ge/100*Z*Ce,he=Pe/100*ae*Ce;D=Math.max(D,Re/2+we),B=Math.max(B,Te/2+he);}let z=Math.max(1,2*D),w=Math.max(1,2*B),g=Math.min(1,E/z,A/w),v=c===void 0?"pointer":"controlled",L=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:kl(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:kl(A)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${w}px`,transform:`translate(-50%, -50%) scale(${g})`,transformOrigin:"center center"}),N=Om(k,C)??"0px",q=U=>{let Z=n==="fan"?`rotate(${S.base.ang[U]}deg) translate(${S.base.dx[U]}%, ${S.base.dy[U]}%)`:n==="slide"?`translate(${S.base.dx[U]}%, ${S.base.dy[U]}%) rotate(${S.base.ang[U]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[U]}%)`:`translate(${S.base.dx[U]}%, ${S.base.dy[U]}%) rotate(${S.base.ang[U]}deg)`,ae=n==="fan"?`rotate(${S.exp.ang[U]}deg) translate(${S.exp.dx[U]}%, ${S.exp.dy[U]}%)`:n==="slide"?`translate(${S.exp.dx[U]}%, ${S.exp.dy[U]}%) rotate(${S.exp.ang[U]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[U]}%)`:`translate(${S.exp.dx[U]}%, ${S.exp.dy[U]}%) rotate(${S.exp.ang[U]}deg)`,ue=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Z} scale(1)`,ge=a==="expand"?`${ae} scale(${Ml[U]??1.06})`:a==="reveal"?`${Z} scale(${Al[U]??1.03})`:`${Z} 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"&&U===1?10:U+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${ge}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${ge}`}})},G=U=>css({width:`${P(U)}px`,aspectRatio:`${F}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":L,css:[H,b],tabIndex:-1,...p,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:K.map((U,Z)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:q(Z),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(Z),children:U})},Z))})}),y&&jsx(jn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Pl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Vm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function jm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var Um=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=j(),f=ye(),T=Pl[o]??Pl.sm,k=Vm(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:k,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),b=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?b:n==="ghost"?d:p,R=s&&c>0&&jm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var Ym=(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:c,distance:i})=>{let u=Ym(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,b=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:b,className:d,onTransitionEnd:T(p)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:k,onTransitionEnd:T(),children:e})};var Xs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ll=me.createContext(null),Bl=()=>{let e=useContext(Ll);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},nf=({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(Ll.Provider,{value:u,children:e})},$l=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Bl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let m;me.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;me.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 me.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})});$l.displayName="ModalTrigger";var zl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:k,...y},x)=>{let b=j(),{open:d,setOpen:p,lockScroll:C}=Bl(),F=me.useRef(null),R=me.useRef(null);me.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),M=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",M,true),()=>{clearTimeout(S),document.removeEventListener("focusin",M,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let E=typeof b.spacing.sm=="number"?`${b.spacing.sm}px`:String(b.spacing.sm),A=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(Kn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[A,f],ref:S=>{F.current=S,typeof x=="function"?x(S):x&&(x.current=S);},...y,children:e}),K=u==="none"?$:u==="slide"?jsx(Gs,{on:d,direction:m,duration:h,children:$}):u==="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:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[W,T].filter(Boolean),contentCss:W,lockScroll:C,children:K})});zl.displayName="ModalContent";var df=({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=j(),T=ye(),k=t!==void 0,[y,x]=useState(n),b=Math.max(1,e),d=Sr(k?t:y,1,b),p=useCallback(g=>{let v=Sr(g,1,b);k||x(v),o?.(v);},[k,b,o]),C=useMemo(()=>pf({count:b,page:d,siblingCount:r,boundaryCount:s}),[b,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,A=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:A,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),M=(g=false)=>css([W,T({color:g?"primary":"neutral"}),l==="outlined"?g?{background:F,color:f.text.onColors.primary,borderColor:F}:{background:"transparent",borderColor:R,":hover":{background:E}}:l==="ghost"?g?{background:F,color:f.text.onColors.primary}:{":hover":{background:E}}:g?{background:F,color:f.text.onColors.primary,borderColor:F}:{":hover":{background:E}}]),I=useCallback(()=>p(1),[p]),P=useCallback(()=>p(b),[p,b]),D=useCallback(()=>{d===1?i&&p(b):p(d-1);},[d,i,b,p]),B=useCallback(()=>{d===b?i&&p(1):p(d+1);},[d,i,b,p]),z=a||d===1&&!i,w=a||d===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(),D()),g.key==="ArrowRight"&&(g.preventDefault(),B()),g.key==="Home"&&(g.preventDefault(),I()),g.key==="End"&&(g.preventDefault(),P()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[M(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((g,v)=>typeof g=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":g===d?`Page ${g}, current page`:`Go to page ${g}`,"aria-current":g===d?"page":void 0,css:M(g===d),onClick:()=>p(g),children:g},g):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:B,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":w,disabled:w,css:[M(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function pf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Er(1,e);let s=Er(1,Math.min(o,e)),a=Er(Math.max(e-o+1,o+1),e),c=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Sr(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),Er(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Er(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var bf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,hf=me.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=j(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:bf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var _l=createContext(null),Cf=()=>{let e=useContext(_l);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Rf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Tf=({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=j(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),k=h?e:f,y=useRef([]),[x,b]=useState(0),d=()=>b(M=>M+1),p=useCallback(M=>{h||T(M),n?.(M);},[h,n]),C=useCallback(M=>(y.current.push(M),d(),y.current.length-1),[]),F=useCallback((M,I)=>{let P=y.current[M];P&&(y.current[M]={...P,...I},d());},[]),R=()=>y.current.map((M,I)=>({it:M,i:I})).filter(({it:M})=>M.ref&&!M.disabled).map(({i:M})=>M),E=useCallback((M,I)=>{let P=R();if(!P.length)return;let D=Math.max(0,P.indexOf(M)),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]),A=useCallback(M=>{let I=R();if(!I.length)return;let P=M==="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 M=y.current.filter(P=>P.ref&&!P.disabled);return M.length?M.some(P=>P.value===k)?k:M[0]?.value:void 0},[k,x]),K=useMemo(()=>({selected:k,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:F,moveFocusBy:E,moveToEdge:A,focusValue:$,theme:m,anchorOrigin:Rf(l)}),[k,p,o,r,s,a,C,F,E,A,$,m,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(_l.Provider,{value:K,children:i})})})},wf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:k,anchorOrigin:y}=Cf(),x=c||t,b=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],F=C(600),R=C(100),E=f.neutral[300],A=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],K="transparent",W=A,S=$;T==="soft"?(K=R,W=null,S=F):T==="outlined"?(K=C(50),W=A,S=F):(K=f.neutral[200],W="transparent",S=$),b&&(T==="outlined"?(K=R,W=A,S=F):T==="filled"?(K=F,W=null,S=$):(K=R,W=null,S=F));let M=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(()=>{u(P.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let D=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||b?{}:{background:M,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${A}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),B=css({width:p,height:p,minWidth:p,minHeight:p,borderRadius:f.radius.full,background: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?p*.45:0,height:b?p*.45:0,borderRadius:f.radius.full,background:b?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:b?"scale(1)":"scale(0.6)",opacity:b?1:0}),w=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),g=(()=>{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=ye();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":b,"aria-disabled":x||void 0,disabled:x,tabIndex:L,onClick:()=>{x||a(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(P.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(P.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[D,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[B,css({gridColumn:g.col,gridRow:g.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:w,children:o})]})};var Af=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:k,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var qn=(...e)=>e.filter(Boolean).flat();function Zs(e){if(!(e==null||typeof e=="boolean")){if(typeof e=="string"||typeof e=="number"){let t=String(e).trim();return t||void 0}if(Array.isArray(e)){for(let t of e){let n=Zs(t);if(n)return n}return}if(me.isValidElement(e))return Zs(e.props?.children)}}var ea=e=>null;ea.displayName="SelectItem";function Qs(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Qs(n,t);return}if(me.isValidElement(e)){if(e.type===ea){t.push(e);return}if(e.type===me.Fragment){Qs(e.props.children,t);return}}}}var jl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:k=280,wrapperCss:y,labelCss:x,triggerCss:b,menuCss:d,optionCss:p,children:C,className:F,menuSize:R="md",triggerRender:E})=>{let A=j(),$=ye(),K=me.useId(),W=`${K}-label`,S=`${K}-menu`,M={sm:{minHeight:A.componentHeights.sm,radius:A.radius.sm},md:{minHeight:A.componentHeights.md,radius:A.radius.md},lg:{minHeight:A.componentHeights.lg,radius:A.radius.md}},I=M[l]||M.md,[P,D]=me.useState(false),B=V=>D(!!V),z=typeof e<"u",w=c||Array.isArray(e)||Array.isArray(t),[g,v]=me.useState(()=>typeof t<"u"?t:w?[]:void 0),L=z?e:g,H=V=>{z||v(V),n?.(V);},O=[];Qs(C,O);let _=O.map((V,ie)=>{let X=V.props,Q=X.textValue??(typeof X.label=="string"?X.label:void 0)??Zs(X.children),re=X.label??Q,pe=X.css;return {key:V.key??ie,value:X.value,startIcon:X.startIcon,endIcon:X.endIcon,node:X.children,disabled:!!X.disabled,textValue:Q,triggerNode:re,optionCss:X.optionCss??pe,optionClassName:X.className}}),N=V=>w?(Array.isArray(L)?L:[]).some(X=>Object.is(X,V)):Object.is(L,V),q=me.useMemo(()=>{if(w){let ie=Array.isArray(L)?L:[];return _.filter(X=>ie.some(Q=>Object.is(Q,X.value)))}let V=_.find(ie=>Object.is(ie.value,L));return V?[V]:[]},[L,w,_]),G=me.useMemo(()=>q.map(V=>V.textValue).filter(V=>!!V),[q]),se=me.useMemo(()=>q.length?w?G.length===q.length?G.join(", "):`${q.length} selected`:G[0]:typeof r=="string"?r:void 0,[q.length,w,G,r]),U=me.useMemo(()=>{if(q.length){if(!w){let V=q[0];return V.triggerNode??V.textValue}if(G.length===q.length)return G}},[q,w,G]),Z=V=>{i||(Object.is(V,L)||H(V),B(false));},ae=V=>{if(i)return;let ie=Array.isArray(L)?L:[],Q=ie.some(re=>Object.is(re,V))?ie.filter(re=>!Object.is(re,V)):[...ie,V];H(Q);},ue={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},ge={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:A.typography.sizes.sm,padding:`0 ${typeof A.spacing.sm=="number"?`${A.spacing.sm}px`:A.spacing.sm} 0 ${typeof A.spacing.md=="number"?`${A.spacing.md}px`:A.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:A.text.primary,background:"transparent",whiteSpace:"nowrap"},Pe=u==="subtle"?{background:A.surface.subtleBg}:u==="outlined"?{background:A.surface.panelBg,border:`1px solid ${A.surface.border}`}:{background:"transparent"},Ce={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},xe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Re={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Te=jsx(ChevronsUpDown,{size:16,css:css({color:A.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),we=()=>{if(E){let ie=Array.isArray(U)||typeof U=="string"?U:void 0;return E(ie)}if(w){let X=Array.isArray(U)?U.join(", "):q.length?`${q.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(xe),children:s}),jsx("span",{css:css(Re),title:X,children:X})]})}let V=U??(typeof r=="string"||typeof r=="number"?String(r):r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(xe),children:s}),jsx("span",{css:css(Re),title:se,children:V})]})},he={left:"start",center:"center",right:"end"},je=V=>{i||(V.key==="ArrowDown"||V.key==="ArrowUp"||V.key==="Enter"||V.key===" ")&&(V.preventDefault(),B(true));};return jsxs("div",{css:qn(ue,y),className:["plainframe-ui-select-wrapper",F||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:qn({marginBottom:6,fontSize:A.typography.sizes.sm,fontWeight:500,color:A.text.secondary},x),children:o}),jsxs(Bn,{size:R,open:P,onOpenChange:B,children:[jsx($n,{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:je,onClick:()=>B(!P),className:"plainframe-ui-select-trigger",css:qn(css(ge),css(Pe),b,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(Ce),children:we()}),a??Te]})}),jsx(xn,{id:S,gap:"xs",align:he[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:qn({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},d),children:_.map((V,ie)=>{let X=N(V.value),Q=i||V.disabled;return jsx(Lt,{startIcon:V.startIcon,endIcon:V.endIcon,selected:X,disabled:Q,closeOnSelect:!w,onSelect:()=>{Q||(w?ae(V.value):Z(V.value));},css:qn(p),className:["plainframe-ui-select-option",V.optionClassName||""].join(" ").trim(),children:jsx("div",{className:["plainframe-ui-select-option-inner",V.optionClassName||""].join(" ").trim(),css:qn(V.optionCss),children:V.node})},V.key??ie)})})]})]})};jl.displayName="Select";var ta=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Df=keyframes`
14
14
  0% { background-position: -200% 0; }
15
15
  100% { background-position: 200% 0; }
16
16
  `,Nf=keyframes`
17
17
  0% { opacity: .6; }
18
18
  50% { opacity: 1; }
19
19
  100% { opacity: .6; }
20
- `,Hf=me.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"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Df} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Nf} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,k]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var kr=8,na=20,Gn=4,Yl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:k="horizontal",className:y,...x})=>{let b=V(),d=k==="vertical",p=useRef(null),[C,M]=useState(false),[R,w]=useState(false),[D,L]=useState(false),K=e!==void 0,W=useCallback(te=>Math.min(r,Math.max(o,te)),[o,r]),E=useCallback(te=>W(Math.round((te-o)/s)*s+o),[o,s,W]),[A,I]=useState(()=>E(t??o)),F=K?E(e):A;useEffect(()=>{K||I(te=>E(te));},[o,r,s,K,E]);let P=b.palette.primary[600];b.surface.panelBg;let z=b.neutral[500],S=useMemo(()=>{let te=r-o||1;return (F-o)/te*100},[F,o,r]),g=useCallback(te=>{K||I(te),n?.(te);},[K,n]),v=useCallback((te,Q)=>{let J=p.current;if(!J)return F;let X=J.getBoundingClientRect(),re=d?(X.bottom-Q)/X.height:(te-X.left)/X.width;return re=Math.max(0,Math.min(1,re)),E(o+re*(r-o))},[F,d,o,r,E]),$=useCallback(te=>{a||(te.currentTarget.setPointerCapture?.(te.pointerId),g(v(te.clientX,te.clientY)),M(true));},[a,g,v]),N=useCallback(te=>{a||(te.currentTarget.setPointerCapture?.(te.pointerId),M(true));},[a]),O=useCallback(te=>{!C||a||g(v(te.clientX,te.clientY));},[C,a,g,v]),_=useCallback(()=>M(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 H=useCallback(te=>{if(a)return;let Q=F;if(te.key==="ArrowRight"||te.key==="ArrowUp")Q=F+s;else if(te.key==="ArrowLeft"||te.key==="ArrowDown")Q=F-s;else if(te.key==="Home")Q=o;else if(te.key==="End")Q=r;else return;te.preventDefault(),g(E(Q));},[a,F,s,o,r,g,E]),q=C||R||D,U=(R||C)&&!a,ae=`color-mix(in srgb, ${P} 25%, transparent)`,j=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":m?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),Z=css({marginBottom:d?0:4,marginRight:d?8:0,color:b.text.primary,userSelect:"none"}),ie=css({position:"relative",width:d?kr:"100%",height:d?"100%":kr,backgroundColor:b.neutral[200],borderRadius:b.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),de=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?kr:`calc(100% - ${Gn*.5}px)`,height:d?`calc(100% - ${Gn*.5}px)`:kr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),ge=css({width:Gn,height:Gn,borderRadius:"50%",backgroundColor:b.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-S}% )`:0,bottom:0,width:d?"100%":`${S}%`,height:d?`${S}%`:"100%",backgroundColor:a?z:P,borderRadius:b.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:b.text.onColors.primary,width:na,height:na,left:d?"50%":`calc(${S}% - ${na/2}px)`,bottom:d?`${S}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?b.radius.full:`calc(${b.radius.md} * 0.75)`,border:`2px solid ${a?z:P}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:U?`0 0 0 ${C?4:8}px ${ae}`:`0 0 0 0px ${ae}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${ae}`,outline:"none"}}),ve=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Te=css({position:"absolute",top:d?`calc(50% - ${Gn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Gn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:b.neutral[800],color:b.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:b.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Re=h,we=f,he=T,je=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[j,Re],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:Z,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[ie,we],onPointerDown:$,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:de,children:Array.from({length:je}).map((te,Q)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:ge},Q))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":F,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:H,onPointerDown:N,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Ce,he],children:[jsx(AnimatePresence,{children:q&&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:Te,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:()=>L(true),onMouseLeave:()=>L(false),children:F})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[Z,{marginLeft:8}],children:u})]})};Yl.displayName="Slider";var Wf=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Kf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),_f=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"}),Vf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),jf=(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"}),Uf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),qf=(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"}}),Gf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Jl=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"}),Xf=(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}),Yf=me.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:k}){let y=V(),x=ye(),{MAIN:b,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:M,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:w,UPCOMING_FG:D}=r,L="transparent",K=D,W=w;s==="subtle"?i?(L=C,K=M,W=C):c?(L=b,K=d,W=b):(L=R,K=D,W=R):i?(L=C,K=M,W=C):c?(L="transparent",K=p,W=b):(L="transparent",K=D,W=w);let E=n.label,A=n.icon??jsx("span",{css:Gf,children:typeof E=="number"?E:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:_f(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[qf(o,L,K,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof E=="string"?E:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Jl(!i),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Jl(!!i),children:I})]}),E&&jsx("span",{className:"plainframe-ui-step-label",css:Xf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:E})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:Uf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Vf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:jf(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 Jf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:k,className:y,children:x,...b})=>{let d=V(),p=e==="outlined"?"outlined":"subtle",C=me.useMemo(()=>{let v=me.Children.toArray(x).filter($=>me.isValidElement($)&&$.type===sa);return v.length?v.map(($,N)=>({index:N,...$.props})):[{value:1},{value:2},{value:3}]},[x]),M=me.useCallback((v,$)=>v?d.palette?.[v]??v:$,[d.palette]),R=me.useMemo(()=>({MAIN:String(M(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(M(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(M(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(M(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(M(m,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[M,i,l,u,m,d.palette.primary,d.neutral,d.text]),w=me.useMemo(()=>{let v=M(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[M,c,d.palette.primary]),[D,L]=me.useState(()=>C.some($=>$?.value===n)?n:C[0]?.value),K=t!==void 0,W=K?t:D,{activeIndex:E,afterLast:A}=me.useMemo(()=>{let v=C.findIndex($=>$.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let $=Math.floor(W)-1;if($>=C.length)return {activeIndex:C.length-1,afterLast:true};if($>=0)return {activeIndex:$,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=me.useCallback(v=>{r||(K||L(v),o?.(v));},[r,K,o]),F=me.useCallback(v=>a||!!C[v]?.complete||(A?true:v<E),[a,C,A,E]),P=me.useCallback(v=>{if(r)return false;let $=C[v];if(!$||$.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>E)return false}else if(typeof s=="function"&&!s(E,v))return false;return true},[r,C,s,E]),[B,z]=me.useState(false);me.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let S=me.useCallback(v=>{if(!C.length||r)return;let $=E;if(v.key==="ArrowRight")$=Math.min(C.length-1,E+1);else if(v.key==="ArrowLeft")$=Math.max(0,E-1);else if(v.key==="Home")$=0;else if(v.key==="End")$=C.length-1;else return;v.preventDefault(),P($)&&I(C[$].value);},[C,r,E,P,I]),g=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[Wf(T),k],...b,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:S,css:Kf,children:C.map((v,$)=>jsx(me.Fragment,{children:jsx(Yf,{i:$,item:v,size:g,tokens:R,variant:p,titlePosition:f,isActive:!A&&$===E,completed:F($),disabled:r||!!v.disabled,connectorColor:w,showConnector:$<C.length-1,animate:B,separator:h,canGoToIndex:P,setSelected:I})},String(v.value??$)))})})};var Mr=()=>null;Mr.displayName="PF.Tab";var Fr=()=>null;Fr.displayName="PF.TabContent";function Qf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var eg=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:k,activeTabCss:y,activeIndicatorCss:x})=>{let b=V(),d=ye(),p=s==="vertical",C=l||i!=null,M=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:D}=me.useMemo(()=>{let J=[],X=[];return me.Children.forEach(e,re=>{if(!me.isValidElement(re))return;let{type:le,props:De}=Qf(re),$e=le===Mr||le?.displayName===Mr.displayName,Y=le===Fr||le?.displayName===Fr.displayName;if($e){let se=De;if(se?.value===void 0)return;J.push({value:se.value,disabled:se.disabled,node:se.children,className:se.className,css:se.css,activeCss:se.activeCss});}else if(Y){let se=De;if(se?.value===void 0)return;X.push({value:se.value,node:se.children,className:se.className,css:se.css});}}),{tabs:J,contents:X}},[e]),L=me.useMemo(()=>w.find(J=>!J.disabled)?.value,[w]),[K,W]=me.useState(()=>t!==void 0&&w.some(X=>X.value===t&&!X.disabled)?t:L),E=n!==void 0,A=E?n:K,I=me.useRef(null),F=me.useRef([]),P=Math.max(0,w.findIndex(J=>J.value===A)),[B,z]=me.useState({left:0,top:0,width:0,height:0}),[S,g]=me.useState(false),[v,$]=me.useState(false),N=me.useCallback(()=>{let J=I.current,X=F.current[P];if(!J||!X)return;let re=J.getBoundingClientRect(),le=X.getBoundingClientRect();z({left:le.left-re.left,top:le.top-re.top,width:le.width,height:le.height});},[P]);me.useLayoutEffect(()=>{N(),S||(g(true),requestAnimationFrame(()=>$(true)));},[N,S]),me.useEffect(()=>{let J=new ResizeObserver(()=>N());I.current&&J.observe(I.current);let X=F.current[P];X&&J.observe(X);let re=()=>N();return window.addEventListener("resize",re),()=>{J.disconnect(),window.removeEventListener("resize",re);}},[N,P]);let O=(J,X)=>{if(!w.length)return J;let re=J;for(let le=0;le<w.length;le++)if(re=(re+X+w.length)%w.length,!w[re].disabled)return re;return J},_=J=>{E||W(J),o?.(J);},H=J=>{if(!w.length)return;let X=P;if(J.key===(p?"ArrowDown":"ArrowRight"))X=O(P,1);else if(J.key===(p?"ArrowUp":"ArrowLeft"))X=O(P,-1);else if(J.key==="Home")X=w.findIndex(le=>!le.disabled);else if(J.key==="End"){let le=[...w].reverse().findIndex(De=>!De.disabled);X=le===-1?P:w.length-1-le;}else return;J.preventDefault();let re=w[X]?.value;re!==void 0&&_(re),requestAnimationFrame(()=>F.current[X]?.focus());},q=b.text.primary,U=b.text.secondary,ae=b.neutral[500],j=r==="subtle"?b.surface.subtleBg:"transparent",Z=r==="subtle"?b.surface.panelBg??b.surface.panelBg:r==="ghost"?b.surface.subtleBg:"transparent",ie=b.text.primary,de=r==="subtle"||r==="ghost"||r==="underlined",ge=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Ce=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:b.spacing.xs,padding:Pe?b.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?p?b.radius.lg:b.radius.full:b.radius.lg:"none"}),ve=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:S?1:0,visibility:S?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?b.radius.full:b.radius.md:0,background:r==="underlined"?"transparent":Z,...p?{top:`${B.top}px`,height:`${B.height}px`,left:b.spacing.xs,right:b.spacing.xs}:{left:`${B.left}px`,width:`${B.width}px`,top:b.spacing.xs,bottom:b.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Te=css(r!=="underlined"?{}:p?{background:"transparent",top:`${B.top}px`,height:`${B.height}px`,left:0,width:0,borderLeft:`2px solid ${ie}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${B.left}px`,width:`${B.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${ie}`,borderLeft:"none",borderRadius:2}),Re=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${b.spacing.md}`:r==="ghost"&&s!=="vertical"?`${b.spacing.md}`:`${b.spacing.xs} ${b.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?b.radius.full:b.radius.md,minHeight:b.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:M}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:b.typography.sizes.sm,fontWeight:600,color:U,"&[aria-selected='true']":{color:q},"&:hover":{color:q},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:ae}}),we=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[M]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),he=css({marginTop:b.spacing.sm,width:"100%"}),je=me.useId(),te=new Map;D.forEach((J,X)=>te.set(J.value,`${je}-panel-${X}`));let Q=J=>`${je}-tab-${J}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[ge,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:H,css:[Ce,T],children:[de&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[ve,Te,k,x]}),w.map((J,X)=>{let re=A===J.value;return jsx("button",{ref:le=>{F.current[X]=le;},role:"tab",id:Q(X),"aria-selected":re,"aria-controls":te.get(J.value),"aria-disabled":J.disabled||void 0,disabled:J.disabled,tabIndex:J.disabled?-1:X===P?0:-1,className:["plainframe-ui-tab",J.className||""].join(" ").trim(),onClick:()=>{J.disabled||_(J.value);},css:[Re,!J.disabled&&d(),J.css,re?J.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:we,children:J.node})},String(J.value??X))})]}),D.map((J,X)=>{if(!(J.value===A))return null;let le=w.findIndex($e=>$e.value===J.value),De=le>=0?Q(le):void 0;return jsx("div",{role:"tabpanel",id:te.get(J.value),"aria-labelledby":De,className:["plainframe-ui-tab-panel",J.className||""].join(" ").trim(),css:[he,J.css],children:J.node},X)})]})};var Fo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,In=e=>e==null?[]:Array.isArray(e)?e:[e],Po=(...e)=>css(e.filter(Boolean)),ag=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:k,showCharCount:y,focusRingMode:x="always",resizable:b=false,className:d,wrapperCss:p,inputCss:C,labelCss:M,helperRowCss:R,helperTextCss:w,charCountCss:D,css:L,onBlur:K,onFocus:W,onKeyDown:E,autoFocus:A,name:I,id:F,tabIndex:P,autoComplete:B,readOnly:z,required:S})=>{let g=V(),v=Xo(),$=useId(),N=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",_=N[O],H=g.neutral,q=g.text,U=t!==void 0,[ae,j]=useState(n),Z=U?t:ae,ie=useCallback(re=>{U||j(re),o?.(re);},[U,o]),de=useMemo(()=>c?H[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,H,g.surface,g.palette.danger]),ge=g.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${ge} solid ${s?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[m,ge,s,g.palette.danger,g.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Fo(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),ve=useMemo(()=>Po({fontSize:_.labelFont,fontWeight:500,color:s?g.palette.danger?.[700]??q.primary:c?H[500]:q.primary,marginBottom:4,display:"inline-block"},...In(M)),[_.labelFont,s,c,H,q,g.palette.danger,M]),Te=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Fo(_.paddingY)} 0 ${Fo(_.paddingY)} ${Fo(_.paddingX)}`,background:de,border:Pe,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(p),...In(L)],[g,_,de,Pe,ge,h,c,p,L]),Re=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,we=useMemo(()=>Po({width:"100%",minWidth:0,flex:1,resize:b?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:c?H[500]:s?g.palette.danger?.[800]??q.primary:q.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Fo(_.paddingX),overflowY:"auto",minHeight:Re,"&::placeholder":{color:s?g.palette.danger?.[700]??q.secondary:q.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?g.palette.danger?.[800]??q.primary:q.primary} !important`,boxShadow:`0 0 0 1000px ${de} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?g.palette.danger?.[800]??q.primary:q.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Re} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...In(C)),[b,_,c,s,H,q,g.palette.danger,Re,de,f,C]),he=useMemo(()=>Po({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...In(R)),[R]),je=useMemo(()=>Po({fontSize:_.helperFont,color:s?g.palette.danger?.[700]??q.secondary:q.secondary,flex:1,minWidth:0},...In(w)),[_.helperFont,s,g.palette.danger,q,w]),te=useMemo(()=>Po({fontSize:_.helperFont,color:k&&Z.length>k?g.palette.danger?.[700]??q.secondary:q.secondary,flexShrink:0},...In(D)),[_.helperFont,k,Z.length,g.palette.danger,q,D]),Q=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let re=Q.current;if(!re)return;if(b){let De=window.getComputedStyle(re),$e=parseFloat(De.lineHeight||"20"),Y=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),se=Math.max($e*(f??1),Y);re.style.setProperty("--pf-minh",`${se}px`);return}(()=>{let De=window.getComputedStyle(re),$e=parseFloat(De.lineHeight||"20"),Y=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),se=Math.max($e*(f??1),Y);re.style.setProperty("--pf-minh",`${se}px`);let ee=T?$e*T:1/0;re.style.height="auto",re.style.height=`${Math.min(re.scrollHeight,ee)}px`;})();},[Z,f,T,_.minHeight,b]);let J=a!=null||y?`${F??$}-help`:void 0,X=F??$;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:X,className:"plainframe-ui-textarea-label",css:ve,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Te],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&Q.current?.focus(),children:jsx("textarea",{ref:Q,id:X,className:"plainframe-ui-textarea-input",css:we,rows:f,value:Z,onChange:re=>{let le=re.target.value;k&&le.length>k||ie(le);},placeholder:r||"",disabled:c,onBlur:K,onFocus:W,onKeyDown:E,autoFocus:A,name:I,tabIndex:P,autoComplete:B,readOnly:z,required:S,"aria-invalid":!!s||void 0,"aria-describedby":J})}),(a!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:he,children:[jsx("span",{id:J,className:"plainframe-ui-textarea-helper-text",css:je,children:a}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:te,children:[Z.length,"/",k]})]})]})};var fg=Vo,gg={type:"spring",stiffness:920,damping:100},ec="__toast_root__",bg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Dr=(e,t)=>{for(let n of t){let o=bg(e,n);if(o!=null&&o!=="")return o}},ia=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function hg(e){let t=Dr(e,["radius.md","shape.borderRadius","radii.md"]),n=Dr(e,["spacing.lg","space.4","spacing.4"]),o=Dr(e,["spacing.md","space.3","spacing.3"]),r=Dr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:ia(t,16),padX:ia(n,14),padY:ia(o,12),shadow:String(r)}}var yg=hg(fg),Vt=null,Xn=null,be={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function oc(){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[ec]??null,Xn||(Xn=createRoot(Vt),Vt[ec]=Xn,Xn.render(jsx(Ha,{children:jsx(Ag,{})})))));}var ne={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=()=>{ne.sync(),ne.notify();},xg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Nr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||ne.timers.has(e.id))return;let o=Date.now(),r=ne.remaining.get(e.id),s=r!=null?Math.max(0,r):n;ne.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Le.dismiss(e.id),s);ne.timers.set(e.id,a);}function Hr(e){let t=ne.timers.get(e);t&&(clearTimeout(t),ne.timers.delete(e));}function vg(){let e=false;for(;ne.displayed.length<be.max&&ne.queue.length;){let t=ne.queue.shift();ne.displayed=[t,...ne.displayed],ne.enterFrom[t.id]="head",ne.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete ne.entering[t.id],kn();}),Nr(t);}e&&kn();}function Cg(){if(ne.displayed.length<be.max)return;let e=ne.displayed.filter(o=>!ne.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=ne.expiry.get(t.id);n!=null&&ne.remaining.set(t.id,Math.max(0,n-Date.now())),Hr(t.id),ne.exiting[t.id]=true,ne.displayed=ne.displayed.filter(o=>o.id!==t.id),delete ne.enterFrom[t.id],ne.queue.push(t),kn();}var Rg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function Tg(e,t){let n=Rg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,k=o.palette;return {bg:T?.[m]??k?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Le=Object.assign((e,t)=>{oc();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&&!me.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(me.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??xg(),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,Hr(s),ne.remaining.delete(s),ne.paused.has(s)||Nr(m),kn(),true};if(a(ne.displayed)||a(ne.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?be.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 ne.displayed.length>=be.max&&Cg(),ne.displayed=[...ne.displayed,c],ne.enterFrom[c.id]="tail",ne.entering[c.id]=true,requestAnimationFrame(()=>{delete ne.entering[c.id],kn();}),kn(),Nr(c),s},{success:(e,t={})=>Le(e,{...t,status:"success"}),error:(e,t={})=>Le(e,{...t,status:"error"}),warning:(e,t={})=>Le(e,{...t,status:"warning"}),info:(e,t={})=>Le(e,{...t,status:"info"}),custom:(e,t={})=>Le(e,{...t}),update:(e,t)=>Le({id:e,...t}),dismiss:e=>{if(!e){let n=ne.displayed.find(o=>!ne.exiting[o.id])?.id;n&&Le.dismiss(n);return}Hr(e),ne.remaining.delete(e),ne.paused.delete(e),ne.exiting[e]=true;let t=ne.displayed.find(n=>n.id===e);ne.displayed=ne.displayed.filter(n=>n.id!==e),delete ne.enterFrom[e],kn(),window.setTimeout(()=>t?.onClose?.(),120),vg();},clear:()=>{[...ne.displayed.map(t=>t.id)].forEach(t=>Le.dismiss(t));},pause:e=>{if(ne.paused.has(e))return;let t=ne.expiry.get(e);t!=null&&ne.remaining.set(e,Math.max(0,t-Date.now())),ne.paused.add(e),Hr(e);},resume:e=>{if(!ne.paused.has(e))return;ne.paused.delete(e);let t=ne.displayed.find(o=>o.id===e)??ne.queue.find(o=>o.id===e),n=ne.remaining.get(e);t&&Nr(t,n??void 0),ne.remaining.delete(e);},pauseLatest:()=>{let e=ne.displayed.at(-1);e&&Le.pause(e.id);},resumeLatest:()=>{let e=ne.displayed.at(-1);e&&Le.resume(e.id);},promise:(e,t,n={})=>{let o=Le(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Le.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Le.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(be.max=e.max),e.position&&(be.position=e.position),e.gutter!=null&&(be.gutter=e.gutter),e.zIndex!=null&&(be.zIndex=e.zIndex),e.duration!==void 0&&(be.duration=e.duration),e.showDismiss&&(be.showDismiss=e.showDismiss),e.styles&&(be.styles={...be.styles,...e.styles}),e.renderer!==void 0&&(be.renderer=e.renderer),e.bareRenderer!==void 0&&(be.bareRenderer=e.bareRenderer);}});function wg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":be.showDismiss}function Eg(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 Sg=css({display:"flex",alignItems:"flex-start",gap:10}),tc=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),Ig=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),kg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Ag=me.memo(function(){let t=useSyncExternalStore(ne.subscribe.bind(ne),()=>ne.snapshot,()=>ne.snapshot),n=V(),o=be.position.startsWith("bottom"),r=me.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=me.useMemo(()=>({position:"fixed",zIndex:be.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Eg(be.position),...be.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?be.gutter:0,m={toast:a,close:Le.dismiss,pause:Le.pause,resume:Le.resume},{bg:h,fg:f,border:T}=Tg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:yg.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 be.styles.surface=="function"?be.styles.surface(a):be.styles.surface??{},x=wg(a.showDismiss),b={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(b[d]={opacity:0,pointerEvents:"none"},b[p]={opacity:1,pointerEvents:"auto"}):x==="always"?b[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(b[d]={display:"none"});let C=css({...k,...y,...b}),M=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...be.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:D=>a.onClick?.(a.id,D),children:w});}else if(be.bareRenderer&&be.renderer){let w=typeof be.renderer=="function"?be.renderer(m):be.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:D=>a.onClick?.(a.id,D),children:w});}else {let w;be.renderer?w=typeof be.renderer=="function"?be.renderer(m):be.renderer:a.render&&!a.bare?w=typeof a.render=="function"?a.render(m):a.render:w=jsxs(Fragment,{children:[jsxs("div",{css:Sg,children:[a.startIcon&&jsx("div",{css:tc,children:a.startIcon}),jsx("div",{css:Ig,children:a.content}),a.endIcon&&jsx("div",{css:tc,children:a.endIcon})]}),a.action&&jsx("div",{css:kg,children:a.action})]}),R=jsxs("div",{css:C,onClick:D=>a.onClick?.(a.id,D),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:M,onClick:D=>{D.stopPropagation(),Le.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Mg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Mg=me.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:gg});},[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",...be.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),b=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:b}}).then(()=>Le.dismiss(n));},onMouseEnter:c?()=>Le.pause(n):void 0,onMouseLeave:c?()=>Le.resume(n):void 0,children:i})}),nc=false;(function(){nc||(nc=true,oc());})();var Qg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},ac=createContext(null),ic=()=>{let e=useContext(ac);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},eb=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),k=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),b=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([k,y,x,b]),C=useId(),M=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(ac.Provider,{value:M,children:e})},tb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=ic(),c=me.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:Qg(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return me.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})},nb=({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}=ic(),T=V(),k=l.split("-")[0]||"top",x=k==="bottom"?{opacity:0,y:-8,scale:.98}:k==="top"?{opacity:0,y:8,scale:.98}:k==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},b=x,d=k==="bottom"?"center top":k==="top"?"center bottom":k==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),M=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:b,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:M?.x!=null?`${M.x}px`:void 0,top:M?.y!=null?`${M.y}px`:void 0,[R]:"-3px"}})]})})})};function ab(){let e=V();return jsx(Global,{styles:css`
20
+ `,Hf=me.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=j(),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"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Df} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Nf} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,k]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var kr=8,na=20,Xn=4,Yl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:k="horizontal",className:y,...x})=>{let b=j(),d=k==="vertical",p=useRef(null),[C,F]=useState(false),[R,E]=useState(false),[A,$]=useState(false),K=e!==void 0,W=useCallback(V=>Math.min(r,Math.max(o,V)),[o,r]),S=useCallback(V=>W(Math.round((V-o)/s)*s+o),[o,s,W]),[M,I]=useState(()=>S(t??o)),P=K?S(e):M;useEffect(()=>{K||I(V=>S(V));},[o,r,s,K,S]);let D=b.palette.primary[600];b.surface.panelBg;let z=b.neutral[500],w=useMemo(()=>{let V=r-o||1;return (P-o)/V*100},[P,o,r]),g=useCallback(V=>{K||I(V),n?.(V);},[K,n]),v=useCallback((V,ie)=>{let X=p.current;if(!X)return P;let Q=X.getBoundingClientRect(),re=d?(Q.bottom-ie)/Q.height:(V-Q.left)/Q.width;return re=Math.max(0,Math.min(1,re)),S(o+re*(r-o))},[P,d,o,r,S]),L=useCallback(V=>{a||(V.currentTarget.setPointerCapture?.(V.pointerId),g(v(V.clientX,V.clientY)),F(true));},[a,g,v]),H=useCallback(V=>{a||(V.currentTarget.setPointerCapture?.(V.pointerId),F(true));},[a]),O=useCallback(V=>{!C||a||g(v(V.clientX,V.clientY));},[C,a,g,v]),_=useCallback(()=>F(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(V=>{if(a)return;let ie=P;if(V.key==="ArrowRight"||V.key==="ArrowUp")ie=P+s;else if(V.key==="ArrowLeft"||V.key==="ArrowDown")ie=P-s;else if(V.key==="Home")ie=o;else if(V.key==="End")ie=r;else return;V.preventDefault(),g(S(ie));},[a,P,s,o,r,g,S]),q=C||R||A,G=(R||C)&&!a,se=`color-mix(in srgb, ${D} 25%, transparent)`,U=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"}),Z=css({marginBottom:d?0:4,marginRight:d?8:0,color:b.text.primary,userSelect:"none"}),ae=css({position:"relative",width:d?kr:"100%",height:d?"100%":kr,backgroundColor:b.neutral[200],borderRadius:b.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?kr:`calc(100% - ${Xn*.5}px)`,height:d?`calc(100% - ${Xn*.5}px)`:kr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),ge=css({width:Xn,height:Xn,borderRadius:"50%",backgroundColor:b.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-w}% )`:0,bottom:0,width:d?"100%":`${w}%`,height:d?`${w}%`:"100%",backgroundColor:a?z:D,borderRadius:b.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:b.text.onColors.primary,width:na,height:na,left:d?"50%":`calc(${w}% - ${na/2}px)`,bottom:d?`${w}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?b.radius.full:`calc(${b.radius.md} * 0.75)`,border:`2px solid ${a?z:D}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),xe=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Re=css({position:"absolute",top:d?`calc(50% - ${Xn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Xn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:b.neutral[800],color:b.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:b.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Te=h,we=f,he=T,je=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[U,Te],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:Z,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[ae,we],onPointerDown:L,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ue,children:Array.from({length:je}).map((V,ie)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:ge},ie))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":P,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:H,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>E(true),onMouseLeave:()=>E(false),className:"plainframe-ui-slider-thumb",css:[Ce,he],children:[jsx(AnimatePresence,{children:q&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:xe,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:Re,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:P})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[Z,{marginLeft:8}],children:u})]})};Yl.displayName="Slider";var Wf=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Kf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),_f=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"}),Vf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),jf=(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"}),Uf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),qf=(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"}}),Gf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Jl=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"}),Xf=(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}),Yf=me.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:k}){let y=j(),x=ye(),{MAIN:b,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:F,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:E,UPCOMING_FG:A}=r,$="transparent",K=A,W=E;s==="subtle"?i?($=C,K=F,W=C):c?($=b,K=d,W=b):($=R,K=A,W=R):i?($=C,K=F,W=C):c?($="transparent",K=p,W=b):($="transparent",K=A,W=E);let S=n.label,M=n.icon??jsx("span",{css:Gf,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:_f(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[qf(o,$,K,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Jl(!i),children:M}),jsx("span",{className:"plainframe-ui-step-check",css:Jl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Xf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:Uf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Vf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:jf(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 Jf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:k,className:y,children:x,...b})=>{let d=j(),p=e==="outlined"?"outlined":"subtle",C=me.useMemo(()=>{let v=me.Children.toArray(x).filter(L=>me.isValidElement(L)&&L.type===sa);return v.length?v.map((L,H)=>({index:H,...L.props})):[{value:1},{value:2},{value:3}]},[x]),F=me.useCallback((v,L)=>v?d.palette?.[v]??v:L,[d.palette]),R=me.useMemo(()=>({MAIN:String(F(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(F(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(F(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(F(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(F(m,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[F,i,l,u,m,d.palette.primary,d.neutral,d.text]),E=me.useMemo(()=>{let v=F(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[F,c,d.palette.primary]),[A,$]=me.useState(()=>C.some(L=>L?.value===n)?n:C[0]?.value),K=t!==void 0,W=K?t:A,{activeIndex:S,afterLast:M}=me.useMemo(()=>{let v=C.findIndex(L=>L.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let L=Math.floor(W)-1;if(L>=C.length)return {activeIndex:C.length-1,afterLast:true};if(L>=0)return {activeIndex:L,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=me.useCallback(v=>{r||(K||$(v),o?.(v));},[r,K,o]),P=me.useCallback(v=>a||!!C[v]?.complete||(M?true:v<S),[a,C,M,S]),D=me.useCallback(v=>{if(r)return false;let L=C[v];if(!L||L.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>S)return false}else if(typeof s=="function"&&!s(S,v))return false;return true},[r,C,s,S]),[B,z]=me.useState(false);me.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let w=me.useCallback(v=>{if(!C.length||r)return;let L=S;if(v.key==="ArrowRight")L=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")L=Math.max(0,S-1);else if(v.key==="Home")L=0;else if(v.key==="End")L=C.length-1;else return;v.preventDefault(),D(L)&&I(C[L].value);},[C,r,S,D,I]),g=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[Wf(T),k],...b,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:w,css:Kf,children:C.map((v,L)=>jsx(me.Fragment,{children:jsx(Yf,{i:L,item:v,size:g,tokens:R,variant:p,titlePosition:f,isActive:!M&&L===S,completed:P(L),disabled:r||!!v.disabled,connectorColor:E,showConnector:L<C.length-1,animate:B,separator:h,canGoToIndex:D,setSelected:I})},String(v.value??L)))})})};var Mr=()=>null;Mr.displayName="PF.Tab";var Fr=()=>null;Fr.displayName="PF.TabContent";function Qf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var eg=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:k,activeTabCss:y,activeIndicatorCss:x})=>{let b=j(),d=ye(),p=s==="vertical",C=l||i!=null,F=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:E,contents:A}=me.useMemo(()=>{let X=[],Q=[];return me.Children.forEach(e,re=>{if(!me.isValidElement(re))return;let{type:pe,props:De}=Qf(re),$e=pe===Mr||pe?.displayName===Mr.displayName,J=pe===Fr||pe?.displayName===Fr.displayName;if($e){let oe=De;if(oe?.value===void 0)return;X.push({value:oe.value,disabled:oe.disabled,node:oe.children,className:oe.className,css:oe.css,activeCss:oe.activeCss});}else if(J){let oe=De;if(oe?.value===void 0)return;Q.push({value:oe.value,node:oe.children,className:oe.className,css:oe.css});}}),{tabs:X,contents:Q}},[e]),$=me.useMemo(()=>E.find(X=>!X.disabled)?.value,[E]),[K,W]=me.useState(()=>t!==void 0&&E.some(Q=>Q.value===t&&!Q.disabled)?t:$),S=n!==void 0,M=S?n:K,I=me.useRef(null),P=me.useRef([]),D=Math.max(0,E.findIndex(X=>X.value===M)),[B,z]=me.useState({left:0,top:0,width:0,height:0}),[w,g]=me.useState(false),[v,L]=me.useState(false),H=me.useCallback(()=>{let X=I.current,Q=P.current[D];if(!X||!Q)return;let re=X.getBoundingClientRect(),pe=Q.getBoundingClientRect();z({left:pe.left-re.left,top:pe.top-re.top,width:pe.width,height:pe.height});},[D]);me.useLayoutEffect(()=>{H(),w||(g(true),requestAnimationFrame(()=>L(true)));},[H,w]),me.useEffect(()=>{let X=new ResizeObserver(()=>H());I.current&&X.observe(I.current);let Q=P.current[D];Q&&X.observe(Q);let re=()=>H();return window.addEventListener("resize",re),()=>{X.disconnect(),window.removeEventListener("resize",re);}},[H,D]);let O=(X,Q)=>{if(!E.length)return X;let re=X;for(let pe=0;pe<E.length;pe++)if(re=(re+Q+E.length)%E.length,!E[re].disabled)return re;return X},_=X=>{S||W(X),o?.(X);},N=X=>{if(!E.length)return;let Q=D;if(X.key===(p?"ArrowDown":"ArrowRight"))Q=O(D,1);else if(X.key===(p?"ArrowUp":"ArrowLeft"))Q=O(D,-1);else if(X.key==="Home")Q=E.findIndex(pe=>!pe.disabled);else if(X.key==="End"){let pe=[...E].reverse().findIndex(De=>!De.disabled);Q=pe===-1?D:E.length-1-pe;}else return;X.preventDefault();let re=E[Q]?.value;re!==void 0&&_(re),requestAnimationFrame(()=>P.current[Q]?.focus());},q=b.text.primary,G=b.text.secondary,se=b.neutral[500],U=r==="subtle"?b.surface.subtleBg:"transparent",Z=r==="subtle"?b.surface.panelBg??b.surface.panelBg:r==="ghost"?b.surface.subtleBg:"transparent",ae=b.text.primary,ue=r==="subtle"||r==="ghost"||r==="underlined",ge=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Ce=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:b.spacing.xs,padding:Pe?b.spacing.xs:0,background:U,borderRadius:r==="subtle"?u?p?b.radius.lg:b.radius.full:b.radius.lg:"none"}),xe=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:w?1:0,visibility:w?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?b.radius.full:b.radius.md:0,background:r==="underlined"?"transparent":Z,...p?{top:`${B.top}px`,height:`${B.height}px`,left:b.spacing.xs,right:b.spacing.xs}:{left:`${B.left}px`,width:`${B.width}px`,top:b.spacing.xs,bottom:b.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Re=css(r!=="underlined"?{}:p?{background:"transparent",top:`${B.top}px`,height:`${B.height}px`,left:0,width:0,borderLeft:`2px solid ${ae}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${B.left}px`,width:`${B.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${ae}`,borderLeft:"none",borderRadius:2}),Te=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${b.spacing.md}`:r==="ghost"&&s!=="vertical"?`${b.spacing.md}`:`${b.spacing.xs} ${b.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?b.radius.full:b.radius.md,minHeight:b.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:F}:C?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:b.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:q},"&:hover":{color:q},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),we=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"}),he=css({marginTop:b.spacing.sm,width:"100%"}),je=me.useId(),V=new Map;A.forEach((X,Q)=>V.set(X.value,`${je}-panel-${Q}`));let ie=X=>`${je}-tab-${X}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[ge,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Ce,T],children:[ue&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[xe,Re,k,x]}),E.map((X,Q)=>{let re=M===X.value;return jsx("button",{ref:pe=>{P.current[Q]=pe;},role:"tab",id:ie(Q),"aria-selected":re,"aria-controls":V.get(X.value),"aria-disabled":X.disabled||void 0,disabled:X.disabled,tabIndex:X.disabled?-1:Q===D?0:-1,className:["plainframe-ui-tab",X.className||""].join(" ").trim(),onClick:()=>{X.disabled||_(X.value);},css:[Te,!X.disabled&&d(),X.css,re?X.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:we,children:X.node})},String(X.value??Q))})]}),A.map((X,Q)=>{if(!(X.value===M))return null;let pe=E.findIndex($e=>$e.value===X.value),De=pe>=0?ie(pe):void 0;return jsx("div",{role:"tabpanel",id:V.get(X.value),"aria-labelledby":De,className:["plainframe-ui-tab-panel",X.className||""].join(" ").trim(),css:[he,X.css],children:X.node},Q)})]})};var Fo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,In=e=>e==null?[]:Array.isArray(e)?e:[e],Po=(...e)=>css(e.filter(Boolean)),ag=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:k,showCharCount:y,focusRingMode:x="always",resizable:b=false,className:d,wrapperCss:p,inputCss:C,labelCss:F,helperRowCss:R,helperTextCss:E,charCountCss:A,css:$,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:M,name:I,id:P,tabIndex:D,autoComplete:B,readOnly:z,required:w})=>{let g=j(),v=Xo(),L=useId(),H=useMemo(()=>({sm:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.sm,labelFont:g.typography.sizes.xs,helperFont:g.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:g.spacing.md},md:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.md,labelFont:g.typography.sizes.sm,helperFont:g.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:g.spacing.md},lg:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.lg,labelFont:g.typography.sizes.md,helperFont:g.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:g.spacing.md}}),[g]),O=["sm","md","lg"].includes(u)?u:"md",_=H[O],N=g.neutral,q=g.text,G=t!==void 0,[se,U]=useState(n),Z=G?t:se,ae=useCallback(re=>{G||U(re),o?.(re);},[G,o]),ue=useMemo(()=>c?N[200]:s&&m==="outlined"?g.palette.danger?.[50]??g.surface.panelBg:s&&m==="subtle"?g.palette.danger?.[50]??g.surface.subtleBg:m==="outlined"?g.surface.panelBg:m==="subtle"?g.surface.subtleBg:"transparent",[c,s,m,N,g.surface,g.palette.danger]),ge=g.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${ge} solid ${s?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[m,ge,s,g.palette.danger,g.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Fo(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),xe=useMemo(()=>Po({fontSize:_.labelFont,fontWeight:500,color:s?g.palette.danger?.[700]??q.primary:c?N[500]:q.primary,marginBottom:4,display:"inline-block"},...In(F)),[_.labelFont,s,c,N,q,g.palette.danger,F]),Re=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Fo(_.paddingY)} 0 ${Fo(_.paddingY)} ${Fo(_.paddingX)}`,background:ue,border:Pe,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(p),...In($)],[g,_,ue,Pe,ge,h,c,p,$]),Te=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,we=useMemo(()=>Po({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]??q.primary:q.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Fo(_.paddingX),overflowY:"auto",minHeight:Te,"&::placeholder":{color:s?g.palette.danger?.[700]??q.secondary:q.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?g.palette.danger?.[800]??q.primary:q.primary} !important`,boxShadow:`0 0 0 1000px ${ue} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?g.palette.danger?.[800]??q.primary:q.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Te} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...In(C)),[b,_,c,s,N,q,g.palette.danger,Te,ue,f,C]),he=useMemo(()=>Po({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...In(R)),[R]),je=useMemo(()=>Po({fontSize:_.helperFont,color:s?g.palette.danger?.[700]??q.secondary:q.secondary,flex:1,minWidth:0},...In(E)),[_.helperFont,s,g.palette.danger,q,E]),V=useMemo(()=>Po({fontSize:_.helperFont,color:k&&Z.length>k?g.palette.danger?.[700]??q.secondary:q.secondary,flexShrink:0},...In(A)),[_.helperFont,k,Z.length,g.palette.danger,q,A]),ie=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let re=ie.current;if(!re)return;if(b){let De=window.getComputedStyle(re),$e=parseFloat(De.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max($e*(f??1),J);re.style.setProperty("--pf-minh",`${oe}px`);return}(()=>{let De=window.getComputedStyle(re),$e=parseFloat(De.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max($e*(f??1),J);re.style.setProperty("--pf-minh",`${oe}px`);let ee=T?$e*T:1/0;re.style.height="auto",re.style.height=`${Math.min(re.scrollHeight,ee)}px`;})();},[Z,f,T,_.minHeight,b]);let X=a!=null||y?`${P??L}-help`:void 0,Q=P??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:Q,className:"plainframe-ui-textarea-label",css:xe,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Re],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&ie.current?.focus(),children:jsx("textarea",{ref:ie,id:Q,className:"plainframe-ui-textarea-input",css:we,rows:f,value:Z,onChange:re=>{let pe=re.target.value;k&&pe.length>k||ae(pe);},placeholder:r||"",disabled:c,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:M,name:I,tabIndex:D,autoComplete:B,readOnly:z,required:w,"aria-invalid":!!s||void 0,"aria-describedby":X})}),(a!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:he,children:[jsx("span",{id:X,className:"plainframe-ui-textarea-helper-text",css:je,children:a}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:V,children:[Z.length,"/",k]})]})]})};var fg=Vo,gg={type:"spring",stiffness:920,damping:100},ec="__toast_root__",bg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Dr=(e,t)=>{for(let n of t){let o=bg(e,n);if(o!=null&&o!=="")return o}},ia=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function hg(e){let t=Dr(e,["radius.md","shape.borderRadius","radii.md"]),n=Dr(e,["spacing.lg","space.4","spacing.4"]),o=Dr(e,["spacing.md","space.3","spacing.3"]),r=Dr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:ia(t,16),padX:ia(n,14),padY:ia(o,12),shadow:String(r)}}var yg=hg(fg),Vt=null,Yn=null,be={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function oc(){typeof document>"u"||(Vt||(Vt=document.getElementById("toast-host"),Vt||(Vt=document.createElement("div"),Vt.id="toast-host",document.body.appendChild(Vt))),Yn||(Yn=Vt[ec]??null,Yn||(Yn=createRoot(Vt),Vt[ec]=Yn,Yn.render(jsx(Ha,{children:jsx(Ag,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},kn=()=>{te.sync(),te.notify();},xg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Nr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||te.timers.has(e.id))return;let o=Date.now(),r=te.remaining.get(e.id),s=r!=null?Math.max(0,r):n;te.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Le.dismiss(e.id),s);te.timers.set(e.id,a);}function Hr(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function vg(){let e=false;for(;te.displayed.length<be.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],kn();}),Nr(t);}e&&kn();}function Cg(){if(te.displayed.length<be.max)return;let e=te.displayed.filter(o=>!te.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=te.expiry.get(t.id);n!=null&&te.remaining.set(t.id,Math.max(0,n-Date.now())),Hr(t.id),te.exiting[t.id]=true,te.displayed=te.displayed.filter(o=>o.id!==t.id),delete te.enterFrom[t.id],te.queue.push(t),kn();}var Rg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function Tg(e,t){let n=Rg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,k=o.palette;return {bg:T?.[m]??k?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Le=Object.assign((e,t)=>{oc();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&&!me.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(me.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??xg(),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,Hr(s),te.remaining.delete(s),te.paused.has(s)||Nr(m),kn(),true};if(a(te.displayed)||a(te.queue))return s;let c={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?be.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return te.displayed.length>=be.max&&Cg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],kn();}),kn(),Nr(c),s},{success:(e,t={})=>Le(e,{...t,status:"success"}),error:(e,t={})=>Le(e,{...t,status:"error"}),warning:(e,t={})=>Le(e,{...t,status:"warning"}),info:(e,t={})=>Le(e,{...t,status:"info"}),custom:(e,t={})=>Le(e,{...t}),update:(e,t)=>Le({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Le.dismiss(n);return}Hr(e),te.remaining.delete(e),te.paused.delete(e),te.exiting[e]=true;let t=te.displayed.find(n=>n.id===e);te.displayed=te.displayed.filter(n=>n.id!==e),delete te.enterFrom[e],kn(),window.setTimeout(()=>t?.onClose?.(),120),vg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Le.dismiss(t));},pause:e=>{if(te.paused.has(e))return;let t=te.expiry.get(e);t!=null&&te.remaining.set(e,Math.max(0,t-Date.now())),te.paused.add(e),Hr(e);},resume:e=>{if(!te.paused.has(e))return;te.paused.delete(e);let t=te.displayed.find(o=>o.id===e)??te.queue.find(o=>o.id===e),n=te.remaining.get(e);t&&Nr(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Le.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Le.resume(e.id);},promise:(e,t,n={})=>{let o=Le(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Le.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Le.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(be.max=e.max),e.position&&(be.position=e.position),e.gutter!=null&&(be.gutter=e.gutter),e.zIndex!=null&&(be.zIndex=e.zIndex),e.duration!==void 0&&(be.duration=e.duration),e.showDismiss&&(be.showDismiss=e.showDismiss),e.styles&&(be.styles={...be.styles,...e.styles}),e.renderer!==void 0&&(be.renderer=e.renderer),e.bareRenderer!==void 0&&(be.bareRenderer=e.bareRenderer);}});function wg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":be.showDismiss}function Eg(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 Sg=css({display:"flex",alignItems:"flex-start",gap:10}),tc=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),Ig=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),kg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Ag=me.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=j(),o=be.position.startsWith("bottom"),r=me.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=me.useMemo(()=>({position:"fixed",zIndex:be.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Eg(be.position),...be.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?be.gutter:0,m={toast:a,close:Le.dismiss,pause:Le.pause,resume:Le.resume},{bg:h,fg:f,border:T}=Tg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:yg.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 be.styles.surface=="function"?be.styles.surface(a):be.styles.surface??{},x=wg(a.showDismiss),b={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(b[d]={opacity:0,pointerEvents:"none"},b[p]={opacity:1,pointerEvents:"auto"}):x==="always"?b[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(b[d]={display:"none"});let C=css({...k,...y,...b}),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",...be.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:A=>a.onClick?.(a.id,A),children:E});}else if(be.bareRenderer&&be.renderer){let E=typeof be.renderer=="function"?be.renderer(m):be.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:A=>a.onClick?.(a.id,A),children:E});}else {let E;be.renderer?E=typeof be.renderer=="function"?be.renderer(m):be.renderer:a.render&&!a.bare?E=typeof a.render=="function"?a.render(m):a.render:E=jsxs(Fragment,{children:[jsxs("div",{css:Sg,children:[a.startIcon&&jsx("div",{css:tc,children:a.startIcon}),jsx("div",{css:Ig,children:a.content}),a.endIcon&&jsx("div",{css:tc,children:a.endIcon})]}),a.action&&jsx("div",{css:kg,children:a.action})]}),R=jsxs("div",{css:C,onClick:A=>a.onClick?.(a.id,A),children:[E,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:F,onClick:A=>{A.stopPropagation(),Le.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Mg,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Mg=me.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:gg});},[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",...be.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),b=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:b}}).then(()=>Le.dismiss(n));},onMouseEnter:c?()=>Le.pause(n):void 0,onMouseLeave:c?()=>Le.resume(n):void 0,children:i})}),nc=false;(function(){nc||(nc=true,oc());})();var Qg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},ac=createContext(null),ic=()=>{let e=useContext(ac);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},eb=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),k=useHover(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),b=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([k,y,x,b]),C=useId(),F=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(ac.Provider,{value:F,children:e})},tb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=ic(),c=me.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:Qg(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return me.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})},nb=({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}=ic(),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},b=x,d=k==="bottom"?"center top":k==="top"?"center bottom":k==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),F=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:b,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:F?.x!=null?`${F.x}px`:void 0,top:F?.y!=null?`${F.y}px`:void 0,[R]:"-3px"}})]})})})};function ab(){let e=j();return jsx(Global,{styles:css`
21
21
  *,*::before,*::after{box-sizing:border-box}
22
22
 
23
23
  body{
@@ -45,4 +45,4 @@ ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),M()
45
45
  @media (prefers-reduced-motion:reduce){
46
46
  *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}
47
47
  }
48
- `})}export{Ka as Accordion,ns as AccordionDetails,ja as AccordionGroup,ts as AccordionSummary,qa as ActionBar,ei as Alert,is as AlertDescription,as as AlertTitle,Hi as Autocomplete,Li as Avatar,Jd as AvatarGroup,Ss as Backdrop,rp as Badge,br as BreadCrumbItem,up as BreadCrumbs,ji as Button,Yi as ButtonGroup,Qi as Card,Fp as CardContent,Hp as CardDescription,Dp as CardEnd,nl as CardGroup,Pp as CardStart,Np as CardTitle,rr as Checkbox,sl as Chip,Yp as CodeField,Kn as Container,Zp as ContextZone,ab as CssBaseline,nm as Divider,xl as Drawer,Bn as DropdownMenu,xn as DropdownMenuContent,ki as DropdownMenuSub,Mi as DropdownMenuSubContent,Ai as DropdownMenuSubTrigger,$n as DropdownMenuTrigger,Ks as Fade,wl as Flex,_s as Grow,Il as Image,Wm as ImageStack,Um as Kbd,ii as Menu,bs as MenuCheckboxGroup,lo as MenuCheckboxItem,Lt as MenuItem,gn as MenuLabel,Ri as MenuRadioGroup,rd as MenuRadioItem,sd as MenuSeparator,vi as MenuSwitchItem,Qo as MenuVariantCtx,nf as Modal,zl as ModalContent,$l as ModalTrigger,df as Pagination,Ku as Popover,di as PopoverAnchor,pi as PopoverContent,ui as PopoverTrigger,to as Progress,hf as Quote,Tf as RadioGroup,wf as RadioItem,Af as Rotate,jl as Select,ea as SelectItem,Hf as Skeleton,Gs as Slide,Yl as Slider,sa as Step,Jf as Stepper,fs as Switch,Mr as Tab,Fr as TabContent,eg as Tabs,ag as TextArea,Zo as TextField,Ha as ThemeProvider,eb as Tooltip,nb as TooltipContent,tb as TooltipTrigger,jn as Typography,Sa as defaultDarkTheme,Vo as defaultLightTheme,Qn as surfaceFromNeutral,_o as textDark,Ko as textLight,Le as toast,Tc as useColorMode,Ed as useDropdownMenuActiveIndex,V as usePlainframeUITheme,Vu as usePopoverContext,wc as usePrimary,pb as usePrimitives};
48
+ `})}export{Ka as Accordion,ns as AccordionDetails,ja as AccordionGroup,ts as AccordionSummary,qa as ActionBar,ei as Alert,is as AlertDescription,as as AlertTitle,Hi as Autocomplete,Li as Avatar,Jd as AvatarGroup,Ss as Backdrop,rp as Badge,br as BreadCrumbItem,up as BreadCrumbs,ji as Button,Yi as ButtonGroup,Qi as Card,Fp as CardContent,Hp as CardDescription,Dp as CardEnd,nl as CardGroup,Pp as CardStart,Np as CardTitle,rr as Checkbox,sl as Chip,Yp as CodeField,Kn as Container,Zp as ContextZone,ab as CssBaseline,nm as Divider,xl as Drawer,Bn as DropdownMenu,xn as DropdownMenuContent,ki as DropdownMenuSub,Mi as DropdownMenuSubContent,Ai as DropdownMenuSubTrigger,$n as DropdownMenuTrigger,Ks as Fade,wl as Flex,_s as Grow,Il as Image,Wm as ImageStack,Um as Kbd,ii as Menu,bs as MenuCheckboxGroup,co as MenuCheckboxItem,Lt as MenuItem,gn as MenuLabel,Ri as MenuRadioGroup,rd as MenuRadioItem,sd as MenuSeparator,vi as MenuSwitchItem,Qo as MenuVariantCtx,nf as Modal,zl as ModalContent,$l as ModalTrigger,df as Pagination,Ku as Popover,di as PopoverAnchor,pi as PopoverContent,ui as PopoverTrigger,no as Progress,hf as Quote,Tf as RadioGroup,wf as RadioItem,Af as Rotate,jl as Select,ea as SelectItem,Hf as Skeleton,Gs as Slide,Yl as Slider,sa as Step,Jf as Stepper,fs as Switch,Mr as Tab,Fr as TabContent,eg as Tabs,ag as TextArea,Zo as TextField,Ha as ThemeProvider,eb as Tooltip,nb as TooltipContent,tb as TooltipTrigger,jn as Typography,Sa as defaultDarkTheme,Vo as defaultLightTheme,eo as surfaceFromNeutral,_o as textDark,Ko as textLight,Le as toast,Tc as useColorMode,Ed as useDropdownMenuActiveIndex,j as usePlainframeUITheme,Vu as usePopoverContext,wc as usePrimary,pb as usePrimitives};