@aindy/ui-kit 2.0.0 → 2.1.0

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.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),$=require("react"),Ne=require("react-router-dom"),Ur=require("react-dom");function hn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=hn($),bn=hn(Ur);function Fr(e){return Array.isArray(e)?e:e==null?[]:[]}function Et(e,t){return Array.isArray(e)?e.map(t):(console.warn("safeMap prevented crash. Value:",e),[])}const At="".replace(/\/$/,""),_t="token",Nt="aindy_token",yn=globalThis.__AINDY_APP_VERSION_OVERRIDE__||"2.0.0",Gr=new Set(["agents","allowed_auto_grant_tools","allowed_capabilities","analyses","drop_points","end","error_rate_series","events","feedback","fields","findings","flows","generations","granted_tools","history","items","jobs","logs","memories","nodes","plans","pings","recent","recent_authors","recent_changes","recent_errors","recent_ripples","results","runs","steps","strategies","suggestions","tags","timeline","tools"]);class J extends Error{constructor(t,n,r){super(n),this.name="ApiError",this.status=t,this.body=r}}function Wr(e,t){return function(...n){return t(...n).catch(r=>{throw r instanceof J&&(r.domain=e),r})}}function xe(e){if(e&&typeof e=="object"&&"data"in e){if("error"in e&&e.error)throw new J(200,e.error,e);return e.data!==void 0?e.data:e}return e}function We(e){if(Array.isArray(e))return Et(e,n=>We(n));if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e)){if(Gr.has(n)){t[n]=Array.isArray(r)?Et(r,o=>We(o)):[];continue}t[n]=We(r)}return t}function ce(){return localStorage.getItem(_t)||localStorage.getItem(Nt)||""}function Ge(e){localStorage.setItem(_t,e),localStorage.setItem(Nt,e)}function _e(){localStorage.removeItem(_t),localStorage.removeItem(Nt)}function xn(e){return/^https?:\/\//i.test(e)?e:At?`${At}${e}`:e}function wn(){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:session-expired"))}function vn(e){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:version-warning",{detail:{message:e}}))}async function ee(e,t={}){const n=xn(e),r=ce(),o=new AbortController,{_isRetry:s=!1,...i}=t,a=typeof window<"u"?setTimeout(()=>o.abort(),3e4):null;i.signal&&(i.signal.aborted?o.abort():i.signal.addEventListener("abort",()=>o.abort(),{once:!0}));try{const l=await fetch(n,{...i,signal:o.signal,headers:{"Content-Type":"application/json","X-Client-Version":yn,...r?{Authorization:`Bearer ${r}`}:{},...i.headers||{}}}),c=l.headers?.get?.("X-Version-Warning");if(c&&typeof window<"u"&&(console.warn("[API Version Warning]",c),vn(c)),l.status===503){const u=parseInt(l.headers.get("Retry-After")||"0",10);if(u>0&&u<=60&&!s)return await new Promise(p=>setTimeout(p,u*1e3)),ee(e,{...i,_isRetry:!0})}if(!l.ok){const u=await l.text(),p=new J(l.status,`API Error (${l.status}): ${u}`,u);throw l.status===401&&wn(),p}const d=await l.text();try{return We(JSON.parse(d))}catch{return d}}catch(l){throw l?.name==="AbortError"?new J(408,"Request timed out after 30 seconds.",null):l instanceof TypeError&&!l.status?new J(0,"Network error. Check your connection.",null):l}finally{a&&clearTimeout(a)}}function En(e,t={}){return ee(e,{...t})}function Vr(e,t={}){const n=ce();let r=!1;if(n)try{const[,o=""]=n.split("."),s=o.replace(/-/g,"+").replace(/_/g,"/"),i=s.padEnd(Math.ceil(s.length/4)*4,"=");r=JSON.parse(atob(i))?.is_admin===!0}catch{r=!1}return r?En(e,t):Promise.reject(new J(403,"Admin privileges required for this operation.",null))}async function $t(e,t={}){const n=ce(),r=new AbortController,{_isRetry:o=!1,...s}=t,i=typeof window<"u"?setTimeout(()=>r.abort(),3e4):null;s.signal&&(s.signal.aborted?r.abort():s.signal.addEventListener("abort",()=>r.abort(),{once:!0}));try{const a=await fetch(e,{...s,signal:r.signal,headers:{"Content-Type":"application/json","X-Client-Version":yn,...n?{Authorization:`Bearer ${n}`}:{},...s.headers||{}}}),l=a.headers?.get?.("X-Version-Warning");if(l&&typeof window<"u"&&(console.warn("[API Version Warning]",l),vn(l)),a.status===503){const d=parseInt(a.headers.get("Retry-After")||"0",10);if(d>0&&d<=60&&!o)return await new Promise(u=>setTimeout(u,d*1e3)),$t(e,{...s,_isRetry:!0})}if(!a.ok){const d=await a.text(),u=new J(a.status,`API Error (${a.status}): ${d}`,d);throw a.status===401&&wn(),u}const c=await a.text();try{return We(JSON.parse(c))}catch{return c}}catch(a){throw a?.name==="AbortError"?new J(408,"Request timed out after 30 seconds.",null):a instanceof TypeError&&!a.status?new J(0,"Network error. Check your connection.",null):a}finally{i&&clearTimeout(i)}}function Hr(e,t={}){return $t(e,{...t})}const h="",j=`${h}/apps`,ne=`${h}/platform`,Br=Object.freeze({OPERATOR_FLOW_STRATEGIES:!0,OPERATOR_AUTOMATION_LOGS:!1,OPERATOR_SCHEDULER_STATUS:!1,RIPPLETRACE_VIEWER:!1}),Yr=Object.freeze({LOGIN:`${h}/auth/login`,REGISTER:`${h}/auth/register`,LOGOUT:`${h}/auth/logout`,VERIFY_EMAIL:`${h}/auth/verify-email`,PASSWORD_CHANGE:`${h}/auth/password/change`,PASSWORD_FORGOT:`${h}/auth/password/forgot`,PASSWORD_RESET:`${h}/auth/password/reset`}),qr=Object.freeze({LIST:`${h}/tasks/list`,CREATE:`${h}/tasks/create`,COMPLETE:`${h}/tasks/complete`,START:`${h}/tasks/start`}),Kr=Object.freeze({ANALYZE:`${h}/arm/analyze`,GENERATE:`${h}/arm/generate`,LOGS:`${h}/arm/logs`,CONFIG:`${h}/arm/config`,METRICS:`${h}/arm/metrics`,CONFIG_SUGGESTIONS:`${h}/arm/config/suggest`}),Xr=Object.freeze({CREATE_RUN:`${j}/agent/run`,RUNS:`${j}/agent/runs`,RUN:e=>`${j}/agent/runs/${e}`,APPROVE:e=>`${j}/agent/runs/${e}/approve`,REJECT:e=>`${j}/agent/runs/${e}/reject`,RECOVER:e=>`${j}/agent/runs/${e}/recover`,REPLAY:e=>`${j}/agent/runs/${e}/replay`,STEPS:e=>`${j}/agent/runs/${e}/steps`,EVENTS:e=>`${j}/agent/runs/${e}/events`,TOOLS:`${j}/agent/tools`,TRUST:`${j}/agent/trust`,SUGGESTIONS:`${j}/agent/suggestions`}),Jr=Object.freeze({LINKEDIN_MANUAL:`${h}/analytics/linkedin/manual`,MASTERPLAN_SUMMARY:e=>`${h}/analytics/masterplan/${e}/summary`,CALCULATE_TWR:`${h}/calculate_twr`,CALCULATE_ENGAGEMENT:`${h}/calculate_engagement`,CALCULATE_AI_EFFICIENCY:`${h}/calculate_ai_efficiency`,CALCULATE_IMPACT_SCORE:`${h}/calculate_impact_score`,CALCULATE_INCOME_EFFICIENCY:`${h}/income_efficiency`,CALCULATE_REVENUE_SCALING:`${h}/revenue_scaling`,CALCULATE_EXECUTION_SPEED:`${h}/execution_speed`,CALCULATE_ATTENTION_VALUE:`${h}/attention_value`,CALCULATE_ENGAGEMENT_RATE:`${h}/engagement_rate`,CALCULATE_BUSINESS_GROWTH:`${h}/business_growth`,CALCULATE_MONETIZATION_EFFICIENCY:`${h}/monetization_efficiency`,CALCULATE_AI_PRODUCTIVITY_BOOST:`${h}/ai_productivity_boost`,CALCULATE_DECISION_EFFICIENCY:`${h}/decision_efficiency`,CALCULATE_LOST_POTENTIAL:`${h}/lost_potential`,SCORES_ME:`${h}/scores/me`,SCORES_RECALCULATE:`${h}/scores/me/recalculate`,SCORES_HISTORY:`${h}/scores/me/history`,SCORES_FEEDBACK:`${h}/scores/feedback`}),Zr=Object.freeze({ORDERS:`${h}/freelance/orders`,FEEDBACK:`${h}/freelance/feedback`,METRICS_LATEST:`${h}/freelance/metrics/latest`}),Qr=Object.freeze({BOOT:`${h}/identity/boot`,PROFILE:`${h}/identity/`,EVOLUTION:`${h}/identity/evolution`,CONTEXT:`${h}/identity/context`}),eo=Object.freeze({GENESIS_SESSION:`${h}/genesis/session`,GENESIS_MESSAGE:`${h}/genesis/message`,GENESIS_SESSION_BY_ID:e=>`${h}/genesis/session/${e}`,GENESIS_SYNTHESIZE:`${h}/genesis/synthesize`,GENESIS_DRAFT:e=>`${h}/genesis/draft/${e}`,GENESIS_LOCK:`${h}/genesis/lock`,GENESIS_AUDIT:`${h}/genesis/audit`,PLANS:`${h}/masterplans/`,PLAN:e=>`${h}/masterplans/${e}`,PLAN_ACTIVATE:e=>`${h}/masterplans/${e}/activate`,PLAN_ANCHOR:e=>`${h}/masterplans/${e}/anchor`,PLAN_PROJECTION:e=>`${h}/masterplans/${e}/projection`}),to=Object.freeze({AGENTS:`${j}/memory/agents`,AGENT_RECALL:e=>`${j}/memory/agents/${e}/recall`,FEDERATED_RECALL:`${j}/memory/federated/recall`,NODES:`${j}/memory/nodes`,RECALL_V3:`${j}/memory/recall/v3`,SUGGEST:`${j}/memory/suggest`,NODE_FEEDBACK:e=>`${j}/memory/nodes/${e}/feedback`,NODE_PERFORMANCE:e=>`${j}/memory/nodes/${e}/performance`,NODE_TRAVERSE:e=>`${j}/memory/nodes/${e}/traverse`,NODE_HISTORY:e=>`${j}/memory/nodes/${e}/history`,NODE_SHARE:e=>`${j}/memory/nodes/${e}/share`,METRICS_DASHBOARD:`${j}/memory/metrics/dashboard`}),no=Object.freeze({RESEARCH_QUERY:`${h}/research/query`,HISTORY:`${h}/search/history`,HISTORY_ITEM:e=>`${h}/search/history/${e}`,LEAD_GEN:`${h}/leadgen/`,ANALYZE_SEO:`${h}/analyze_seo/`,GENERATE_META:`${h}/generate_meta/`,SUGGEST_IMPROVEMENTS:`${h}/suggest_improvements/`}),ro=Object.freeze({PROFILE_BY_USERNAME:e=>`${h}/social/profile/${e}`,PROFILE:`${h}/social/profile`,FEED:`${h}/social/feed`,POST:`${h}/social/post`,ANALYTICS:`${h}/social/analytics`,INTERACT:e=>`${h}/social/posts/${e}/interact`}),oo=Object.freeze({DROP_POINTS:`${h}/rippletrace/drop_points`,PINGS:`${h}/rippletrace/pings`,RECENT:`${h}/rippletrace/recent`,TRACE:e=>`${h}/rippletrace/ripples/${e}`,TRACE_GRAPH:e=>`${h}/rippletrace/${encodeURIComponent(e)}`,CAUSAL_GRAPH:`${h}/rippletrace/causal/graph`,CAUSAL_CHAIN:e=>`${h}/rippletrace/causal/chain/${encodeURIComponent(e)}`,NARRATIVE_SUMMARY:`${h}/rippletrace/narrative/summary`,DROP_POINT_NARRATIVE:e=>`${h}/rippletrace/narrative/${encodeURIComponent(e)}`,PREDICTIONS_SUMMARY:`${h}/rippletrace/predictions/summary`,DROP_POINT_PREDICTION:e=>`${h}/rippletrace/predictions/${encodeURIComponent(e)}`,SYSTEM_RECOMMENDATIONS:`${h}/rippletrace/recommendations/system`,RECOMMENDATIONS_SUMMARY:`${h}/rippletrace/recommendations/summary`,DROP_POINT_RECOMMENDATION:e=>`${h}/rippletrace/recommendations/${encodeURIComponent(e)}`,LEARNING_STATS:`${h}/rippletrace/learning/stats`,EVALUATE_LEARNING_OUTCOME:e=>`${h}/rippletrace/learning/evaluate/${encodeURIComponent(e)}`,ADJUST_LEARNING_THRESHOLDS:`${h}/rippletrace/learning/adjust`,PLAYBOOKS:`${h}/rippletrace/playbooks`,PLAYBOOK:e=>`${h}/rippletrace/playbooks/${encodeURIComponent(e)}`,MATCH_PLAYBOOKS:e=>`${h}/rippletrace/playbooks/match/${encodeURIComponent(e)}`,STRATEGIES:`${h}/rippletrace/strategies`,BUILD_STRATEGIES:`${h}/rippletrace/strategies/build`,STRATEGY:e=>`${h}/rippletrace/strategies/${encodeURIComponent(e)}`,MATCH_STRATEGIES:e=>`${h}/rippletrace/strategies/match/${encodeURIComponent(e)}`,EVENT_DOWNSTREAM:e=>`${h}/rippletrace/event/${encodeURIComponent(e)}/downstream`,EVENT_UPSTREAM:e=>`${h}/rippletrace/event/${encodeURIComponent(e)}/upstream`}),so=Object.freeze({FLOW_RUNS:`${ne}/flows/runs`,FLOW_RUN:e=>`${ne}/flows/runs/${e}`,FLOW_RUN_HISTORY:e=>`${ne}/flows/runs/${e}/history`,FLOW_RUN_RESUME:e=>`${ne}/flows/runs/${e}/resume`,FLOW_REGISTRY:`${ne}/flows/registry`,FLOW_STRATEGIES:`${ne}/flows/strategies`,RIPPLETRACE_STATUS:`${ne}/observability/rippletrace/status`,OBSERVABILITY_REQUESTS:`${ne}/observability/requests`,OBSERVABILITY_DASHBOARD:`${ne}/observability/dashboard`,CLIENT_ERROR:`${h}/client/error`,CLIENT_VITALS:`${h}/client/vitals`,AUTOMATION_LOGS:`${h}/automation/logs`,AUTOMATION_LOG:e=>`${h}/automation/logs/${e}`,AUTOMATION_REPLAY:e=>`${h}/automation/logs/${e}/replay`,SCHEDULER_STATUS:`${ne}/observability/scheduler/status`}),io=Object.freeze({DASHBOARD_OVERVIEW:`${h}/dashboard/overview`,HEALTH_DETAILS:`${h}/health/details`,INFLUENCE_GRAPH:`${h}/influence_graph`,CAUSAL_GRAPH:`${h}/causal_graph`,NARRATIVE:e=>`${h}/narrative/${e}`,HEALTH:`${h}/health`,HEALTH_DEEP:`${h}/health/deep`,HEALTH_DOMAINS:`${h}/health/domains`,VERSION:`${h}/api/version`}),fe=Object.freeze({AUTH:Yr,TASKS:qr,ARM:Kr,AGENT:Xr,ANALYTICS:Jr,FREELANCE:Zr,IDENTITY:Qr,MASTERPLAN:eo,MEMORY:to,SEARCH:no,SOCIAL:ro,RIPPLETRACE:oo,OPERATOR:so,PLATFORM:io});function An(e){return ee(fe.AUTH.LOGIN,{method:"POST",body:JSON.stringify(e)}).then(xe)}function Sn(e){return ee(fe.AUTH.REGISTER,{method:"POST",body:JSON.stringify(e)}).then(xe)}function Rn(e){return ee(fe.AUTH.VERIFY_EMAIL,{method:"POST",body:JSON.stringify({token:e})}).then(xe)}function Cn(e,t,n=ce()){return ee(fe.AUTH.PASSWORD_CHANGE,{method:"POST",headers:n?{Authorization:`Bearer ${n}`}:{},body:JSON.stringify({current_password:e,new_password:t})}).then(xe)}function ao(e){return ee(fe.AUTH.PASSWORD_FORGOT,{method:"POST",body:JSON.stringify({email:e})}).then(xe)}function lo(e,t){return ee(fe.AUTH.PASSWORD_RESET,{method:"POST",body:JSON.stringify({token:e,new_password:t})}).then(xe)}function co(e=ce()){return ee(fe.AUTH.LOGOUT,{method:"POST",headers:e?{Authorization:`Bearer ${e}`}:{}}).catch(()=>null)}function Tn(e=ce()){return ee(fe.IDENTITY.BOOT,{method:"GET",headers:e?{Authorization:`Bearer ${e}`}:{}}).then(xe)}const On=$.createContext(null);function kn(e){if(!e)return null;try{const[,t=""]=e.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return JSON.parse(window.atob(r))}catch{return null}}function bt(e){const t=kn(e);return!t||typeof t.exp!="number"?!1:Date.now()/1e3>t.exp-30}function uo({children:e}){const[t,n]=$.useState(()=>{const u=ce();return u&&bt(u)?(_e(),null):u||null}),r=$.useMemo(()=>{const u=kn(t);return u?{...u,is_admin:u?.is_admin===!0}:null},[t]),o=r?.is_admin===!0;$.useEffect(()=>{const u=ce();if(u&&bt(u)){_e(),n(null);return}n(u||null)},[]),$.useEffect(()=>{if(!t)return;const u=setInterval(()=>{bt(t)&&(_e(),n(null))},6e4);return()=>clearInterval(u)},[t]),$.useEffect(()=>{const u=()=>{_e(),n(null)};return window.addEventListener("aindy:session-expired",u),()=>window.removeEventListener("aindy:session-expired",u)},[]);const s=async(u,p)=>{const g=(await An({email:u,password:p}))?.access_token;if(!g)throw new Error("Authentication did not return an access token.");return Ge(g),n(g),g},i=async(u,p,m=null)=>{const y=(await Sn({email:u,password:p,username:m}))?.access_token;return y?(Ge(y),n(y),{verificationSent:!1,token:y}):{verificationSent:!0,token:null}},a=async u=>{const m=(await Rn(u))?.access_token;if(!m)throw new Error("Verification did not return an access token.");return Ge(m),n(m),m},l=async(u,p)=>{const g=(await Cn(u,p))?.access_token;return g&&(Ge(g),n(g)),g??null},c=()=>{co(),_e(),n(null)},d=$.useMemo(()=>({token:t,user:r,isAdmin:o,isAuthenticated:!!t,login:s,register:i,verify:a,changeOwnPassword:l,logout:c,setToken:n}),[t,r,o]);return b.jsx(On.Provider,{value:d,children:e})}function lt(){const e=$.useContext(On);if(!e)throw new Error("useAuth must be used within AuthProvider.");return e}const Pn=$.createContext(null),Pe={user_id:null,memory:[],runs:[],metrics:null,flows:[],runtime:{boot_mode:"unknown",boot_profile:"unknown",boot_profile_source:"unknown",app_plugins_loaded:!1,app_plugin_count:0,ui_mode:"app-profile",default_route:"/dashboard",platform_home:"/platform/agent"},system_state:{memory_count:0,active_runs:0,score:null,active_flows:0}};function fo({children:e,skipBoot:t=!1}){const{token:n,logout:r}=lt(),[o,s]=$.useState(Pe),[i,a]=$.useState(!1),[l,c]=$.useState(!1),[d,u]=$.useState(""),p=$.useRef(null),m=()=>{s(Pe),c(!1),u(""),p.current=null},g=async(w=n)=>{if(!w)return m(),Pe;a(!0),u("");try{const x=await Tn(w);return s({...Pe,...x,memory:x?.memory||[],runs:x?.runs||[],flows:x?.flows||[],metrics:x?.metrics||null,runtime:{...Pe.runtime,...x?.runtime||{}},system_state:{...Pe.system_state,...x?.system_state||{}}}),c(!0),p.current=w,x}catch(x){const E=x instanceof Error?x.message:"Failed to boot identity context.";throw u(E),c(!1),x instanceof J&&x.status===401&&r(),x}finally{a(!1)}};$.useEffect(()=>{if(t){if(!n){m();return}c(!0),u(""),p.current=n;return}if(!n){m();return}p.current===n&&l||g(n).catch(()=>{})},[n,l,t]);const y=$.useMemo(()=>({system:o,setSystem:s,clearSystem:m,bootSystem:g,booting:i,booted:l,bootError:d}),[o,i,l,d]);return b.jsx(Pn.Provider,{value:y,children:e})}function _n(){const e=$.useContext(Pn);if(!e)throw new Error("useSystem must be used within SystemProvider.");return e}const mo="/platform",po=e=>`${mo}${e}`,go=[{title:"PLATFORM",adminOnly:!0,runtimeOnlySafe:!0,links:[{to:"/agent",label:"Agent Console",external:!0},{to:"/flows",label:"Flow Engine",external:!0},{to:"/observability",label:"Observability",external:!0},{to:"/health",label:"Health",external:!0},{to:"/approvals",label:"Approvals",external:!0},{to:"/registry",label:"Registry",external:!0},{to:"/executions",label:"Executions",external:!0,runtimeOnlySafe:!1},{to:"/trace",label:"Ripple Trace",external:!0,runtimeOnlySafe:!1}]},{title:"WORKSPACE",runtimeOnlySafe:!1,links:[{to:"/dashboard",label:"Dashboard"},{to:"/tasks",label:"Tasks"},{to:"/masterplan",label:"MasterPlan"}]},{title:"ANALYTICS",runtimeOnlySafe:!1,links:[{to:"/analytics",label:"Analytics"},{to:"/kpi",label:"KPI Snapshot"}]},{title:"GROWTH",runtimeOnlySafe:!1,links:[{to:"/search/research",label:"Research"},{to:"/search/leadgen",label:"Lead Gen"},{to:"/social",label:"Social Feed"},{to:"/freelance",label:"Freelance"}]},{title:"AI TOOLS",runtimeOnlySafe:!1,links:[{to:"/arm/analyze",label:"ARM Analyze"},{to:"/arm/config",label:"ARM Config"},{to:"/arm/config/suggest",label:"ARM Suggest"},{to:"/arm/config/generate",label:"ARM Generate"},{to:"/arm/config/logs",label:"ARM Logs"},{to:"/arm/config/metrics",label:"ARM Metrics"}]},{title:"RUNTIME",runtimeOnlySafe:!0,links:[{to:"/identity",label:"Identity"},{to:"/memory",label:"Memory"}]}];function ho({to:e,label:t,onNavigate:n,external:r=!1}){const o=["block rounded-2xl border px-3 py-2 text-sm transition-colors","border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"];if(r){const s=typeof window<"u"&&window.location.pathname.startsWith("/platform");return b.jsx("a",{href:po(e),onClick:n,target:"_self",className:["block rounded-2xl border px-3 py-2 text-sm transition-colors",s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":"border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"].join(" "),children:t})}return b.jsx(Ne.NavLink,{to:e,onClick:n,className:({isActive:s})=>[...o,s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":""].join(" "),children:t})}function bo(){const{isAdmin:e,logout:t,user:n}=lt(),{system:r}=_n(),[o,s]=$.useState(!1),i=r?.runtime?.boot_mode==="runtime-only",a=$.useMemo(()=>go.filter(l=>!l.adminOnly||e).filter(l=>!i||l.runtimeOnlySafe!==!1).map(l=>({...l,title:l.title==="RUNTIME"&&!i?"IDENTITY":l.title,links:l.links.filter(c=>!i||c.runtimeOnlySafe!==!1)})),[e,i]);return b.jsxs("div",{className:"min-h-screen bg-[#09090b] text-[#fafafa] selection:bg-[#00ffaa]/30 lg:flex",children:[b.jsx("aside",{className:["fixed inset-y-0 left-0 z-40 w-80 border-r border-zinc-800/60 bg-zinc-950/95 backdrop-blur transition-transform lg:static lg:translate-x-0",o?"translate-x-0":"-translate-x-full"].join(" "),children:b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsx("div",{className:"border-b border-zinc-800/60 px-5 py-5",children:b.jsxs("div",{className:"flex items-start justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-[#00ffaa]",children:"Control Surface"}),b.jsx("h1",{className:"mt-3 text-2xl font-black tracking-tight text-white",children:"A.I.N.D.Y."}),b.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:i?"Runtime-only mode. Platform, memory, and identity surfaces are active.":"Route the workspace, analytics, growth, and platform surfaces."}),i?b.jsx("p",{className:"mt-3 inline-flex rounded-full border border-[#00ffaa]/30 bg-[#00ffaa]/10 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-[#00ffaa]",children:"Runtime-Only"}):null]}),b.jsx("button",{type:"button",className:"rounded-xl border border-zinc-800 px-3 py-2 text-xs uppercase tracking-[0.18em] text-zinc-400 lg:hidden",onClick:()=>s(!1),children:"Close"})]})}),b.jsx("nav",{className:"flex-1 space-y-6 overflow-y-auto px-4 py-5 custom-scrollbar",children:a.map(l=>b.jsxs("div",{children:[b.jsx("p",{className:"mb-3 px-2 text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:l.title}),b.jsx("div",{className:"space-y-2",children:l.links.map(c=>b.jsx(ho,{to:c.to,label:c.label,external:c.external,onNavigate:()=>s(!1)},c.to))})]},l.title))})]})}),o?b.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/60 lg:hidden",onClick:()=>s(!1)}):null,b.jsxs("div",{className:"flex min-h-screen flex-1 flex-col lg:ml-0",children:[b.jsx("header",{className:"sticky top-0 z-20 border-b border-zinc-800/60 bg-[#09090b]/95 backdrop-blur",children:b.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 sm:px-6 lg:px-8",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{type:"button",className:"rounded-2xl border border-zinc-800 bg-zinc-950/70 px-3 py-2 text-[10px] font-bold uppercase tracking-[0.18em] text-zinc-300 lg:hidden",onClick:()=>s(!0),children:"Menu"}),b.jsxs("div",{children:[b.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:"Navigation Shell"}),b.jsx("p",{className:"text-sm text-zinc-300",children:i?"Intentional platform surface":"Unified workspace routing"})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"hidden rounded-2xl border border-zinc-800 bg-zinc-950/70 px-4 py-2 text-right sm:block",children:[b.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-zinc-600",children:"Active Identity"}),b.jsx("p",{className:"text-sm text-zinc-200",children:n?.email||"Unknown user"})]}),b.jsx("button",{type:"button",onClick:t,className:"rounded-2xl bg-[#00ffaa] px-4 py-2 text-[10px] font-black uppercase tracking-[0.18em] text-black transition-colors hover:bg-[#00ffaa]/80",children:"Logout"})]})]})}),b.jsx("main",{className:"flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8",children:b.jsx("div",{className:"min-h-full rounded-[28px] border border-zinc-800/60 bg-zinc-950/40 p-4 shadow-2xl shadow-black/20 sm:p-6 lg:p-8",children:b.jsx(Ne.Outlet,{})})})]})]})}function yo({requireAdmin:e=!1}){const t=Ne.useLocation(),{isAdmin:n,isAuthenticated:r}=lt();return r?e&&!n?b.jsx(Ne.Navigate,{to:"/dashboard",replace:!0}):b.jsx(Ne.Outlet,{}):b.jsx(Ne.Navigate,{to:"/login",replace:!0,state:{from:t}})}const xo={major_mismatch:{bg:"#b91c1c",label:"Incompatible version",message:(e,t)=>`This page (v${t}) is incompatible with the current API (v${e}). Please reload.`,dismissable:!1},minor_mismatch:{bg:"#b45309",label:"API updated",message:(e,t)=>`API updated to v${e} (you have v${t}). Some features may not work correctly.`,dismissable:!0},patch_mismatch:{bg:"#1d4ed8",label:"Minor update available",message:(e,t)=>`API v${e} is available (you have v${t}). Reload when convenient.`,dismissable:!0},client_ahead:{bg:"#4b5563",label:"Client ahead of API",message:(e,t)=>`Client v${t} is ahead of API v${e}. This may indicate a partial rollback.`,dismissable:!0}};function wo({status:e,apiVersion:t,clientVersion:n,onDismiss:r}){const o=xo[e];return o?b.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:0,left:0,right:0,zIndex:9999,background:o.bg,color:"white",padding:"12px 16px",textAlign:"center",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px"},children:[b.jsxs("strong",{children:[o.label,":"]}),b.jsx("span",{children:o.message(t,n)}),b.jsx("button",{onClick:()=>window.location.reload(),style:{textDecoration:"underline",cursor:"pointer",background:"none",border:"none",color:"white"},children:"Reload"}),o.dismissable&&r?b.jsx("button",{onClick:r,"aria-label":"Dismiss version warning",style:{marginLeft:8,cursor:"pointer",background:"none",border:"none",color:"white",fontSize:"18px",lineHeight:1},children:"×"}):null]}):null}const Bt={error:"border-red-500/30 bg-red-950/80 text-red-200",success:"border-emerald-500/30 bg-emerald-950/80 text-emerald-200",info:"border-zinc-600/30 bg-zinc-900/90 text-zinc-200"};function vo({toast:e,onDismiss:t}){return e?b.jsxs("div",{role:"alert","aria-live":"assertive",className:`fixed bottom-6 right-6 z-50 max-w-sm rounded-xl border px-4 py-3 text-sm shadow-xl backdrop-blur-sm ${Bt[e.type]||Bt.error}`,children:[b.jsx("span",{children:e.message}),b.jsx("button",{onClick:t,className:"ml-3 text-xs underline opacity-60 hover:opacity-100","aria-label":"Dismiss",children:"Dismiss"})]}):null}function Eo({lines:e=3,label:t}){const n=["w-full","w-3/4","w-1/2"];return b.jsxs("div",{className:"rounded-2xl border border-zinc-800/50 bg-zinc-950/50 p-6",children:[b.jsx("div",{className:"space-y-3",children:Array.from({length:e},(r,o)=>b.jsx("div",{"data-testid":"loading-panel-line",className:`h-3 rounded bg-zinc-800 animate-pulse ${n[o%n.length]}`},o))}),t?b.jsx("p",{className:"mt-4 text-center text-xs text-zinc-500",children:t}):null]})}function Ao({error:e,domain:t,onRetry:n}){if(!e)return null;const r=e?.status??"unknown",o=t||e?.domain||"server";let s=`${o} returned an unexpected error (${r}).`;return r===408?s=`${o} timed out. Check your connection and try again.`:r===429?s=`${o} is rate-limited. Wait a moment and try again.`:r===500?s=`${o} encountered an error. Our team has been notified.`:r===503&&(s=`${o} is temporarily unavailable. Try again in a moment.`),b.jsxs("div",{className:"rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-6 text-center",children:[b.jsx("p",{className:"text-sm text-zinc-400",children:s}),n?b.jsx("button",{type:"button",className:"mt-3 text-xs text-zinc-500 underline",onClick:n,children:"Try again"}):null]})}function So(e){const[t,n]=$.useState(!1);return $.useEffect(()=>{e||n(!0)},[e]),t}function Ro(){return b.jsx("div",{role:"alert",className:"flex min-h-[200px] items-center justify-center rounded-2xl border border-red-500/20 bg-zinc-950/80 p-8 text-center",children:b.jsxs("div",{children:[b.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-red-400",children:"Admin Access Required"}),b.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:"This panel is only available to administrator accounts."})]})})}function Co({message:e,hint:t}){return b.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-8 text-center",children:[b.jsx("p",{className:"text-sm text-zinc-400",children:e}),t?b.jsx("p",{className:"mt-1 text-xs text-zinc-600",children:t}):null]})}function Yt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function It(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yt(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yt(e[o],null)}}}}function Re(...e){return f.useCallback(It(...e),e)}var To=Symbol.for("react.lazy"),nt=f[" use ".trim().toString()];function Oo(e){return typeof e=="object"&&e!==null&&"then"in e}function Nn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===To&&"_payload"in e&&Oo(e._payload)}function ko(e){const t=_o(e),n=f.forwardRef((r,o)=>{let{children:s,...i}=r;Nn(s)&&typeof nt=="function"&&(s=nt(s._payload));const a=f.Children.toArray(s),l=a.find($o);if(l){const c=l.props.children,d=a.map(u=>u===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:u);return b.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return b.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Po=ko("Slot");function _o(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(Nn(o)&&typeof nt=="function"&&(o=nt(o._payload)),f.isValidElement(o)){const i=Lo(o),a=Io(s,o.props);return o.type!==f.Fragment&&(a.ref=r?It(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var No=Symbol("radix.slottable");function $o(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===No}function Io(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Lo(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $n(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=$n(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function In(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$n(e))&&(r&&(r+=" "),r+=t);return r}const qt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kt=In,Mo=(e,t)=>n=>{var r;if(t?.variants==null)return Kt(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],u=s?.[c];if(d===null)return null;const p=qt(d)||qt(u);return o[c][p]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,p]=d;return p===void 0||(c[u]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:p,...m}=d;return Object.entries(m).every(g=>{let[y,w]=g;return Array.isArray(w)?w.includes({...s,...a}[y]):{...s,...a}[y]===w})?[...c,u,p]:c},[]);return Kt(e,i,l,n?.class,n?.className)},Do=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},zo=(e,t)=>({classGroupId:e,validator:t}),Ln=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rt="-",Xt=[],jo="arbitrary..",Uo=e=>{const t=Go(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Fo(i);const a=i.split(rt),l=a[0]===""&&a.length>1?1:0;return Mn(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?Do(c,l):l:c||Xt}return n[i]||Xt}}},Mn=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=Mn(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(rt):e.slice(t).join(rt),l=i.length;for(let c=0;c<l;c++){const d=i[c];if(d.validator(a))return d.classGroupId}},Fo=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?jo+r:void 0})(),Go=e=>{const{theme:t,classGroups:n}=e;return Wo(n,t)},Wo=(e,t)=>{const n=Ln();for(const r in e){const o=e[r];Lt(o,n,r,t)}return n},Lt=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Vo(i,t,n,r)}},Vo=(e,t,n,r)=>{if(typeof e=="string"){Ho(e,t,n);return}if(typeof e=="function"){Bo(e,t,n,r);return}Yo(e,t,n,r)},Ho=(e,t,n)=>{const r=e===""?t:Dn(t,e);r.classGroupId=n},Bo=(e,t,n,r)=>{if(qo(e)){Lt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(zo(n,e))},Yo=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];Lt(l,Dn(t,a),n,r)}},Dn=(e,t)=>{let n=e;const r=t.split(rt),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=Ln(),n.nextPart.set(i,a)),n=a}return n},qo=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ko=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},St="!",Jt=":",Xo=[],Zt=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Jo=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const d=o.length;for(let y=0;y<d;y++){const w=o[y];if(i===0&&a===0){if(w===Jt){s.push(o.slice(l,y)),l=y+1;continue}if(w==="/"){c=y;continue}}w==="["?i++:w==="]"?i--:w==="("?a++:w===")"&&a--}const u=s.length===0?o:o.slice(l);let p=u,m=!1;u.endsWith(St)?(p=u.slice(0,-1),m=!0):u.startsWith(St)&&(p=u.slice(1),m=!0);const g=c&&c>l?c-l:void 0;return Zt(s,m,p,g)};if(t){const o=t+Jt,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Zt(Xo,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Zo=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Qo=e=>({cache:Ko(e.cacheSize),parseClassName:Jo(e),sortModifiers:Zo(e),postfixLookupClassGroupIds:es(e),...Uo(e)}),es=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},ts=/\s+/,ns=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,a=[],l=e.trim().split(ts);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:p,modifiers:m,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:w}=n(u);if(p){c=u+(c.length>0?" "+c:c);continue}let x=!!w,E;if(x){const T=y.substring(0,w);E=r(T);const v=E&&i[E]?r(y):void 0;v&&v!==E&&(E=v,x=!1)}else E=r(y);if(!E){if(!x){c=u+(c.length>0?" "+c:c);continue}if(E=r(y),!E){c=u+(c.length>0?" "+c:c);continue}x=!1}const O=m.length===0?"":m.length===1?m[0]:s(m).join(":"),C=g?O+St:O,k=C+E;if(a.indexOf(k)>-1)continue;a.push(k);const P=o(E,x);for(let T=0;T<P.length;++T){const v=P[T];a.push(C+v)}c=u+(c.length>0?" "+c:c)}return c},rs=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=zn(n))&&(o&&(o+=" "),o+=r);return o},zn=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zn(e[r]))&&(n&&(n+=" "),n+=t);return n},os=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((d,u)=>u(d),e());return n=Qo(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const d=ns(l,n);return o(l,d),d};return s=i,(...l)=>s(rs(...l))},ss=[],H=e=>{const t=n=>n[e]||ss;return t.isThemeGetter=!0,t},jn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Un=/^\((?:(\w[\w-]*):)?(.+)\)$/i,is=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,as=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ls=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,us=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ds=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,he=e=>is.test(e),_=e=>!!e&&!Number.isNaN(Number(e)),re=e=>!!e&&Number.isInteger(Number(e)),yt=e=>e.endsWith("%")&&_(e.slice(0,-1)),ae=e=>as.test(e),Fn=()=>!0,fs=e=>ls.test(e)&&!cs.test(e),Mt=()=>!1,ms=e=>us.test(e),ps=e=>ds.test(e),gs=e=>!A(e)&&!S(e),hs=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),bs=e=>we(e,Vn,Mt),A=e=>jn.test(e),ve=e=>we(e,Hn,fs),Qt=e=>we(e,Rs,_),ys=e=>we(e,Yn,Fn),xs=e=>we(e,Bn,Mt),en=e=>we(e,Gn,Mt),ws=e=>we(e,Wn,ps),Je=e=>we(e,qn,ms),S=e=>Un.test(e),Fe=e=>Ce(e,Hn),vs=e=>Ce(e,Bn),tn=e=>Ce(e,Gn),Es=e=>Ce(e,Vn),As=e=>Ce(e,Wn),Ze=e=>Ce(e,qn,!0),Ss=e=>Ce(e,Yn,!0),we=(e,t,n)=>{const r=jn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ce=(e,t,n=!1)=>{const r=Un.exec(e);return r?r[1]?t(r[1]):n:!1},Gn=e=>e==="position"||e==="percentage",Wn=e=>e==="image"||e==="url",Vn=e=>e==="length"||e==="size"||e==="bg-size",Hn=e=>e==="length",Rs=e=>e==="number",Bn=e=>e==="family-name",Yn=e=>e==="number"||e==="weight",qn=e=>e==="shadow",Cs=()=>{const e=H("color"),t=H("font"),n=H("text"),r=H("font-weight"),o=H("tracking"),s=H("leading"),i=H("breakpoint"),a=H("container"),l=H("spacing"),c=H("radius"),d=H("shadow"),u=H("inset-shadow"),p=H("text-shadow"),m=H("drop-shadow"),g=H("blur"),y=H("perspective"),w=H("aspect"),x=H("ease"),E=H("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...C(),S,A],P=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],v=()=>[S,A,l],I=()=>[he,"full","auto",...v()],D=()=>[re,"none","subgrid",S,A],B=()=>["auto",{span:["full",re,S,A]},re,S,A],F=()=>[re,"auto",S,A],U=()=>["auto","min","max","fr",S,A],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...v()],M=()=>[he,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],N=()=>[he,"screen","full","dvw","lvw","svw","min","max","fit",...v()],W=()=>[he,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],R=()=>[e,S,A],ze=()=>[...C(),tn,en,{position:[S,A]}],Ye=()=>["no-repeat",{repeat:["","x","y","space","round"]}],qe=()=>["auto","cover","contain",Es,bs,{size:[S,A]}],je=()=>[yt,Fe,ve],Y=()=>["","none","full",c,S,A],q=()=>["",_,Fe,ve],te=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[_,yt,tn,en],Ke=()=>["","none",g,S,A],Oe=()=>["none",_,S,A],ke=()=>["none",_,S,A],ge=()=>[_,S,A],Xe=()=>[he,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ae],breakpoint:[ae],color:[Fn],container:[ae],"drop-shadow":[ae],ease:["in","out","in-out"],font:[gs],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ae],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ae],shadow:[ae],spacing:["px",_],text:[ae],"text-shadow":[ae],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",he,A,S,w]}],container:["container"],"container-type":[{"@container":["","normal","size",S,A]}],"container-named":[hs],columns:[{columns:[_,A,S,a]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[re,"auto",S,A]}],basis:[{basis:[he,"full","auto",a,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_,he,"auto","initial","none",A]}],grow:[{grow:["",_,S,A]}],shrink:[{shrink:["",_,S,A]}],order:[{order:[re,"first","last","none",S,A]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,Fe,ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ss,ys]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yt,A]}],"font-family":[{font:[vs,xs,t]}],"font-features":[{"font-features":[A]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,S,A]}],"line-clamp":[{"line-clamp":[_,"none",S,Qt]}],leading:[{leading:[s,...v()]}],"list-image":[{"list-image":["none",S,A]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",S,A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[_,"from-font","auto",S,ve]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[_,"auto",S,A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"tab-size":[{tab:[re,S,A]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S,A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",S,A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ze()}],"bg-repeat":[{bg:Ye()}],"bg-size":[{bg:qe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},re,S,A],radial:["",S,A],conic:[re,S,A]},As,ws]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:je()}],"gradient-via-pos":[{via:je()}],"gradient-to-pos":[{to:je()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_,S,A]}],"outline-w":[{outline:["",_,Fe,ve]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,Ze,Je]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",u,Ze,Je]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[_,ve]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",p,Ze,Je]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[_,S,A]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[S,A]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[_]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ze()}],"mask-repeat":[{mask:Ye()}],"mask-size":[{mask:qe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",S,A]}],filter:[{filter:["","none",S,A]}],blur:[{blur:Ke()}],brightness:[{brightness:[_,S,A]}],contrast:[{contrast:[_,S,A]}],"drop-shadow":[{"drop-shadow":["","none",m,Ze,Je]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",_,S,A]}],"hue-rotate":[{"hue-rotate":[_,S,A]}],invert:[{invert:["",_,S,A]}],saturate:[{saturate:[_,S,A]}],sepia:[{sepia:["",_,S,A]}],"backdrop-filter":[{"backdrop-filter":["","none",S,A]}],"backdrop-blur":[{"backdrop-blur":Ke()}],"backdrop-brightness":[{"backdrop-brightness":[_,S,A]}],"backdrop-contrast":[{"backdrop-contrast":[_,S,A]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_,S,A]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_,S,A]}],"backdrop-invert":[{"backdrop-invert":["",_,S,A]}],"backdrop-opacity":[{"backdrop-opacity":[_,S,A]}],"backdrop-saturate":[{"backdrop-saturate":[_,S,A]}],"backdrop-sepia":[{"backdrop-sepia":["",_,S,A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",S,A]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_,"initial",S,A]}],ease:[{ease:["linear","initial",x,S,A]}],delay:[{delay:[_,S,A]}],animate:[{animate:["none",E,S,A]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,S,A]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[S,A,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],zoom:[{zoom:[re,S,A]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S,A]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S,A]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[_,Fe,ve,Qt]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ts=os(Cs);function me(...e){return Ts(In(e))}const Kn=Mo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Xn=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Po:"button";return b.jsx(i,{className:me(Kn({variant:t,size:n,className:e})),ref:s,...o})});Xn.displayName="Button";const Jn=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Jn.displayName="Card";const Zn=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));Zn.displayName="CardHeader";const Qn=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));Qn.displayName="CardTitle";const er=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));er.displayName="CardDescription";const tr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));tr.displayName="CardContent";const nr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));nr.displayName="CardFooter";function le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function rr(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i),l=n.length;n=[...n,i];const c=u=>{const{scope:p,children:m,...g}=u,y=p?.[e]?.[l]||a,w=f.useMemo(()=>g,Object.values(g));return b.jsx(y.Provider,{value:w,children:m})};c.displayName=s+"Provider";function d(u,p){const m=p?.[e]?.[l]||a,g=f.useContext(m);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=a?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Os(o,...t)]}function Os(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ks(e){const t=Ps(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(Ns);if(l){const c=l.props.children,d=a.map(u=>u===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:u);return b.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return b.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Ps(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=Is(o),a=$s(s,o.props);return o.type!==f.Fragment&&(a.ref=r?It(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _s=Symbol("radix.slottable");function Ns(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_s}function $s(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Is(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ls=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=Ls.reduce((e,t)=>{const n=ks(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ms(e,t){e&&bn.flushSync(()=>e.dispatchEvent(t))}function ct(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ds(e,t=globalThis?.document){const n=ct(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var zs="DismissableLayer",Rt="dismissableLayer.update",js="dismissableLayer.pointerDownOutside",Us="dismissableLayer.focusOutside",nn,or=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=f.useContext(or),[d,u]=f.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=f.useState({}),g=Re(t,T=>u(T)),y=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(w),E=d?y.indexOf(d):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,C=E>=x,k=Ws(T=>{const v=T.target,I=[...c.branches].some(D=>D.contains(v));!C||I||(o?.(T),i?.(T),T.defaultPrevented||a?.())},p),P=Vs(T=>{const v=T.target;[...c.branches].some(D=>D.contains(v))||(s?.(T),i?.(T),T.defaultPrevented||a?.())},p);return Ds(T=>{E===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},p),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(nn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),rn(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=nn)}},[d,p,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),rn())},[d,c]),f.useEffect(()=>{const T=()=>m({});return document.addEventListener(Rt,T),()=>document.removeEventListener(Rt,T)},[]),b.jsx(Te.div,{...l,ref:g,style:{pointerEvents:O?C?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,P.onFocusCapture),onBlurCapture:le(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,k.onPointerDownCapture)})});sr.displayName=zs;var Fs="DismissableLayerBranch",Gs=f.forwardRef((e,t)=>{const n=f.useContext(or),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),b.jsx(Te.div,{...e,ref:o})});Gs.displayName=Fs;function Ws(e,t=globalThis?.document){const n=ct(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){ir(js,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Vs(e,t=globalThis?.document){const n=ct(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&ir(Us,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rn(){const e=new CustomEvent(Rt);document.dispatchEvent(e)}function ir(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ms(o,s):o.dispatchEvent(s)}var Ae=globalThis?.document?f.useLayoutEffect:()=>{},Hs=f[" useId ".trim().toString()]||(()=>{}),Bs=0;function Ys(e){const[t,n]=f.useState(Hs());return Ae(()=>{n(r=>r??String(Bs++))},[e]),t?`radix-${t}`:""}const qs=["top","right","bottom","left"],be=Math.min,K=Math.max,ot=Math.round,Qe=Math.floor,se=e=>({x:e,y:e}),Ks={left:"right",right:"left",bottom:"top",top:"bottom"};function Ct(e,t,n){return K(e,be(t,n))}function ue(e,t){return typeof e=="function"?e(t):e}function de(e){return e.split("-")[0]}function Me(e){return e.split("-")[1]}function Dt(e){return e==="x"?"y":"x"}function zt(e){return e==="y"?"height":"width"}function oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jt(e){return Dt(oe(e))}function Xs(e,t,n){n===void 0&&(n=!1);const r=Me(e),o=jt(e),s=zt(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=st(i)),[i,st(i)]}function Js(e){const t=st(e);return[Tt(e),t,Tt(t)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const on=["left","right"],sn=["right","left"],Zs=["top","bottom"],Qs=["bottom","top"];function ei(e,t,n){switch(e){case"top":case"bottom":return n?t?sn:on:t?on:sn;case"left":case"right":return t?Zs:Qs;default:return[]}}function ti(e,t,n,r){const o=Me(e);let s=ei(de(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Tt)))),s}function st(e){const t=de(e);return Ks[t]+e.slice(t.length)}function ni(e){return{top:0,right:0,bottom:0,left:0,...e}}function ar(e){return typeof e!="number"?ni(e):{top:e,right:e,bottom:e,left:e}}function it(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function an(e,t,n){let{reference:r,floating:o}=e;const s=oe(t),i=jt(t),a=zt(i),l=de(t),c=s==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:u};break;case"left":m={x:r.x-o.width,y:u};break;default:m={x:r.x,y:r.y}}switch(Me(t)){case"start":m[i]-=p*(n&&c?-1:1);break;case"end":m[i]+=p*(n&&c?-1:1);break}return m}async function ri(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=ue(t,e),g=ar(m),w=a[p?u==="floating"?"reference":"floating":u],x=it(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),E=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},k=it(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:O,strategy:l}):E);return{top:(x.top-k.top+g.top)/C.y,bottom:(k.bottom-x.bottom+g.bottom)/C.y,left:(x.left-k.left+g.left)/C.x,right:(k.right-x.right+g.right)/C.x}}const oi=50,si=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:ri},l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=an(c,r,l),p=r,m=0;const g={};for(let y=0;y<s.length;y++){const w=s[y];if(!w)continue;const{name:x,fn:E}=w,{x:O,y:C,data:k,reset:P}=await E({x:d,y:u,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});d=O??d,u=C??u,g[x]={...g[x],...k},P&&m<oi&&(m++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(c=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:u}=an(c,p,l)),y=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:g}},ii=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ue(e,t)||{};if(c==null)return{};const u=ar(d),p={x:n,y:r},m=jt(o),g=zt(m),y=await i.getDimensions(c),w=m==="y",x=w?"top":"left",E=w?"bottom":"right",O=w?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-p[m]-s.floating[g],k=p[m]-s.reference[m],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let T=P?P[O]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=a.floating[O]||s.floating[g]);const v=C/2-k/2,I=T/2-y[g]/2-1,D=be(u[x],I),B=be(u[E],I),F=D,U=T-y[g]-B,z=T/2-y[g]/2+v,G=Ct(F,z,U),L=!l.arrow&&Me(o)!=null&&z!==G&&s.reference[g]/2-(z<F?D:B)-y[g]/2<0,M=L?z<F?z-F:z-U:0;return{[m]:p[m]+M,data:{[m]:G,centerOffset:z-G-M,...L&&{alignmentOffset:M}},reset:L}}}),ai=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=ue(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=de(o),E=oe(a),O=de(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=p||(O||!y?[st(a)]:Js(a)),P=g!=="none";!p&&P&&k.push(...ti(a,y,g,C));const T=[a,...k],v=await l.detectOverflow(t,w),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&I.push(v[x]),u){const z=Xs(o,i,C);I.push(v[z[0]],v[z[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(z=>z<=0)){var B,F;const z=(((B=s.flip)==null?void 0:B.index)||0)+1,G=T[z];if(G&&(!(u==="alignment"?E!==oe(G):!1)||D.every(N=>oe(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:G}};let L=(F=D.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(m){case"bestFit":{var U;const M=(U=D.filter(N=>{if(P){const W=oe(N.placement);return W===E||W==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(W=>W>0).reduce((W,R)=>W+R,0)]).sort((N,W)=>N[1]-W[1])[0])==null?void 0:U[0];M&&(L=M);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function ln(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cn(e){return qs.some(t=>e[t]>=0)}const li=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=ue(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=ln(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:cn(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=ln(i,n.floating);return{data:{escapedOffsets:a,escaped:cn(a)}}}default:return{}}}}},lr=new Set(["left","top"]);async function ci(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=de(n),a=Me(n),l=oe(n)==="y",c=lr.has(i)?-1:1,d=s&&l?-1:1,u=ue(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*d,y:p*c}:{x:p*c,y:m*d}}const ui=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await ci(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},di=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:E,y:O}=x;return{x:E,y:O}}},...c}=ue(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),p=oe(de(o)),m=Dt(p);let g=d[m],y=d[p];if(i){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=g+u[x],C=g-u[E];g=Ct(O,g,C)}if(a){const x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",O=y+u[x],C=y-u[E];y=Ct(O,y,C)}const w=l.fn({...t,[m]:g,[p]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[m]:i,[p]:a}}}}}},fi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ue(e,t),d={x:n,y:r},u=oe(o),p=Dt(u);let m=d[p],g=d[u];const y=ue(a,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const O=p==="y"?"height":"width",C=s.reference[p]-s.floating[O]+w.mainAxis,k=s.reference[p]+s.reference[O]-w.mainAxis;m<C?m=C:m>k&&(m=k)}if(c){var x,E;const O=p==="y"?"width":"height",C=lr.has(de(o)),k=s.reference[u]-s.floating[O]+(C&&((x=i.offset)==null?void 0:x[u])||0)+(C?0:w.crossAxis),P=s.reference[u]+s.reference[O]+(C?0:((E=i.offset)==null?void 0:E[u])||0)-(C?w.crossAxis:0);g<k?g=k:g>P&&(g=P)}return{[p]:m,[u]:g}}}},mi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=ue(e,t),d=await i.detectOverflow(t,c),u=de(o),p=Me(o),m=oe(o)==="y",{width:g,height:y}=s.floating;let w,x;u==="top"||u==="bottom"?(w=u,x=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=u,w=p==="end"?"top":"bottom");const E=y-d.top-d.bottom,O=g-d.left-d.right,C=be(y-d[w],E),k=be(g-d[x],O),P=!t.middlewareData.shift;let T=C,v=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(v=O),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),P&&!p){const D=K(d.left,0),B=K(d.right,0),F=K(d.top,0),U=K(d.bottom,0);m?v=g-2*(D!==0||B!==0?D+B:K(d.left,d.right)):T=y-2*(F!==0||U!==0?F+U:K(d.top,d.bottom))}await l({...t,availableWidth:v,availableHeight:T});const I=await i.getDimensions(a.floating);return g!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function De(e){return cr(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ie(e){var t;return(t=(cr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cr(e){return ut()?e instanceof Node||e instanceof X(e).Node:!1}function Z(e){return ut()?e instanceof Element||e instanceof X(e).Element:!1}function pe(e){return ut()?e instanceof HTMLElement||e instanceof X(e).HTMLElement:!1}function un(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof X(e).ShadowRoot}function Be(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function pi(e){return/^(table|td|th)$/.test(De(e))}function dt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const gi=/transform|translate|scale|rotate|perspective|filter/,hi=/paint|layout|strict|content/,Ee=e=>!!e&&e!=="none";let xt;function Ut(e){const t=Z(e)?Q(e):e;return Ee(t.transform)||Ee(t.translate)||Ee(t.scale)||Ee(t.rotate)||Ee(t.perspective)||!Ft()&&(Ee(t.backdropFilter)||Ee(t.filter))||gi.test(t.willChange||"")||hi.test(t.contain||"")}function bi(e){let t=ye(e);for(;pe(t)&&!Ie(t);){if(Ut(t))return t;if(dt(t))return null;t=ye(t)}return null}function Ft(){return xt==null&&(xt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xt}function Ie(e){return/^(html|body|#document)$/.test(De(e))}function Q(e){return X(e).getComputedStyle(e)}function ft(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ye(e){if(De(e)==="html")return e;const t=e.assignedSlot||e.parentNode||un(e)&&e.host||ie(e);return un(t)?t.host:t}function ur(e){const t=ye(e);return Ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Be(t)?t:ur(t)}function Ve(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ur(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=X(o);if(s){const a=Ot(i);return t.concat(i,i.visualViewport||[],Be(o)?o:[],a&&n?Ve(a):[])}else return t.concat(o,Ve(o,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dr(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ot(n)!==s||ot(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Gt(e){return Z(e)?e:e.contextElement}function $e(e){const t=Gt(e);if(!pe(t))return se(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=dr(t);let i=(s?ot(n.width):n.width)/r,a=(s?ot(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const yi=se(0);function fr(e){const t=X(e);return!Ft()||!t.visualViewport?yi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==X(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Gt(e);let i=se(1);t&&(r?Z(r)&&(i=$e(r)):i=$e(e));const a=xi(s,n,r)?fr(s):se(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const p=X(s),m=r&&Z(r)?X(r):r;let g=p,y=Ot(g);for(;y&&r&&m!==g;){const w=$e(y),x=y.getBoundingClientRect(),E=Q(y),O=x.left+(y.clientLeft+parseFloat(E.paddingLeft))*w.x,C=x.top+(y.clientTop+parseFloat(E.paddingTop))*w.y;l*=w.x,c*=w.y,d*=w.x,u*=w.y,l+=O,c+=C,g=X(y),y=Ot(g)}}return it({width:d,height:u,x:l,y:c})}function mt(e,t){const n=ft(e).scrollLeft;return t?t.left+n:Se(ie(e)).left+n}function mr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function wi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ie(r),a=t?dt(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=se(1);const d=se(0),u=pe(r);if((u||!u&&!s)&&((De(r)!=="body"||Be(i))&&(l=ft(r)),u)){const m=Se(r);c=$e(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=i&&!u&&!s?mr(i,l):se(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function vi(e){return Array.from(e.getClientRects())}function Ei(e){const t=ie(e),n=ft(e),r=e.ownerDocument.body,o=K(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=K(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+mt(e);const a=-n.scrollTop;return Q(r).direction==="rtl"&&(i+=K(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const dn=25;function Ai(e,t){const n=X(e),r=ie(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Ft();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=mt(r);if(c<=0){const d=r.ownerDocument,u=d.body,p=getComputedStyle(u),m=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-u.clientWidth-m);g<=dn&&(s-=g)}else c<=dn&&(s+=c);return{width:s,height:i,x:a,y:l}}function Si(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=pe(e)?$e(e):se(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function fn(e,t,n){let r;if(t==="viewport")r=Ai(e,n);else if(t==="document")r=Ei(ie(e));else if(Z(t))r=Si(t,n);else{const o=fr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return it(r)}function pr(e,t){const n=ye(e);return n===t||!Z(n)||Ie(n)?!1:Q(n).position==="fixed"||pr(n,t)}function Ri(e,t){const n=t.get(e);if(n)return n;let r=Ve(e,[],!1).filter(a=>Z(a)&&De(a)!=="body"),o=null;const s=Q(e).position==="fixed";let i=s?ye(e):e;for(;Z(i)&&!Ie(i);){const a=Q(i),l=Ut(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Be(i)&&!l&&pr(e,i))?r=r.filter(d=>d!==i):o=a,i=ye(i)}return t.set(e,r),r}function Ci(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?dt(t)?[]:Ri(t,this._c):[].concat(n),r],a=fn(t,i[0],o);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let p=1;p<i.length;p++){const m=fn(t,i[p],o);l=K(m.top,l),c=be(m.right,c),d=be(m.bottom,d),u=K(m.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function Ti(e){const{width:t,height:n}=dr(e);return{width:t,height:n}}function Oi(e,t,n){const r=pe(t),o=ie(t),s=n==="fixed",i=Se(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=se(0);function c(){l.x=mt(o)}if(r||!r&&!s)if((De(t)!=="body"||Be(o))&&(a=ft(t)),r){const m=Se(t,!0,s,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?mr(o,a):se(0),u=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:u,y:p,width:i.width,height:i.height}}function wt(e){return Q(e).position==="static"}function mn(e,t){if(!pe(e)||Q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ie(e)===n&&(n=n.ownerDocument.body),n}function gr(e,t){const n=X(e);if(dt(e))return n;if(!pe(e)){let o=ye(e);for(;o&&!Ie(o);){if(Z(o)&&!wt(o))return o;o=ye(o)}return n}let r=mn(e,t);for(;r&&pi(r)&&wt(r);)r=mn(r,t);return r&&Ie(r)&&wt(r)&&!Ut(r)?n:r||bi(e)||n}const ki=async function(e){const t=this.getOffsetParent||gr,n=this.getDimensions,r=await n(e.floating);return{reference:Oi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Pi(e){return Q(e).direction==="rtl"}const _i={convertOffsetParentRelativeRectToViewportRelativeRect:wi,getDocumentElement:ie,getClippingRect:Ci,getOffsetParent:gr,getElementRects:ki,getClientRects:vi,getDimensions:Ti,getScale:$e,isElement:Z,isRTL:Pi};function hr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ni(e,t){let n=null,r;const o=ie(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:m}=c;if(a||t(),!p||!m)return;const g=Qe(u),y=Qe(o.clientWidth-(d+p)),w=Qe(o.clientHeight-(u+m)),x=Qe(d),O={rootMargin:-g+"px "+-y+"px "+-w+"px "+-x+"px",threshold:K(0,be(1,l))||1};let C=!0;function k(P){const T=P[0].intersectionRatio;if(T!==l){if(!C)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!hr(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(k,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,O)}n.observe(e)}return i(!0),s}function $i(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Gt(e),d=o||s?[...c?Ve(c):[],...t?Ve(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const u=c&&a?Ni(c,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(x=>{let[E]=x;E&&E.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var O;(O=m)==null||O.observe(t)})),n()}),c&&!l&&m.observe(c),t&&m.observe(t));let g,y=l?Se(e):null;l&&w();function w(){const x=Se(e);y&&!hr(y,x)&&n(),y=x,g=requestAnimationFrame(w)}return n(),()=>{var x;d.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),u?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const Ii=ui,Li=di,Mi=ai,Di=mi,zi=li,pn=ii,ji=fi,Ui=(e,t,n)=>{const r=new Map,o={platform:_i,...n},s={...o.platform,_c:r};return si(e,t,{...o,platform:s})};var Fi=typeof document<"u",Gi=function(){},tt=Fi?$.useLayoutEffect:Gi;function at(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!at(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!at(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function br(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gn(e,t){const n=br(e);return Math.round(t*n)/n}function vt(e){const t=f.useRef(e);return tt(()=>{t.current=e}),t}function Wi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);at(p,r)||m(r);const[g,y]=f.useState(null),[w,x]=f.useState(null),E=f.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),O=f.useCallback(N=>{N!==T.current&&(T.current=N,x(N))},[]),C=s||g,k=i||w,P=f.useRef(null),T=f.useRef(null),v=f.useRef(d),I=l!=null,D=vt(l),B=vt(o),F=vt(c),U=f.useCallback(()=>{if(!P.current||!T.current)return;const N={placement:t,strategy:n,middleware:p};B.current&&(N.platform=B.current),Ui(P.current,T.current,N).then(W=>{const R={...W,isPositioned:F.current!==!1};z.current&&!at(v.current,R)&&(v.current=R,bn.flushSync(()=>{u(R)}))})},[p,t,n,B,F]);tt(()=>{c===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[c]);const z=f.useRef(!1);tt(()=>(z.current=!0,()=>{z.current=!1}),[]),tt(()=>{if(C&&(P.current=C),k&&(T.current=k),C&&k){if(D.current)return D.current(C,k,U);U()}},[C,k,U,D,I]);const G=f.useMemo(()=>({reference:P,floating:T,setReference:E,setFloating:O}),[E,O]),L=f.useMemo(()=>({reference:C,floating:k}),[C,k]),M=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!L.floating)return N;const W=gn(L.floating,d.x),R=gn(L.floating,d.y);return a?{...N,transform:"translate("+W+"px, "+R+"px)",...br(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:R}},[n,a,L.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:U,refs:G,elements:L,floatingStyles:M}),[d,U,G,L,M])}const Vi=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?pn({element:r.current,padding:o}).fn(n):{}:r?pn({element:r,padding:o}).fn(n):{}}}},Hi=(e,t)=>{const n=Ii(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bi=(e,t)=>{const n=Li(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yi=(e,t)=>({fn:ji(e).fn,options:[e,t]}),qi=(e,t)=>{const n=Mi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ki=(e,t)=>{const n=Di(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xi=(e,t)=>{const n=zi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ji=(e,t)=>{const n=Vi(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Zi="Arrow",yr=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return b.jsx(Te.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});yr.displayName=Zi;var Qi=yr;function ea(e){const[t,n]=f.useState(void 0);return Ae(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Wt="Popper",[xr,wr]=rr(Wt),[ta,vr]=xr(Wt),Er=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return b.jsx(ta,{scope:t,anchor:r,onAnchorChange:o,children:n})};Er.displayName=Wt;var Ar="PopperAnchor",Sr=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=vr(Ar,n),i=f.useRef(null),a=Re(t,i),l=f.useRef(null);return f.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:b.jsx(Te.div,{...o,ref:a})});Sr.displayName=Ar;var Vt="PopperContent",[na,ra]=xr(Vt),Rr=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,w=vr(Vt,n),[x,E]=f.useState(null),O=Re(t,te=>E(te)),[C,k]=f.useState(null),P=ea(C),T=P?.width??0,v=P?.height??0,I=r+(s!=="center"?"-"+s:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(c)?c:[c],F=B.length>0,U={padding:D,boundary:B.filter(sa),altBoundary:F},{refs:z,floatingStyles:G,placement:L,isPositioned:M,middlewareData:N}=Wi({strategy:"fixed",placement:I,whileElementsMounted:(...te)=>$i(...te,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[Hi({mainAxis:o+v,alignmentAxis:i}),l&&Bi({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Yi():void 0,...U}),l&&qi({...U}),Ki({...U,apply:({elements:te,rects:Ue,availableWidth:V,availableHeight:Ke})=>{const{width:Oe,height:ke}=Ue.reference,ge=te.floating.style;ge.setProperty("--radix-popper-available-width",`${V}px`),ge.setProperty("--radix-popper-available-height",`${Ke}px`),ge.setProperty("--radix-popper-anchor-width",`${Oe}px`),ge.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&Ji({element:C,padding:a}),ia({arrowWidth:T,arrowHeight:v}),p&&Xi({strategy:"referenceHidden",...U})]}),[W,R]=Or(L),ze=ct(g);Ae(()=>{M&&ze?.()},[M,ze]);const Ye=N.arrow?.x,qe=N.arrow?.y,je=N.arrow?.centerOffset!==0,[Y,q]=f.useState();return Ae(()=>{x&&q(window.getComputedStyle(x).zIndex)},[x]),b.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:M?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(na,{scope:n,placedSide:W,onArrowChange:k,arrowX:Ye,arrowY:qe,shouldHideArrow:je,children:b.jsx(Te.div,{"data-side":W,"data-align":R,...y,ref:O,style:{...y.style,animation:M?void 0:"none"}})})})});Rr.displayName=Vt;var Cr="PopperArrow",oa={top:"bottom",right:"left",bottom:"top",left:"right"},Tr=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ra(Cr,r),i=oa[s.placedSide];return b.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:b.jsx(Qi,{...o,ref:n,style:{...o.style,display:"block"}})})});Tr.displayName=Cr;function sa(e){return e!==null}var ia=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=Or(n),u={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,m=(o.arrow?.y??0)+l/2;let g="",y="";return c==="bottom"?(g=i?u:`${p}px`,y=`${-l}px`):c==="top"?(g=i?u:`${p}px`,y=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,y=i?u:`${m}px`):c==="left"&&(g=`${r.floating.width+l}px`,y=i?u:`${m}px`),{data:{x:g,y}}}});function Or(e){const[t,n="center"]=e.split("-");return[t,n]}var aa=Er,la=Sr,ca=Rr,ua=Tr;function da(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var kr=e=>{const{present:t,children:n}=e,r=fa(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=Re(r.ref,ma(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};kr.displayName="Presence";function fa(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,l]=da(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=et(r.current);s.current=a==="mounted"?c:"none"},[a]),Ae(()=>{const c=r.current,d=o.current;if(d!==e){const p=s.current,m=et(c);e?l("MOUNT"):m==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ae(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=m=>{const y=et(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(l("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=m=>{m.target===t&&(s.current=et(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function et(e){return e?.animationName||"none"}function ma(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pa=Symbol("radix.slottable");function ga(e){const t=({children:n})=>b.jsx(b.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=pa,t}var ha=f[" useInsertionEffect ".trim().toString()]||Ae;function ba({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=ya({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=f.useCallback(d=>{if(a){const u=xa(d)?d(e):d;u!==e&&i.current?.(u)}else s(d)},[a,e,s,i]);return[l,c]}function ya({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return ha(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function xa(e){return typeof e=="function"}var wa=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),va="VisuallyHidden",Pr=f.forwardRef((e,t)=>b.jsx(Te.span,{...e,ref:t,style:{...wa,...e.style}}));Pr.displayName=va;var Ea=Pr,[pt]=rr("Tooltip",[wr]),gt=wr(),_r="TooltipProvider",Aa=700,kt="tooltip.open",[Sa,Ht]=pt(_r),Nr=e=>{const{__scopeTooltip:t,delayDuration:n=Aa,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),b.jsx(Sa,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};Nr.displayName=_r;var He="Tooltip",[Ra,ht]=pt(He),$r=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Ht(He,e.__scopeTooltip),c=gt(t),[d,u]=f.useState(null),p=Ys(),m=f.useRef(0),g=i??l.disableHoverableContent,y=a??l.delayDuration,w=f.useRef(!1),[x,E]=ba({prop:r,defaultProp:o??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(kt))):l.onClose(),s?.(T)},caller:He}),O=f.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),C=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w.current=!1,E(!0)},[E]),k=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,E(!1)},[E]),P=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,E(!0),m.current=0},y)},[y,E]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),b.jsx(aa,{...c,children:b.jsx(Ra,{scope:t,contentId:p,open:x,stateAttribute:O,trigger:d,onTriggerChange:u,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayedRef.current?P():C()},[l.isOpenDelayedRef,P,C]),onTriggerLeave:f.useCallback(()=>{g?k():(window.clearTimeout(m.current),m.current=0)},[k,g]),onOpen:C,onClose:k,disableHoverableContent:g,children:n})})};$r.displayName=He;var Pt="TooltipTrigger",Ir=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ht(Pt,n),s=Ht(Pt,n),i=gt(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),u=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),b.jsx(la,{asChild:!0,...i,children:b.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:le(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:le(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:le(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:le(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:le(e.onBlur,o.onClose),onClick:le(e.onClick,o.onClose)})})});Ir.displayName=Pt;var Ca="TooltipPortal",[Ka,Ta]=pt(Ca,{forceMount:void 0}),Le="TooltipContent",Lr=f.forwardRef((e,t)=>{const n=Ta(Le,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=ht(Le,e.__scopeTooltip);return b.jsx(kr,{present:r||i.open,children:i.disableHoverableContent?b.jsx(Mr,{side:o,...s,ref:t}):b.jsx(Oa,{side:o,...s,ref:t})})}),Oa=f.forwardRef((e,t)=>{const n=ht(Le,e.__scopeTooltip),r=Ht(Le,e.__scopeTooltip),o=f.useRef(null),s=Re(t,o),[i,a]=f.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:u}=r,p=f.useCallback(()=>{a(null),u(!1)},[u]),m=f.useCallback((g,y)=>{const w=g.currentTarget,x={x:g.clientX,y:g.clientY},E=$a(x,w.getBoundingClientRect()),O=Ia(x,E),C=La(y.getBoundingClientRect()),k=Da([...O,...C]);a(k),u(!0)},[u]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&d){const g=w=>m(w,d),y=w=>m(w,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",y)}}},[l,d,m,p]),f.useEffect(()=>{if(i){const g=y=>{const w=y.target,x={x:y.clientX,y:y.clientY},E=l?.contains(w)||d?.contains(w),O=!Ma(x,i);E?p():O&&(p(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,i,c,p]),b.jsx(Mr,{...e,ref:s})}),[ka,Pa]=pt(He,{isInside:!1}),_a=ga("TooltipContent"),Mr=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=ht(Le,n),c=gt(n),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(kt,d),()=>document.removeEventListener(kt,d)),[d]),f.useEffect(()=>{if(l.trigger){const u=p=>{p.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),b.jsx(sr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:b.jsxs(ca,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[b.jsx(_a,{children:r}),b.jsx(ka,{scope:n,isInside:!0,children:b.jsx(Ea,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Lr.displayName=Le;var Dr="TooltipArrow",Na=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gt(n);return Pa(Dr,n).isInside?null:b.jsx(ua,{...o,...r,ref:t})});Na.displayName=Dr;function $a(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ia(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function La(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Ma(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,u=l.x,p=l.y;d>r!=p>r&&n<(u-c)*(r-d)/(p-d)+c&&(o=!o)}return o}function Da(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),za(t)}function za(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ja=Nr,Ua=$r,Fa=Ir,zr=Lr;const Ga=ja,Wa=Ua,Va=Fa,jr=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>b.jsx(zr,{ref:r,sideOffset:t,className:me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));jr.displayName=zr.displayName;const Ha="agent-approval-count-changed";function Ba(e,t){if(e.length>0){const n=e[e.length-1];if(n&&typeof n=="object"&&!Array.isArray(n))return[...e.slice(0,-1),{...n,signal:t}]}return[...e,{signal:t}]}function Ya(e,t={}){const{domain:n="server",onSuccess:r,onError:o}=t,[s,i]=$.useState(!1),[a,l]=$.useState(null),[c,d]=$.useState(null),u=$.useRef(!0),p=$.useRef(null);$.useEffect(()=>(u.current=!0,()=>{u.current=!1,p.current&&p.current.abort()}),[]);const m=$.useCallback(()=>{u.current&&(l(null),d(null))},[]),g=$.useCallback(async(...y)=>{p.current&&p.current.abort();const w=new AbortController;p.current=w,u.current&&(i(!0),l(null));try{const x=await e(...Ba(y,w.signal));return!u.current||w.signal.aborted?null:(d(x),r?.(x),x)}catch(x){if(!u.current||w.signal.aborted)return null;if(x instanceof J){if(x.domain=n,x.status===401)return null;x.status===408&&(x.message=`${n} timed out. Check your connection and try again.`)}return l(x),o?.(x),null}finally{p.current===w&&(p.current=null),u.current&&!w.signal.aborted&&i(!1)}},[e,n,o,r]);return{loading:s,error:a,data:c,execute:g,reset:m}}function qa(){const[e,t]=$.useState(null),n=$.useCallback((o,s="error")=>{t({message:String(o),type:s}),setTimeout(()=>t(null),4e3)},[]),r=$.useCallback(()=>t(null),[]);return{toast:e,showToast:n,clearToast:r}}exports.API_BASE=At;exports.APPROVAL_EVENT=Ha;exports.AdminAccessRequired=Ro;exports.ApiError=J;exports.AppShell=bo;exports.AuthProvider=uo;exports.Button=Xn;exports.Card=Jn;exports.CardContent=tr;exports.CardDescription=er;exports.CardFooter=nr;exports.CardHeader=Zn;exports.CardTitle=Qn;exports.DomainError=Ao;exports.EmptyState=Co;exports.FEATURE_FLAGS=Br;exports.LoadingPanel=Eo;exports.ProtectedRoute=yo;exports.ROUTES=fe;exports.SystemProvider=fo;exports.Toast=vo;exports.Tooltip=Wa;exports.TooltipContent=jr;exports.TooltipProvider=Ga;exports.TooltipTrigger=Va;exports.VersionMismatchBanner=wo;exports.adminRequest=Vr;exports.authRequest=En;exports.authRequestExternal=Hr;exports.bootIdentity=Tn;exports.buildApiUrl=xn;exports.buttonVariants=Kn;exports.changePassword=Cn;exports.clearStoredToken=_e;exports.cn=me;exports.forgotPassword=ao;exports.getStoredToken=ce;exports.loginUser=An;exports.registerUser=Sn;exports.request=ee;exports.requestAbsolute=$t;exports.resetPassword=lo;exports.safeArray=Fr;exports.safeMap=Et;exports.setStoredToken=Ge;exports.taggedRequest=Wr;exports.unwrapEnvelope=xe;exports.useAdminApiGuard=So;exports.useApiCall=Ya;exports.useAuth=lt;exports.useSystem=_n;exports.useToast=qa;exports.verifyEmail=Rn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),$=require("react"),Ne=require("react-router-dom"),Vr=require("react-dom");function yn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=yn($),xn=yn(Vr);function Hr(e){return Array.isArray(e)?e:e==null?[]:[]}function Et(e,t){return Array.isArray(e)?e.map(t):(console.warn("safeMap prevented crash. Value:",e),[])}const At="".replace(/\/$/,""),_t="token",Nt="aindy_token",wn=globalThis.__AINDY_APP_VERSION_OVERRIDE__||"2.1.0",Br=new Set(["agents","allowed_auto_grant_tools","allowed_capabilities","analyses","drop_points","end","error_rate_series","events","feedback","fields","findings","flows","generations","granted_tools","history","items","jobs","logs","memories","nodes","plans","pings","recent","recent_authors","recent_changes","recent_errors","recent_ripples","results","runs","steps","strategies","suggestions","tags","timeline","tools"]);class K extends Error{constructor(t,n,r){super(n),this.name="ApiError",this.status=t,this.body=r}}function Yr(e,t){return function(...n){return t(...n).catch(r=>{throw r instanceof K&&(r.domain=e),r})}}const qr="X-AINDY-Envelope",vn=Symbol.for("aindy.ui-kit.envelope.resolved");let Bt=!1;function Yt(e,t){return e!==null&&typeof e=="object"&&Object.defineProperty(e,vn,{value:t,enumerable:!1,configurable:!0}),e}function Xr(e){if(e&&typeof e=="object"){if("error"in e&&e.error)throw new K(200,e.error,e);return e.data!==void 0?e.data:null}return e}function En(e,t){const n=e.headers?.get?.(qr);return n?(Bt=!0,Yt(Xr(t),n)):Bt?Yt(t,null):t}function xe(e){if(e!==null&&typeof e=="object"&&vn in e)return e;if(e&&typeof e=="object"&&"data"in e){if("error"in e&&e.error)throw new K(200,e.error,e);return e.data!==void 0?e.data:e}return e}function We(e){if(Array.isArray(e))return Et(e,n=>We(n));if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e)){if(Br.has(n)){t[n]=Array.isArray(r)?Et(r,o=>We(o)):[];continue}t[n]=We(r)}return t}function ce(){return localStorage.getItem(_t)||localStorage.getItem(Nt)||""}function Ge(e){localStorage.setItem(_t,e),localStorage.setItem(Nt,e)}function _e(){localStorage.removeItem(_t),localStorage.removeItem(Nt)}function An(e){return/^https?:\/\//i.test(e)?e:At?`${At}${e}`:e}function Sn(){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:session-expired"))}function Rn(e){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:version-warning",{detail:{message:e}}))}async function ee(e,t={}){const n=An(e),r=ce(),o=new AbortController,{_isRetry:s=!1,...i}=t,a=typeof window<"u"?setTimeout(()=>o.abort(),3e4):null;i.signal&&(i.signal.aborted?o.abort():i.signal.addEventListener("abort",()=>o.abort(),{once:!0}));try{const l=await fetch(n,{...i,signal:o.signal,headers:{"Content-Type":"application/json","X-Client-Version":wn,...r?{Authorization:`Bearer ${r}`}:{},...i.headers||{}}}),c=l.headers?.get?.("X-Version-Warning");if(c&&typeof window<"u"&&(console.warn("[API Version Warning]",c),Rn(c)),l.status===503){const m=parseInt(l.headers.get("Retry-After")||"0",10);if(m>0&&m<=60&&!s)return await new Promise(p=>setTimeout(p,m*1e3)),ee(e,{...i,_isRetry:!0})}if(!l.ok){const m=await l.text(),p=new K(l.status,`API Error (${l.status}): ${m}`,m);throw l.status===401&&Sn(),p}const d=await l.text();let u;try{u=We(JSON.parse(d))}catch{return d}return En(l,u)}catch(l){throw l?.name==="AbortError"?new K(408,"Request timed out after 30 seconds.",null):l instanceof TypeError&&!l.status?new K(0,"Network error. Check your connection.",null):l}finally{a&&clearTimeout(a)}}function Cn(e,t={}){return ee(e,{...t})}function Kr(e,t={}){const n=ce();let r=!1;if(n)try{const[,o=""]=n.split("."),s=o.replace(/-/g,"+").replace(/_/g,"/"),i=s.padEnd(Math.ceil(s.length/4)*4,"=");r=JSON.parse(atob(i))?.is_admin===!0}catch{r=!1}return r?Cn(e,t):Promise.reject(new K(403,"Admin privileges required for this operation.",null))}async function $t(e,t={}){const n=ce(),r=new AbortController,{_isRetry:o=!1,...s}=t,i=typeof window<"u"?setTimeout(()=>r.abort(),3e4):null;s.signal&&(s.signal.aborted?r.abort():s.signal.addEventListener("abort",()=>r.abort(),{once:!0}));try{const a=await fetch(e,{...s,signal:r.signal,headers:{"Content-Type":"application/json","X-Client-Version":wn,...n?{Authorization:`Bearer ${n}`}:{},...s.headers||{}}}),l=a.headers?.get?.("X-Version-Warning");if(l&&typeof window<"u"&&(console.warn("[API Version Warning]",l),Rn(l)),a.status===503){const u=parseInt(a.headers.get("Retry-After")||"0",10);if(u>0&&u<=60&&!o)return await new Promise(m=>setTimeout(m,u*1e3)),$t(e,{...s,_isRetry:!0})}if(!a.ok){const u=await a.text(),m=new K(a.status,`API Error (${a.status}): ${u}`,u);throw a.status===401&&Sn(),m}const c=await a.text();let d;try{d=We(JSON.parse(c))}catch{return c}return En(a,d)}catch(a){throw a?.name==="AbortError"?new K(408,"Request timed out after 30 seconds.",null):a instanceof TypeError&&!a.status?new K(0,"Network error. Check your connection.",null):a}finally{i&&clearTimeout(i)}}function Jr(e,t={}){return $t(e,{...t})}const h="",z=`${h}/apps`,ne=`${h}/platform`,Zr=Object.freeze({OPERATOR_FLOW_STRATEGIES:!0,OPERATOR_AUTOMATION_LOGS:!1,OPERATOR_SCHEDULER_STATUS:!1,RIPPLETRACE_VIEWER:!1}),Qr=Object.freeze({LOGIN:`${h}/auth/login`,REGISTER:`${h}/auth/register`,LOGOUT:`${h}/auth/logout`,VERIFY_EMAIL:`${h}/auth/verify-email`,PASSWORD_CHANGE:`${h}/auth/password/change`,PASSWORD_FORGOT:`${h}/auth/password/forgot`,PASSWORD_RESET:`${h}/auth/password/reset`}),eo=Object.freeze({LIST:`${h}/tasks/list`,CREATE:`${h}/tasks/create`,COMPLETE:`${h}/tasks/complete`,START:`${h}/tasks/start`}),to=Object.freeze({ANALYZE:`${h}/arm/analyze`,GENERATE:`${h}/arm/generate`,LOGS:`${h}/arm/logs`,CONFIG:`${h}/arm/config`,METRICS:`${h}/arm/metrics`,CONFIG_SUGGESTIONS:`${h}/arm/config/suggest`}),no=Object.freeze({CREATE_RUN:`${z}/agent/run`,RUNS:`${z}/agent/runs`,RUN:e=>`${z}/agent/runs/${e}`,APPROVE:e=>`${z}/agent/runs/${e}/approve`,REJECT:e=>`${z}/agent/runs/${e}/reject`,RECOVER:e=>`${z}/agent/runs/${e}/recover`,REPLAY:e=>`${z}/agent/runs/${e}/replay`,STEPS:e=>`${z}/agent/runs/${e}/steps`,EVENTS:e=>`${z}/agent/runs/${e}/events`,TOOLS:`${z}/agent/tools`,TRUST:`${z}/agent/trust`,SUGGESTIONS:`${z}/agent/suggestions`}),ro=Object.freeze({LINKEDIN_MANUAL:`${h}/analytics/linkedin/manual`,MASTERPLAN_SUMMARY:e=>`${h}/analytics/masterplan/${e}/summary`,CALCULATE_TWR:`${h}/calculate_twr`,CALCULATE_ENGAGEMENT:`${h}/calculate_engagement`,CALCULATE_AI_EFFICIENCY:`${h}/calculate_ai_efficiency`,CALCULATE_IMPACT_SCORE:`${h}/calculate_impact_score`,CALCULATE_INCOME_EFFICIENCY:`${h}/income_efficiency`,CALCULATE_REVENUE_SCALING:`${h}/revenue_scaling`,CALCULATE_EXECUTION_SPEED:`${h}/execution_speed`,CALCULATE_ATTENTION_VALUE:`${h}/attention_value`,CALCULATE_ENGAGEMENT_RATE:`${h}/engagement_rate`,CALCULATE_BUSINESS_GROWTH:`${h}/business_growth`,CALCULATE_MONETIZATION_EFFICIENCY:`${h}/monetization_efficiency`,CALCULATE_AI_PRODUCTIVITY_BOOST:`${h}/ai_productivity_boost`,CALCULATE_DECISION_EFFICIENCY:`${h}/decision_efficiency`,CALCULATE_LOST_POTENTIAL:`${h}/lost_potential`,SCORES_ME:`${h}/scores/me`,SCORES_RECALCULATE:`${h}/scores/me/recalculate`,SCORES_HISTORY:`${h}/scores/me/history`,SCORES_FEEDBACK:`${h}/scores/feedback`}),oo=Object.freeze({ORDERS:`${h}/freelance/orders`,FEEDBACK:`${h}/freelance/feedback`,METRICS_LATEST:`${h}/freelance/metrics/latest`}),so=Object.freeze({BOOT:`${h}/identity/boot`,PROFILE:`${h}/identity/`,EVOLUTION:`${h}/identity/evolution`,CONTEXT:`${h}/identity/context`}),io=Object.freeze({GENESIS_SESSION:`${h}/genesis/session`,GENESIS_MESSAGE:`${h}/genesis/message`,GENESIS_SESSION_BY_ID:e=>`${h}/genesis/session/${e}`,GENESIS_SYNTHESIZE:`${h}/genesis/synthesize`,GENESIS_DRAFT:e=>`${h}/genesis/draft/${e}`,GENESIS_LOCK:`${h}/genesis/lock`,GENESIS_AUDIT:`${h}/genesis/audit`,PLANS:`${h}/masterplans/`,PLAN:e=>`${h}/masterplans/${e}`,PLAN_ACTIVATE:e=>`${h}/masterplans/${e}/activate`,PLAN_ANCHOR:e=>`${h}/masterplans/${e}/anchor`,PLAN_PROJECTION:e=>`${h}/masterplans/${e}/projection`}),ao=Object.freeze({AGENTS:`${z}/memory/agents`,AGENT_RECALL:e=>`${z}/memory/agents/${e}/recall`,FEDERATED_RECALL:`${z}/memory/federated/recall`,NODES:`${z}/memory/nodes`,RECALL_V3:`${z}/memory/recall/v3`,SUGGEST:`${z}/memory/suggest`,NODE_FEEDBACK:e=>`${z}/memory/nodes/${e}/feedback`,NODE_PERFORMANCE:e=>`${z}/memory/nodes/${e}/performance`,NODE_TRAVERSE:e=>`${z}/memory/nodes/${e}/traverse`,NODE_HISTORY:e=>`${z}/memory/nodes/${e}/history`,NODE_SHARE:e=>`${z}/memory/nodes/${e}/share`,METRICS_DASHBOARD:`${z}/memory/metrics/dashboard`}),lo=Object.freeze({RESEARCH_QUERY:`${h}/research/query`,HISTORY:`${h}/search/history`,HISTORY_ITEM:e=>`${h}/search/history/${e}`,LEAD_GEN:`${h}/leadgen/`,ANALYZE_SEO:`${h}/analyze_seo/`,GENERATE_META:`${h}/generate_meta/`,SUGGEST_IMPROVEMENTS:`${h}/suggest_improvements/`}),co=Object.freeze({PROFILE_BY_USERNAME:e=>`${h}/social/profile/${e}`,PROFILE:`${h}/social/profile`,FEED:`${h}/social/feed`,POST:`${h}/social/post`,ANALYTICS:`${h}/social/analytics`,INTERACT:e=>`${h}/social/posts/${e}/interact`}),uo=Object.freeze({DROP_POINTS:`${h}/rippletrace/drop_points`,PINGS:`${h}/rippletrace/pings`,RECENT:`${h}/rippletrace/recent`,TRACE:e=>`${h}/rippletrace/ripples/${e}`,TRACE_GRAPH:e=>`${h}/rippletrace/${encodeURIComponent(e)}`,CAUSAL_GRAPH:`${h}/rippletrace/causal/graph`,CAUSAL_CHAIN:e=>`${h}/rippletrace/causal/chain/${encodeURIComponent(e)}`,NARRATIVE_SUMMARY:`${h}/rippletrace/narrative/summary`,DROP_POINT_NARRATIVE:e=>`${h}/rippletrace/narrative/${encodeURIComponent(e)}`,PREDICTIONS_SUMMARY:`${h}/rippletrace/predictions/summary`,DROP_POINT_PREDICTION:e=>`${h}/rippletrace/predictions/${encodeURIComponent(e)}`,SYSTEM_RECOMMENDATIONS:`${h}/rippletrace/recommendations/system`,RECOMMENDATIONS_SUMMARY:`${h}/rippletrace/recommendations/summary`,DROP_POINT_RECOMMENDATION:e=>`${h}/rippletrace/recommendations/${encodeURIComponent(e)}`,LEARNING_STATS:`${h}/rippletrace/learning/stats`,EVALUATE_LEARNING_OUTCOME:e=>`${h}/rippletrace/learning/evaluate/${encodeURIComponent(e)}`,ADJUST_LEARNING_THRESHOLDS:`${h}/rippletrace/learning/adjust`,PLAYBOOKS:`${h}/rippletrace/playbooks`,PLAYBOOK:e=>`${h}/rippletrace/playbooks/${encodeURIComponent(e)}`,MATCH_PLAYBOOKS:e=>`${h}/rippletrace/playbooks/match/${encodeURIComponent(e)}`,STRATEGIES:`${h}/rippletrace/strategies`,BUILD_STRATEGIES:`${h}/rippletrace/strategies/build`,STRATEGY:e=>`${h}/rippletrace/strategies/${encodeURIComponent(e)}`,MATCH_STRATEGIES:e=>`${h}/rippletrace/strategies/match/${encodeURIComponent(e)}`,EVENT_DOWNSTREAM:e=>`${h}/rippletrace/event/${encodeURIComponent(e)}/downstream`,EVENT_UPSTREAM:e=>`${h}/rippletrace/event/${encodeURIComponent(e)}/upstream`}),fo=Object.freeze({FLOW_RUNS:`${ne}/flows/runs`,FLOW_RUN:e=>`${ne}/flows/runs/${e}`,FLOW_RUN_HISTORY:e=>`${ne}/flows/runs/${e}/history`,FLOW_RUN_RESUME:e=>`${ne}/flows/runs/${e}/resume`,FLOW_REGISTRY:`${ne}/flows/registry`,FLOW_STRATEGIES:`${ne}/flows/strategies`,RIPPLETRACE_STATUS:`${ne}/observability/rippletrace/status`,OBSERVABILITY_REQUESTS:`${ne}/observability/requests`,OBSERVABILITY_DASHBOARD:`${ne}/observability/dashboard`,CLIENT_ERROR:`${h}/client/error`,CLIENT_VITALS:`${h}/client/vitals`,AUTOMATION_LOGS:`${h}/automation/logs`,AUTOMATION_LOG:e=>`${h}/automation/logs/${e}`,AUTOMATION_REPLAY:e=>`${h}/automation/logs/${e}/replay`,SCHEDULER_STATUS:`${ne}/observability/scheduler/status`}),mo=Object.freeze({DASHBOARD_OVERVIEW:`${h}/dashboard/overview`,HEALTH_DETAILS:`${h}/health/details`,INFLUENCE_GRAPH:`${h}/influence_graph`,CAUSAL_GRAPH:`${h}/causal_graph`,NARRATIVE:e=>`${h}/narrative/${e}`,HEALTH:`${h}/health`,HEALTH_DEEP:`${h}/health/deep`,HEALTH_DOMAINS:`${h}/health/domains`,VERSION:`${h}/api/version`}),fe=Object.freeze({AUTH:Qr,TASKS:eo,ARM:to,AGENT:no,ANALYTICS:ro,FREELANCE:oo,IDENTITY:so,MASTERPLAN:io,MEMORY:ao,SEARCH:lo,SOCIAL:co,RIPPLETRACE:uo,OPERATOR:fo,PLATFORM:mo});function Tn(e){return ee(fe.AUTH.LOGIN,{method:"POST",body:JSON.stringify(e)}).then(xe)}function On(e){return ee(fe.AUTH.REGISTER,{method:"POST",body:JSON.stringify(e)}).then(xe)}function kn(e){return ee(fe.AUTH.VERIFY_EMAIL,{method:"POST",body:JSON.stringify({token:e})}).then(xe)}function Pn(e,t,n=ce()){return ee(fe.AUTH.PASSWORD_CHANGE,{method:"POST",headers:n?{Authorization:`Bearer ${n}`}:{},body:JSON.stringify({current_password:e,new_password:t})}).then(xe)}function po(e){return ee(fe.AUTH.PASSWORD_FORGOT,{method:"POST",body:JSON.stringify({email:e})}).then(xe)}function go(e,t){return ee(fe.AUTH.PASSWORD_RESET,{method:"POST",body:JSON.stringify({token:e,new_password:t})}).then(xe)}function ho(e=ce()){return ee(fe.AUTH.LOGOUT,{method:"POST",headers:e?{Authorization:`Bearer ${e}`}:{}}).catch(()=>null)}function _n(e=ce()){return ee(fe.IDENTITY.BOOT,{method:"GET",headers:e?{Authorization:`Bearer ${e}`}:{}}).then(xe)}const Nn=$.createContext(null);function $n(e){if(!e)return null;try{const[,t=""]=e.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return JSON.parse(window.atob(r))}catch{return null}}function bt(e){const t=$n(e);return!t||typeof t.exp!="number"?!1:Date.now()/1e3>t.exp-30}function bo({children:e}){const[t,n]=$.useState(()=>{const u=ce();return u&&bt(u)?(_e(),null):u||null}),r=$.useMemo(()=>{const u=$n(t);return u?{...u,is_admin:u?.is_admin===!0}:null},[t]),o=r?.is_admin===!0;$.useEffect(()=>{const u=ce();if(u&&bt(u)){_e(),n(null);return}n(u||null)},[]),$.useEffect(()=>{if(!t)return;const u=setInterval(()=>{bt(t)&&(_e(),n(null))},6e4);return()=>clearInterval(u)},[t]),$.useEffect(()=>{const u=()=>{_e(),n(null)};return window.addEventListener("aindy:session-expired",u),()=>window.removeEventListener("aindy:session-expired",u)},[]);const s=async(u,m)=>{const g=(await Tn({email:u,password:m}))?.access_token;if(!g)throw new Error("Authentication did not return an access token.");return Ge(g),n(g),g},i=async(u,m,p=null)=>{const y=(await On({email:u,password:m,username:p}))?.access_token;return y?(Ge(y),n(y),{verificationSent:!1,token:y}):{verificationSent:!0,token:null}},a=async u=>{const p=(await kn(u))?.access_token;if(!p)throw new Error("Verification did not return an access token.");return Ge(p),n(p),p},l=async(u,m)=>{const g=(await Pn(u,m))?.access_token;return g&&(Ge(g),n(g)),g??null},c=()=>{ho(),_e(),n(null)},d=$.useMemo(()=>({token:t,user:r,isAdmin:o,isAuthenticated:!!t,login:s,register:i,verify:a,changeOwnPassword:l,logout:c,setToken:n}),[t,r,o]);return b.jsx(Nn.Provider,{value:d,children:e})}function lt(){const e=$.useContext(Nn);if(!e)throw new Error("useAuth must be used within AuthProvider.");return e}const In=$.createContext(null),Pe={user_id:null,memory:[],runs:[],metrics:null,flows:[],runtime:{boot_mode:"unknown",boot_profile:"unknown",boot_profile_source:"unknown",app_plugins_loaded:!1,app_plugin_count:0,ui_mode:"app-profile",default_route:"/dashboard",platform_home:"/platform/agent"},system_state:{memory_count:0,active_runs:0,score:null,active_flows:0}};function yo({children:e,skipBoot:t=!1}){const{token:n,logout:r}=lt(),[o,s]=$.useState(Pe),[i,a]=$.useState(!1),[l,c]=$.useState(!1),[d,u]=$.useState(""),m=$.useRef(null),p=()=>{s(Pe),c(!1),u(""),m.current=null},g=async(w=n)=>{if(!w)return p(),Pe;a(!0),u("");try{const x=await _n(w);return s({...Pe,...x,memory:x?.memory||[],runs:x?.runs||[],flows:x?.flows||[],metrics:x?.metrics||null,runtime:{...Pe.runtime,...x?.runtime||{}},system_state:{...Pe.system_state,...x?.system_state||{}}}),c(!0),m.current=w,x}catch(x){const E=x instanceof Error?x.message:"Failed to boot identity context.";throw u(E),c(!1),x instanceof K&&x.status===401&&r(),x}finally{a(!1)}};$.useEffect(()=>{if(t){if(!n){p();return}c(!0),u(""),m.current=n;return}if(!n){p();return}m.current===n&&l||g(n).catch(()=>{})},[n,l,t]);const y=$.useMemo(()=>({system:o,setSystem:s,clearSystem:p,bootSystem:g,booting:i,booted:l,bootError:d}),[o,i,l,d]);return b.jsx(In.Provider,{value:y,children:e})}function Ln(){const e=$.useContext(In);if(!e)throw new Error("useSystem must be used within SystemProvider.");return e}const xo="/platform",wo=e=>`${xo}${e}`,vo=[{title:"PLATFORM",adminOnly:!0,runtimeOnlySafe:!0,links:[{to:"/agent",label:"Agent Console",external:!0},{to:"/flows",label:"Flow Engine",external:!0},{to:"/observability",label:"Observability",external:!0},{to:"/health",label:"Health",external:!0},{to:"/approvals",label:"Approvals",external:!0},{to:"/registry",label:"Registry",external:!0},{to:"/executions",label:"Executions",external:!0,runtimeOnlySafe:!1},{to:"/trace",label:"Ripple Trace",external:!0,runtimeOnlySafe:!1}]},{title:"WORKSPACE",runtimeOnlySafe:!1,links:[{to:"/dashboard",label:"Dashboard"},{to:"/tasks",label:"Tasks"},{to:"/masterplan",label:"MasterPlan"}]},{title:"ANALYTICS",runtimeOnlySafe:!1,links:[{to:"/analytics",label:"Analytics"},{to:"/kpi",label:"KPI Snapshot"}]},{title:"GROWTH",runtimeOnlySafe:!1,links:[{to:"/search/research",label:"Research"},{to:"/search/leadgen",label:"Lead Gen"},{to:"/social",label:"Social Feed"},{to:"/freelance",label:"Freelance"}]},{title:"AI TOOLS",runtimeOnlySafe:!1,links:[{to:"/arm/analyze",label:"ARM Analyze"},{to:"/arm/config",label:"ARM Config"},{to:"/arm/config/suggest",label:"ARM Suggest"},{to:"/arm/config/generate",label:"ARM Generate"},{to:"/arm/config/logs",label:"ARM Logs"},{to:"/arm/config/metrics",label:"ARM Metrics"}]},{title:"RUNTIME",runtimeOnlySafe:!0,links:[{to:"/identity",label:"Identity"},{to:"/memory",label:"Memory"}]}];function Eo({to:e,label:t,onNavigate:n,external:r=!1}){const o=["block rounded-2xl border px-3 py-2 text-sm transition-colors","border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"];if(r){const s=typeof window<"u"&&window.location.pathname.startsWith("/platform");return b.jsx("a",{href:wo(e),onClick:n,target:"_self",className:["block rounded-2xl border px-3 py-2 text-sm transition-colors",s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":"border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"].join(" "),children:t})}return b.jsx(Ne.NavLink,{to:e,onClick:n,className:({isActive:s})=>[...o,s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":""].join(" "),children:t})}function Ao(){const{isAdmin:e,logout:t,user:n}=lt(),{system:r}=Ln(),[o,s]=$.useState(!1),i=r?.runtime?.boot_mode==="runtime-only",a=$.useMemo(()=>vo.filter(l=>!l.adminOnly||e).filter(l=>!i||l.runtimeOnlySafe!==!1).map(l=>({...l,title:l.title==="RUNTIME"&&!i?"IDENTITY":l.title,links:l.links.filter(c=>!i||c.runtimeOnlySafe!==!1)})),[e,i]);return b.jsxs("div",{className:"min-h-screen bg-[#09090b] text-[#fafafa] selection:bg-[#00ffaa]/30 lg:flex",children:[b.jsx("aside",{className:["fixed inset-y-0 left-0 z-40 w-80 border-r border-zinc-800/60 bg-zinc-950/95 backdrop-blur transition-transform lg:static lg:translate-x-0",o?"translate-x-0":"-translate-x-full"].join(" "),children:b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsx("div",{className:"border-b border-zinc-800/60 px-5 py-5",children:b.jsxs("div",{className:"flex items-start justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-[#00ffaa]",children:"Control Surface"}),b.jsx("h1",{className:"mt-3 text-2xl font-black tracking-tight text-white",children:"A.I.N.D.Y."}),b.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:i?"Runtime-only mode. Platform, memory, and identity surfaces are active.":"Route the workspace, analytics, growth, and platform surfaces."}),i?b.jsx("p",{className:"mt-3 inline-flex rounded-full border border-[#00ffaa]/30 bg-[#00ffaa]/10 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-[#00ffaa]",children:"Runtime-Only"}):null]}),b.jsx("button",{type:"button",className:"rounded-xl border border-zinc-800 px-3 py-2 text-xs uppercase tracking-[0.18em] text-zinc-400 lg:hidden",onClick:()=>s(!1),children:"Close"})]})}),b.jsx("nav",{className:"flex-1 space-y-6 overflow-y-auto px-4 py-5 custom-scrollbar",children:a.map(l=>b.jsxs("div",{children:[b.jsx("p",{className:"mb-3 px-2 text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:l.title}),b.jsx("div",{className:"space-y-2",children:l.links.map(c=>b.jsx(Eo,{to:c.to,label:c.label,external:c.external,onNavigate:()=>s(!1)},c.to))})]},l.title))})]})}),o?b.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/60 lg:hidden",onClick:()=>s(!1)}):null,b.jsxs("div",{className:"flex min-h-screen flex-1 flex-col lg:ml-0",children:[b.jsx("header",{className:"sticky top-0 z-20 border-b border-zinc-800/60 bg-[#09090b]/95 backdrop-blur",children:b.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 sm:px-6 lg:px-8",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{type:"button",className:"rounded-2xl border border-zinc-800 bg-zinc-950/70 px-3 py-2 text-[10px] font-bold uppercase tracking-[0.18em] text-zinc-300 lg:hidden",onClick:()=>s(!0),children:"Menu"}),b.jsxs("div",{children:[b.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:"Navigation Shell"}),b.jsx("p",{className:"text-sm text-zinc-300",children:i?"Intentional platform surface":"Unified workspace routing"})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"hidden rounded-2xl border border-zinc-800 bg-zinc-950/70 px-4 py-2 text-right sm:block",children:[b.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-zinc-600",children:"Active Identity"}),b.jsx("p",{className:"text-sm text-zinc-200",children:n?.email||"Unknown user"})]}),b.jsx("button",{type:"button",onClick:t,className:"rounded-2xl bg-[#00ffaa] px-4 py-2 text-[10px] font-black uppercase tracking-[0.18em] text-black transition-colors hover:bg-[#00ffaa]/80",children:"Logout"})]})]})}),b.jsx("main",{className:"flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8",children:b.jsx("div",{className:"min-h-full rounded-[28px] border border-zinc-800/60 bg-zinc-950/40 p-4 shadow-2xl shadow-black/20 sm:p-6 lg:p-8",children:b.jsx(Ne.Outlet,{})})})]})]})}function So({requireAdmin:e=!1}){const t=Ne.useLocation(),{isAdmin:n,isAuthenticated:r}=lt();return r?e&&!n?b.jsx(Ne.Navigate,{to:"/dashboard",replace:!0}):b.jsx(Ne.Outlet,{}):b.jsx(Ne.Navigate,{to:"/login",replace:!0,state:{from:t}})}const Ro={major_mismatch:{bg:"#b91c1c",label:"Incompatible version",message:(e,t)=>`This page (v${t}) is incompatible with the current API (v${e}). Please reload.`,dismissable:!1},minor_mismatch:{bg:"#b45309",label:"API updated",message:(e,t)=>`API updated to v${e} (you have v${t}). Some features may not work correctly.`,dismissable:!0},patch_mismatch:{bg:"#1d4ed8",label:"Minor update available",message:(e,t)=>`API v${e} is available (you have v${t}). Reload when convenient.`,dismissable:!0},client_ahead:{bg:"#4b5563",label:"Client ahead of API",message:(e,t)=>`Client v${t} is ahead of API v${e}. This may indicate a partial rollback.`,dismissable:!0}};function Co({status:e,apiVersion:t,clientVersion:n,onDismiss:r}){const o=Ro[e];return o?b.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:0,left:0,right:0,zIndex:9999,background:o.bg,color:"white",padding:"12px 16px",textAlign:"center",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px"},children:[b.jsxs("strong",{children:[o.label,":"]}),b.jsx("span",{children:o.message(t,n)}),b.jsx("button",{onClick:()=>window.location.reload(),style:{textDecoration:"underline",cursor:"pointer",background:"none",border:"none",color:"white"},children:"Reload"}),o.dismissable&&r?b.jsx("button",{onClick:r,"aria-label":"Dismiss version warning",style:{marginLeft:8,cursor:"pointer",background:"none",border:"none",color:"white",fontSize:"18px",lineHeight:1},children:"×"}):null]}):null}const qt={error:"border-red-500/30 bg-red-950/80 text-red-200",success:"border-emerald-500/30 bg-emerald-950/80 text-emerald-200",info:"border-zinc-600/30 bg-zinc-900/90 text-zinc-200"};function To({toast:e,onDismiss:t}){return e?b.jsxs("div",{role:"alert","aria-live":"assertive",className:`fixed bottom-6 right-6 z-50 max-w-sm rounded-xl border px-4 py-3 text-sm shadow-xl backdrop-blur-sm ${qt[e.type]||qt.error}`,children:[b.jsx("span",{children:e.message}),b.jsx("button",{onClick:t,className:"ml-3 text-xs underline opacity-60 hover:opacity-100","aria-label":"Dismiss",children:"Dismiss"})]}):null}function Oo({lines:e=3,label:t}){const n=["w-full","w-3/4","w-1/2"];return b.jsxs("div",{className:"rounded-2xl border border-zinc-800/50 bg-zinc-950/50 p-6",children:[b.jsx("div",{className:"space-y-3",children:Array.from({length:e},(r,o)=>b.jsx("div",{"data-testid":"loading-panel-line",className:`h-3 rounded bg-zinc-800 animate-pulse ${n[o%n.length]}`},o))}),t?b.jsx("p",{className:"mt-4 text-center text-xs text-zinc-500",children:t}):null]})}function ko({error:e,domain:t,onRetry:n}){if(!e)return null;const r=e?.status??"unknown",o=t||e?.domain||"server";let s=`${o} returned an unexpected error (${r}).`;return r===408?s=`${o} timed out. Check your connection and try again.`:r===429?s=`${o} is rate-limited. Wait a moment and try again.`:r===500?s=`${o} encountered an error. Our team has been notified.`:r===503&&(s=`${o} is temporarily unavailable. Try again in a moment.`),b.jsxs("div",{className:"rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-6 text-center",children:[b.jsx("p",{className:"text-sm text-zinc-400",children:s}),n?b.jsx("button",{type:"button",className:"mt-3 text-xs text-zinc-500 underline",onClick:n,children:"Try again"}):null]})}function Po(e){const[t,n]=$.useState(!1);return $.useEffect(()=>{e||n(!0)},[e]),t}function _o(){return b.jsx("div",{role:"alert",className:"flex min-h-[200px] items-center justify-center rounded-2xl border border-red-500/20 bg-zinc-950/80 p-8 text-center",children:b.jsxs("div",{children:[b.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-red-400",children:"Admin Access Required"}),b.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:"This panel is only available to administrator accounts."})]})})}function No({message:e,hint:t}){return b.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-8 text-center",children:[b.jsx("p",{className:"text-sm text-zinc-400",children:e}),t?b.jsx("p",{className:"mt-1 text-xs text-zinc-600",children:t}):null]})}function Xt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function It(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Xt(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Xt(e[o],null)}}}}function Re(...e){return f.useCallback(It(...e),e)}var $o=Symbol.for("react.lazy"),nt=f[" use ".trim().toString()];function Io(e){return typeof e=="object"&&e!==null&&"then"in e}function Mn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$o&&"_payload"in e&&Io(e._payload)}function Lo(e){const t=Do(e),n=f.forwardRef((r,o)=>{let{children:s,...i}=r;Mn(s)&&typeof nt=="function"&&(s=nt(s._payload));const a=f.Children.toArray(s),l=a.find(zo);if(l){const c=l.props.children,d=a.map(u=>u===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:u);return b.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return b.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Mo=Lo("Slot");function Do(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(Mn(o)&&typeof nt=="function"&&(o=nt(o._payload)),f.isValidElement(o)){const i=Fo(o),a=Uo(s,o.props);return o.type!==f.Fragment&&(a.ref=r?It(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jo=Symbol("radix.slottable");function zo(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jo}function Uo(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Fo(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Dn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Dn(e))&&(r&&(r+=" "),r+=t);return r}const Kt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jt=jn,Go=(e,t)=>n=>{var r;if(t?.variants==null)return Jt(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],u=s?.[c];if(d===null)return null;const m=Kt(d)||Kt(u);return o[c][m]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,m]=d;return m===void 0||(c[u]=m),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:m,...p}=d;return Object.entries(p).every(g=>{let[y,w]=g;return Array.isArray(w)?w.includes({...s,...a}[y]):{...s,...a}[y]===w})?[...c,u,m]:c},[]);return Jt(e,i,l,n?.class,n?.className)},Wo=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vo=(e,t)=>({classGroupId:e,validator:t}),zn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rt="-",Zt=[],Ho="arbitrary..",Bo=e=>{const t=qo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Yo(i);const a=i.split(rt),l=a[0]===""&&a.length>1?1:0;return Un(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?Wo(c,l):l:c||Zt}return n[i]||Zt}}},Un=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=Un(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(rt):e.slice(t).join(rt),l=i.length;for(let c=0;c<l;c++){const d=i[c];if(d.validator(a))return d.classGroupId}},Yo=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Ho+r:void 0})(),qo=e=>{const{theme:t,classGroups:n}=e;return Xo(n,t)},Xo=(e,t)=>{const n=zn();for(const r in e){const o=e[r];Lt(o,n,r,t)}return n},Lt=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Ko(i,t,n,r)}},Ko=(e,t,n,r)=>{if(typeof e=="string"){Jo(e,t,n);return}if(typeof e=="function"){Zo(e,t,n,r);return}Qo(e,t,n,r)},Jo=(e,t,n)=>{const r=e===""?t:Fn(t,e);r.classGroupId=n},Zo=(e,t,n,r)=>{if(es(e)){Lt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vo(n,e))},Qo=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];Lt(l,Fn(t,a),n,r)}},Fn=(e,t)=>{let n=e;const r=t.split(rt),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=zn(),n.nextPart.set(i,a)),n=a}return n},es=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ts=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},St="!",Qt=":",ns=[],en=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),rs=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const d=o.length;for(let y=0;y<d;y++){const w=o[y];if(i===0&&a===0){if(w===Qt){s.push(o.slice(l,y)),l=y+1;continue}if(w==="/"){c=y;continue}}w==="["?i++:w==="]"?i--:w==="("?a++:w===")"&&a--}const u=s.length===0?o:o.slice(l);let m=u,p=!1;u.endsWith(St)?(m=u.slice(0,-1),p=!0):u.startsWith(St)&&(m=u.slice(1),p=!0);const g=c&&c>l?c-l:void 0;return en(s,p,m,g)};if(t){const o=t+Qt,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):en(ns,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},os=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},ss=e=>({cache:ts(e.cacheSize),parseClassName:rs(e),sortModifiers:os(e),postfixLookupClassGroupIds:is(e),...Bo(e)}),is=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},as=/\s+/,ls=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,a=[],l=e.trim().split(as);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:m,modifiers:p,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:w}=n(u);if(m){c=u+(c.length>0?" "+c:c);continue}let x=!!w,E;if(x){const T=y.substring(0,w);E=r(T);const v=E&&i[E]?r(y):void 0;v&&v!==E&&(E=v,x=!1)}else E=r(y);if(!E){if(!x){c=u+(c.length>0?" "+c:c);continue}if(E=r(y),!E){c=u+(c.length>0?" "+c:c);continue}x=!1}const O=p.length===0?"":p.length===1?p[0]:s(p).join(":"),C=g?O+St:O,k=C+E;if(a.indexOf(k)>-1)continue;a.push(k);const P=o(E,x);for(let T=0;T<P.length;++T){const v=P[T];a.push(C+v)}c=u+(c.length>0?" "+c:c)}return c},cs=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Gn(n))&&(o&&(o+=" "),o+=r);return o},Gn=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gn(e[r]))&&(n&&(n+=" "),n+=t);return n},us=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((d,u)=>u(d),e());return n=ss(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const d=ls(l,n);return o(l,d),d};return s=i,(...l)=>s(cs(...l))},ds=[],H=e=>{const t=n=>n[e]||ds;return t.isThemeGetter=!0,t},Wn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fs=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ms=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ps=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,he=e=>fs.test(e),_=e=>!!e&&!Number.isNaN(Number(e)),re=e=>!!e&&Number.isInteger(Number(e)),yt=e=>e.endsWith("%")&&_(e.slice(0,-1)),ae=e=>ms.test(e),Hn=()=>!0,ys=e=>ps.test(e)&&!gs.test(e),Mt=()=>!1,xs=e=>hs.test(e),ws=e=>bs.test(e),vs=e=>!A(e)&&!S(e),Es=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),As=e=>we(e,qn,Mt),A=e=>Wn.test(e),ve=e=>we(e,Xn,ys),tn=e=>we(e,_s,_),Ss=e=>we(e,Jn,Hn),Rs=e=>we(e,Kn,Mt),nn=e=>we(e,Bn,Mt),Cs=e=>we(e,Yn,ws),Je=e=>we(e,Zn,xs),S=e=>Vn.test(e),Fe=e=>Ce(e,Xn),Ts=e=>Ce(e,Kn),rn=e=>Ce(e,Bn),Os=e=>Ce(e,qn),ks=e=>Ce(e,Yn),Ze=e=>Ce(e,Zn,!0),Ps=e=>Ce(e,Jn,!0),we=(e,t,n)=>{const r=Wn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ce=(e,t,n=!1)=>{const r=Vn.exec(e);return r?r[1]?t(r[1]):n:!1},Bn=e=>e==="position"||e==="percentage",Yn=e=>e==="image"||e==="url",qn=e=>e==="length"||e==="size"||e==="bg-size",Xn=e=>e==="length",_s=e=>e==="number",Kn=e=>e==="family-name",Jn=e=>e==="number"||e==="weight",Zn=e=>e==="shadow",Ns=()=>{const e=H("color"),t=H("font"),n=H("text"),r=H("font-weight"),o=H("tracking"),s=H("leading"),i=H("breakpoint"),a=H("container"),l=H("spacing"),c=H("radius"),d=H("shadow"),u=H("inset-shadow"),m=H("text-shadow"),p=H("drop-shadow"),g=H("blur"),y=H("perspective"),w=H("aspect"),x=H("ease"),E=H("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...C(),S,A],P=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],v=()=>[S,A,l],I=()=>[he,"full","auto",...v()],D=()=>[re,"none","subgrid",S,A],B=()=>["auto",{span:["full",re,S,A]},re,S,A],F=()=>[re,"auto",S,A],U=()=>["auto","min","max","fr",S,A],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...v()],M=()=>[he,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],N=()=>[he,"screen","full","dvw","lvw","svw","min","max","fit",...v()],W=()=>[he,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],R=()=>[e,S,A],je=()=>[...C(),rn,nn,{position:[S,A]}],Ye=()=>["no-repeat",{repeat:["","x","y","space","round"]}],qe=()=>["auto","cover","contain",Os,As,{size:[S,A]}],ze=()=>[yt,Fe,ve],Y=()=>["","none","full",c,S,A],q=()=>["",_,Fe,ve],te=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[_,yt,rn,nn],Xe=()=>["","none",g,S,A],Oe=()=>["none",_,S,A],ke=()=>["none",_,S,A],ge=()=>[_,S,A],Ke=()=>[he,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ae],breakpoint:[ae],color:[Hn],container:[ae],"drop-shadow":[ae],ease:["in","out","in-out"],font:[vs],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ae],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ae],shadow:[ae],spacing:["px",_],text:[ae],"text-shadow":[ae],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",he,A,S,w]}],container:["container"],"container-type":[{"@container":["","normal","size",S,A]}],"container-named":[Es],columns:[{columns:[_,A,S,a]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[re,"auto",S,A]}],basis:[{basis:[he,"full","auto",a,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_,he,"auto","initial","none",A]}],grow:[{grow:["",_,S,A]}],shrink:[{shrink:["",_,S,A]}],order:[{order:[re,"first","last","none",S,A]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,Fe,ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ps,Ss]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yt,A]}],"font-family":[{font:[Ts,Rs,t]}],"font-features":[{"font-features":[A]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,S,A]}],"line-clamp":[{"line-clamp":[_,"none",S,tn]}],leading:[{leading:[s,...v()]}],"list-image":[{"list-image":["none",S,A]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",S,A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[_,"from-font","auto",S,ve]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[_,"auto",S,A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"tab-size":[{tab:[re,S,A]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S,A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",S,A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:je()}],"bg-repeat":[{bg:Ye()}],"bg-size":[{bg:qe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},re,S,A],radial:["",S,A],conic:[re,S,A]},ks,Cs]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:ze()}],"gradient-via-pos":[{via:ze()}],"gradient-to-pos":[{to:ze()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_,S,A]}],"outline-w":[{outline:["",_,Fe,ve]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,Ze,Je]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",u,Ze,Je]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[_,ve]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,Ze,Je]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[_,S,A]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[S,A]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[_]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:je()}],"mask-repeat":[{mask:Ye()}],"mask-size":[{mask:qe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",S,A]}],filter:[{filter:["","none",S,A]}],blur:[{blur:Xe()}],brightness:[{brightness:[_,S,A]}],contrast:[{contrast:[_,S,A]}],"drop-shadow":[{"drop-shadow":["","none",p,Ze,Je]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",_,S,A]}],"hue-rotate":[{"hue-rotate":[_,S,A]}],invert:[{invert:["",_,S,A]}],saturate:[{saturate:[_,S,A]}],sepia:[{sepia:["",_,S,A]}],"backdrop-filter":[{"backdrop-filter":["","none",S,A]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[_,S,A]}],"backdrop-contrast":[{"backdrop-contrast":[_,S,A]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_,S,A]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_,S,A]}],"backdrop-invert":[{"backdrop-invert":["",_,S,A]}],"backdrop-opacity":[{"backdrop-opacity":[_,S,A]}],"backdrop-saturate":[{"backdrop-saturate":[_,S,A]}],"backdrop-sepia":[{"backdrop-sepia":["",_,S,A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",S,A]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_,"initial",S,A]}],ease:[{ease:["linear","initial",x,S,A]}],delay:[{delay:[_,S,A]}],animate:[{animate:["none",E,S,A]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,S,A]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[S,A,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],zoom:[{zoom:[re,S,A]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S,A]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S,A]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[_,Fe,ve,tn]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$s=us(Ns);function me(...e){return $s(jn(e))}const Qn=Go("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),er=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Mo:"button";return b.jsx(i,{className:me(Qn({variant:t,size:n,className:e})),ref:s,...o})});er.displayName="Button";const tr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));tr.displayName="Card";const nr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));nr.displayName="CardHeader";const rr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));rr.displayName="CardTitle";const or=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));or.displayName="CardDescription";const sr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));sr.displayName="CardContent";const ir=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));ir.displayName="CardFooter";function le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ar(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i),l=n.length;n=[...n,i];const c=u=>{const{scope:m,children:p,...g}=u,y=m?.[e]?.[l]||a,w=f.useMemo(()=>g,Object.values(g));return b.jsx(y.Provider,{value:w,children:p})};c.displayName=s+"Provider";function d(u,m){const p=m?.[e]?.[l]||a,g=f.useContext(p);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=a?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Is(o,...t)]}function Is(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ls(e){const t=Ms(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(js);if(l){const c=l.props.children,d=a.map(u=>u===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:u);return b.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return b.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Ms(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=Us(o),a=zs(s,o.props);return o.type!==f.Fragment&&(a.ref=r?It(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ds=Symbol("radix.slottable");function js(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ds}function zs(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Us(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=Fs.reduce((e,t)=>{const n=Ls(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gs(e,t){e&&xn.flushSync(()=>e.dispatchEvent(t))}function ct(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ws(e,t=globalThis?.document){const n=ct(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Vs="DismissableLayer",Rt="dismissableLayer.update",Hs="dismissableLayer.pointerDownOutside",Bs="dismissableLayer.focusOutside",on,lr=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=f.useContext(lr),[d,u]=f.useState(null),m=d?.ownerDocument??globalThis?.document,[,p]=f.useState({}),g=Re(t,T=>u(T)),y=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(w),E=d?y.indexOf(d):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,C=E>=x,k=Xs(T=>{const v=T.target,I=[...c.branches].some(D=>D.contains(v));!C||I||(o?.(T),i?.(T),T.defaultPrevented||a?.())},m),P=Ks(T=>{const v=T.target;[...c.branches].some(D=>D.contains(v))||(s?.(T),i?.(T),T.defaultPrevented||a?.())},m);return Ws(T=>{E===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},m),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(on=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),sn(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=on)}},[d,m,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),sn())},[d,c]),f.useEffect(()=>{const T=()=>p({});return document.addEventListener(Rt,T),()=>document.removeEventListener(Rt,T)},[]),b.jsx(Te.div,{...l,ref:g,style:{pointerEvents:O?C?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,P.onFocusCapture),onBlurCapture:le(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,k.onPointerDownCapture)})});cr.displayName=Vs;var Ys="DismissableLayerBranch",qs=f.forwardRef((e,t)=>{const n=f.useContext(lr),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),b.jsx(Te.div,{...e,ref:o})});qs.displayName=Ys;function Xs(e,t=globalThis?.document){const n=ct(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){ur(Hs,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ks(e,t=globalThis?.document){const n=ct(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&ur(Bs,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sn(){const e=new CustomEvent(Rt);document.dispatchEvent(e)}function ur(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Gs(o,s):o.dispatchEvent(s)}var Ae=globalThis?.document?f.useLayoutEffect:()=>{},Js=f[" useId ".trim().toString()]||(()=>{}),Zs=0;function Qs(e){const[t,n]=f.useState(Js());return Ae(()=>{n(r=>r??String(Zs++))},[e]),t?`radix-${t}`:""}const ei=["top","right","bottom","left"],be=Math.min,X=Math.max,ot=Math.round,Qe=Math.floor,se=e=>({x:e,y:e}),ti={left:"right",right:"left",bottom:"top",top:"bottom"};function Ct(e,t,n){return X(e,be(t,n))}function ue(e,t){return typeof e=="function"?e(t):e}function de(e){return e.split("-")[0]}function Me(e){return e.split("-")[1]}function Dt(e){return e==="x"?"y":"x"}function jt(e){return e==="y"?"height":"width"}function oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zt(e){return Dt(oe(e))}function ni(e,t,n){n===void 0&&(n=!1);const r=Me(e),o=zt(e),s=jt(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=st(i)),[i,st(i)]}function ri(e){const t=st(e);return[Tt(e),t,Tt(t)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const an=["left","right"],ln=["right","left"],oi=["top","bottom"],si=["bottom","top"];function ii(e,t,n){switch(e){case"top":case"bottom":return n?t?ln:an:t?an:ln;case"left":case"right":return t?oi:si;default:return[]}}function ai(e,t,n,r){const o=Me(e);let s=ii(de(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Tt)))),s}function st(e){const t=de(e);return ti[t]+e.slice(t.length)}function li(e){return{top:0,right:0,bottom:0,left:0,...e}}function dr(e){return typeof e!="number"?li(e):{top:e,right:e,bottom:e,left:e}}function it(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function cn(e,t,n){let{reference:r,floating:o}=e;const s=oe(t),i=zt(t),a=jt(i),l=de(t),c=s==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Me(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}async function ci(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:p=0}=ue(t,e),g=dr(p),w=a[m?u==="floating"?"reference":"floating":u],x=it(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),E=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},k=it(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:O,strategy:l}):E);return{top:(x.top-k.top+g.top)/C.y,bottom:(k.bottom-x.bottom+g.bottom)/C.y,left:(x.left-k.left+g.left)/C.x,right:(k.right-x.right+g.right)/C.x}}const ui=50,di=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:ci},l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=cn(c,r,l),m=r,p=0;const g={};for(let y=0;y<s.length;y++){const w=s[y];if(!w)continue;const{name:x,fn:E}=w,{x:O,y:C,data:k,reset:P}=await E({x:d,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});d=O??d,u=C??u,g[x]={...g[x],...k},P&&p<ui&&(p++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(c=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:u}=cn(c,m,l)),y=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:g}},fi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ue(e,t)||{};if(c==null)return{};const u=dr(d),m={x:n,y:r},p=zt(o),g=jt(p),y=await i.getDimensions(c),w=p==="y",x=w?"top":"left",E=w?"bottom":"right",O=w?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[p]-m[p]-s.floating[g],k=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let T=P?P[O]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=a.floating[O]||s.floating[g]);const v=C/2-k/2,I=T/2-y[g]/2-1,D=be(u[x],I),B=be(u[E],I),F=D,U=T-y[g]-B,j=T/2-y[g]/2+v,G=Ct(F,j,U),L=!l.arrow&&Me(o)!=null&&j!==G&&s.reference[g]/2-(j<F?D:B)-y[g]/2<0,M=L?j<F?j-F:j-U:0;return{[p]:m[p]+M,data:{[p]:G,centerOffset:j-G-M,...L&&{alignmentOffset:M}},reset:L}}}),mi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=ue(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=de(o),E=oe(a),O=de(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=m||(O||!y?[st(a)]:ri(a)),P=g!=="none";!m&&P&&k.push(...ai(a,y,g,C));const T=[a,...k],v=await l.detectOverflow(t,w),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&I.push(v[x]),u){const j=ni(o,i,C);I.push(v[j[0]],v[j[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(j=>j<=0)){var B,F;const j=(((B=s.flip)==null?void 0:B.index)||0)+1,G=T[j];if(G&&(!(u==="alignment"?E!==oe(G):!1)||D.every(N=>oe(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:j,overflows:D},reset:{placement:G}};let L=(F=D.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(p){case"bestFit":{var U;const M=(U=D.filter(N=>{if(P){const W=oe(N.placement);return W===E||W==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(W=>W>0).reduce((W,R)=>W+R,0)]).sort((N,W)=>N[1]-W[1])[0])==null?void 0:U[0];M&&(L=M);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function un(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dn(e){return ei.some(t=>e[t]>=0)}const pi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=ue(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=un(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:dn(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=un(i,n.floating);return{data:{escapedOffsets:a,escaped:dn(a)}}}default:return{}}}}},fr=new Set(["left","top"]);async function gi(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=de(n),a=Me(n),l=oe(n)==="y",c=fr.has(i)?-1:1,d=s&&l?-1:1,u=ue(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:m*c}:{x:m*c,y:p*d}}const hi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await gi(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},bi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:E,y:O}=x;return{x:E,y:O}}},...c}=ue(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),m=oe(de(o)),p=Dt(m);let g=d[p],y=d[m];if(i){const x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",O=g+u[x],C=g-u[E];g=Ct(O,g,C)}if(a){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=y+u[x],C=y-u[E];y=Ct(O,y,C)}const w=l.fn({...t,[p]:g,[m]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:i,[m]:a}}}}}},yi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ue(e,t),d={x:n,y:r},u=oe(o),m=Dt(u);let p=d[m],g=d[u];const y=ue(a,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const O=m==="y"?"height":"width",C=s.reference[m]-s.floating[O]+w.mainAxis,k=s.reference[m]+s.reference[O]-w.mainAxis;p<C?p=C:p>k&&(p=k)}if(c){var x,E;const O=m==="y"?"width":"height",C=fr.has(de(o)),k=s.reference[u]-s.floating[O]+(C&&((x=i.offset)==null?void 0:x[u])||0)+(C?0:w.crossAxis),P=s.reference[u]+s.reference[O]+(C?0:((E=i.offset)==null?void 0:E[u])||0)-(C?w.crossAxis:0);g<k?g=k:g>P&&(g=P)}return{[m]:p,[u]:g}}}},xi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=ue(e,t),d=await i.detectOverflow(t,c),u=de(o),m=Me(o),p=oe(o)==="y",{width:g,height:y}=s.floating;let w,x;u==="top"||u==="bottom"?(w=u,x=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=u,w=m==="end"?"top":"bottom");const E=y-d.top-d.bottom,O=g-d.left-d.right,C=be(y-d[w],E),k=be(g-d[x],O),P=!t.middlewareData.shift;let T=C,v=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(v=O),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),P&&!m){const D=X(d.left,0),B=X(d.right,0),F=X(d.top,0),U=X(d.bottom,0);p?v=g-2*(D!==0||B!==0?D+B:X(d.left,d.right)):T=y-2*(F!==0||U!==0?F+U:X(d.top,d.bottom))}await l({...t,availableWidth:v,availableHeight:T});const I=await i.getDimensions(a.floating);return g!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function De(e){return mr(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ie(e){var t;return(t=(mr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mr(e){return ut()?e instanceof Node||e instanceof J(e).Node:!1}function Z(e){return ut()?e instanceof Element||e instanceof J(e).Element:!1}function pe(e){return ut()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function fn(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function Be(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function wi(e){return/^(table|td|th)$/.test(De(e))}function dt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const vi=/transform|translate|scale|rotate|perspective|filter/,Ei=/paint|layout|strict|content/,Ee=e=>!!e&&e!=="none";let xt;function Ut(e){const t=Z(e)?Q(e):e;return Ee(t.transform)||Ee(t.translate)||Ee(t.scale)||Ee(t.rotate)||Ee(t.perspective)||!Ft()&&(Ee(t.backdropFilter)||Ee(t.filter))||vi.test(t.willChange||"")||Ei.test(t.contain||"")}function Ai(e){let t=ye(e);for(;pe(t)&&!Ie(t);){if(Ut(t))return t;if(dt(t))return null;t=ye(t)}return null}function Ft(){return xt==null&&(xt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xt}function Ie(e){return/^(html|body|#document)$/.test(De(e))}function Q(e){return J(e).getComputedStyle(e)}function ft(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ye(e){if(De(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fn(e)&&e.host||ie(e);return fn(t)?t.host:t}function pr(e){const t=ye(e);return Ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Be(t)?t:pr(t)}function Ve(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=J(o);if(s){const a=Ot(i);return t.concat(i,i.visualViewport||[],Be(o)?o:[],a&&n?Ve(a):[])}else return t.concat(o,Ve(o,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gr(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ot(n)!==s||ot(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Gt(e){return Z(e)?e:e.contextElement}function $e(e){const t=Gt(e);if(!pe(t))return se(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gr(t);let i=(s?ot(n.width):n.width)/r,a=(s?ot(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Si=se(0);function hr(e){const t=J(e);return!Ft()||!t.visualViewport?Si:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ri(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==J(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Gt(e);let i=se(1);t&&(r?Z(r)&&(i=$e(r)):i=$e(e));const a=Ri(s,n,r)?hr(s):se(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const m=J(s),p=r&&Z(r)?J(r):r;let g=m,y=Ot(g);for(;y&&r&&p!==g;){const w=$e(y),x=y.getBoundingClientRect(),E=Q(y),O=x.left+(y.clientLeft+parseFloat(E.paddingLeft))*w.x,C=x.top+(y.clientTop+parseFloat(E.paddingTop))*w.y;l*=w.x,c*=w.y,d*=w.x,u*=w.y,l+=O,c+=C,g=J(y),y=Ot(g)}}return it({width:d,height:u,x:l,y:c})}function mt(e,t){const n=ft(e).scrollLeft;return t?t.left+n:Se(ie(e)).left+n}function br(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ci(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ie(r),a=t?dt(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=se(1);const d=se(0),u=pe(r);if((u||!u&&!s)&&((De(r)!=="body"||Be(i))&&(l=ft(r)),u)){const p=Se(r);c=$e(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const m=i&&!u&&!s?br(i,l):se(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}}function Ti(e){return Array.from(e.getClientRects())}function Oi(e){const t=ie(e),n=ft(e),r=e.ownerDocument.body,o=X(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=X(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+mt(e);const a=-n.scrollTop;return Q(r).direction==="rtl"&&(i+=X(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const mn=25;function ki(e,t){const n=J(e),r=ie(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Ft();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=mt(r);if(c<=0){const d=r.ownerDocument,u=d.body,m=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-u.clientWidth-p);g<=mn&&(s-=g)}else c<=mn&&(s+=c);return{width:s,height:i,x:a,y:l}}function Pi(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=pe(e)?$e(e):se(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function pn(e,t,n){let r;if(t==="viewport")r=ki(e,n);else if(t==="document")r=Oi(ie(e));else if(Z(t))r=Pi(t,n);else{const o=hr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return it(r)}function yr(e,t){const n=ye(e);return n===t||!Z(n)||Ie(n)?!1:Q(n).position==="fixed"||yr(n,t)}function _i(e,t){const n=t.get(e);if(n)return n;let r=Ve(e,[],!1).filter(a=>Z(a)&&De(a)!=="body"),o=null;const s=Q(e).position==="fixed";let i=s?ye(e):e;for(;Z(i)&&!Ie(i);){const a=Q(i),l=Ut(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Be(i)&&!l&&yr(e,i))?r=r.filter(d=>d!==i):o=a,i=ye(i)}return t.set(e,r),r}function Ni(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?dt(t)?[]:_i(t,this._c):[].concat(n),r],a=pn(t,i[0],o);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let m=1;m<i.length;m++){const p=pn(t,i[m],o);l=X(p.top,l),c=be(p.right,c),d=be(p.bottom,d),u=X(p.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function $i(e){const{width:t,height:n}=gr(e);return{width:t,height:n}}function Ii(e,t,n){const r=pe(t),o=ie(t),s=n==="fixed",i=Se(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=se(0);function c(){l.x=mt(o)}if(r||!r&&!s)if((De(t)!=="body"||Be(o))&&(a=ft(t)),r){const p=Se(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?br(o,a):se(0),u=i.left+a.scrollLeft-l.x-d.x,m=i.top+a.scrollTop-l.y-d.y;return{x:u,y:m,width:i.width,height:i.height}}function wt(e){return Q(e).position==="static"}function gn(e,t){if(!pe(e)||Q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ie(e)===n&&(n=n.ownerDocument.body),n}function xr(e,t){const n=J(e);if(dt(e))return n;if(!pe(e)){let o=ye(e);for(;o&&!Ie(o);){if(Z(o)&&!wt(o))return o;o=ye(o)}return n}let r=gn(e,t);for(;r&&wi(r)&&wt(r);)r=gn(r,t);return r&&Ie(r)&&wt(r)&&!Ut(r)?n:r||Ai(e)||n}const Li=async function(e){const t=this.getOffsetParent||xr,n=this.getDimensions,r=await n(e.floating);return{reference:Ii(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mi(e){return Q(e).direction==="rtl"}const Di={convertOffsetParentRelativeRectToViewportRelativeRect:Ci,getDocumentElement:ie,getClippingRect:Ni,getOffsetParent:xr,getElementRects:Li,getClientRects:Ti,getDimensions:$i,getScale:$e,isElement:Z,isRTL:Mi};function wr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ji(e,t){let n=null,r;const o=ie(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:p}=c;if(a||t(),!m||!p)return;const g=Qe(u),y=Qe(o.clientWidth-(d+m)),w=Qe(o.clientHeight-(u+p)),x=Qe(d),O={rootMargin:-g+"px "+-y+"px "+-w+"px "+-x+"px",threshold:X(0,be(1,l))||1};let C=!0;function k(P){const T=P[0].intersectionRatio;if(T!==l){if(!C)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!wr(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(k,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,O)}n.observe(e)}return i(!0),s}function zi(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Gt(e),d=o||s?[...c?Ve(c):[],...t?Ve(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const u=c&&a?ji(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let g,y=l?Se(e):null;l&&w();function w(){const x=Se(e);y&&!wr(y,x)&&n(),y=x,g=requestAnimationFrame(w)}return n(),()=>{var x;d.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),u?.(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const Ui=hi,Fi=bi,Gi=mi,Wi=xi,Vi=pi,hn=fi,Hi=yi,Bi=(e,t,n)=>{const r=new Map,o={platform:Di,...n},s={...o.platform,_c:r};return di(e,t,{...o,platform:s})};var Yi=typeof document<"u",qi=function(){},tt=Yi?$.useLayoutEffect:qi;function at(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!at(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!at(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function vr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bn(e,t){const n=vr(e);return Math.round(t*n)/n}function vt(e){const t=f.useRef(e);return tt(()=>{t.current=e}),t}function Xi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(r);at(m,r)||p(r);const[g,y]=f.useState(null),[w,x]=f.useState(null),E=f.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),O=f.useCallback(N=>{N!==T.current&&(T.current=N,x(N))},[]),C=s||g,k=i||w,P=f.useRef(null),T=f.useRef(null),v=f.useRef(d),I=l!=null,D=vt(l),B=vt(o),F=vt(c),U=f.useCallback(()=>{if(!P.current||!T.current)return;const N={placement:t,strategy:n,middleware:m};B.current&&(N.platform=B.current),Bi(P.current,T.current,N).then(W=>{const R={...W,isPositioned:F.current!==!1};j.current&&!at(v.current,R)&&(v.current=R,xn.flushSync(()=>{u(R)}))})},[m,t,n,B,F]);tt(()=>{c===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[c]);const j=f.useRef(!1);tt(()=>(j.current=!0,()=>{j.current=!1}),[]),tt(()=>{if(C&&(P.current=C),k&&(T.current=k),C&&k){if(D.current)return D.current(C,k,U);U()}},[C,k,U,D,I]);const G=f.useMemo(()=>({reference:P,floating:T,setReference:E,setFloating:O}),[E,O]),L=f.useMemo(()=>({reference:C,floating:k}),[C,k]),M=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!L.floating)return N;const W=bn(L.floating,d.x),R=bn(L.floating,d.y);return a?{...N,transform:"translate("+W+"px, "+R+"px)",...vr(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:R}},[n,a,L.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:U,refs:G,elements:L,floatingStyles:M}),[d,U,G,L,M])}const Ki=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hn({element:r.current,padding:o}).fn(n):{}:r?hn({element:r,padding:o}).fn(n):{}}}},Ji=(e,t)=>{const n=Ui(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zi=(e,t)=>{const n=Fi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qi=(e,t)=>({fn:Hi(e).fn,options:[e,t]}),ea=(e,t)=>{const n=Gi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ta=(e,t)=>{const n=Wi(e);return{name:n.name,fn:n.fn,options:[e,t]}},na=(e,t)=>{const n=Vi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ra=(e,t)=>{const n=Ki(e);return{name:n.name,fn:n.fn,options:[e,t]}};var oa="Arrow",Er=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return b.jsx(Te.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});Er.displayName=oa;var sa=Er;function ia(e){const[t,n]=f.useState(void 0);return Ae(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Wt="Popper",[Ar,Sr]=ar(Wt),[aa,Rr]=Ar(Wt),Cr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return b.jsx(aa,{scope:t,anchor:r,onAnchorChange:o,children:n})};Cr.displayName=Wt;var Tr="PopperAnchor",Or=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Rr(Tr,n),i=f.useRef(null),a=Re(t,i),l=f.useRef(null);return f.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:b.jsx(Te.div,{...o,ref:a})});Or.displayName=Tr;var Vt="PopperContent",[la,ca]=Ar(Vt),kr=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:g,...y}=e,w=Rr(Vt,n),[x,E]=f.useState(null),O=Re(t,te=>E(te)),[C,k]=f.useState(null),P=ia(C),T=P?.width??0,v=P?.height??0,I=r+(s!=="center"?"-"+s:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(c)?c:[c],F=B.length>0,U={padding:D,boundary:B.filter(da),altBoundary:F},{refs:j,floatingStyles:G,placement:L,isPositioned:M,middlewareData:N}=Xi({strategy:"fixed",placement:I,whileElementsMounted:(...te)=>zi(...te,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[Ji({mainAxis:o+v,alignmentAxis:i}),l&&Zi({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Qi():void 0,...U}),l&&ea({...U}),ta({...U,apply:({elements:te,rects:Ue,availableWidth:V,availableHeight:Xe})=>{const{width:Oe,height:ke}=Ue.reference,ge=te.floating.style;ge.setProperty("--radix-popper-available-width",`${V}px`),ge.setProperty("--radix-popper-available-height",`${Xe}px`),ge.setProperty("--radix-popper-anchor-width",`${Oe}px`),ge.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&ra({element:C,padding:a}),fa({arrowWidth:T,arrowHeight:v}),m&&na({strategy:"referenceHidden",...U})]}),[W,R]=Nr(L),je=ct(g);Ae(()=>{M&&je?.()},[M,je]);const Ye=N.arrow?.x,qe=N.arrow?.y,ze=N.arrow?.centerOffset!==0,[Y,q]=f.useState();return Ae(()=>{x&&q(window.getComputedStyle(x).zIndex)},[x]),b.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:M?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(la,{scope:n,placedSide:W,onArrowChange:k,arrowX:Ye,arrowY:qe,shouldHideArrow:ze,children:b.jsx(Te.div,{"data-side":W,"data-align":R,...y,ref:O,style:{...y.style,animation:M?void 0:"none"}})})})});kr.displayName=Vt;var Pr="PopperArrow",ua={top:"bottom",right:"left",bottom:"top",left:"right"},_r=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ca(Pr,r),i=ua[s.placedSide];return b.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:b.jsx(sa,{...o,ref:n,style:{...o.style,display:"block"}})})});_r.displayName=Pr;function da(e){return e!==null}var fa=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=Nr(n),u={start:"0%",center:"50%",end:"100%"}[d],m=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let g="",y="";return c==="bottom"?(g=i?u:`${m}px`,y=`${-l}px`):c==="top"?(g=i?u:`${m}px`,y=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,y=i?u:`${p}px`):c==="left"&&(g=`${r.floating.width+l}px`,y=i?u:`${p}px`),{data:{x:g,y}}}});function Nr(e){const[t,n="center"]=e.split("-");return[t,n]}var ma=Cr,pa=Or,ga=kr,ha=_r;function ba(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var $r=e=>{const{present:t,children:n}=e,r=ya(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=Re(r.ref,xa(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};$r.displayName="Presence";function ya(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,l]=ba(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=et(r.current);s.current=a==="mounted"?c:"none"},[a]),Ae(()=>{const c=r.current,d=o.current;if(d!==e){const m=s.current,p=et(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ae(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=p=>{const y=et(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(l("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=p=>{p.target===t&&(s.current=et(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function et(e){return e?.animationName||"none"}function xa(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wa=Symbol("radix.slottable");function va(e){const t=({children:n})=>b.jsx(b.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wa,t}var Ea=f[" useInsertionEffect ".trim().toString()]||Ae;function Aa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Sa({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=f.useCallback(d=>{if(a){const u=Ra(d)?d(e):d;u!==e&&i.current?.(u)}else s(d)},[a,e,s,i]);return[l,c]}function Sa({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Ea(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Ra(e){return typeof e=="function"}var Ca=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ta="VisuallyHidden",Ir=f.forwardRef((e,t)=>b.jsx(Te.span,{...e,ref:t,style:{...Ca,...e.style}}));Ir.displayName=Ta;var Oa=Ir,[pt]=ar("Tooltip",[Sr]),gt=Sr(),Lr="TooltipProvider",ka=700,kt="tooltip.open",[Pa,Ht]=pt(Lr),Mr=e=>{const{__scopeTooltip:t,delayDuration:n=ka,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),b.jsx(Pa,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};Mr.displayName=Lr;var He="Tooltip",[_a,ht]=pt(He),Dr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Ht(He,e.__scopeTooltip),c=gt(t),[d,u]=f.useState(null),m=Qs(),p=f.useRef(0),g=i??l.disableHoverableContent,y=a??l.delayDuration,w=f.useRef(!1),[x,E]=Aa({prop:r,defaultProp:o??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(kt))):l.onClose(),s?.(T)},caller:He}),O=f.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),C=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w.current=!1,E(!0)},[E]),k=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,E(!1)},[E]),P=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{w.current=!0,E(!0),p.current=0},y)},[y,E]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),b.jsx(ma,{...c,children:b.jsx(_a,{scope:t,contentId:m,open:x,stateAttribute:O,trigger:d,onTriggerChange:u,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayedRef.current?P():C()},[l.isOpenDelayedRef,P,C]),onTriggerLeave:f.useCallback(()=>{g?k():(window.clearTimeout(p.current),p.current=0)},[k,g]),onOpen:C,onClose:k,disableHoverableContent:g,children:n})})};Dr.displayName=He;var Pt="TooltipTrigger",jr=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ht(Pt,n),s=Ht(Pt,n),i=gt(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),u=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),b.jsx(pa,{asChild:!0,...i,children:b.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:le(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:le(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:le(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:le(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:le(e.onBlur,o.onClose),onClick:le(e.onClick,o.onClose)})})});jr.displayName=Pt;var Na="TooltipPortal",[tl,$a]=pt(Na,{forceMount:void 0}),Le="TooltipContent",zr=f.forwardRef((e,t)=>{const n=$a(Le,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=ht(Le,e.__scopeTooltip);return b.jsx($r,{present:r||i.open,children:i.disableHoverableContent?b.jsx(Ur,{side:o,...s,ref:t}):b.jsx(Ia,{side:o,...s,ref:t})})}),Ia=f.forwardRef((e,t)=>{const n=ht(Le,e.__scopeTooltip),r=Ht(Le,e.__scopeTooltip),o=f.useRef(null),s=Re(t,o),[i,a]=f.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:u}=r,m=f.useCallback(()=>{a(null),u(!1)},[u]),p=f.useCallback((g,y)=>{const w=g.currentTarget,x={x:g.clientX,y:g.clientY},E=za(x,w.getBoundingClientRect()),O=Ua(x,E),C=Fa(y.getBoundingClientRect()),k=Wa([...O,...C]);a(k),u(!0)},[u]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(l&&d){const g=w=>p(w,d),y=w=>p(w,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",y)}}},[l,d,p,m]),f.useEffect(()=>{if(i){const g=y=>{const w=y.target,x={x:y.clientX,y:y.clientY},E=l?.contains(w)||d?.contains(w),O=!Ga(x,i);E?m():O&&(m(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,i,c,m]),b.jsx(Ur,{...e,ref:s})}),[La,Ma]=pt(He,{isInside:!1}),Da=va("TooltipContent"),Ur=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=ht(Le,n),c=gt(n),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(kt,d),()=>document.removeEventListener(kt,d)),[d]),f.useEffect(()=>{if(l.trigger){const u=m=>{m.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),b.jsx(cr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:b.jsxs(ga,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[b.jsx(Da,{children:r}),b.jsx(La,{scope:n,isInside:!0,children:b.jsx(Oa,{id:l.contentId,role:"tooltip",children:o||r})})]})})});zr.displayName=Le;var Fr="TooltipArrow",ja=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gt(n);return Ma(Fr,n).isInside?null:b.jsx(ha,{...o,...r,ref:t})});ja.displayName=Fr;function za(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ua(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Fa(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Ga(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,u=l.x,m=l.y;d>r!=m>r&&n<(u-c)*(r-d)/(m-d)+c&&(o=!o)}return o}function Wa(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Va(t)}function Va(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ha=Mr,Ba=Dr,Ya=jr,Gr=zr;const qa=Ha,Xa=Ba,Ka=Ya,Wr=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>b.jsx(Gr,{ref:r,sideOffset:t,className:me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));Wr.displayName=Gr.displayName;const Ja="agent-approval-count-changed";function Za(e,t){if(e.length>0){const n=e[e.length-1];if(n&&typeof n=="object"&&!Array.isArray(n))return[...e.slice(0,-1),{...n,signal:t}]}return[...e,{signal:t}]}function Qa(e,t={}){const{domain:n="server",onSuccess:r,onError:o}=t,[s,i]=$.useState(!1),[a,l]=$.useState(null),[c,d]=$.useState(null),u=$.useRef(!0),m=$.useRef(null);$.useEffect(()=>(u.current=!0,()=>{u.current=!1,m.current&&m.current.abort()}),[]);const p=$.useCallback(()=>{u.current&&(l(null),d(null))},[]),g=$.useCallback(async(...y)=>{m.current&&m.current.abort();const w=new AbortController;m.current=w,u.current&&(i(!0),l(null));try{const x=await e(...Za(y,w.signal));return!u.current||w.signal.aborted?null:(d(x),r?.(x),x)}catch(x){if(!u.current||w.signal.aborted)return null;if(x instanceof K){if(x.domain=n,x.status===401)return null;x.status===408&&(x.message=`${n} timed out. Check your connection and try again.`)}return l(x),o?.(x),null}finally{m.current===w&&(m.current=null),u.current&&!w.signal.aborted&&i(!1)}},[e,n,o,r]);return{loading:s,error:a,data:c,execute:g,reset:p}}function el(){const[e,t]=$.useState(null),n=$.useCallback((o,s="error")=>{t({message:String(o),type:s}),setTimeout(()=>t(null),4e3)},[]),r=$.useCallback(()=>t(null),[]);return{toast:e,showToast:n,clearToast:r}}exports.API_BASE=At;exports.APPROVAL_EVENT=Ja;exports.AdminAccessRequired=_o;exports.ApiError=K;exports.AppShell=Ao;exports.AuthProvider=bo;exports.Button=er;exports.Card=tr;exports.CardContent=sr;exports.CardDescription=or;exports.CardFooter=ir;exports.CardHeader=nr;exports.CardTitle=rr;exports.DomainError=ko;exports.EmptyState=No;exports.FEATURE_FLAGS=Zr;exports.LoadingPanel=Oo;exports.ProtectedRoute=So;exports.ROUTES=fe;exports.SystemProvider=yo;exports.Toast=To;exports.Tooltip=Xa;exports.TooltipContent=Wr;exports.TooltipProvider=qa;exports.TooltipTrigger=Ka;exports.VersionMismatchBanner=Co;exports.adminRequest=Kr;exports.authRequest=Cn;exports.authRequestExternal=Jr;exports.bootIdentity=_n;exports.buildApiUrl=An;exports.buttonVariants=Qn;exports.changePassword=Pn;exports.clearStoredToken=_e;exports.cn=me;exports.forgotPassword=po;exports.getStoredToken=ce;exports.loginUser=Tn;exports.registerUser=On;exports.request=ee;exports.requestAbsolute=$t;exports.resetPassword=go;exports.safeArray=Hr;exports.safeMap=Et;exports.setStoredToken=Ge;exports.taggedRequest=Yr;exports.unwrapEnvelope=xe;exports.useAdminApiGuard=Po;exports.useApiCall=Qa;exports.useAuth=lt;exports.useSystem=Ln;exports.useToast=el;exports.verifyEmail=kn;
2
2
  //# sourceMappingURL=index.cjs.map