titan-agent 5.0.2 → 5.0.3
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/agent/agent.js +48 -3
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLoop.js +83 -5
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/commandPost.js +1 -1
- package/dist/agent/commandPost.js.map +1 -1
- package/dist/agent/goalProposer.js +2 -2
- package/dist/agent/goalProposer.js.map +1 -1
- package/dist/agent/missionDriver.js +1 -1
- package/dist/agent/missionDriver.js.map +1 -1
- package/dist/agent/promptBudget.js +85 -0
- package/dist/agent/promptBudget.js.map +1 -0
- package/dist/agent/structuredSpawn.js +1 -1
- package/dist/agent/structuredSpawn.js.map +1 -1
- package/dist/agent/subtaskTaxonomy.js +1 -1
- package/dist/agent/subtaskTaxonomy.js.map +1 -1
- package/dist/agent/systemPromptParts.js +10 -1
- package/dist/agent/systemPromptParts.js.map +1 -1
- package/dist/agent/toolRunner.js +16 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/agent/toolSearch.js +4 -1
- package/dist/agent/toolSearch.js.map +1 -1
- package/dist/analytics/bugReports.js +1 -1
- package/dist/analytics/bugReports.js.map +1 -1
- package/dist/channels/messenger.js +1 -1
- package/dist/channels/messenger.js.map +1 -1
- package/dist/eval/harness.js +141 -0
- package/dist/eval/harness.js.map +1 -0
- package/dist/gateway/server.js +374 -74
- package/dist/gateway/server.js.map +1 -1
- package/dist/hooks/shellHooks.js +1 -1
- package/dist/hooks/shellHooks.js.map +1 -1
- package/dist/lib/auto-heal/repair-strategies.js.map +1 -1
- package/dist/memory/promptIncludes.js +58 -0
- package/dist/memory/promptIncludes.js.map +1 -0
- package/dist/organism/alertsStore.js +70 -0
- package/dist/organism/alertsStore.js.map +1 -0
- package/dist/plugins/memoryRetrieval.js.map +1 -1
- package/dist/providers/ollama.js +7 -7
- package/dist/providers/ollama.js.map +1 -1
- package/dist/safety/invariants.js +60 -0
- package/dist/safety/invariants.js.map +1 -0
- package/dist/safety/opusReview.js +1 -1
- package/dist/safety/opusReview.js.map +1 -1
- package/dist/security/commandScanner.js +2 -2
- package/dist/security/commandScanner.js.map +1 -1
- package/dist/security/secretGuard.js +4 -4
- package/dist/security/secretGuard.js.map +1 -1
- package/dist/skills/builtin/widget_gallery.js +28 -1
- package/dist/skills/builtin/widget_gallery.js.map +1 -1
- package/dist/skills/frontmatterLoader.js +119 -0
- package/dist/skills/frontmatterLoader.js.map +1 -0
- package/dist/skills/registry.js +20 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/testing/testHealthMonitor.js +1 -2
- package/dist/testing/testHealthMonitor.js.map +1 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/replyQuality.js +1 -1
- package/dist/utils/replyQuality.js.map +1 -1
- package/dist/utils/tokens.js +1 -1
- package/dist/utils/tokens.js.map +1 -1
- package/docs/bleeding-edge-agents-2026.md +450 -0
- package/docs/langchain-analysis.md +598 -0
- package/docs/langchain-code-analysis.md +363 -0
- package/docs/space-agent-analysis.md +300 -0
- package/package.json +1 -1
- package/ui/dist/assets/{AuditPanel-G7YA1HzV.js → AuditPanel-B84Mp16G.js} +2 -2
- package/ui/dist/assets/AutonomyPanel-DOtiTFxV.js +11 -0
- package/ui/dist/assets/{AutopilotPanel-CHRjxdh0.js → AutopilotPanel-nTb1Dnru.js} +1 -1
- package/ui/dist/assets/AutoresearchPanel-D46mX8VF.js +6 -0
- package/ui/dist/assets/BackupPanel-DGM1XXbG.js +1 -0
- package/ui/dist/assets/BrowserPanel-Cn1tTN3y.js +6 -0
- package/ui/dist/assets/{CPAgents-D5533PhK.js → CPAgents-CEraUkME.js} +1 -1
- package/ui/dist/assets/{CPDashboard-C-GgqDsI.js → CPDashboard-B_yidGAe.js} +2 -2
- package/ui/dist/assets/CPFiles-BBS8jtYH.js +1 -0
- package/ui/dist/assets/CPGoals-DL5v21TZ.js +1 -0
- package/ui/dist/assets/CPInbox-CyLQJBYF.js +11 -0
- package/ui/dist/assets/{CPSocial-mUQsrSh5.js → CPSocial-BkEtQ1Um.js} +3 -3
- package/ui/dist/assets/ChannelsPanel-CD2kHhA5.js +1 -0
- package/ui/dist/assets/CheckpointsPanel-BrUTFPu_.js +1 -0
- package/ui/dist/assets/CommandPostHub-BPPaUv1B.js +29 -0
- package/ui/dist/assets/CronPanel-CsfQctFp.js +1 -0
- package/ui/dist/assets/DaemonPanel-CNUggBbL.js +1 -0
- package/ui/dist/assets/DataTable-DuAEp_QJ.js +1 -0
- package/ui/dist/assets/{EmptyState-D60-wQrz.js → EmptyState-DFrAEZDm.js} +1 -1
- package/ui/dist/assets/EvalPanel-DEX0a5-b.js +1 -0
- package/ui/dist/assets/{FilesPanel-BNN3h_HW.js → FilesPanel-DATsiAqG.js} +1 -1
- package/ui/dist/assets/FleetPanel-QYQKqx4W.js +1 -0
- package/ui/dist/assets/{HomelabPanel-1mfhRBh6.js → HomelabPanel-DhuXd3ZD.js} +2 -2
- package/ui/dist/assets/{InfraView-Df6SFI7b.js → InfraView-eS7cpESw.js} +2 -2
- package/ui/dist/assets/InlineEditableField-zIAnW4AR.js +1 -0
- package/ui/dist/assets/{Input-DYukme8A.js → Input-bFsLI0fq.js} +1 -1
- package/ui/dist/assets/IntegrationsPanel-C_FswSRN.js +1 -0
- package/ui/dist/assets/IntelligenceView-smQ6aBwx.js +2 -0
- package/ui/dist/assets/{LearningPanel-BPx05bBu.js → LearningPanel-BEgF_iND.js} +1 -1
- package/ui/dist/assets/{LogsPanel-D3Qfp2SE.js → LogsPanel-Br1P8ST6.js} +1 -1
- package/ui/dist/assets/McpPanel-ByvQ12J_.js +1 -0
- package/ui/dist/assets/{MemoryGraphPanel-BFovwaSG.js → MemoryGraphPanel-BGOeSaET.js} +1 -1
- package/ui/dist/assets/MemoryWikiPanel-CR8btd66.js +11 -0
- package/ui/dist/assets/MeshPanel-BjkcSOMz.js +11 -0
- package/ui/dist/assets/NvidiaPanel-NYt42w7L.js +1 -0
- package/ui/dist/assets/OrganismPanel-PHvISvVn.js +1 -0
- package/ui/dist/assets/OverviewPanel-q35zdMr6.js +6 -0
- package/ui/dist/assets/{PageHeader-BdvxKoad.js → PageHeader-Cwn3OALc.js} +1 -1
- package/ui/dist/assets/PaperclipPanel-BDpQki0d.js +1 -0
- package/ui/dist/assets/{PersonasPanel-BpI6Npxv.js → PersonasPanel-DxrGW5C4.js} +1 -1
- package/ui/dist/assets/RecipesPanel-CYRdBx5u.js +1 -0
- package/ui/dist/assets/{SecurityPanel-CBDsEAFz.js → SecurityPanel-i1QMctV0.js} +1 -1
- package/ui/dist/assets/SelfImprovePanel-DbybAZWp.js +1 -0
- package/ui/dist/assets/SelfProposalsPanel-DtcTUDDd.js +2 -0
- package/ui/dist/assets/SessionsPanel-B7QmOizR.js +1 -0
- package/ui/dist/assets/SessionsTab-BdJj_vsI.js +1 -0
- package/ui/dist/assets/{SettingsPanel-BiWHsOAJ.js → SettingsPanel-DnEvJUFe.js} +1 -1
- package/ui/dist/assets/SettingsView-C39dk_yr.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-CGtpZJ-7.js → SkeletonLoader-CsiR8ED9.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-Z_9jA6dU.js → SkillsPanel-DM4qBFDS.js} +1 -1
- package/ui/dist/assets/{SomaView-AP3BXqf-.js → SomaView-CWnPKEQI.js} +1 -1
- package/ui/dist/assets/{StatCard-CrnvXPg5.js → StatCard-CY8lgeWm.js} +1 -1
- package/ui/dist/assets/{StatusBadge-B6r5EWBA.js → StatusBadge-CGvKbP7R.js} +1 -1
- package/ui/dist/assets/TeamsPanel-Bf6GaUni.js +1 -0
- package/ui/dist/assets/{TelemetryPanel-D6o14H-i.js → TelemetryPanel-JZ90gJXC.js} +1 -1
- package/ui/dist/assets/TitanCanvas-Hk49NFcA.js +1092 -0
- package/ui/dist/assets/ToolsView-Cq7Fuq3i.js +2 -0
- package/ui/dist/assets/{Tooltip-DNsYGHC9.js → Tooltip-CcoZrKsl.js} +1 -1
- package/ui/dist/assets/{TraceViewer-TOpdmqLF.js → TraceViewer-ojGf0drx.js} +1 -1
- package/ui/dist/assets/TrainingPanel-CWnP4H2l.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-XIyCbAP7.js → VoiceOverlay-Dn6iaYgd.js} +1 -1
- package/ui/dist/assets/VramPanel-CLd9Ggck.js +1 -0
- package/ui/dist/assets/WatchView-CQBemwsm.js +13 -0
- package/ui/dist/assets/WorkTab-BOfTN-Bd.js +1 -0
- package/ui/dist/assets/WorkflowsPanel-qzNS0p0u.js +11 -0
- package/ui/dist/assets/{arrow-left-CQF-yBIU.js → arrow-left-c-8OFZUV.js} +1 -1
- package/ui/dist/assets/{chart-column-1smg0GbX.js → chart-column-x6L66Qw7.js} +1 -1
- package/ui/dist/assets/{circle-check-big-BiMDFx6C.js → circle-check-big-WaW3U3Xl.js} +1 -1
- package/ui/dist/assets/{dollar-sign-DMYH4Q_a.js → dollar-sign-D2Oce4Ru.js} +1 -1
- package/ui/dist/assets/{download-BYFd-yl6.js → download-YvPDLlFJ.js} +1 -1
- package/ui/dist/assets/eye-off-DIMcxsdQ.js +6 -0
- package/ui/dist/assets/{funnel-pWBglhfw.js → funnel-DqD9srZu.js} +1 -1
- package/ui/dist/assets/{git-branch-Cgqic2Us.js → git-branch-0FamUEbU.js} +1 -1
- package/ui/dist/assets/index-D932CbpQ.css +1 -0
- package/ui/dist/assets/index-NatBSFxj.js +227 -0
- package/ui/dist/assets/{legacy-BHbi-Nm_.js → legacy-DOO7F5cq.js} +1 -1
- package/ui/dist/assets/{lightbulb-D_y0Mtyq.js → lightbulb-Bk6KlR6q.js} +1 -1
- package/ui/dist/assets/pause-DDC_zUiJ.js +6 -0
- package/ui/dist/assets/{play-2xR4_zUG.js → play-BPXbHToG.js} +1 -1
- package/ui/dist/assets/{plug-DhvhYYy_.js → plug-Dxp-sWVF.js} +1 -1
- package/ui/dist/assets/proxy-vU7v4NVM.js +9 -0
- package/ui/dist/assets/square-Bn_0tYME.js +6 -0
- package/ui/dist/assets/target-BrtxUtzl.js +6 -0
- package/ui/dist/assets/toggle-right-CYphlpN5.js +11 -0
- package/ui/dist/assets/{trash-2-DmRaMz9e.js → trash-2-C_Jsp23A.js} +1 -1
- package/ui/dist/assets/{trending-up-DsDcs3Jo.js → trending-up-DrtLViSm.js} +1 -1
- package/ui/dist/assets/trophy-DdRzAOfo.js +6 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/CPFiles-G7veSjMg.js +0 -6
- package/ui/dist/assets/CPGoals-C3DlKJrJ.js +0 -1
- package/ui/dist/assets/CPInbox-D10curQs.js +0 -16
- package/ui/dist/assets/ChannelsPanel-M3pO2htW.js +0 -1
- package/ui/dist/assets/CommandPostHub-CW9OY1A4.js +0 -37
- package/ui/dist/assets/InlineEditableField-CH-jR3LC.js +0 -11
- package/ui/dist/assets/IntegrationsPanel-EaN999Te.js +0 -1
- package/ui/dist/assets/IntelligenceView-Q4DBmJpJ.js +0 -2
- package/ui/dist/assets/McpPanel-zC7jTaSx.js +0 -6
- package/ui/dist/assets/MeshPanel-CqtYZ74K.js +0 -11
- package/ui/dist/assets/NvidiaPanel-BVIZFHet.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-PSCYO6sx.js +0 -11
- package/ui/dist/assets/SessionsTab-Cn3dGgjX.js +0 -1
- package/ui/dist/assets/SettingsView-3BSIzAfW.js +0 -2
- package/ui/dist/assets/TitanCanvas-cnb7R1gS.js +0 -1056
- package/ui/dist/assets/ToolsView-Dp-xUWJG.js +0 -2
- package/ui/dist/assets/WorkTab-Pgq-iLz9.js +0 -1
- package/ui/dist/assets/WorkflowsPanel-B91LeW7r.js +0 -21
- package/ui/dist/assets/eye-BfW7UcEC.js +0 -11
- package/ui/dist/assets/index-BWSnB6Kr.js +0 -227
- package/ui/dist/assets/index-Dtw1pbjc.css +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkTab-Pgq-iLz9.js","assets/index-BWSnB6Kr.js","assets/index-Dtw1pbjc.css","assets/TitanCanvas-cnb7R1gS.js","assets/VoiceOverlay-XIyCbAP7.js","assets/TitanCanvas-BfitWg9R.css","assets/play-2xR4_zUG.js","assets/trash-2-DmRaMz9e.js","assets/InlineEditableField-CH-jR3LC.js","assets/Input-DYukme8A.js","assets/Tooltip-DNsYGHC9.js","assets/dollar-sign-DMYH4Q_a.js","assets/git-branch-Cgqic2Us.js","assets/chart-column-1smg0GbX.js","assets/SessionsTab-Cn3dGgjX.js","assets/CPInbox-D10curQs.js","assets/PageHeader-BdvxKoad.js","assets/EmptyState-D60-wQrz.js","assets/SkeletonLoader-CGtpZJ-7.js","assets/funnel-pWBglhfw.js","assets/CPFiles-G7veSjMg.js","assets/TraceViewer-TOpdmqLF.js","assets/trending-up-DsDcs3Jo.js","assets/arrow-left-CQF-yBIU.js","assets/CPSocial-mUQsrSh5.js","assets/lightbulb-D_y0Mtyq.js","assets/CPDashboard-C-GgqDsI.js","assets/StatusBadge-B6r5EWBA.js","assets/CPGoals-C3DlKJrJ.js","assets/CPAgents-D5533PhK.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as Ue,r as x,j as a,n as ao,k as lo,e as Qe,f as et,A as Ie,T as cs,o as hi,p as co,q as uo,s as ho,_ as ie,b as Ft,v as fo,w as mo,x as po,y as xo,z as go,B as yo,D as vo,E as bo,G as wo}from"./index-BWSnB6Kr.js";import{B as _s}from"./Input-DYukme8A.js";import{P as jo,T as To,I as Me}from"./InlineEditableField-CH-jR3LC.js";import{H as So}from"./Tooltip-DNsYGHC9.js";import{C as Ws}from"./VoiceOverlay-XIyCbAP7.js";import{B as Co,W as fi,C as mi,M as pi,U as Po,F as No,T as Ao,R as Mo,S as Vo,P as us}from"./TitanCanvas-cnb7R1gS.js";import{D as ds}from"./dollar-sign-DMYH4Q_a.js";import{G as xi}from"./git-branch-Cgqic2Us.js";import{C as gi}from"./chart-column-1smg0GbX.js";import{T as yi}from"./trash-2-DmRaMz9e.js";/**
|
|
3
|
-
* @license lucide-react v0.513.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const Do=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Bt=Ue("briefcase",Do);/**
|
|
8
|
-
* @license lucide-react v0.513.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const ko=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],Ot=Ue("building-2",ko);/**
|
|
13
|
-
* @license lucide-react v0.513.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const Eo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Ro=Ue("circle-stop",Eo);/**
|
|
18
|
-
* @license lucide-react v0.513.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const Lo=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Io=Ue("mail",Lo);/**
|
|
23
|
-
* @license lucide-react v0.513.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const Fo=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],vi=Ue("scale",Fo),hs=x.createContext({});function fs(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Bo=typeof window<"u",bi=Bo?x.useLayoutEffect:x.useEffect,xt=x.createContext(null);function ms(e,t){e.indexOf(t)===-1&&e.push(t)}function lt(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Q=(e,t,s)=>s>t?t:s<e?e:s;let ps=()=>{};const ne={},wi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ji(e){return typeof e=="object"&&e!==null}const Ti=e=>/^0[^.\s]+$/u.test(e);function Si(e){let t;return()=>(t===void 0&&(t=e()),t)}const K=e=>e,Oo=(e,t)=>s=>t(e(s)),_e=(...e)=>e.reduce(Oo),Fe=(e,t,s)=>{const n=t-e;return n===0?1:(s-e)/n};class xs{constructor(){this.subscriptions=[]}add(t){return ms(this.subscriptions,t),()=>lt(this.subscriptions,t)}notify(t,s,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,s,n);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(t,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const U=e=>e*1e3,W=e=>e/1e3;function Ci(e,t){return t?e*(1e3/t):0}const Pi=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,zo=1e-7,$o=12;function Uo(e,t,s,n,i){let o,r,l=0;do r=t+(s-t)/2,o=Pi(r,n,i)-e,o>0?s=r:t=r;while(Math.abs(o)>zo&&++l<$o);return r}function We(e,t,s,n){if(e===t&&s===n)return K;const i=o=>Uo(o,0,1,e,s);return o=>o===0||o===1?o:Pi(i(o),t,n)}const Ni=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ai=e=>t=>1-e(1-t),Mi=We(.33,1.53,.69,.99),gs=Ai(Mi),Vi=Ni(gs),Di=e=>(e*=2)<1?.5*gs(e):.5*(2-Math.pow(2,-10*(e-1))),ys=e=>1-Math.sin(Math.acos(e)),ki=Ai(ys),Ei=Ni(ys),_o=We(.42,0,1,1),Wo=We(0,0,.58,1),Ri=We(.42,0,.58,1),Ko=e=>Array.isArray(e)&&typeof e[0]!="number",Li=e=>Array.isArray(e)&&typeof e[0]=="number",Go={linear:K,easeIn:_o,easeInOut:Ri,easeOut:Wo,circIn:ys,circInOut:Ei,circOut:ki,backIn:gs,backInOut:Vi,backOut:Mi,anticipate:Di},Ho=e=>typeof e=="string",Ks=e=>{if(Li(e)){ps(e.length===4);const[t,s,n,i]=e;return We(t,s,n,i)}else if(Ho(e))return Go[e];return e},Xe=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Xo(e,t){let s=new Set,n=new Set,i=!1,o=!1;const r=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(c){r.has(c)&&(d.schedule(c),e()),c(l)}const d={schedule:(c,h=!1,f=!1)=>{const m=f&&i?s:n;return h&&r.add(c),m.has(c)||m.add(c),c},cancel:c=>{n.delete(c),r.delete(c)},process:c=>{if(l=c,i){o=!0;return}i=!0,[s,n]=[n,s],s.forEach(u),s.clear(),i=!1,o&&(o=!1,d.process(c))}};return d}const Yo=40;function Ii(e,t){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>s=!0,r=Xe.reduce((w,v)=>(w[v]=Xo(o),w),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:c,update:h,preRender:f,render:p,postRender:m}=r,g=()=>{const w=ne.useManualTiming?i.timestamp:performance.now();s=!1,ne.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(w-i.timestamp,Yo),1)),i.timestamp=w,i.isProcessing=!0,l.process(i),u.process(i),d.process(i),c.process(i),h.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,s&&t&&(n=!1,e(g))},y=()=>{s=!0,n=!0,i.isProcessing||e(g)};return{schedule:Xe.reduce((w,v)=>{const S=r[v];return w[v]=(A,M=!1,T=!1)=>(s||y(),S.schedule(A,M,T)),w},{}),cancel:w=>{for(let v=0;v<Xe.length;v++)r[Xe[v]].cancel(w)},state:i,steps:r}}const{schedule:V,cancel:le,state:B,steps:bt}=Ii(typeof requestAnimationFrame<"u"?requestAnimationFrame:K,!0);let tt;function qo(){tt=void 0}const z={now:()=>(tt===void 0&&z.set(B.isProcessing||ne.useManualTiming?B.timestamp:performance.now()),tt),set:e=>{tt=e,queueMicrotask(qo)}},Fi=e=>t=>typeof t=="string"&&t.startsWith(e),Bi=Fi("--"),Zo=Fi("var(--"),vs=e=>Zo(e)?Jo.test(e.split("/*")[0].trim()):!1,Jo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Gs(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Pe={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Be={...Pe,transform:e=>Q(0,1,e)},Ye={...Pe,default:1},ke=e=>Math.round(e*1e5)/1e5,bs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qo(e){return e==null}const ea=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ws=(e,t)=>s=>!!(typeof s=="string"&&ea.test(s)&&s.startsWith(e)||t&&!Qo(s)&&Object.prototype.hasOwnProperty.call(s,t)),Oi=(e,t,s)=>n=>{if(typeof n!="string")return n;const[i,o,r,l]=n.match(bs);return{[e]:parseFloat(i),[t]:parseFloat(o),[s]:parseFloat(r),alpha:l!==void 0?parseFloat(l):1}},ta=e=>Q(0,255,e),wt={...Pe,transform:e=>Math.round(ta(e))},fe={test:ws("rgb","red"),parse:Oi("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:n=1})=>"rgba("+wt.transform(e)+", "+wt.transform(t)+", "+wt.transform(s)+", "+ke(Be.transform(n))+")"};function sa(e){let t="",s="",n="",i="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,s+=s,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const zt={test:ws("#"),parse:sa,transform:fe.transform},Ke=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),re=Ke("deg"),J=Ke("%"),C=Ke("px"),na=Ke("vh"),ia=Ke("vw"),Hs={...J,parse:e=>J.parse(e)/100,transform:e=>J.transform(e*100)},ye={test:ws("hsl","hue"),parse:Oi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:n=1})=>"hsla("+Math.round(e)+", "+J.transform(ke(t))+", "+J.transform(ke(s))+", "+ke(Be.transform(n))+")"},R={test:e=>fe.test(e)||zt.test(e)||ye.test(e),parse:e=>fe.test(e)?fe.parse(e):ye.test(e)?ye.parse(e):zt.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?fe.transform(e):ye.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},ra=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oa(e){var t,s;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bs))==null?void 0:t.length)||0)+(((s=e.match(ra))==null?void 0:s.length)||0)>0}const zi="number",$i="color",aa="var",la="var(",Xs="${}",ca=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Se(e){const t=e.toString(),s=[],n={color:[],number:[],var:[]},i=[];let o=0;const l=t.replace(ca,u=>(R.test(u)?(n.color.push(o),i.push($i),s.push(R.parse(u))):u.startsWith(la)?(n.var.push(o),i.push(aa),s.push(u)):(n.number.push(o),i.push(zi),s.push(parseFloat(u))),++o,Xs)).split(Xs);return{values:s,split:l,indexes:n,types:i}}function ua(e){return Se(e).values}function Ui({split:e,types:t}){const s=e.length;return n=>{let i="";for(let o=0;o<s;o++)if(i+=e[o],n[o]!==void 0){const r=t[o];r===zi?i+=ke(n[o]):r===$i?i+=R.transform(n[o]):i+=n[o]}return i}}function da(e){return Ui(Se(e))}const ha=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e,fa=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:ha(e);function ma(e){const t=Se(e);return Ui(t)(t.values.map((n,i)=>fa(n,t.split[i])))}const X={test:oa,parse:ua,createTransformer:da,getAnimatableNone:ma};function jt(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function pa({hue:e,saturation:t,lightness:s,alpha:n}){e/=360,t/=100,s/=100;let i=0,o=0,r=0;if(!t)i=o=r=s;else{const l=s<.5?s*(1+t):s+t-s*t,u=2*s-l;i=jt(u,l,e+1/3),o=jt(u,l,e),r=jt(u,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:n}}function ct(e,t){return s=>s>0?t:e}const k=(e,t,s)=>e+(t-e)*s,Tt=(e,t,s)=>{const n=e*e,i=s*(t*t-n)+n;return i<0?0:Math.sqrt(i)},xa=[zt,fe,ye],ga=e=>xa.find(t=>t.test(e));function Ys(e){const t=ga(e);if(!t)return!1;let s=t.parse(e);return t===ye&&(s=pa(s)),s}const qs=(e,t)=>{const s=Ys(e),n=Ys(t);if(!s||!n)return ct(e,t);const i={...s};return o=>(i.red=Tt(s.red,n.red,o),i.green=Tt(s.green,n.green,o),i.blue=Tt(s.blue,n.blue,o),i.alpha=k(s.alpha,n.alpha,o),fe.transform(i))},$t=new Set(["none","hidden"]);function ya(e,t){return $t.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function va(e,t){return s=>k(e,t,s)}function js(e){return typeof e=="number"?va:typeof e=="string"?vs(e)?ct:R.test(e)?qs:ja:Array.isArray(e)?_i:typeof e=="object"?R.test(e)?qs:ba:ct}function _i(e,t){const s=[...e],n=s.length,i=e.map((o,r)=>js(o)(o,t[r]));return o=>{for(let r=0;r<n;r++)s[r]=i[r](o);return s}}function ba(e,t){const s={...e,...t},n={};for(const i in s)e[i]!==void 0&&t[i]!==void 0&&(n[i]=js(e[i])(e[i],t[i]));return i=>{for(const o in n)s[o]=n[o](i);return s}}function wa(e,t){const s=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],r=e.indexes[o][n[o]],l=e.values[r]??0;s[i]=l,n[o]++}return s}const ja=(e,t)=>{const s=X.createTransformer(t),n=Se(e),i=Se(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?$t.has(e)&&!i.values.length||$t.has(t)&&!n.values.length?ya(e,t):_e(_i(wa(n,i),i.values),s):ct(e,t)};function Wi(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?k(e,t,s):js(e)(e,t)}const Ta=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>V.update(t,s),stop:()=>le(t),now:()=>B.isProcessing?B.timestamp:z.now()}},Ki=(e,t,s=10)=>{let n="";const i=Math.max(Math.round(t/s),2);for(let o=0;o<i;o++)n+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ut=2e4;function Ts(e){let t=0;const s=50;let n=e.next(t);for(;!n.done&&t<ut;)t+=s,n=e.next(t);return t>=ut?1/0:t}function Sa(e,t=100,s){const n=s({...e,keyframes:[0,t]}),i=Math.min(Ts(n),ut);return{type:"keyframes",ease:o=>n.next(i*o).value/t,duration:W(i)}}const E={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ut(e,t){return e*Math.sqrt(1-t*t)}const Ca=12;function Pa(e,t,s){let n=s;for(let i=1;i<Ca;i++)n=n-e(n)/t(n);return n}const St=.001;function Na({duration:e=E.duration,bounce:t=E.bounce,velocity:s=E.velocity,mass:n=E.mass}){let i,o,r=1-t;r=Q(E.minDamping,E.maxDamping,r),e=Q(E.minDuration,E.maxDuration,W(e)),r<1?(i=d=>{const c=d*r,h=c*e,f=c-s,p=Ut(d,r),m=Math.exp(-h);return St-f/p*m},o=d=>{const h=d*r*e,f=h*s+s,p=Math.pow(r,2)*Math.pow(d,2)*e,m=Math.exp(-h),g=Ut(Math.pow(d,2),r);return(-i(d)+St>0?-1:1)*((f-p)*m)/g}):(i=d=>{const c=Math.exp(-d*e),h=(d-s)*e+1;return-St+c*h},o=d=>{const c=Math.exp(-d*e),h=(s-d)*(e*e);return c*h});const l=5/e,u=Pa(i,o,l);if(e=U(e),isNaN(u))return{stiffness:E.stiffness,damping:E.damping,duration:e};{const d=Math.pow(u,2)*n;return{stiffness:d,damping:r*2*Math.sqrt(n*d),duration:e}}}const Aa=["duration","bounce"],Ma=["stiffness","damping","mass"];function Zs(e,t){return t.some(s=>e[s]!==void 0)}function Va(e){let t={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...e};if(!Zs(e,Ma)&&Zs(e,Aa))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,n=2*Math.PI/(s*1.2),i=n*n,o=2*Q(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:E.mass,stiffness:i,damping:o}}else{const s=Na({...e,velocity:0});t={...t,...s,mass:E.mass},t.isResolvedFromDuration=!0}return t}function dt(e=E.visualDuration,t=E.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=s;const o=s.keyframes[0],r=s.keyframes[s.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:d,mass:c,duration:h,velocity:f,isResolvedFromDuration:p}=Va({...s,velocity:-W(s.velocity||0)}),m=f||0,g=d/(2*Math.sqrt(u*c)),y=r-o,b=W(Math.sqrt(u/c)),j=Math.abs(y)<5;n||(n=j?E.restSpeed.granular:E.restSpeed.default),i||(i=j?E.restDelta.granular:E.restDelta.default);let w,v,S,A,M,T;if(g<1)S=Ut(b,g),A=(m+g*b*y)/S,w=N=>{const D=Math.exp(-g*b*N);return r-D*(A*Math.sin(S*N)+y*Math.cos(S*N))},M=g*b*A+y*S,T=g*b*y-A*S,v=N=>Math.exp(-g*b*N)*(M*Math.sin(S*N)+T*Math.cos(S*N));else if(g===1){w=D=>r-Math.exp(-b*D)*(y+(m+b*y)*D);const N=m+b*y;v=D=>Math.exp(-b*D)*(b*N*D-m)}else{const N=b*Math.sqrt(g*g-1);w=Y=>{const te=Math.exp(-g*b*Y),q=Math.min(N*Y,300);return r-te*((m+g*b*y)*Math.sinh(q)+N*y*Math.cosh(q))/N};const D=(m+g*b*y)/N,I=g*b*D-y*N,ee=g*b*y-D*N;v=Y=>{const te=Math.exp(-g*b*Y),q=Math.min(N*Y,300);return te*(I*Math.sinh(q)+ee*Math.cosh(q))}}const P={calculatedDuration:p&&h||null,velocity:N=>U(v(N)),next:N=>{if(!p&&g<1){const I=Math.exp(-g*b*N),ee=Math.sin(S*N),Y=Math.cos(S*N),te=r-I*(A*ee+y*Y),q=U(I*(M*ee+T*Y));return l.done=Math.abs(q)<=n&&Math.abs(r-te)<=i,l.value=l.done?r:te,l}const D=w(N);if(p)l.done=N>=h;else{const I=U(v(N));l.done=Math.abs(I)<=n&&Math.abs(r-D)<=i}return l.value=l.done?r:D,l},toString:()=>{const N=Math.min(Ts(P),ut),D=Ki(I=>P.next(N*I).value,N,30);return N+"ms "+D},toTransition:()=>{}};return P}dt.applyToOptions=e=>{const t=Sa(e,100,dt);return e.ease=t.ease,e.duration=U(t.duration),e.type="keyframes",e};const Da=5;function Gi(e,t,s){const n=Math.max(t-Da,0);return Ci(s-e(n),t-n)}function _t({keyframes:e,velocity:t=0,power:s=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:l,max:u,restDelta:d=.5,restSpeed:c}){const h=e[0],f={done:!1,value:h},p=T=>l!==void 0&&T<l||u!==void 0&&T>u,m=T=>l===void 0?u:u===void 0||Math.abs(l-T)<Math.abs(u-T)?l:u;let g=s*t;const y=h+g,b=r===void 0?y:r(y);b!==y&&(g=b-h);const j=T=>-g*Math.exp(-T/n),w=T=>b+j(T),v=T=>{const P=j(T),N=w(T);f.done=Math.abs(P)<=d,f.value=f.done?b:N};let S,A;const M=T=>{p(f.value)&&(S=T,A=dt({keyframes:[f.value,m(f.value)],velocity:Gi(w,T,f.value),damping:i,stiffness:o,restDelta:d,restSpeed:c}))};return M(0),{calculatedDuration:null,next:T=>{let P=!1;return!A&&S===void 0&&(P=!0,v(T),M(T)),S!==void 0&&T>=S?A.next(T-S):(!P&&v(T),f)}}}function ka(e,t,s){const n=[],i=s||ne.mix||Wi,o=e.length-1;for(let r=0;r<o;r++){let l=i(e[r],e[r+1]);if(t){const u=Array.isArray(t)?t[r]||K:t;l=_e(u,l)}n.push(l)}return n}function Ea(e,t,{clamp:s=!0,ease:n,mixer:i}={}){const o=e.length;if(ps(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const r=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=ka(t,n,i),u=l.length,d=c=>{if(r&&c<e[0])return t[0];let h=0;if(u>1)for(;h<e.length-2&&!(c<e[h+1]);h++);const f=Fe(e[h],e[h+1],c);return l[h](f)};return s?c=>d(Q(e[0],e[o-1],c)):d}function Ra(e,t){const s=e[e.length-1];for(let n=1;n<=t;n++){const i=Fe(0,t,n);e.push(k(s,1,i))}}function La(e){const t=[0];return Ra(t,e.length-1),t}function Ia(e,t){return e.map(s=>s*t)}function Fa(e,t){return e.map(()=>t||Ri).splice(0,e.length-1)}function Ee({duration:e=300,keyframes:t,times:s,ease:n="easeInOut"}){const i=Ko(n)?n.map(Ks):Ks(n),o={done:!1,value:t[0]},r=Ia(s&&s.length===t.length?s:La(t),e),l=Ea(r,t,{ease:Array.isArray(i)?i:Fa(t,i)});return{calculatedDuration:e,next:u=>(o.value=l(u),o.done=u>=e,o)}}const Ba=e=>e!==null;function Ss(e,{repeat:t,repeatType:s="loop"},n,i=1){const o=e.filter(Ba),l=i<0||t&&s!=="loop"&&t%2===1?0:o.length-1;return!l||n===void 0?o[l]:n}const Oa={decay:_t,inertia:_t,tween:Ee,keyframes:Ee,spring:dt};function Hi(e){typeof e.type=="string"&&(e.type=Oa[e.type])}class Cs{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const za=e=>e/100;class Ps extends Cs{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:s}=this.options;s&&s.updatedAt!==z.now()&&this.tick(z.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Hi(t);const{type:s=Ee,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=t;let{keyframes:l}=t;const u=s||Ee;u!==Ee&&typeof l[0]!="number"&&(this.mixKeyframes=_e(za,Wi(l[0],l[1])),l=[0,100]);const d=u({...t,keyframes:l});o==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-r})),d.calculatedDuration===null&&(d.calculatedDuration=Ts(d));const{calculatedDuration:c}=d;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=d}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return n.next(0);const{delay:d=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),j=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,v=n;if(h){const T=Math.min(this.currentTime,i)/l;let P=Math.floor(T),N=T%1;!N&&T>=1&&(N=1),N===1&&P--,P=Math.min(P,h+1),!!(P%2)&&(f==="reverse"?(N=1-N,p&&(N-=p/l)):f==="mirror"&&(v=r)),w=Q(0,1,N)*l}const S=j?{done:!1,value:c[0]}:v.next(w);o&&!j&&(S.value=o(S.value));let{done:A}=S;!j&&u!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&m!==_t&&(S.value=Ss(c,this.options,y,this.speed)),g&&g(S.value),M&&this.finish(),S}then(t,s){return this.finished.then(t,s)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+W(t)}get time(){return W(this.currentTime)}set time(t){t=U(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return Gi(n=>this.generator.next(n).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(z.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=W(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:t=Ta,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),(o=(i=this.options).onPlay)==null||o.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=s??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(z.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(t=this.options).onComplete)==null||s.call(t)}cancel(){var t,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(t=this.options).onCancel)==null||s.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),t.observe(this)}}function $a(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const me=e=>e*180/Math.PI,Wt=e=>{const t=me(Math.atan2(e[1],e[0]));return Kt(t)},Ua={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Wt,rotateZ:Wt,skewX:e=>me(Math.atan(e[1])),skewY:e=>me(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Kt=e=>(e=e%360,e<0&&(e+=360),e),Js=Wt,Qs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),en=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),_a={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qs,scaleY:en,scale:e=>(Qs(e)+en(e))/2,rotateX:e=>Kt(me(Math.atan2(e[6],e[5]))),rotateY:e=>Kt(me(Math.atan2(-e[2],e[0]))),rotateZ:Js,rotate:Js,skewX:e=>me(Math.atan(e[4])),skewY:e=>me(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Gt(e){return e.includes("scale")?1:0}function Ht(e,t){if(!e||e==="none")return Gt(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=_a,i=s;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Ua,i=l}if(!i)return Gt(t);const o=n[t],r=i[1].split(",").map(Ka);return typeof o=="function"?o(r):r[o]}const Wa=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return Ht(s,t)};function Ka(e){return parseFloat(e.trim())}const Ne=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ae=new Set(Ne),tn=e=>e===Pe||e===C,Ga=new Set(["x","y","z"]),Ha=Ne.filter(e=>!Ga.has(e));function Xa(e){const t=[];return Ha.forEach(s=>{const n=e.getValue(s);n!==void 0&&(t.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),t}const ae={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ht(t,"x"),y:(e,{transform:t})=>Ht(t,"y")};ae.translateX=ae.x;ae.translateY=ae.y;const pe=new Set;let Xt=!1,Yt=!1,qt=!1;function Xi(){if(Yt){const e=Array.from(pe).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),s=new Map;t.forEach(n=>{const i=Xa(n);i.length&&(s.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=s.get(n);i&&i.forEach(([o,r])=>{var l;(l=n.getValue(o))==null||l.set(r)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Yt=!1,Xt=!1,pe.forEach(e=>e.complete(qt)),pe.clear()}function Yi(){pe.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Yt=!0)})}function Ya(){qt=!0,Yi(),Xi(),qt=!1}class Ns{constructor(t,s,n,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=n,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(pe.add(this),Xt||(Xt=!0,V.read(Yi),V.resolveKeyframes(Xi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:n,motionValue:i}=this;if(t[0]===null){const o=i==null?void 0:i.get(),r=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&s){const l=n.readValue(s,r);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=r),i&&o===void 0&&i.set(t[0])}$a(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),pe.delete(this)}cancel(){this.state==="scheduled"&&(pe.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qa=e=>e.startsWith("--");function qi(e,t,s){qa(t)?e.style.setProperty(t,s):e.style[t]=s}const Za={};function Zi(e,t){const s=Si(e);return()=>Za[t]??s()}const Ja=Zi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ji=Zi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),De=([e,t,s,n])=>`cubic-bezier(${e}, ${t}, ${s}, ${n})`,sn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:De([0,.65,.55,1]),circOut:De([.55,0,1,.45]),backIn:De([.31,.01,.66,-.59]),backOut:De([.33,1.53,.69,.99])};function Qi(e,t){if(e)return typeof e=="function"?Ji()?Ki(e,t):"ease-out":Li(e)?De(e):Array.isArray(e)?e.map(s=>Qi(s,t)||sn.easeOut):sn[e]}function Qa(e,t,s,{delay:n=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:l="easeOut",times:u}={},d=void 0){const c={[t]:s};u&&(c.offset=u);const h=Qi(l,i);Array.isArray(h)&&(c.easing=h);const f={delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return d&&(f.pseudoElement=d),e.animate(c,f)}function er(e){return typeof e=="function"&&"applyToOptions"in e}function el({type:e,...t}){return er(e)&&Ji()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class tr extends Cs{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:n,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=t,ps(typeof t.type!="string");const d=el(t);this.animation=Qa(s,n,i,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=Ss(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(c),qi(s,n,c),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,s;(s=(t=this.animation).finish)==null||s.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var s,n,i;const t=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var s,n;const t=((n=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:n.call(s).duration)||0;return W(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+W(t)}get time(){return W(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=U(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:n,observe:i}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Ja()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),n&&(this.animation.rangeEnd=n),K):i(this)}}const sr={anticipate:Di,backInOut:Vi,circInOut:Ei};function tl(e){return e in sr}function sl(e){typeof e.ease=="string"&&tl(e.ease)&&(e.ease=sr[e.ease])}const Ct=10;class nl extends tr{constructor(t){sl(t),Hi(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:n,onComplete:i,element:o,...r}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const l=new Ps({...r,autoplay:!1}),u=Math.max(Ct,z.now()-this.startTime),d=Q(0,Ct,u-Ct),c=l.sample(u).value,{name:h}=this.options;o&&h&&qi(o,h,c),s.setWithVelocity(l.sample(Math.max(0,u-d)).value,c,d),l.stop()}}const nn=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(X.test(e)||e==="0")&&!e.startsWith("url("));function il(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function rl(e,t,s,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],r=nn(i,t),l=nn(o,t);return!r||!l?!1:il(e)||(s==="spring"||er(s))&&n}function Zt(e){e.duration=0,e.type="keyframes"}const ol=new Set(["opacity","clipPath","filter","transform"]),al=Si(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ll(e){var c;const{motionValue:t,name:s,repeatDelay:n,repeatType:i,damping:o,type:r}=e;if(!(((c=t==null?void 0:t.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return al()&&s&&ol.has(s)&&(s!=="transform"||!d)&&!u&&!n&&i!=="mirror"&&o!==0&&r!=="inertia"}const cl=40;class ul extends Cs{constructor({autoplay:t=!0,delay:s=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:l,name:u,motionValue:d,element:c,...h}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=z.now();const f={autoplay:t,delay:s,type:n,repeat:i,repeatDelay:o,repeatType:r,name:u,motionValue:d,element:c,...h},p=(c==null?void 0:c.KeyframeResolver)||Ns;this.keyframeResolver=new p(l,(g,y,b)=>this.onKeyframesResolved(g,y,f,!b),u,d,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,s,n,i){var y,b;this.keyframeResolver=void 0;const{name:o,type:r,velocity:l,delay:u,isHandoff:d,onUpdate:c}=n;this.resolvedAt=z.now(),rl(t,o,r,l)||((ne.instantAnimations||!u)&&(c==null||c(Ss(t,n,s))),t[0]=t[t.length-1],Zt(n),n.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>cl?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...n,keyframes:t},p=!d&&ll(f),m=(b=(y=f.motionValue)==null?void 0:y.owner)==null?void 0:b.current,g=p?new nl({...f,element:m}):new Ps(f);g.finished.then(()=>{this.notifyFinished()}).catch(K),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ya()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function nr(e,t,s,n=0,i=1){const o=Array.from(e).sort((d,c)=>d.sortNodePosition(c)).indexOf(t),r=e.size,l=(r-1)*n;return typeof s=="function"?s(o,r):i===1?o*n:l-o*n}const dl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hl(e){const t=dl.exec(e);if(!t)return[,];const[,s,n,i]=t;return[`--${s??n}`,i]}function ir(e,t,s=1){const[n,i]=hl(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const r=o.trim();return wi(r)?parseFloat(r):r}return vs(i)?ir(i,t,s+1):i}const fl={type:"spring",stiffness:500,damping:25,restSpeed:10},ml=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),pl={type:"keyframes",duration:.8},xl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},gl=(e,{keyframes:t})=>t.length>2?pl:Ae.has(e)?e.startsWith("scale")?ml(t[1]):fl:xl,yl=e=>e!==null;function vl(e,{repeat:t,repeatType:s="loop"},n){const i=e.filter(yl),o=t&&s!=="loop"&&t%2===1?0:i.length-1;return i[o]}function rr(e,t){if(e!=null&&e.inherit&&t){const{inherit:s,...n}=e;return{...t,...n}}return e}function As(e,t){const s=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return s!==e?rr(s,e):s}function bl({when:e,delay:t,delayChildren:s,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:l,from:u,elapsed:d,...c}){return!!Object.keys(c).length}const Ms=(e,t,s,n={},i,o)=>r=>{const l=As(n,e)||{},u=l.delay||n.delay||0;let{elapsed:d=0}=n;d=d-U(u);const c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-d,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{r(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:i};bl(l)||Object.assign(c,gl(e,c)),c.duration&&(c.duration=U(c.duration)),c.repeatDelay&&(c.repeatDelay=U(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Zt(c),c.delay===0&&(h=!0)),(ne.instantAnimations||ne.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,Zt(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,h&&!o&&t.get()!==void 0){const f=vl(c.keyframes,l);if(f!==void 0){V.update(()=>{c.onUpdate(f),c.onComplete()});return}}return l.isSync?new Ps(c):new ul(c)};function rn(e){const t=[{},{}];return e==null||e.values.forEach((s,n)=>{t[0][n]=s.get(),t[1][n]=s.getVelocity()}),t}function Vs(e,t,s,n){if(typeof t=="function"){const[i,o]=rn(n);t=t(s!==void 0?s:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=rn(n);t=t(s!==void 0?s:e.custom,i,o)}return t}function Te(e,t,s){const n=e.getProps();return Vs(n,t,s!==void 0?s:n.custom,e)}const or=new Set(["width","height","top","left","right","bottom",...Ne]),on=30,wl=e=>!isNaN(parseFloat(e));class jl{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var o;const i=z.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=z.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new xs);const n=this.events[t].add(s);return t==="change"?()=>{n(),V.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>on)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,on);return Ci(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,s;(t=this.dependents)==null||t.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ce(e,t){return new jl(e,t)}const Jt=e=>Array.isArray(e);function Tl(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Ce(s))}function Sl(e){return Jt(e)?e[e.length-1]||0:e}function Cl(e,t){const s=Te(e,t);let{transitionEnd:n={},transition:i={},...o}=s||{};o={...o,...n};for(const r in o){const l=Sl(o[r]);Tl(e,r,l)}}const O=e=>!!(e&&e.getVelocity);function Pl(e){return!!(O(e)&&e.add)}function Qt(e,t){const s=e.getValue("willChange");if(Pl(s))return s.add(t);if(!s&&ne.WillChange){const n=new ne.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Ds(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Nl="framerAppearId",ar="data-"+Ds(Nl);function lr(e){return e.props[ar]}function Al({protectedKeys:e,needsAnimating:t},s){const n=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,n}function cr(e,t,{delay:s=0,transitionOverride:n,type:i}={}){let{transition:o,transitionEnd:r,...l}=t;const u=e.getDefaultTransition();o=o?rr(o,u):u;const d=o==null?void 0:o.reduceMotion;n&&(o=n);const c=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const p=e.getValue(f,e.latestValues[f]??null),m=l[f];if(m===void 0||h&&Al(h,f))continue;const g={delay:s,...As(o||{},f)},y=p.get();if(y!==void 0&&!p.isAnimating&&!Array.isArray(m)&&m===y&&!g.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const v=lr(e);if(v){const S=window.MotionHandoffAnimation(v,f,V);S!==null&&(g.startTime=S,b=!0)}}Qt(e,f);const j=d??e.shouldReduceMotion;p.start(Ms(f,p,m,j&&or.has(f)?{type:!1}:g,e,b));const w=p.animation;w&&c.push(w)}if(r){const f=()=>V.update(()=>{r&&Cl(e,r)});c.length?Promise.all(c).then(f):f()}return c}function es(e,t,s={}){var u;const n=Te(e,t,s.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(i=s.transitionOverride);const o=n?()=>Promise.all(cr(e,n,s)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=i;return Ml(e,t,d,c,h,f,s)}:()=>Promise.resolve(),{when:l}=i;if(l){const[d,c]=l==="beforeChildren"?[o,r]:[r,o];return d().then(()=>c())}else return Promise.all([o(),r(s.delay)])}function Ml(e,t,s=0,n=0,i=0,o=1,r){const l=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),l.push(es(u,t,{...r,delay:s+(typeof n=="function"?0:n)+nr(e.variantChildren,u,n,i,o)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(l)}function Vl(e,t,s={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(o=>es(e,o,s));n=Promise.all(i)}else if(typeof t=="string")n=es(e,t,s);else{const i=typeof t=="function"?Te(e,t,s.custom):t;n=Promise.all(cr(e,i,s))}return n.then(()=>{e.notify("AnimationComplete",t)})}const Dl={test:e=>e==="auto",parse:e=>e},ur=e=>t=>t.test(e),dr=[Pe,C,J,re,ia,na,Dl],an=e=>dr.find(ur(e));function kl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Ti(e):!0}const El=new Set(["brightness","contrast","saturate","opacity"]);function Rl(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=s.match(bs)||[];if(!n)return e;const i=s.replace(n,"");let o=El.has(t)?1:0;return n!==s&&(o*=100),t+"("+o+i+")"}const Ll=/\b([a-z-]*)\(.*?\)/gu,ts={...X,getAnimatableNone:e=>{const t=e.match(Ll);return t?t.map(Rl).join(" "):e}},ss={...X,getAnimatableNone:e=>{const t=X.parse(e);return X.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},ln={...Pe,transform:Math.round},Il={rotate:re,rotateX:re,rotateY:re,rotateZ:re,scale:Ye,scaleX:Ye,scaleY:Ye,scaleZ:Ye,skew:re,skewX:re,skewY:re,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:Be,originX:Hs,originY:Hs,originZ:C},ks={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...Il,zIndex:ln,fillOpacity:Be,strokeOpacity:Be,numOctaves:ln},Fl={...ks,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ts,WebkitFilter:ts,mask:ss,WebkitMask:ss},hr=e=>Fl[e],Bl=new Set([ts,ss]);function fr(e,t){let s=hr(e);return Bl.has(s)||(s=X),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const Ol=new Set(["auto","none","0"]);function zl(e,t,s){let n=0,i;for(;n<e.length&&!i;){const o=e[n];typeof o=="string"&&!Ol.has(o)&&Se(o).values.length&&(i=e[n]),n++}if(i&&s)for(const o of t)e[o]=fr(s,i)}class $l extends Ns{constructor(t,s,n,i,o){super(t,s,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:n}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let h=t[c];if(typeof h=="string"&&(h=h.trim(),vs(h))){const f=ir(h,s.current);f!==void 0&&(t[c]=f),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!or.has(n)||t.length!==2)return;const[i,o]=t,r=an(i),l=an(o),u=Gs(i),d=Gs(o);if(u!==d&&ae[n]){this.needsMeasurement=!0;return}if(r!==l)if(tn(r)&&tn(l))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else ae[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||kl(t[i]))&&n.push(i);n.length&&zl(t,n,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ae[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const i=s[s.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var l;const{element:t,name:s,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(s);i&&i.jump(this.measuredOrigin,!1);const o=n.length-1,r=n[o];n[o]=ae[s](t.measureViewportBox(),window.getComputedStyle(t.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{t.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const Ul=new Set(["opacity","clipPath","filter","transform"]);function mr(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=(s==null?void 0:s[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(n=>n!=null)}const pr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function st(e){return ji(e)&&"offsetHeight"in e}const{schedule:Es}=Ii(queueMicrotask,!1),H={x:!1,y:!1};function xr(){return H.x||H.y}function _l(e){return e==="x"||e==="y"?H[e]?null:(H[e]=!0,()=>{H[e]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function gr(e,t){const s=mr(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[s,i,()=>n.abort()]}function Wl(e){return!(e.pointerType==="touch"||xr())}function Kl(e,t,s={}){const[n,i,o]=gr(e,s);return n.forEach(r=>{let l=!1,u=!1,d;const c=()=>{r.removeEventListener("pointerleave",m)},h=y=>{d&&(d(y),d=void 0),c()},f=y=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,h(y))},p=()=>{l=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=y=>{if(y.pointerType!=="touch"){if(l){u=!0;return}h(y)}},g=y=>{if(!Wl(y))return;u=!1;const b=t(r,y);typeof b=="function"&&(d=b,r.addEventListener("pointerleave",m,i))};r.addEventListener("pointerenter",g,i),r.addEventListener("pointerdown",p,i)}),o}const yr=(e,t)=>t?e===t?!0:yr(e,t.parentElement):!1,Rs=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Gl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Hl(e){return Gl.has(e.tagName)||e.isContentEditable===!0}const Xl=new Set(["INPUT","SELECT","TEXTAREA"]);function Yl(e){return Xl.has(e.tagName)||e.isContentEditable===!0}const nt=new WeakSet;function cn(e){return t=>{t.key==="Enter"&&e(t)}}function Pt(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ql=(e,t)=>{const s=e.currentTarget;if(!s)return;const n=cn(()=>{if(nt.has(s))return;Pt(s,"down");const i=cn(()=>{Pt(s,"up")}),o=()=>Pt(s,"cancel");s.addEventListener("keyup",i,t),s.addEventListener("blur",o,t)});s.addEventListener("keydown",n,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),t)};function un(e){return Rs(e)&&!xr()}const dn=new WeakSet;function Zl(e,t,s={}){const[n,i,o]=gr(e,s),r=l=>{const u=l.currentTarget;if(!un(l)||dn.has(l))return;nt.add(u),s.stopPropagation&&dn.add(l);const d=t(u,l),c=(p,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),nt.has(u)&&nt.delete(u),un(p)&&typeof d=="function"&&d(p,{success:m})},h=p=>{c(p,u===window||u===document||s.useGlobalTarget||yr(u,p.target))},f=p=>{c(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return n.forEach(l=>{(s.useGlobalTarget?window:l).addEventListener("pointerdown",r,i),st(l)&&(l.addEventListener("focus",d=>ql(d,i)),!Hl(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),o}function Ls(e){return ji(e)&&"ownerSVGElement"in e}const it=new WeakMap;let oe;const vr=(e,t,s)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:Ls(n)&&"getBBox"in n?n.getBBox()[t]:n[s],Jl=vr("inline","width","offsetWidth"),Ql=vr("block","height","offsetHeight");function ec({target:e,borderBoxSize:t}){var s;(s=it.get(e))==null||s.forEach(n=>{n(e,{get width(){return Jl(e,t)},get height(){return Ql(e,t)}})})}function tc(e){e.forEach(ec)}function sc(){typeof ResizeObserver>"u"||(oe=new ResizeObserver(tc))}function nc(e,t){oe||sc();const s=mr(e);return s.forEach(n=>{let i=it.get(n);i||(i=new Set,it.set(n,i)),i.add(t),oe==null||oe.observe(n)}),()=>{s.forEach(n=>{const i=it.get(n);i==null||i.delete(t),i!=null&&i.size||oe==null||oe.unobserve(n)})}}const rt=new Set;let ve;function ic(){ve=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};rt.forEach(t=>t(e))},window.addEventListener("resize",ve)}function rc(e){return rt.add(e),ve||ic(),()=>{rt.delete(e),!rt.size&&typeof ve=="function"&&(window.removeEventListener("resize",ve),ve=void 0)}}function hn(e,t){return typeof e=="function"?rc(e):nc(e,t)}function oc(e){return Ls(e)&&e.tagName==="svg"}const ac=[...dr,R,X],lc=e=>ac.find(ur(e)),fn=()=>({translate:0,scale:1,origin:0,originPoint:0}),be=()=>({x:fn(),y:fn()}),mn=()=>({min:0,max:0}),L=()=>({x:mn(),y:mn()}),cc=new WeakMap;function gt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Oe(e){return typeof e=="string"||Array.isArray(e)}const Is=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fs=["initial",...Is];function yt(e){return gt(e.animate)||Fs.some(t=>Oe(e[t]))}function br(e){return!!(yt(e)||e.variants)}function uc(e,t,s){for(const n in t){const i=t[n],o=s[n];if(O(i))e.addValue(n,i);else if(O(o))e.addValue(n,Ce(i,{owner:e}));else if(o!==i)if(e.hasValue(n)){const r=e.getValue(n);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=e.getStaticValue(n);e.addValue(n,Ce(r!==void 0?r:i,{owner:e}))}}for(const n in s)t[n]===void 0&&e.removeValue(n);return t}const ns={current:null},wr={current:!1},dc=typeof window<"u";function hc(){if(wr.current=!0,!!dc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ns.current=e.matches;e.addEventListener("change",t),t()}else ns.current=!1}const pn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ht={};function jr(e){ht=e}function fc(){return ht}class mc{scrapeMotionValuesFromProps(t,s,n){return{}}constructor({parent:t,props:s,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ns,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=z.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,V.render(this.render,!1,!0))};const{latestValues:d,renderState:c}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=s.initial?{...d}:{},this.renderState=c,this.parent=t,this.props=s,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=u,this.blockInitialAnimation=!!r,this.isControllingVariants=yt(s),this.isVariantNode=br(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(s,{},this);for(const p in f){const m=f[p];d[p]!==void 0&&O(m)&&m.set(d[p])}}mount(t){var s,n;if(this.hasBeenMounted)for(const i in this.initialValues)(s=this.values.get(i))==null||s.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,cc.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(wr.current||hc(),this.shouldReduceMotion=ns.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),le(this.notifyUpdate),le(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const n=this.features[s];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&Ul.has(t)&&this.current instanceof HTMLElement){const{factory:r,keyframes:l,times:u,ease:d,duration:c}=s.accelerate,h=new tr({element:this.current,name:t,keyframes:l,times:u,ease:d,duration:U(c)}),f=r(h);this.valueSubscriptions.set(t,()=>{f(),h.cancel()});return}const n=Ae.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=s.on("change",r=>{this.latestValues[t]=r,this.props.onUpdate&&V.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ht){const s=ht[t];if(!s)continue;const{isEnabled:n,Feature:i}=s;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):L()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let n=0;n<pn.length;n++){const i=pn[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=t[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=uc(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const n=this.values.get(t);s!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&s!==void 0&&(n=Ce(s===null?void 0:s,{owner:this}),this.addValue(t,n)),n}readValue(t,s){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(wi(n)||Ti(n))?n=parseFloat(n):!lc(n)&&X.test(s)&&(n=fr(t,s)),this.setBaseTarget(t,O(n)?n.get():n)),O(n)?n.get():n}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){var o;const{initial:s}=this.props;let n;if(typeof s=="string"||typeof s=="object"){const r=Vs(this.props,s,(o=this.presenceContext)==null?void 0:o.custom);r&&(n=r[t])}if(s&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!O(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new xs),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){Es.render(this.render)}}class Tr extends mc{constructor(){super(...arguments),this.KeyframeResolver=$l}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const n=t.style;return n?n[s]:void 0}removeValueFromRenderState(t,{vars:s,style:n}){delete s[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;O(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class ce{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Sr({top:e,left:t,right:s,bottom:n}){return{x:{min:t,max:s},y:{min:e,max:n}}}function pc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xc(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Nt(e){return e===void 0||e===1}function is({scale:e,scaleX:t,scaleY:s}){return!Nt(e)||!Nt(t)||!Nt(s)}function he(e){return is(e)||Cr(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cr(e){return xn(e.x)||xn(e.y)}function xn(e){return e&&e!=="0%"}function ft(e,t,s){const n=e-s,i=t*n;return s+i}function gn(e,t,s,n,i){return i!==void 0&&(e=ft(e,i,n)),ft(e,s,n)+t}function rs(e,t=0,s=1,n,i){e.min=gn(e.min,t,s,n,i),e.max=gn(e.max,t,s,n,i)}function Pr(e,{x:t,y:s}){rs(e.x,t.translate,t.scale,t.originPoint),rs(e.y,s.translate,s.scale,s.originPoint)}const yn=.999999999999,vn=1.0000000000001;function gc(e,t,s,n=!1){var l;const i=s.length;if(!i)return;t.x=t.y=1;let o,r;for(let u=0;u<i;u++){o=s[u],r=o.projectionDelta;const{visualElement:d}=o.options;d&&d.props.style&&d.props.style.display==="contents"||(n&&o.options.layoutScroll&&o.scroll&&o!==o.root&&je(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(t.x*=r.x.scale,t.y*=r.y.scale,Pr(e,r)),n&&he(o.latestValues)&&je(e,o.latestValues,(l=o.layout)==null?void 0:l.layoutBox))}t.x<vn&&t.x>yn&&(t.x=1),t.y<vn&&t.y>yn&&(t.y=1)}function we(e,t){e.min=e.min+t,e.max=e.max+t}function bn(e,t,s,n,i=.5){const o=k(e.min,e.max,i);rs(e,t,s,o,n)}function wn(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function je(e,t,s){const n=s??e;bn(e.x,wn(t.x,n.x),t.scaleX,t.scale,t.originX),bn(e.y,wn(t.y,n.y),t.scaleY,t.scale,t.originY)}function Nr(e,t){return Sr(xc(e.getBoundingClientRect(),t))}function yc(e,t,s){const n=Nr(e,s),{scroll:i}=t;return i&&(we(n.x,i.offset.x),we(n.y,i.offset.y)),n}const vc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bc=Ne.length;function wc(e,t,s){let n="",i=!0;for(let o=0;o<bc;o++){const r=Ne[o],l=e[r];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(r.startsWith("scale")?1:0);else{const d=parseFloat(l);u=r.startsWith("scale")?d===1:d===0}if(!u||s){const d=pr(l,ks[r]);if(!u){i=!1;const c=vc[r]||r;n+=`${c}(${d}) `}s&&(t[r]=d)}}return n=n.trim(),s?n=s(t,i?"":n):i&&(n="none"),n}function Bs(e,t,s){const{style:n,vars:i,transformOrigin:o}=e;let r=!1,l=!1;for(const u in t){const d=t[u];if(Ae.has(u)){r=!0;continue}else if(Bi(u)){i[u]=d;continue}else{const c=pr(d,ks[u]);u.startsWith("origin")?(l=!0,o[u]=c):n[u]=c}}if(t.transform||(r||s?n.transform=wc(t,e.transform,s):n.transform&&(n.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:c=0}=o;n.transformOrigin=`${u} ${d} ${c}`}}function Ar(e,{style:t,vars:s},n,i){const o=e.style;let r;for(r in t)o[r]=t[r];i==null||i.applyProjectionStyles(o,n);for(r in s)o.setProperty(r,s[r])}function jn(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ve={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(C.test(e))e=parseFloat(e);else return e;const s=jn(e,t.target.x),n=jn(e,t.target.y);return`${s}% ${n}%`}},jc={correct:(e,{treeScale:t,projectionDelta:s})=>{const n=e,i=X.parse(e);if(i.length>5)return n;const o=X.createTransformer(e),r=typeof i[0]!="number"?1:0,l=s.x.scale*t.x,u=s.y.scale*t.y;i[0+r]/=l,i[1+r]/=u;const d=k(l,u,.5);return typeof i[2+r]=="number"&&(i[2+r]/=d),typeof i[3+r]=="number"&&(i[3+r]/=d),o(i)}},os={borderRadius:{...Ve,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomLeftRadius:Ve,borderBottomRightRadius:Ve,boxShadow:jc};function Mr(e,{layout:t,layoutId:s}){return Ae.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!os[e]||e==="opacity")}function Os(e,t,s){var r;const n=e.style,i=t==null?void 0:t.style,o={};if(!n)return o;for(const l in n)(O(n[l])||i&&O(i[l])||Mr(l,e)||((r=s==null?void 0:s.getValue(l))==null?void 0:r.liveStyle)!==void 0)&&(o[l]=n[l]);return o}function Tc(e){return window.getComputedStyle(e)}class Sc extends Tr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(t,s){var n;if(Ae.has(s))return(n=this.projection)!=null&&n.isProjecting?Gt(s):Wa(t,s);{const i=Tc(t),o=(Bi(s)?i.getPropertyValue(s):i[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return Nr(t,s)}build(t,s,n){Bs(t,s,n.transformTemplate)}scrapeMotionValuesFromProps(t,s,n){return Os(t,s,n)}}const Cc={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pc={offset:"strokeDashoffset",array:"strokeDasharray"};function Nc(e,t,s=1,n=0,i=!0){e.pathLength=1;const o=i?Cc:Pc;e[o.offset]=`${-n}`,e[o.array]=`${t} ${s}`}const Ac=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Vr(e,{attrX:t,attrY:s,attrScale:n,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...l},u,d,c){if(Bs(e,l,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const p of Ac)h[p]!==void 0&&(f[p]=h[p],delete h[p]);t!==void 0&&(h.x=t),s!==void 0&&(h.y=s),n!==void 0&&(h.scale=n),i!==void 0&&Nc(h,i,o,r,!1)}const Dr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),kr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Mc(e,t,s,n){Ar(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(Dr.has(i)?i:Ds(i),t.attrs[i])}function Er(e,t,s){const n=Os(e,t,s);for(const i in e)if(O(e[i])||O(t[i])){const o=Ne.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[o]=e[i]}return n}class Vc extends Tr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=L}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(Ae.has(s)){const n=hr(s);return n&&n.default||0}return s=Dr.has(s)?s:Ds(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,n){return Er(t,s,n)}build(t,s,n){Vr(t,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,s,n,i){Mc(t,s,n,i)}mount(t){this.isSVGTag=kr(t.tagName),super.mount(t)}}const Dc=Fs.length;function Rr(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?Rr(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<Dc;s++){const n=Fs[s],i=e.props[n];(Oe(i)||i===!1)&&(t[n]=i)}return t}function Lr(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let n=0;n<s;n++)if(t[n]!==e[n])return!1;return!0}const kc=[...Is].reverse(),Ec=Is.length;function Rc(e){return t=>Promise.all(t.map(({animation:s,options:n})=>Vl(e,s,n)))}function Lc(e){let t=Rc(e),s=Tn(),n=!0,i=!1;const o=d=>(c,h)=>{var p;const f=Te(e,h,d==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:g,...y}=f;c={...c,...y,...g}}return c};function r(d){t=d(e)}function l(d){const{props:c}=e,h=Rr(e.parent)||{},f=[],p=new Set;let m={},g=1/0;for(let b=0;b<Ec;b++){const j=kc[b],w=s[j],v=c[j]!==void 0?c[j]:h[j],S=Oe(v),A=j===d?w.isActive:null;A===!1&&(g=b);let M=v===h[j]&&v!==c[j]&&S;if(M&&(n||i)&&e.manuallyAnimateOnMount&&(M=!1),w.protectedKeys={...m},!w.isActive&&A===null||!v&&!w.prevProp||gt(v)||typeof v=="boolean")continue;if(j==="exit"&&w.isActive&&A!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const T=Ic(w.prevProp,v);let P=T||j===d&&w.isActive&&!M&&S||b>g&&S,N=!1;const D=Array.isArray(v)?v:[v];let I=D.reduce(o(j),{});A===!1&&(I={});const{prevResolvedValues:ee={}}=w,Y={...ee,...I},te=F=>{P=!0,p.has(F)&&(N=!0,p.delete(F)),w.needsAnimating[F]=!0;const _=e.getValue(F);_&&(_.liveStyle=!1)};for(const F in Y){const _=I[F],ue=ee[F];if(m.hasOwnProperty(F))continue;let xe=!1;Jt(_)&&Jt(ue)?xe=!Lr(_,ue):xe=_!==ue,xe?_!=null?te(F):p.add(F):_!==void 0&&p.has(F)?te(F):w.protectedKeys[F]=!0}w.prevProp=v,w.prevResolvedValues=I,w.isActive&&(m={...m,...I}),(n||i)&&e.blockInitialAnimation&&(P=!1);const q=M&&T;P&&(!q||N)&&f.push(...D.map(F=>{const _={type:j};if(typeof F=="string"&&(n||i)&&!q&&e.manuallyAnimateOnMount&&e.parent){const{parent:ue}=e,xe=Te(ue,F);if(ue.enteringChildren&&xe){const{delayChildren:oo}=xe.transition||{};_.delay=nr(ue.enteringChildren,e,oo)}}return{animation:F,options:_}}))}if(p.size){const b={};if(typeof c.initial!="boolean"){const j=Te(e,Array.isArray(c.initial)?c.initial[0]:c.initial);j&&j.transition&&(b.transition=j.transition)}p.forEach(j=>{const w=e.getBaseTarget(j),v=e.getValue(j);v&&(v.liveStyle=!0),b[j]=w??null}),f.push({animation:b})}let y=!!f.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),n=!1,i=!1,y?t(f):Promise.resolve()}function u(d,c){var f;if(s[d].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(d,c)}),s[d].isActive=c;const h=l(d);for(const p in s)s[p].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:r,getState:()=>s,reset:()=>{s=Tn(),i=!0}}}function Ic(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lr(t,e):!1}function de(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tn(){return{animate:de(!0),whileInView:de(),whileHover:de(),whileTap:de(),whileDrag:de(),whileFocus:de(),exit:de()}}function Sn(e,t){e.min=t.min,e.max=t.max}function G(e,t){Sn(e.x,t.x),Sn(e.y,t.y)}function Cn(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Ir=1e-4,Fc=1-Ir,Bc=1+Ir,Fr=.01,Oc=0-Fr,zc=0+Fr;function $(e){return e.max-e.min}function $c(e,t,s){return Math.abs(e-t)<=s}function Pn(e,t,s,n=.5){e.origin=n,e.originPoint=k(t.min,t.max,e.origin),e.scale=$(s)/$(t),e.translate=k(s.min,s.max,e.origin)-e.originPoint,(e.scale>=Fc&&e.scale<=Bc||isNaN(e.scale))&&(e.scale=1),(e.translate>=Oc&&e.translate<=zc||isNaN(e.translate))&&(e.translate=0)}function Re(e,t,s,n){Pn(e.x,t.x,s.x,n?n.originX:void 0),Pn(e.y,t.y,s.y,n?n.originY:void 0)}function Nn(e,t,s){e.min=s.min+t.min,e.max=e.min+$(t)}function Uc(e,t,s){Nn(e.x,t.x,s.x),Nn(e.y,t.y,s.y)}function An(e,t,s){e.min=t.min-s.min,e.max=e.min+$(t)}function mt(e,t,s){An(e.x,t.x,s.x),An(e.y,t.y,s.y)}function Mn(e,t,s,n,i){return e-=t,e=ft(e,1/s,n),i!==void 0&&(e=ft(e,1/i,n)),e}function _c(e,t=0,s=1,n=.5,i,o=e,r=e){if(J.test(t)&&(t=parseFloat(t),t=k(r.min,r.max,t/100)-r.min),typeof t!="number")return;let l=k(o.min,o.max,n);e===o&&(l-=t),e.min=Mn(e.min,t,s,l,i),e.max=Mn(e.max,t,s,l,i)}function Vn(e,t,[s,n,i],o,r){_c(e,t[s],t[n],t[i],t.scale,o,r)}const Wc=["x","scaleX","originX"],Kc=["y","scaleY","originY"];function Dn(e,t,s,n){Vn(e.x,t,Wc,s?s.x:void 0,n?n.x:void 0),Vn(e.y,t,Kc,s?s.y:void 0,n?n.y:void 0)}function kn(e){return e.translate===0&&e.scale===1}function Br(e){return kn(e.x)&&kn(e.y)}function En(e,t){return e.min===t.min&&e.max===t.max}function Gc(e,t){return En(e.x,t.x)&&En(e.y,t.y)}function Rn(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Or(e,t){return Rn(e.x,t.x)&&Rn(e.y,t.y)}function Ln(e){return $(e.x)/$(e.y)}function In(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Z(e){return[e("x"),e("y")]}function Hc(e,t,s){let n="";const i=e.x.translate/t.x,o=e.y.translate/t.y,r=(s==null?void 0:s.z)||0;if((i||o||r)&&(n=`translate3d(${i}px, ${o}px, ${r}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:d,rotate:c,rotateX:h,rotateY:f,skewX:p,skewY:m}=s;d&&(n=`perspective(${d}px) ${n}`),c&&(n+=`rotate(${c}deg) `),h&&(n+=`rotateX(${h}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),m&&(n+=`skewY(${m}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(n+=`scale(${l}, ${u})`),n||"none"}const zr=["TopLeft","TopRight","BottomLeft","BottomRight"],Xc=zr.length,Fn=e=>typeof e=="string"?parseFloat(e):e,Bn=e=>typeof e=="number"||C.test(e);function Yc(e,t,s,n,i,o){i?(e.opacity=k(0,s.opacity??1,qc(n)),e.opacityExit=k(t.opacity??1,0,Zc(n))):o&&(e.opacity=k(t.opacity??1,s.opacity??1,n));for(let r=0;r<Xc;r++){const l=`border${zr[r]}Radius`;let u=On(t,l),d=On(s,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||Bn(u)===Bn(d)?(e[l]=Math.max(k(Fn(u),Fn(d),n),0),(J.test(d)||J.test(u))&&(e[l]+="%")):e[l]=d}(t.rotate||s.rotate)&&(e.rotate=k(t.rotate||0,s.rotate||0,n))}function On(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const qc=$r(0,.5,ki),Zc=$r(.5,.95,K);function $r(e,t,s){return n=>n<e?0:n>t?1:s(Fe(e,t,n))}function Jc(e,t,s){const n=O(e)?e:Ce(e);return n.start(Ms("",n,t,s)),n.animation}function ze(e,t,s,n={passive:!0}){return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s)}const Qc=(e,t)=>e.depth-t.depth;class eu{constructor(){this.children=[],this.isDirty=!1}add(t){ms(this.children,t),this.isDirty=!0}remove(t){lt(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Qc),this.isDirty=!1,this.children.forEach(t)}}function tu(e,t){const s=z.now(),n=({timestamp:i})=>{const o=i-s;o>=t&&(le(n),e(o-t))};return V.setup(n,!0),()=>le(n)}function ot(e){return O(e)?e.get():e}class su{constructor(){this.members=[]}add(t){ms(this.members,t);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(lt(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(lt(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){var s;for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&((s=i.instance)==null?void 0:s.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,s){var i;const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=n.options,{layoutDependency:r}=t.options;(o===void 0||o!==r)&&(t.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var s,n,i,o,r;(n=(s=t.options).onExitComplete)==null||n.call(s),(r=(i=t.resumingFrom)==null?void 0:(o=i.options).onExitComplete)==null||r.call(o)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const at={hasAnimatedSinceResize:!0,hasEverUpdated:!1},At=["","X","Y","Z"],nu=1e3;let iu=0;function Mt(e,t,s,n){const{latestValues:i}=t;i[e]&&(s[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Ur(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=lr(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",V,!(i||o))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Ur(n)}function _r({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(r={},l=t==null?void 0:t()){this.id=iu++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(au),this.nodes.forEach(du),this.nodes.forEach(hu),this.nodes.forEach(lu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new eu)}addEventListener(r,l){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new xs),this.eventHandlers.get(r).add(l)}notifyListeners(r,...l){const u=this.eventHandlers.get(r);u&&u.notify(...l)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Ls(r)&&!oc(r),this.instance=r;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),e){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;V.read(()=>{h=window.innerWidth}),e(r,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,c&&c(),c=tu(f,250),at.hasAnimatedSinceResize&&(at.hasAnimatedSinceResize=!1,this.nodes.forEach(Un)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||gu,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=d.getProps(),b=!this.targetLayout||!Or(this.targetLayout,p),j=!h&&f;if(this.options.layoutRoot||this.resumeFrom||j||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...As(m,"layout"),onPlay:g,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(c,j)}else h||Un(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),le(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fu),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ur(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(zn);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($n);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(uu),this.nodes.forEach(ru),this.nodes.forEach(ou)):this.nodes.forEach($n),this.clearAllSnapshots();const l=z.now();B.delta=Q(0,1e3/60,l-B.timestamp),B.timestamp=l,B.isProcessing=!0,bt.update.process(B),bt.preRender.process(B),bt.render.process(B),B.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Es.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cu),this.sharedNodes.forEach(mu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$(this.snapshot.measuredBox.x)&&!$(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=L(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(l=!1),l&&this.instance){const u=n(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:u,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Br(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,c=d!==this.prevTransformTemplateValue;r&&this.instance&&(l||he(this.latestValues)||c)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return r&&(u=this.removeTransform(u)),yu(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:r}=this.options;if(!r)return L();const l=r.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(vu))){const{scroll:c}=this.root;c&&(we(l.x,c.offset.x),we(l.y,c.offset.y))}return l}removeElementScroll(r){var u;const l=L();if(G(l,r),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const c=this.path[d],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&G(l,r),we(l.x,h.offset.x),we(l.y,h.offset.y))}return l}applyTransform(r,l=!1){var d,c;const u=L();G(u,r);for(let h=0;h<this.path.length;h++){const f=this.path[h];!l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&je(u,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),he(f.latestValues)&&je(u,f.latestValues,(d=f.layout)==null?void 0:d.layoutBox)}return he(this.latestValues)&&je(u,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),u}removeTransform(r){var u;const l=L();G(l,r);for(let d=0;d<this.path.length;d++){const c=this.path[d];if(!he(c.latestValues))continue;let h;c.instance&&(is(c.latestValues)&&c.updateSnapshot(),h=L(),G(h,c.measurePageBox())),Dn(l,c.latestValues,(u=c.snapshot)==null?void 0:u.layoutBox,h)}return he(this.latestValues)&&Dn(l,this.latestValues),l}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==B.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(r||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=B.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=L(),this.targetWithTransforms=L()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Uc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):G(this.target,this.layout.layoutBox),Pr(this.target,this.targetDelta)):G(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||is(this.parent.latestValues)||Cr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,l,u){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=L(),this.relativeTargetOrigin=L(),mt(this.relativeTargetOrigin,l,u),G(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const r=this.getLead(),l=!!this.resumingFrom||this!==r;let u=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===B.timestamp&&(u=!1),u)return;const{layout:d,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||c))return;G(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;gc(this.layoutCorrected,this.treeScale,this.path,l),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=L());const{target:p}=r;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cn(this.prevProjectionDelta.x,this.projectionDelta.x),Cn(this.prevProjectionDelta.y,this.projectionDelta.y)),Re(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!In(this.projectionDelta.x,this.prevProjectionDelta.x)||!In(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),r){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=be(),this.projectionDelta=be(),this.projectionDeltaWithTransform=be()}setAnimationOrigin(r,l=!1){const u=this.snapshot,d=u?u.latestValues:{},c={...this.latestValues},h=be();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=L(),p=u?u.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,y=this.getStack(),b=!y||y.members.length<=1,j=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(xu));this.animationProgress=0;let w;this.mixTargetDelta=v=>{const S=v/1e3;_n(h.x,r.x,S),_n(h.y,r.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pu(this.relativeTarget,this.relativeTargetOrigin,f,S),w&&Gc(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=L()),G(w,this.relativeTarget)),g&&(this.animationValues=c,Yc(c,d,this.latestValues,S,j,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(le(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{at.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ce(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),r.onUpdate&&r.onUpdate(c)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:c}=r;if(!(!l||!u||!d)){if(this!==r&&this.layout&&d&&Wr(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||L();const h=$(this.layout.layoutBox.x);u.x.min=r.target.x.min,u.x.max=u.x.min+h;const f=$(this.layout.layoutBox.y);u.y.min=r.target.y.min,u.y.max=u.y.min+f}G(l,u),je(l,c),Re(this.projectionDeltaWithTransform,this.layoutCorrected,l,c)}}registerSharedNode(r,l){this.sharedNodes.has(r)||this.sharedNodes.set(r,new su),this.sharedNodes.get(r).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var l;const{layoutId:r}=this.options;return r?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:r}=this.options;return r?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),r&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let l=!1;const{latestValues:u}=r;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&Mt("z",r,d,this.animationValues);for(let c=0;c<At.length;c++)Mt(`rotate${At[c]}`,r,d,this.animationValues),Mt(`skew${At[c]}`,r,d,this.animationValues);r.render();for(const c in d)r.setStaticValue(c,d[c]),this.animationValues&&(this.animationValues[c]=d[c]);r.scheduleRender()}applyProjectionStyles(r,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=ot(l==null?void 0:l.pointerEvents)||"",r.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=ot(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!he(this.latestValues)&&(r.transform=u?u({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=d.animationValues||d.latestValues;this.applyTransformsToTarget();let h=Hc(this.projectionDeltaWithTransform,this.treeScale,c);u&&(h=u(c,h)),r.transform=h;const{x:f,y:p}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,d.animationValues?r.opacity=d===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=d===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in os){if(c[m]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:b}=os[m],j=h==="none"?c[m]:g(c[m],d);if(y){const w=y.length;for(let v=0;v<w;v++)r[y[v]]=j}else b?this.options.visualElement.renderState.vars[m]=j:r[m]=j}this.options.layoutId&&(r.pointerEvents=d===this?ot(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var l;return(l=r.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(zn),this.root.sharedNodes.clear()}}}function ru(e){e.updateLayout()}function ou(e){var s;const t=((s=e.resumeFrom)==null?void 0:s.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:o}=e.options,r=t.source!==e.layout.source;o==="size"?Z(h=>{const f=r?t.measuredBox[h]:t.layoutBox[h],p=$(f);f.min=n[h].min,f.max=f.min+p}):Wr(o,t.layoutBox,n)&&Z(h=>{const f=r?t.measuredBox[h]:t.layoutBox[h],p=$(n[h]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=be();Re(l,n,t.layoutBox);const u=be();r?Re(u,e.applyTransform(i,!0),t.measuredBox):Re(u,n,t.layoutBox);const d=!Br(l);let c=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const m=L();mt(m,t.layoutBox,f.layoutBox);const g=L();mt(g,n,p.layoutBox),Or(m,g)||(c=!0),h.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function au(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function lu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cu(e){e.clearSnapshot()}function zn(e){e.clearMeasurements()}function $n(e){e.isLayoutDirty=!1}function uu(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Un(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function du(e){e.resolveTargetDelta()}function hu(e){e.calcProjection()}function fu(e){e.resetSkewAndRotation()}function mu(e){e.removeLeadSnapshot()}function _n(e,t,s){e.translate=k(t.translate,0,s),e.scale=k(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function Wn(e,t,s,n){e.min=k(t.min,s.min,n),e.max=k(t.max,s.max,n)}function pu(e,t,s,n){Wn(e.x,t.x,s.x,n),Wn(e.y,t.y,s.y,n)}function xu(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const gu={duration:.45,ease:[.4,0,.1,1]},Kn=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gn=Kn("applewebkit/")&&!Kn("chrome/")?Math.round:K;function Hn(e){e.min=Gn(e.min),e.max=Gn(e.max)}function yu(e){Hn(e.x),Hn(e.y)}function Wr(e,t,s){return e==="position"||e==="preserve-aspect"&&!$c(Ln(t),Ln(s),.2)}function vu(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const bu=_r({attachResizeListener:(e,t)=>ze(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Vt={current:void 0},Kr=_r({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vt.current){const e=new bu({});e.mount(window),e.setOptions({layoutScroll:!0}),Vt.current=e}return Vt.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zs=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Xn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wu(...e){return t=>{let s=!1;const n=e.map(i=>{const o=Xn(i,t);return!s&&typeof o=="function"&&(s=!0),o});if(s)return()=>{for(let i=0;i<n.length;i++){const o=n[i];typeof o=="function"?o():Xn(e[i],null)}}}}function ju(...e){return x.useCallback(wu(...e),e)}class Tu extends x.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(st(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const n=s.offsetParent,i=st(n)&&n.offsetWidth||0,o=st(n)&&n.offsetHeight||0,r=getComputedStyle(s),l=this.props.sizeRef.current;l.height=parseFloat(r.height),l.width=parseFloat(r.width),l.top=s.offsetTop,l.left=s.offsetLeft,l.right=i-l.width-l.left,l.bottom=o-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Su({children:e,isPresent:t,anchorX:s,anchorY:n,root:i,pop:o}){var f;const r=x.useId(),l=x.useRef(null),u=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=x.useContext(zs),c=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),h=ju(l,c);return x.useInsertionEffect(()=>{const{width:p,height:m,top:g,left:y,right:b,bottom:j}=u.current;if(t||o===!1||!l.current||!p||!m)return;const w=s==="left"?`left: ${y}`:`right: ${b}`,v=n==="bottom"?`bottom: ${j}`:`top: ${g}`;l.current.dataset.motionPopId=r;const S=document.createElement("style");d&&(S.nonce=d);const A=i??document.head;return A.appendChild(S),S.sheet&&S.sheet.insertRule(`
|
|
28
|
-
[data-motion-pop-id="${r}"] {
|
|
29
|
-
position: absolute !important;
|
|
30
|
-
width: ${p}px !important;
|
|
31
|
-
height: ${m}px !important;
|
|
32
|
-
${w}px !important;
|
|
33
|
-
${v}px !important;
|
|
34
|
-
}
|
|
35
|
-
`),()=>{A.contains(S)&&A.removeChild(S)}},[t]),a.jsx(Tu,{isPresent:t,childRef:l,sizeRef:u,pop:o,children:o===!1?e:x.cloneElement(e,{ref:h})})}const Cu=({children:e,initial:t,isPresent:s,onExitComplete:n,custom:i,presenceAffectsLayout:o,mode:r,anchorX:l,anchorY:u,root:d})=>{const c=fs(Pu),h=x.useId();let f=!0,p=x.useMemo(()=>(f=!1,{id:h,initial:t,isPresent:s,custom:i,onExitComplete:m=>{c.set(m,!0);for(const g of c.values())if(!g)return;n&&n()},register:m=>(c.set(m,!1),()=>c.delete(m))}),[s,c,n]);return o&&f&&(p={...p}),x.useMemo(()=>{c.forEach((m,g)=>c.set(g,!1))},[s]),x.useEffect(()=>{!s&&!c.size&&n&&n()},[s]),e=a.jsx(Su,{pop:r==="popLayout",isPresent:s,anchorX:l,anchorY:u,root:d,children:e}),a.jsx(xt.Provider,{value:p,children:e})};function Pu(){return new Map}function Gr(e=!0){const t=x.useContext(xt);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:n,register:i}=t,o=x.useId();x.useEffect(()=>{if(e)return i(o)},[e]);const r=x.useCallback(()=>e&&n&&n(o),[o,n,e]);return!s&&n?[!1,r]:[!0]}const qe=e=>e.key||"";function Yn(e){const t=[];return x.Children.forEach(e,s=>{x.isValidElement(s)&&t.push(s)}),t}const Nu=({children:e,custom:t,initial:s=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[c,h]=Gr(r),f=x.useMemo(()=>Yn(e),[e]),p=r&&!c?[]:f.map(qe),m=x.useRef(!0),g=x.useRef(f),y=fs(()=>new Map),b=x.useRef(new Set),[j,w]=x.useState(f),[v,S]=x.useState(f);bi(()=>{m.current=!1,g.current=f;for(let T=0;T<v.length;T++){const P=qe(v[T]);p.includes(P)?(y.delete(P),b.current.delete(P)):y.get(P)!==!0&&y.set(P,!1)}},[v,p.length,p.join("-")]);const A=[];if(f!==j){let T=[...f];for(let P=0;P<v.length;P++){const N=v[P],D=qe(N);p.includes(D)||(T.splice(P,0,N),A.push(N))}return o==="wait"&&A.length&&(T=A),S(Yn(T)),w(f),null}const{forceRender:M}=x.useContext(hs);return a.jsx(a.Fragment,{children:v.map(T=>{const P=qe(T),N=r&&!c?!1:f===v||p.includes(P),D=()=>{if(b.current.has(P))return;if(b.current.add(P),y.has(P))y.set(P,!0);else return;let I=!0;y.forEach(ee=>{ee||(I=!1)}),I&&(M==null||M(),S(g.current),r&&(h==null||h()),n&&n())};return a.jsx(Cu,{isPresent:N,initial:!m.current||s?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:d,onExitComplete:N?void 0:D,anchorX:l,anchorY:u,children:T},P)})})},Hr=x.createContext({strict:!1}),qn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Zn=!1;function Au(){if(Zn)return;const e={};for(const t in qn)e[t]={isEnabled:s=>qn[t].some(n=>!!s[n])};jr(e),Zn=!0}function Xr(){return Au(),fc()}function Mu(e){const t=Xr();for(const s in e)t[s]={...t[s],...e[s]};jr(t)}const Vu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function pt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Vu.has(e)}let Yr=e=>!pt(e);function Du(e){typeof e=="function"&&(Yr=t=>t.startsWith("on")?!pt(t):e(t))}try{Du(require("@emotion/is-prop-valid").default)}catch{}function ku(e,t,s){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(Yr(i)||s===!0&&pt(i)||!t&&!pt(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}const vt=x.createContext({});function Eu(e,t){if(yt(e)){const{initial:s,animate:n}=e;return{initial:s===!1||Oe(s)?s:void 0,animate:Oe(n)?n:void 0}}return e.inherit!==!1?t:{}}function Ru(e){const{initial:t,animate:s}=Eu(e,x.useContext(vt));return x.useMemo(()=>({initial:t,animate:s}),[Jn(t),Jn(s)])}function Jn(e){return Array.isArray(e)?e.join(" "):e}const $s=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qr(e,t,s){for(const n in t)!O(t[n])&&!Mr(n,s)&&(e[n]=t[n])}function Lu({transformTemplate:e},t){return x.useMemo(()=>{const s=$s();return Bs(s,t,e),Object.assign({},s.vars,s.style)},[t])}function Iu(e,t){const s=e.style||{},n={};return qr(n,s,e),Object.assign(n,Lu(e,t)),n}function Fu(e,t){const s={},n=Iu(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=n,s}const Zr=()=>({...$s(),attrs:{}});function Bu(e,t,s,n){const i=x.useMemo(()=>{const o=Zr();return Vr(o,t,kr(n),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};qr(o,e.style,e),i.style={...o,...i.style}}return i}const Ou=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Us(e){return typeof e!="string"||e.includes("-")?!1:!!(Ou.indexOf(e)>-1||/[A-Z]/u.test(e))}function zu(e,t,s,{latestValues:n},i,o=!1,r){const u=(r??Us(e)?Bu:Fu)(t,n,i,e),d=ku(t,typeof e=="string",o),c=e!==x.Fragment?{...d,...u,ref:s}:{},{children:h}=t,f=x.useMemo(()=>O(h)?h.get():h,[h]);return x.createElement(e,{...c,children:f})}function $u({scrapeMotionValuesFromProps:e,createRenderState:t},s,n,i){return{latestValues:Uu(s,n,i,e),renderState:t()}}function Uu(e,t,s,n){const i={},o=n(e,{});for(const f in o)i[f]=ot(o[f]);let{initial:r,animate:l}=e;const u=yt(e),d=br(e);t&&d&&!u&&e.inherit!==!1&&(r===void 0&&(r=t.initial),l===void 0&&(l=t.animate));let c=s?s.initial===!1:!1;c=c||r===!1;const h=c?l:r;if(h&&typeof h!="boolean"&&!gt(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const m=Vs(e,f[p]);if(m){const{transitionEnd:g,transition:y,...b}=m;for(const j in b){let w=b[j];if(Array.isArray(w)){const v=c?w.length-1:0;w=w[v]}w!==null&&(i[j]=w)}for(const j in g)i[j]=g[j]}}}return i}const Jr=e=>(t,s)=>{const n=x.useContext(vt),i=x.useContext(xt),o=()=>$u(e,t,n,i);return s?o():fs(o)},_u=Jr({scrapeMotionValuesFromProps:Os,createRenderState:$s}),Wu=Jr({scrapeMotionValuesFromProps:Er,createRenderState:Zr}),Ku=Symbol.for("motionComponentSymbol");function Gu(e,t,s){const n=x.useRef(s);x.useInsertionEffect(()=>{n.current=s});const i=x.useRef(null);return x.useCallback(o=>{var l;o&&((l=e.onMount)==null||l.call(e,o));const r=n.current;if(typeof r=="function")if(o){const u=r(o);typeof u=="function"&&(i.current=u)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const Qr=x.createContext({});function ge(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Hu(e,t,s,n,i,o){var w,v;const{visualElement:r}=x.useContext(vt),l=x.useContext(Hr),u=x.useContext(xt),d=x.useContext(zs),c=d.reducedMotion,h=d.skipAnimations,f=x.useRef(null),p=x.useRef(!1);n=n||l.renderer,!f.current&&n&&(f.current=n(e,{visualState:t,parent:r,props:s,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:o}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,g=x.useContext(Qr);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&Xu(f.current,s,i,g);const y=x.useRef(!1);x.useInsertionEffect(()=>{m&&y.current&&m.update(s,u)});const b=s[ar],j=x.useRef(!!b&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,b))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,b)));return bi(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),j.current&&m.animationState&&m.animationState.animateChanges())}),x.useEffect(()=>{m&&(!j.current&&m.animationState&&m.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,b)}),j.current=!1),m.enteringChildren=void 0)}),m}function Xu(e,t,s,n){const{layoutId:i,layout:o,drag:r,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutCrossfade:c}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:eo(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||l&&ge(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,crossfade:c,layoutScroll:u,layoutRoot:d})}function eo(e){if(e)return e.options.allowProjection!==!1?e.projection:eo(e.parent)}function Dt(e,{forwardMotionProps:t=!1,type:s}={},n,i){n&&Mu(n);const o=s?s==="svg":Us(e),r=o?Wu:_u;function l(d,c){let h;const f={...x.useContext(zs),...d,layoutId:Yu(d)},{isStatic:p}=f,m=Ru(d),g=r(d,p);if(!p&&typeof window<"u"){qu();const y=Zu(f);h=y.MeasureLayout,m.visualElement=Hu(e,g,f,i,y.ProjectionNode,o)}return a.jsxs(vt.Provider,{value:m,children:[h&&m.visualElement?a.jsx(h,{visualElement:m.visualElement,...f}):null,zu(e,d,Gu(g,m.visualElement,c),g,p,t,o)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=x.forwardRef(l);return u[Ku]=e,u}function Yu({layoutId:e}){const t=x.useContext(hs).id;return t&&e!==void 0?t+"-"+e:e}function qu(e,t){x.useContext(Hr).strict}function Zu(e){const t=Xr(),{drag:s,layout:n}=t;if(!s&&!n)return{};const i={...s,...n};return{MeasureLayout:s!=null&&s.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Ju(e,t){if(typeof Proxy>"u")return Dt;const s=new Map,n=(o,r)=>Dt(o,r,e,t),i=(o,r)=>n(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?n:(s.has(r)||s.set(r,Dt(r,void 0,e,t)),s.get(r))})}const Qu=(e,t)=>t.isSVG??Us(e)?new Vc(t):new Sc(t,{allowProjection:e!==x.Fragment});class ed extends ce{constructor(t){super(t),t.animationState||(t.animationState=Lc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();gt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let td=0;class sd extends ce{constructor(){super(...arguments),this.id=td++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);s&&!t&&i.then(()=>{s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const nd={animation:{Feature:ed},exit:{Feature:sd}};function Ge(e){return{point:{x:e.pageX,y:e.pageY}}}const id=e=>t=>Rs(t)&&e(t,Ge(t));function Le(e,t,s,n){return ze(e,t,id(s),n)}const to=({current:e})=>e?e.ownerDocument.defaultView:null,Qn=(e,t)=>Math.abs(e-t);function rd(e,t){const s=Qn(e.x,t.x),n=Qn(e.y,t.y);return Math.sqrt(s**2+n**2)}const ei=new Set(["auto","scroll"]);class so{constructor(t,s,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ze(this.lastRawMoveEventInfo,this.transformPagePoint));const p=kt(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=rd(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:y}=p,{timestamp:b}=B;this.history.push({...y,timestamp:b});const{onStart:j,onMove:w}=this.handlers;m||(j&&j(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=Ze(m,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=kt(p.type==="pointercancel"?this.lastMoveEventInfo:Ze(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,j),y&&y(p,j)},!Rs(t))return;this.dragSnapToOrigin=o,this.handlers=s,this.transformPagePoint=n,this.distanceThreshold=r,this.contextWindow=i||window;const u=Ge(t),d=Ze(u,this.transformPagePoint),{point:c}=d,{timestamp:h}=B;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=s;f&&f(t,kt(d,this.history)),this.removeListeners=_e(Le(this.contextWindow,"pointermove",this.handlePointerMove),Le(this.contextWindow,"pointerup",this.handlePointerUp),Le(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let s=t.parentElement;for(;s;){const n=getComputedStyle(s);(ei.has(n.overflowX)||ei.has(n.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:i.x-s.x,y:i.y-s.y};o.x===0&&o.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,i),V.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),le(this.updatePoint)}}function Ze(e,t){return t?{point:t(e.point)}:e}function ti(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kt({point:e},t){return{point:e,delta:ti(e,no(t)),offset:ti(e,od(t)),velocity:ad(t,.1)}}function od(e){return e[0]}function no(e){return e[e.length-1]}function ad(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,n=null;const i=no(e);for(;s>=0&&(n=e[s],!(i.timestamp-n.timestamp>U(t)));)s--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>U(t)*2&&(n=e[1]);const o=W(i.timestamp-n.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-n.x)/o,y:(i.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ld(e,{min:t,max:s},n){return t!==void 0&&e<t?e=n?k(t,e,n.min):Math.max(e,t):s!==void 0&&e>s&&(e=n?k(s,e,n.max):Math.min(e,s)),e}function si(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function cd(e,{top:t,left:s,bottom:n,right:i}){return{x:si(e.x,s,i),y:si(e.y,t,n)}}function ni(e,t){let s=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,n]=[n,s]),{min:s,max:n}}function ud(e,t){return{x:ni(e.x,t.x),y:ni(e.y,t.y)}}function dd(e,t){let s=.5;const n=$(e),i=$(t);return i>n?s=Fe(t.min,t.max-n,e.min):n>i&&(s=Fe(e.min,e.max-i,t.min)),Q(0,1,s)}function hd(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const as=.35;function fd(e=as){return e===!1?e=0:e===!0&&(e=as),{x:ii(e,"left","right"),y:ii(e,"top","bottom")}}function ii(e,t,s){return{min:ri(e,t),max:ri(e,s)}}function ri(e,t){return typeof e=="number"?e:e[t]||0}const md=new WeakMap;class pd{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=L(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{s&&this.snapToCursor(Ge(h).point),this.stopAnimation()},r=(h,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_l(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Z(b=>{let j=this.getAxisMotionValue(b).get()||0;if(J.test(j)){const{projection:w}=this.visualElement;if(w&&w.layout){const v=w.layout.layoutBox[b];v&&(j=$(v)*(parseFloat(j)/100))}}this.originPoint[b]=j}),g&&V.update(()=>g(h,f),!1,!0),Qt(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=gd(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),y&&V.update(()=>y(h,f),!1,!0)},u=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new so(t,{onSessionStart:o,onStart:r,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:to(this.visualElement),element:this.visualElement.current})}stop(t,s){const n=t||this.latestPointerEvent,i=s||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:l}=this.getProps();l&&V.postRender(()=>l(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,n){const{drag:i}=this.getProps();if(!n||!Je(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=ld(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:s}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&ge(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=cd(n.layoutBox,t):this.constraints=!1,this.elastic=fd(s),i!==this.constraints&&!ge(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Z(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=hd(n.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!ge(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=yc(n,i.root,this.visualElement.getTransformPagePoint());let r=ud(i.layout.layoutBox,o);if(s){const l=s(pc(r));this.hasMutatedConstraints=!!l,l&&(r=Sr(l))}return r}startAnimation(t){const{drag:s,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Z(c=>{if(!Je(c,s,this.currentDirection))return;let h=u&&u[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:n?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(d).then(l)}startAxisValueAnimation(t,s){const n=this.getAxisMotionValue(t);return Qt(this.visualElement,t),n.start(Ms(t,n,0,s,this.visualElement,!1))}stopAnimation(){Z(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[s];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Z(s=>{const{drag:n}=this.getProps();if(!Je(s,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(s);if(i&&i.layout){const{min:r,max:l}=i.layout.layoutBox[s],u=o.get()||0;o.set(t[s]-k(r,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!ge(s)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Z(r=>{const l=this.getAxisMotionValue(r);if(l&&this.constraints!==!1){const u=l.get();i[r]=dd({min:u,max:u},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Z(r=>{if(!Je(r,t,null))return;const l=this.getAxisMotionValue(r),{min:u,max:d}=this.constraints[r];l.set(k(u,d,i[r]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;md.set(this.visualElement,this);const t=this.visualElement.current,s=Le(t,"pointerdown",d=>{const{drag:c,dragListener:h=!0}=this.getProps(),f=d.target,p=f!==t&&Yl(f);c&&h&&!p&&this.start(d)});let n;const i=()=>{const{dragConstraints:d}=this.getProps();ge(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),n||(n=xd(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,r=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),V.read(i);const l=ze(window,"resize",()=>this.scalePositionWithinConstraints()),u=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:c})=>{this.isDragging&&c&&(Z(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=d[h].translate,f.set(f.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),s(),r(),u&&u(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=as,dragMomentum:l=!0}=t;return{...t,drag:s,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:l}}}function oi(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function xd(e,t,s){const n=hn(e,oi(s)),i=hn(t,oi(s));return()=>{n(),i()}}function Je(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function gd(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class yd extends ce{constructor(t){super(t),this.removeGroupControls=K,this.removeListeners=K,this.controls=new pd(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||K}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Et=e=>(t,s)=>{e&&V.update(()=>e(t,s),!1,!0)};class vd extends ce{constructor(){super(...arguments),this.removePointerDownListener=K}onPointerDown(t){this.session=new so(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:to(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Et(t),onStart:Et(s),onMove:Et(n),onEnd:(o,r)=>{delete this.session,i&&V.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Le(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Rt=!1;class bd extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(s.group&&s.group.add(o),n&&n.register&&i&&n.register(o),Rt&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),at.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:n,drag:i,isPresent:o}=this.props,{projection:r}=n;return r&&(r.isPresent=o,t.layoutDependency!==s&&r.setOptions({...r.options,layoutDependency:s}),Rt=!0,i||t.layoutDependency!==s||s===void 0||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||V.postRender(()=>{const l=r.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Es.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:i}=t;Rt=!0,i&&(i.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function io(e){const[t,s]=Gr(),n=x.useContext(hs);return a.jsx(bd,{...e,layoutGroup:n,switchLayoutGroup:x.useContext(Qr),isPresent:t,safeToRemove:s})}const wd={pan:{Feature:vd},drag:{Feature:yd,ProjectionNode:Kr,MeasureLayout:io}};function ai(e,t,s){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",s==="Start");const i="onHover"+s,o=n[i];o&&V.postRender(()=>o(t,Ge(t)))}class jd extends ce{mount(){const{current:t}=this.node;t&&(this.unmount=Kl(t,(s,n)=>(ai(this.node,n,"Start"),i=>ai(this.node,i,"End"))))}unmount(){}}class Td extends ce{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_e(ze(this.node.current,"focus",()=>this.onFocus()),ze(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function li(e,t,s){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",s==="Start");const i="onTap"+(s==="End"?"":s),o=n[i];o&&V.postRender(()=>o(t,Ge(t)))}class Sd extends ce{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:n}=this.node.props;this.unmount=Zl(t,(i,o)=>(li(this.node,o,"Start"),(r,{success:l})=>li(this.node,r,l?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const ls=new WeakMap,Lt=new WeakMap,Cd=e=>{const t=ls.get(e.target);t&&t(e)},Pd=e=>{e.forEach(Cd)};function Nd({root:e,...t}){const s=e||document;Lt.has(s)||Lt.set(s,{});const n=Lt.get(s),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(Pd,{root:e,...t})),n[i]}function Ad(e,t,s){const n=Nd(t);return ls.set(e,s),n.observe(e),()=>{ls.delete(e),n.unobserve(e)}}const Md={some:0,all:1};class Vd extends ce{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:s,margin:n,amount:i="some",once:o}=t,r={root:s?s.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Md[i]},l=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=d?c:h;f&&f(u)};return Ad(this.node.current,r,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(Dd(t,s))&&this.startObserver()}unmount(){}}function Dd({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const kd={inView:{Feature:Vd},tap:{Feature:Sd},focus:{Feature:Td},hover:{Feature:jd}},Ed={layout:{ProjectionNode:Kr,MeasureLayout:io}},Rd={...nd,...kd,...wd,...Ed},ci=Ju(Rd,Qu),Ld={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function He({open:e,onClose:t,title:s,children:n,footer:i,size:o="md"}){const r=x.useCallback(l=>{l.key==="Escape"&&t()},[t]);return x.useEffect(()=>{if(e)return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,r]),a.jsx(Nu,{children:e&&a.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[a.jsx(ci.div,{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15}}),a.jsxs(ci.div,{className:ao("relative w-full mx-4 rounded-xl border border-border bg-bg-secondary shadow-2xl",Ld[o]),initial:{opacity:0,y:-16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-16,scale:.97},transition:{duration:.2,ease:"easeOut"},children:[s&&a.jsx("div",{className:"border-b border-border px-5 py-4",children:a.jsx("h2",{className:"text-base font-semibold text-text",children:s})}),a.jsx("div",{className:"px-5 py-4",children:n}),i&&a.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-border px-5 py-3",children:i})]})]})})}function ro({open:e,title:t,message:s,confirmLabel:n="Confirm",cancelLabel:i="Cancel",variant:o="danger",onConfirm:r,onCancel:l}){const[u,d]=x.useState(!1),c=async()=>{d(!0);try{await r()}finally{d(!1)}};return a.jsx(He,{open:e,onClose:()=>!u&&l(),title:t,size:"sm",footer:a.jsxs(a.Fragment,{children:[a.jsx(_s,{variant:"ghost",size:"sm",onClick:l,disabled:u,children:i}),a.jsx(_s,{variant:o==="danger"?"danger":"primary",size:"sm",onClick:c,loading:u,children:n})]}),children:a.jsx("div",{className:"text-sm text-text-secondary leading-relaxed",children:s})})}function Id(e){switch(e){case"active":return a.jsx(Ie,{size:12,className:"text-success animate-pulse"});case"paused":return a.jsx(jo,{size:12,className:"text-warning"});case"error":return a.jsx(cs,{size:12,className:"text-error"});default:return a.jsx(Co,{size:12,className:"text-text-muted"})}}function Fd(e){switch(e){case"active":return"border-success/30 bg-success/5";case"paused":return"border-warning/30 bg-warning/5";case"error":return"border-error/30 bg-error/5";default:return"border-border bg-bg-secondary"}}function Bd({agents:e,runs:t,collapsed:s=!1,onToggle:n,onAgentClick:i}){const[o,r]=x.useState(null);return s?a.jsxs("div",{className:"w-10 border-l border-border bg-bg-secondary flex flex-col items-center py-3 gap-3 shrink-0",children:[a.jsx("button",{onClick:n,className:"p-1.5 rounded hover:bg-bg-tertiary text-text-muted",children:a.jsx(lo,{size:14})}),e.map(l=>a.jsxs("button",{className:"relative",title:l.name,onClick:()=>i==null?void 0:i(l),children:[a.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-bold ${l.status==="error"?"bg-error/20 text-error":l.status==="active"?"bg-success/20 text-success":"bg-bg-tertiary text-text-muted"}`,children:l.name.charAt(0).toUpperCase()}),l.status==="active"&&a.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-success animate-pulse"})]},l.id))]}):a.jsxs("div",{className:"w-64 border-l border-border bg-bg-secondary flex flex-col h-full shrink-0",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[a.jsx("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:"Agents"}),a.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted",children:a.jsx(Ws,{size:14})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-2",children:[e.length===0&&a.jsx("div",{className:"text-center py-4 text-xs text-text-muted",children:"No agents registered"}),e.map(l=>{var f;const u=o===l.id,d=t.filter(p=>p.agentId===l.id),c=d[0],h=d.filter(p=>p.status==="failed"||p.status==="error").length;return a.jsxs("div",{className:`rounded-lg border p-2 cursor-pointer transition-colors ${Fd(l.status)}`,onClick:p=>{p.target.closest(".expand-toggle")?r(u?null:l.id):i==null||i(l)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-bold ${l.status==="error"?"bg-error/20 text-error":l.status==="active"?"bg-success/20 text-success":"bg-bg-tertiary text-text-muted"}`,children:l.name.charAt(0).toUpperCase()}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs font-medium truncate",children:l.name}),a.jsxs("div",{className:"text-[10px] text-text-muted flex items-center gap-1",children:[Id(l.status),a.jsx("span",{className:"capitalize",children:l.status}),l.model&&a.jsxs("span",{className:"truncate",children:["· ",l.model.split("/").pop()]})]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[l.status==="active"&&a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),a.jsx("button",{className:"expand-toggle p-0.5 rounded hover:bg-bg-tertiary text-text-muted",onClick:p=>{p.stopPropagation(),r(u?null:l.id)},children:a.jsx(Ws,{size:12,className:`transition-transform ${u?"rotate-90":""}`})})]})]}),u&&a.jsxs("div",{className:"mt-2 space-y-2 border-t border-border/50 pt-2",children:[a.jsxs("div",{className:"text-[10px] text-text-muted space-y-0.5",children:[a.jsxs("div",{children:["Role: ",l.role||"general"]}),a.jsxs("div",{children:["Tasks: ",l.totalTasksCompleted??0," completed"]}),l.totalCostUsd!==void 0&&a.jsxs("div",{children:["Cost: $",l.totalCostUsd.toFixed(2)]}),h>0&&a.jsxs("div",{className:"text-error",children:[h," failed run",h===1?"":"s"]})]}),c&&a.jsxs("div",{className:"text-[10px] bg-bg rounded p-1.5 border border-border",children:[a.jsxs("div",{className:"font-medium text-text-secondary flex items-center gap-1",children:[c.status==="succeeded"?a.jsx(Qe,{size:10,className:"text-success"}):c.status==="failed"||c.status==="error"?a.jsx(et,{size:10,className:"text-error"}):a.jsx(Ie,{size:10,className:"text-cyan animate-pulse"}),"Latest run"]}),a.jsxs("div",{className:c.status==="failed"||c.status==="error"?"text-error":"text-success",children:[c.status," · ",((f=c.toolsUsed)==null?void 0:f.length)??0," tools"]}),c.error&&a.jsx("div",{className:"text-error truncate mt-0.5",children:c.error})]})]})]},l.id)})]})]})}function ui(e){const t={active:"bg-success/10 text-success border-success/20",idle:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",paused:"bg-warning/10 text-warning border-warning/20",error:"bg-error/10 text-error border-error/20",stopped:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"};return t[e]||t.idle}function It(e){const t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}function Od({agent:e,onClose:t}){const[s,n]=x.useState([]),[i,o]=x.useState([]),[r,l]=x.useState(!0),[u,d]=x.useState(null),c=x.useCallback(async()=>{try{const[m,g]=await Promise.all([hi(e.id,10),co(20,void 0)]);n(m),o(g.traces||[])}catch{}l(!1)},[e.id]);x.useEffect(()=>{c();const m=setInterval(c,1e4);return()=>clearInterval(m)},[c]);const h=s[0],f=s.filter(m=>m.status==="failed"||m.status==="error"),p=s.reduce((m,g)=>m+g.toolsUsed.length,0);return a.jsx(He,{open:!0,onClose:t,size:"lg",title:e.name,children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center text-lg font-bold border ${ui(e.status)}`,children:e.name.charAt(0).toUpperCase()}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-semibold text-text",children:e.name}),a.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full border capitalize ${ui(e.status)}`,children:e.status})]}),a.jsxs("div",{className:"text-[11px] text-text-muted mt-0.5",children:[e.title||e.role," · ",e.model.split("/").pop()," · heartbeat ",It(e.lastHeartbeat)," ago"]})]})]}),a.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{icon:Qe,label:"Tasks",value:e.totalTasksCompleted,color:"text-success"},{icon:ds,label:"Cost",value:`$${e.totalCostUsd.toFixed(2)}`,color:"text-warning"},{icon:fi,label:"Tools",value:p,color:"text-accent"},{icon:et,label:"Failed",value:f.length,color:f.length>0?"text-error":"text-text-muted"}].map(m=>a.jsxs("div",{className:"bg-bg-secondary border border-border rounded-lg p-2.5 text-center",children:[a.jsx(m.icon,{size:14,className:`mx-auto mb-1 ${m.color}`}),a.jsx("div",{className:"text-sm font-bold text-text",children:m.value}),a.jsx("div",{className:"text-[9px] text-text-muted uppercase tracking-wider",children:m.label})]},m.label))}),e.status==="active"&&h&&h.status==="running"&&a.jsxs("div",{className:"bg-success/5 border border-success/20 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-success mb-1",children:[a.jsx(Ie,{size:12,className:"animate-pulse"}),a.jsx("span",{className:"font-medium",children:"Currently working"})]}),a.jsxs("div",{className:"text-[11px] text-text-secondary",children:["Run started ",It(h.startedAt)," ago · ",h.toolsUsed.length," tools used so far"]})]}),e.status==="error"&&(h==null?void 0:h.error)&&a.jsxs("div",{className:"bg-error/5 border border-error/20 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-error mb-1",children:[a.jsx(cs,{size:12}),a.jsx("span",{className:"font-medium",children:"Last error"})]}),a.jsx("div",{className:"text-[11px] text-text-secondary font-mono",children:h.error})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[a.jsx(xi,{size:12,className:"text-accent"}),"Recent Runs"]}),a.jsxs("span",{className:"text-[10px] text-text-muted",children:[s.length," total"]})]}),r?a.jsx("div",{className:"space-y-1.5",children:[1,2,3].map(m=>a.jsx("div",{className:"h-10 rounded-lg bg-bg-secondary animate-pulse"},m))}):s.length===0?a.jsx("div",{className:"text-center py-4 text-[11px] text-text-muted",children:"No runs recorded yet"}):a.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto pr-1",children:s.map(m=>a.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2 rounded-lg bg-bg-secondary border border-border",children:[m.status==="succeeded"?a.jsx(Qe,{size:12,className:"text-success shrink-0"}):m.status==="failed"||m.status==="error"?a.jsx(et,{size:12,className:"text-error shrink-0"}):a.jsx(zd,{size:12,className:"text-cyan animate-spin shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"text-[11px] text-text-secondary truncate",children:[m.source," · ",m.toolsUsed.length," tools"]}),a.jsxs("div",{className:"text-[10px] text-text-muted",children:[m.durationMs?`${m.durationMs}ms`:"..."," · ",It(m.startedAt)," ago"]})]}),m.error&&a.jsx("span",{className:"text-[10px] text-error truncate max-w-[120px]",title:m.error,children:m.error})]},m.id))})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-text-secondary",children:[a.jsx(gi,{size:12,className:"text-accent"}),"Recent Traces"]}),a.jsxs("span",{className:"text-[10px] text-text-muted",children:[i.length," loaded"]})]}),i.length===0?a.jsx("div",{className:"text-center py-4 text-[11px] text-text-muted",children:"No traces available"}):a.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto pr-1",children:i.slice(0,10).map(m=>a.jsxs("button",{onClick:()=>d(m),className:"w-full text-left px-2.5 py-2 rounded-lg bg-bg-secondary border border-border hover:bg-bg-secondary/30 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[m.status==="running"?a.jsx(Ie,{size:12,className:"text-cyan animate-pulse shrink-0"}):m.status==="completed"?a.jsx(Qe,{size:12,className:"text-success shrink-0"}):a.jsx(et,{size:12,className:"text-error shrink-0"}),a.jsx("span",{className:"text-[11px] text-text-secondary truncate flex-1",children:m.message}),a.jsx("span",{className:"text-[10px] text-text-muted shrink-0",children:m.totalMs?`${m.totalMs}ms`:"..."})]}),a.jsxs("div",{className:"flex gap-2 mt-0.5 text-[10px] text-text-muted ml-5",children:[a.jsxs("span",{children:[m.toolCalls.length," tools"]}),a.jsxs("span",{children:[m.rounds," rounds"]}),m.error&&a.jsx("span",{className:"text-error truncate",children:m.error})]})]},m.traceId))})]}),u&&a.jsx($d,{trace:u,onClose:()=>d(null)})]})})}function zd({size:e,className:t}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:`animate-spin ${t||""}`,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",fill:"none",strokeDasharray:"31.4 31.4",opacity:"0.3"}),a.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",fill:"none"})]})}function $d({trace:e,onClose:t}){return a.jsx(He,{open:!0,onClose:t,size:"md",title:`Trace ${e.traceId.slice(0,8)}`,children:a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-xs text-text-secondary truncate",children:e.message}),a.jsxs("div",{className:"flex gap-3 text-[10px] text-text-muted",children:[a.jsx("span",{className:e.status==="completed"?"text-success":e.status==="failed"?"text-error":"text-cyan",children:e.status}),a.jsxs("span",{children:[e.totalMs,"ms"]}),a.jsxs("span",{children:[e.rounds," rounds"]}),e.model&&a.jsx("span",{children:e.model.split("/").pop()})]}),e.spans.length>0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted mb-1",children:"Spans"}),a.jsx("div",{className:"space-y-1",children:e.spans.map((s,n)=>a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsx(mi,{size:10,className:"text-text-muted shrink-0"}),a.jsx("span",{className:"text-text-secondary font-mono",children:s.name}),a.jsxs("span",{className:"text-text-muted",children:[s.durationMs,"ms"]})]},n))})]}),e.toolCalls.length>0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted mb-1",children:"Tool Calls"}),a.jsx("div",{className:"space-y-1",children:e.toolCalls.map((s,n)=>a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsx(fi,{size:10,className:s.success?"text-success":"text-error"}),a.jsx("span",{className:"text-text-secondary font-mono",children:s.tool}),a.jsxs("span",{className:"text-text-muted",children:[s.durationMs,"ms"]}),a.jsxs("span",{className:"text-text-muted",children:["round ",s.round]})]},n))})]}),e.error&&a.jsxs("div",{className:"bg-error/5 border border-error/20 rounded-lg p-2.5",children:[a.jsx("div",{className:"text-[10px] text-error uppercase tracking-wider mb-1",children:"Error"}),a.jsx("div",{className:"text-[11px] text-text-secondary font-mono",children:e.error})]})]})})}function se({label:e}){return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-5 h-5 border-2 border-accent/30 border-t-accent rounded-full animate-spin"}),a.jsxs("span",{className:"text-sm text-text-muted",children:["Loading ",e,"…"]})]})})}function Ud(e){const t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`}function di({status:e}){const t={active:"bg-success/10 text-success",idle:"bg-warning/10 text-warning",running:"bg-cyan/10 text-cyan",paused:"bg-info/10 text-info",error:"bg-error/10 text-error",stopped:"bg-bg-tertiary text-text-muted",pending:"bg-warning/10 text-warning",approved:"bg-success/10 text-success",rejected:"bg-error/10 text-error",succeeded:"bg-success/10 text-success",failed:"bg-error/10 text-error",backlog:"bg-bg-tertiary text-text-muted",todo:"bg-info/10 text-info",in_progress:"bg-cyan/10 text-cyan",in_review:"bg-purple/10 text-purple-light",done:"bg-success/10 text-success",blocked:"bg-error/10 text-error",cancelled:"bg-bg-tertiary text-text-muted",critical:"bg-error/10 text-error",high:"bg-warning/10 text-warning",medium:"bg-warning/10 text-warning",low:"bg-bg-tertiary text-text-muted"},s=e||"unknown";return a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium ${t[s]||"bg-bg-tertiary text-text-muted"}`,children:s.replace("_"," ")})}function $e({icon:e,title:t,count:s,action:n,help:i}){return a.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(e,{size:14,className:"text-accent-light"}),a.jsx("h2",{className:"text-sm font-semibold text-text",children:t}),s!==void 0&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-accent/10 text-accent-light",children:s}),i&&a.jsx(So,{title:i.title,description:i.description})]}),n]})}function _d({agents:e}){const[t,s]=x.useState([]),[n,i]=x.useState([]),[o,r]=x.useState(!1),[l,u]=x.useState(""),[d,c]=x.useState(""),[h,f]=x.useState(null),p=x.useCallback(()=>{fo().then(s).catch(()=>{}),mo().then(v=>i(v)).catch(()=>{})},[]);x.useEffect(()=>{p()},[p]);const m=async()=>{l.trim()&&(await xo({name:l.trim(),mission:d.trim()||void 0}),u(""),c(""),r(!1),p())},g=async(v,S,A)=>{try{await go(v,{[S]:A}),p()}catch(M){alert(`Save failed: ${M.message}`)}},y=async()=>{h&&(await yo(h.id),f(null),p())},b=async(v,S,A)=>{try{await wo(v,{[S]:A||void 0}),p()}catch(M){alert(`Save failed: ${M.message}`)}},j=["ceo","manager","engineer","researcher","general"];function w(v,S=0){var M;const A=((M=e.find(T=>T.id===v.id))==null?void 0:M.reportsTo)||"";return v.model&&v.model.split("/").pop(),a.jsxs("div",{className:S>0?"ml-6 border-l border-border pl-4":"",children:[a.jsxs("div",{className:"bg-bg-tertiary/30 border border-border rounded-xl p-3.5 mb-2 max-w-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[a.jsx("span",{className:"text-[14px] font-semibold text-text min-w-0",children:a.jsx(Me,{value:v.name,onSave:T=>b(v.id,"name",T),placeholder:"Agent name"})}),a.jsx(di,{status:v.status})]}),a.jsxs("div",{className:"grid grid-cols-[72px_1fr] gap-x-3 gap-y-1.5 text-[11px]",children:[a.jsx("span",{className:"text-text-muted",children:"Title"}),a.jsx("span",{className:"text-text-secondary min-w-0",children:a.jsx(Me,{value:v.title||"",onSave:T=>b(v.id,"title",T),placeholder:"Add a title",emptyLabel:"—"})}),a.jsx("span",{className:"text-text-muted",children:"Role"}),a.jsx("select",{value:v.role,onChange:T=>b(v.id,"role",T.target.value),className:"bg-bg-tertiary border border-border rounded px-1.5 py-0.5 text-[11px] text-text-secondary capitalize focus:outline-none focus:border-accent/30 justify-self-start",children:j.map(T=>a.jsx("option",{value:T,children:T},T))}),a.jsx("span",{className:"text-text-muted",children:"Reports to"}),a.jsxs("select",{value:A,onChange:T=>b(v.id,"reportsTo",T.target.value),className:"bg-bg-tertiary border border-border rounded px-1.5 py-0.5 text-[11px] text-text-secondary focus:outline-none focus:border-accent/30 justify-self-start",children:[a.jsx("option",{value:"",children:"— nobody"}),e.filter(T=>T.id!==v.id).map(T=>a.jsx("option",{value:T.id,children:T.name},T.id))]}),a.jsx("span",{className:"text-text-muted",children:"Model"}),a.jsx("span",{className:"text-text-secondary min-w-0",children:a.jsx(Me,{value:v.model||"",onSave:T=>b(v.id,"model",T),placeholder:"e.g. ollama/qwen3.5:cloud",emptyLabel:"—"})})]})]}),v.reports.map(T=>w(T,S+1))]},v.id)}return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[a.jsx($e,{icon:Ot,title:"Organization Chart",count:e.length}),a.jsx("div",{className:"p-4",children:t.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Ot,{size:24,className:"mx-auto mb-2 text-text/10"}),a.jsx("p",{className:"text-[12px] text-text-muted",children:"No agents in org chart yet"}),a.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:'Spawn agents from the Agents tab, then set "Reports to" on each to build the hierarchy.'})]}):t.map(v=>w(v))})]}),a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[a.jsx($e,{icon:Bt,title:"Companies",count:n.length,action:a.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1 px-2.5 py-1 text-[10px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[a.jsx(us,{size:10})," New"]})}),o&&a.jsxs("div",{className:"p-4 border-b border-border bg-bg-secondary/30 space-y-2",children:[a.jsx("input",{value:l,onChange:v=>u(v.target.value),placeholder:"Company name...",className:"w-full bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[13px] text-text placeholder-white/20 focus:outline-none focus:border-accent/30",onKeyDown:v=>v.key==="Enter"&&m()}),a.jsx("input",{value:d,onChange:v=>c(v.target.value),placeholder:"Mission (optional)...",className:"w-full bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[12px] text-text-secondary placeholder-white/15 focus:outline-none focus:border-accent/30"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:m,className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded-lg",children:"Create"}),a.jsx("button",{onClick:()=>r(!1),className:"px-3 py-1.5 text-[11px] text-text-muted",children:"Cancel"})]})]}),a.jsx("div",{className:"divide-y divide-border/30",children:n.length===0?a.jsx("div",{className:"py-6 text-center text-[12px] text-text-muted",children:'No companies yet — click "+ New" to create one.'}):n.map(v=>a.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-bg-secondary/30 transition-colors",children:[a.jsx(Bt,{size:14,className:"text-accent-light flex-shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[a.jsx("div",{className:"text-[13px] text-text font-medium",children:a.jsx(Me,{value:v.name,onSave:S=>g(v.id,"name",S),placeholder:"Company name"})}),a.jsx("div",{className:"text-[10px] text-text-muted",children:a.jsx(Me,{value:v.mission||"",onSave:S=>g(v.id,"mission",S),placeholder:"Add a mission",emptyLabel:"(no mission — click to add)"})})]}),a.jsx(di,{status:v.status||"active"}),a.jsx("button",{onClick:()=>f({id:v.id,name:v.name}),className:"p-1 rounded text-text-muted hover:text-error hover:bg-error/10 transition-colors",title:"Delete company",children:a.jsx(yi,{size:12})})]},v.id))})]}),a.jsx(ro,{open:!!h,title:`Delete company "${(h==null?void 0:h.name)||""}"?`,message:"This removes the company record. Agents and goals linked to it stay; they just lose the company association. This can't be undone.",confirmLabel:"Delete",onConfirm:y,onCancel:()=>f(null)})]})}function Wd({budgets:e,onRefresh:t}){const[s,n]=x.useState(null),[i,o]=x.useState(!1),[r,l]=x.useState(null),u=async()=>{r&&(await po(r.id),l(null),t())};return a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[a.jsx($e,{icon:ds,title:"Budget Policies",count:e.length,action:a.jsxs("button",{onClick:()=>o(!0),className:"flex items-center gap-1 px-2.5 py-1 text-[10px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[a.jsx(us,{size:10})," New Budget"]})}),a.jsx("div",{className:"p-4 space-y-3",children:e.length===0?a.jsx("div",{className:"text-center py-6 text-[12px] text-text-muted",children:'No budget policies yet — click "+ New Budget" to set spending limits per agent, goal, or globally.'}):e.map(d=>{const c=d.limitUsd>0?Math.min(100,d.currentSpend/d.limitUsd*100):0,h=c>=100?"bg-error":c>=80?"bg-warning":"bg-success";return a.jsxs("div",{className:"bg-bg-tertiary/30 border border-border rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-[12px] font-medium text-text",children:d.name}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] text-text-muted capitalize",children:d.scope.type}),a.jsx("span",{className:"text-[10px] text-text-muted",children:d.period}),a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${d.enabled?"text-success bg-success/10":"text-text-muted bg-bg-tertiary"}`,children:d.enabled?"on":"off"}),a.jsx("button",{onClick:()=>n(d),className:"text-[10px] text-text-muted hover:text-text-secondary px-1",title:"Edit budget",children:"Edit"}),a.jsx("button",{onClick:()=>l(d),className:"p-1 rounded text-text-muted hover:text-error hover:bg-error/10 transition-colors",title:"Delete budget",children:a.jsx(yi,{size:12})})]})]}),a.jsx("div",{className:"h-1.5 bg-bg-tertiary rounded-full overflow-hidden mb-1.5",children:a.jsx("div",{className:`h-full ${h} rounded-full transition-all`,style:{width:`${c}%`}})}),a.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted",children:[a.jsxs("span",{children:["$",d.currentSpend.toFixed(2)," spent"]}),a.jsxs("span",{children:["$",d.limitUsd.toFixed(2)," limit · action: ",d.action]})]})]},d.id)})}),(i||s)&&a.jsx(Kd,{existing:s,onClose:()=>{o(!1),n(null)},onSaved:()=>{o(!1),n(null),t()}}),a.jsx(ro,{open:!!r,title:`Delete budget "${(r==null?void 0:r.name)||""}"?`,message:"The policy and its spend history are removed. Agents/goals it covered will no longer be budget-enforced unless another policy applies.",confirmLabel:"Delete",onConfirm:u,onCancel:()=>l(null)})]})}function Kd({existing:e,onClose:t,onSaved:s}){var M,T;const n=!!e,[i,o]=x.useState((e==null?void 0:e.name)||""),[r,l]=x.useState((e==null?void 0:e.scope.type)||"global"),[u,d]=x.useState((e==null?void 0:e.scope.targetId)||""),[c,h]=x.useState((e==null?void 0:e.period)||"daily"),[f,p]=x.useState(((M=e==null?void 0:e.limitUsd)==null?void 0:M.toString())||"10"),[m,g]=x.useState(((T=e==null?void 0:e.warningThresholdPercent)==null?void 0:T.toString())||"80"),[y,b]=x.useState((e==null?void 0:e.action)||"warn"),[j,w]=x.useState((e==null?void 0:e.enabled)??!0),[v,S]=x.useState(!1),A=async()=>{if(i.trim()){S(!0);try{const P={name:i.trim(),scope:{type:r,targetId:r==="global"?void 0:u||void 0},period:c,limitUsd:Number(f)||0,warningThresholdPercent:Number(m)||80,action:y,enabled:j};n&&e?await vo(e.id,P):await bo(P),s()}catch(P){alert(`Save failed: ${P.message}`)}finally{S(!1)}}};return a.jsx(He,{open:!0,onClose:t,size:"md",title:n?"Edit Budget Policy":"New Budget Policy",footer:a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:t,className:"px-3 py-1.5 text-[11px] text-text-secondary hover:text-text",children:"Cancel"}),a.jsx("button",{onClick:A,disabled:v||!i.trim(),className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded hover:bg-accent-hover disabled:opacity-50",children:v?"Saving…":n?"Save changes":"Create budget"})]}),children:a.jsxs("div",{className:"space-y-3 text-[12px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Name"}),a.jsx("input",{value:i,onChange:P=>o(P.target.value),placeholder:"e.g. Daily global cap",className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Scope"}),a.jsxs("select",{value:r,onChange:P=>l(P.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[a.jsx("option",{value:"global",children:"Global (all agents)"}),a.jsx("option",{value:"agent",children:"Per-agent"}),a.jsx("option",{value:"goal",children:"Per-goal"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Target ID"}),a.jsx("input",{value:u,onChange:P=>d(P.target.value),placeholder:r==="global"?"n/a":r==="agent"?"agent-id":"goal-id",disabled:r==="global",className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none disabled:opacity-40"})]})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Period"}),a.jsxs("select",{value:c,onChange:P=>h(P.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[a.jsx("option",{value:"daily",children:"Daily"}),a.jsx("option",{value:"weekly",children:"Weekly"}),a.jsx("option",{value:"monthly",children:"Monthly"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Limit (USD)"}),a.jsx("input",{type:"number",step:"0.01",value:f,onChange:P=>p(P.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Warn at %"}),a.jsx("input",{type:"number",min:"1",max:"100",value:m,onChange:P=>g(P.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Action at limit"}),a.jsxs("select",{value:y,onChange:P=>b(P.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[a.jsx("option",{value:"warn",children:"Warn only"}),a.jsx("option",{value:"pause",children:"Pause agent"}),a.jsx("option",{value:"stop",children:"Stop agent"})]})]}),a.jsx("div",{className:"flex items-end gap-2",children:a.jsxs("label",{className:"flex items-center gap-2 text-text-secondary cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:j,onChange:P=>w(P.target.checked),className:"accent-accent"}),a.jsx("span",{children:"Enabled"})]})})]})]})})}function Gd({dashboard:e}){const[t,s]=x.useState([]),[n,i]=x.useState(""),[o,r]=x.useState(!1),[l,u]=x.useState(""),[d,c]=x.useState(),h=x.useRef(null),f=x.useRef(null),p=x.useCallback(()=>{var b;const g=e,y=g.agents.map(j=>`${j.name} (${j.status}, ${j.role}, cost=$${j.totalCostUsd.toFixed(2)})`).join("; ")||"none";return`[COMMAND POST] ${g.totalAgents} agents (${g.activeAgents} active), ${g.activeCheckouts} locked tasks, budget ${Math.round(g.budgetUtilization??0)}% used, ${((b=g.goalTree)==null?void 0:b.length)??0} goals. Agents: ${y}. You manage this agent organization. Be concise.
|
|
36
|
-
|
|
37
|
-
`},[e]),m=x.useCallback(async()=>{const g=n.trim();if(!g||o)return;i(""),s(w=>[...w,{role:"user",content:g}]),r(!0),u("");const y=new AbortController;h.current=y;let b="",j=d;try{await ho(p()+g,d,w=>{w.type==="token"&&(b+=w.data,u(b)),w.type==="done"&&w.sessionId&&(j=w.sessionId)},y.signal),j&&c(j),b&&s(w=>[...w,{role:"assistant",content:b}])}catch(w){w.name!=="AbortError"&&s(v=>[...v,{role:"assistant",content:`Error: ${w.message}`}])}finally{r(!1),u(""),h.current=null}},[n,o,d,p]);return x.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[t,l]),a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden flex flex-col",style:{height:400},children:[a.jsx($e,{icon:pi,title:"Console",action:o?a.jsxs("button",{onClick:()=>{var g;return(g=h.current)==null?void 0:g.abort()},className:"text-[10px] text-error flex items-center gap-1",children:[a.jsx(Ro,{size:12}),"Stop"]}):void 0}),a.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto px-4 py-3 space-y-2",children:[t.length===0&&!o&&a.jsxs("div",{className:"text-center py-6",children:[a.jsx("p",{className:"text-[11px] text-text-muted mb-3",children:"Manage your organization through natural language"}),a.jsx("div",{className:"flex flex-wrap justify-center gap-1.5",children:["Status report","Create issue: Research competitors","Spawn a research agent","Set $50/day budget"].map(g=>a.jsx("button",{onClick:()=>i(g),className:"text-[10px] text-text-muted hover:text-text-muted px-2.5 py-1 rounded-full border border-border hover:border-border-light",children:g},g))})]}),t.map((g,y)=>a.jsx("div",{className:`flex ${g.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] px-3 py-2 rounded-xl text-[12px] leading-relaxed whitespace-pre-wrap ${g.role==="user"?"bg-accent/80 text-text rounded-br-sm":"bg-bg-tertiary text-text-secondary border border-border rounded-bl-sm"}`,children:g.content})},y)),o&&l&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"max-w-[85%] px-3 py-2 rounded-xl rounded-bl-sm bg-bg-tertiary text-text-secondary border border-border text-[12px] whitespace-pre-wrap",children:[l,a.jsx("span",{className:"inline-block w-1 h-3.5 bg-accent-light ml-0.5 animate-pulse"})]})}),o&&!l&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"px-3 py-2 rounded-xl bg-bg-tertiary border border-border",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted/20 animate-bounce"}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted/20 animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted/20 animate-bounce",style:{animationDelay:"300ms"}})]})})})]}),a.jsx("div",{className:"px-3 py-2 border-t border-border",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{value:n,onChange:g=>i(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),m())},placeholder:"Tell Command Post what to do...",className:"flex-1 bg-bg-tertiary border border-border rounded-lg px-3 py-2 text-[12px] text-text placeholder-white/20 focus:outline-none focus:border-accent/30"}),a.jsx("button",{onClick:m,disabled:!n.trim()||o,className:"p-2 rounded-lg bg-accent text-text hover:bg-accent-hover disabled:opacity-30",children:a.jsx(Vo,{size:14})})]})})]})}function Hd({onClose:e,onCreated:t}){const[s,n]=x.useState(""),[i,o]=x.useState([{role:"pragmatist",model:""},{role:"skeptic",model:""}]),[r,l]=x.useState(2),[u,d]=x.useState("judge"),[c,h]=x.useState(!1),f=()=>{i.length>=5||o([...i,{role:`participant-${i.length+1}`,model:""}])},p=y=>{i.length<=2||o(i.filter((b,j)=>j!==y))},m=(y,b)=>{o(i.map((j,w)=>w===y?{...j,...b}:j))},g=async()=>{if(!(!s.trim()||i.length<2)){h(!0);try{const y=await Ft("/api/command-post/debates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:s.trim(),participants:i.map(b=>({role:b.role.trim()||"participant",model:b.model.trim()||void 0})),rounds:r,resolution:u})});if(!y.ok)throw new Error(`${y.status} ${y.statusText}`);t()}catch(y){alert(`Debate failed: ${y.message}`)}finally{h(!1)}}};return a.jsx(He,{open:!0,onClose:e,title:"Start a new debate",size:"lg",footer:a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:e,className:"px-3 py-1.5 text-[11px] text-text-secondary hover:text-text",children:"Cancel"}),a.jsx("button",{onClick:g,disabled:c||!s.trim()||i.length<2,className:"px-3 py-1.5 text-[11px] bg-accent text-text rounded hover:bg-accent-hover disabled:opacity-50",children:c?"Running debate…":"Run debate"})]}),children:a.jsxs("div",{className:"space-y-3 text-[12px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Question"}),a.jsx("textarea",{value:s,onChange:y=>n(y.target.value),placeholder:"e.g. Should we cache the Ollama probe results for 7 days or 30 days?",rows:2,className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none focus:border-accent/40 resize-none"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:["Participants (",i.length,"/5)"]}),a.jsx("button",{onClick:f,disabled:i.length>=5,className:"text-[10px] text-accent-light/70 hover:text-accent-light disabled:opacity-40",children:"+ Add participant"})]}),a.jsx("div",{className:"space-y-2",children:i.map((y,b)=>a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsx("input",{value:y.role,onChange:j=>m(b,{role:j.target.value}),placeholder:"role (e.g. pragmatist)",className:"flex-1 bg-bg-tertiary border border-border rounded px-2 py-1 text-text focus:outline-none"}),a.jsx("input",{value:y.model,onChange:j=>m(b,{model:j.target.value}),placeholder:"model (optional — defaults to agent.model)",className:"flex-1 bg-bg-tertiary border border-border rounded px-2 py-1 text-text-secondary focus:outline-none"}),a.jsx("button",{onClick:()=>p(b),disabled:i.length<=2,className:"text-text-muted hover:text-error disabled:opacity-20 px-1",title:"Remove",children:"×"})]},b))})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Rounds"}),a.jsx("select",{value:r,onChange:y=>l(Number(y.target.value)),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[1,2,3,4].map(y=>a.jsxs("option",{value:y,children:[y," round",y===1?"":"s"]},y))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Resolution"}),a.jsxs("select",{value:u,onChange:y=>d(y.target.value),className:"mt-1 w-full bg-bg-tertiary border border-border rounded px-2 py-1.5 text-text focus:outline-none",children:[a.jsx("option",{value:"judge",children:"Judge (LLM picks winner)"}),a.jsx("option",{value:"synthesize",children:"Synthesize (LLM merges)"}),a.jsx("option",{value:"vote",children:"Vote (word-overlap consensus)"})]})]})]}),a.jsx("div",{className:"text-[10px] text-text-muted/70 italic",children:"Runs live — 1-3 minutes depending on model + rounds. Transcript saves automatically."})]})})}function Xd(){const[e,t]=x.useState([]),[s,n]=x.useState(null),[i,o]=x.useState(!1),[r,l]=x.useState(!1),u=x.useCallback(async()=>{o(!0);try{const c=await Ft("/api/command-post/debates");if(c.ok){const h=await c.json();t((h==null?void 0:h.items)||[])}}catch{}o(!1)},[]);x.useEffect(()=>{u()},[u]);const d=async c=>{try{const h=await Ft(`/api/command-post/debates/${c}`);if(h.ok){const f=await h.json();n(f)}}catch{}};if(s){const c=new Map;for(const h of s.turns){const f=c.get(h.round)||[];f.push(h),c.set(h.round,f)}return a.jsxs("div",{className:"space-y-3",children:[a.jsx("button",{onClick:()=>n(null),className:"text-[11px] text-text-muted hover:text-text-secondary",children:"← Back to debates"}),a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl p-4",children:[a.jsx("div",{className:"text-[13px] font-semibold text-text mb-1",children:s.question}),a.jsxs("div",{className:"text-[10px] text-text-muted/70",children:[s.resolution," • ",s.rounds," round",s.rounds===1?"":"s"," • ",(s.durationMs/1e3).toFixed(1),"s"]}),s.winner&&a.jsxs("div",{className:"mt-3 p-3 bg-success/[0.06] border border-success/30 rounded-lg",children:[a.jsxs("div",{className:"text-[11px] text-success/80/80 uppercase tracking-wider",children:["Winner: ",s.winner.role]}),a.jsx("div",{className:"text-[12px] text-text mt-1",children:s.winner.content}),s.winner.justification&&a.jsx("div",{className:"text-[10px] text-text-muted italic mt-2",children:s.winner.justification})]})]}),[...c.entries()].sort((h,f)=>h[0]-f[0]).map(([h,f])=>a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-2 border-b border-border/50 text-[11px] font-medium text-text-secondary uppercase tracking-wider",children:["Round ",h]}),a.jsx("div",{className:"divide-y divide-border/30",children:f.map((p,m)=>a.jsxs("div",{className:"px-4 py-3",children:[a.jsx("div",{className:"text-[11px] font-semibold text-accent-light/80 mb-1",children:p.role}),a.jsx("div",{className:"text-[11px] text-text-secondary whitespace-pre-wrap",children:p.content}),a.jsxs("div",{className:"text-[9px] text-text-muted mt-1",children:[p.model.split("/").pop()," • ",p.durationMs,"ms"]})]},m))})]},h))]})}return a.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-2xl overflow-hidden",children:[a.jsx($e,{icon:vi,title:"Debates",count:e.length,help:{title:"Debates",description:"Pit two or more agents against each other to explore different sides of a decision. Useful for risk assessment and trade-off analysis."},action:a.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1 px-2.5 py-1 text-[10px] bg-accent text-text rounded-lg hover:bg-accent-hover",children:[a.jsx(us,{size:10})," New Debate"]})}),r&&a.jsx(Hd,{onClose:()=>l(!1),onCreated:()=>{l(!1),u()}}),a.jsx("div",{className:"divide-y divide-border/30",children:i?a.jsx("div",{className:"py-8 text-center text-[12px] text-text-muted",children:"Loading..."}):e.length===0?a.jsxs("div",{className:"py-8 text-center text-[12px] text-text-muted",children:["No debates yet. Call the ",a.jsx("code",{className:"text-accent-light/70",children:"agent_debate"})," tool to start one."]}):e.map(c=>a.jsxs("button",{onClick:()=>d(c.id),className:"w-full text-left px-4 py-3 hover:bg-bg-tertiary/30 transition-colors",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("div",{className:"text-[12px] text-text flex-1 truncate pr-2",children:c.question}),a.jsxs("span",{className:"text-[10px] text-text-muted whitespace-nowrap",children:[Ud(c.startedAt)," ago"]})]}),a.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[a.jsx("span",{children:c.resolution}),a.jsxs("span",{children:[c.rounds," round",c.rounds===1?"":"s"]}),a.jsxs("span",{children:[(c.durationMs/1e3).toFixed(1),"s"]}),c.winnerRole&&a.jsxs("span",{className:"text-success/80/70",children:["winner: ",c.winnerRole]})]})]},c.id))})]})}const Yd=[{label:"Overview",tabs:[{id:"Dashboard",label:"Dashboard",icon:gi}]},{label:"Operations",tabs:[{id:"Social",label:"Social",icon:pi},{id:"Inbox",label:"Inbox",icon:Io},{id:"Goals",label:"Goals",icon:To},{id:"Work",label:"Work",icon:Bt},{id:"Sessions",label:"Sessions",icon:mi}]},{label:"Governance",tabs:[{id:"Org Chart",label:"Org Chart",icon:xi},{id:"Agents",label:"Agents",icon:Po},{id:"Files",label:"Files",icon:No},{id:"Debates",label:"Debates",icon:vi},{id:"Costs",label:"Costs",icon:ds}]},{label:"System",tabs:[{id:"Traces",label:"Traces",icon:Ie},{id:"Console",label:"Console",icon:Ao}]}],qd=x.lazy(()=>ie(()=>import("./WorkTab-Pgq-iLz9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),Zd=x.lazy(()=>ie(()=>import("./SessionsTab-Cn3dGgjX.js"),__vite__mapDeps([14,1,2,9,3,4,5,8,10,11,12,13,7]))),Jd=x.lazy(()=>ie(()=>import("./CPInbox-D10curQs.js"),__vite__mapDeps([15,1,2,9,3,4,5,16,17,18,19]))),Qd=x.lazy(()=>ie(()=>import("./CPFiles-G7veSjMg.js"),__vite__mapDeps([20,1,2,3,4,5]))),eh=x.lazy(()=>ie(()=>import("./TraceViewer-TOpdmqLF.js"),__vite__mapDeps([21,1,2,22,3,4,5,12,13,23]))),th=x.lazy(()=>ie(()=>import("./CPSocial-mUQsrSh5.js"),__vite__mapDeps([24,1,2,3,4,5,25]))),sh=x.lazy(()=>ie(()=>import("./CPDashboard-C-GgqDsI.js"),__vite__mapDeps([26,1,2,9,3,4,5,27,16,18,11,8]))),nh=x.lazy(()=>ie(()=>import("./CPGoals-C3DlKJrJ.js"),__vite__mapDeps([28,1,2,9,3,4,5,27,16,17,18,8,7,10,11,12,13]))),ih=x.lazy(()=>ie(()=>import("./CPAgents-D5533PhK.js"),__vite__mapDeps([29,1,2,9,3,4,5,27,16,17,18])));function rh(){const[e,t]=x.useState("Dashboard"),[s,n]=x.useState(null),[i,o]=x.useState([]),[r,l]=x.useState(!0),[u,d]=x.useState(null),[c,h]=x.useState([]),[f,p]=x.useState(!1),[m,g]=x.useState(null),y=x.useCallback(async()=>{try{const[w,v]=await Promise.allSettled([uo(),hi()]);w.status==="fulfilled"&&(n(w.value),h(w.value.recentActivity||[])),v.status==="fulfilled"&&o(v.value),d(null)}catch(w){d(w.message)}l(!1)},[]);if(x.useEffect(()=>{y()},[y]),x.useEffect(()=>{if(!s)return;const w=localStorage.getItem("titan-token"),v=w?`/api/command-post/stream?token=${w}`:"/api/command-post/stream",S=new EventSource(v);let A=0;return S.addEventListener("commandpost:activity",M=>{A=0;try{h(T=>[...T.slice(-49),JSON.parse(M.data)])}catch{}}),S.addEventListener("commandpost:agent:status",M=>{A=0;try{const T=JSON.parse(M.data);n(P=>P&&{...P,agents:P.agents.map(N=>N.id===T.agentId?{...N,status:T.status}:N)})}catch{}}),S.onerror=()=>{A++,A>5&&S.close()},()=>S.close()},[s]),x.useEffect(()=>{const w=setInterval(y,3e4);return()=>clearInterval(w)},[y]),r)return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-5 h-5 border-2 border-accent/30 border-t-accent rounded-full animate-spin"}),a.jsx("span",{className:"text-sm text-text-muted",children:"Loading Command Post..."})]})});if(u)return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center",children:[a.jsx(cs,{className:"mx-auto mb-3 text-warning",size:32}),a.jsx("p",{className:"text-sm text-text-secondary mb-4",children:u}),a.jsx("button",{onClick:y,className:"px-4 py-2 text-sm bg-bg-tertiary rounded-lg hover:bg-border text-text-secondary transition-colors",children:"Retry"})]})});const b=s??{agents:[],totalAgents:0,activeAgents:0,activeCheckouts:0,budgetUtilization:0,recentActivity:[],checkouts:[],budgets:[],goalTree:[],companies:[]},j=()=>{switch(e){case"Dashboard":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"dashboard"}),children:a.jsx(sh,{})});case"Social":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"social"}),children:a.jsx(th,{})});case"Inbox":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"inbox"}),children:a.jsx(Jd,{})});case"Goals":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"goals"}),children:a.jsx(nh,{})});case"Work":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"work"}),children:a.jsx(qd,{})});case"Sessions":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"sessions"}),children:a.jsx(Zd,{})});case"Org Chart":return a.jsx(_d,{agents:b.agents});case"Agents":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"agents"}),children:a.jsx(ih,{})});case"Files":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"files"}),children:a.jsx(Qd,{})});case"Debates":return a.jsx(Xd,{});case"Costs":return a.jsx(Wd,{budgets:b.budgets,onRefresh:y});case"Traces":return a.jsx(x.Suspense,{fallback:a.jsx(se,{label:"traces"}),children:a.jsx(eh,{})});case"Console":return a.jsx(Gd,{dashboard:b});default:return null}};return a.jsxs("div",{className:"h-full flex overflow-hidden",children:[a.jsxs("div",{className:"w-52 shrink-0 flex flex-col border-r border-border bg-bg-secondary/30",children:[a.jsx("div",{className:"px-4 py-4 border-b border-border",children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-lg bg-accent/10 border border-accent/20",children:a.jsx(Ot,{size:16,className:"text-accent-light"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-sm font-bold text-text",children:"Command Post"}),a.jsx("p",{className:"text-[10px] text-text-muted",children:"Agent governance"})]})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto py-2 space-y-4",children:Yd.map(w=>a.jsxs("div",{children:[a.jsx("div",{className:"px-3 mb-1 text-[10px] font-semibold text-text-muted uppercase tracking-wider",children:w.label}),a.jsx("div",{className:"px-2 space-y-0.5",children:w.tabs.map(v=>{const S=e===v.id;return a.jsxs("button",{onClick:()=>t(v.id),className:`w-full flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-[12px] transition-all duration-150 ${S?"bg-accent/10 text-accent-light font-medium":"text-text-secondary hover:text-text hover:bg-bg-tertiary/50"}`,children:[a.jsx(v.icon,{size:14,className:S?"text-accent-light":"text-text-muted"}),a.jsx("span",{children:v.label})]},v.id)})})]},w.label))}),a.jsx("div",{className:"px-3 py-2 border-t border-border",children:a.jsxs("button",{onClick:y,className:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-[11px] text-text-muted bg-bg-tertiary/50 border border-border rounded-lg hover:bg-bg-tertiary transition-colors",children:[a.jsx(Mo,{size:12,className:r?"animate-spin":""}),"Refresh"]})})]}),a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-4 md:py-6",children:a.jsx(j,{})})}),a.jsx(Bd,{collapsed:f,onToggle:()=>p(!f),agents:b.agents,runs:i,onAgentClick:w=>g(w)}),m&&a.jsx(Od,{agent:m,onClose:()=>g(null)})]})}const yh=Object.freeze(Object.defineProperty({__proto__:null,default:rh},Symbol.toStringTag,{value:"Module"}));export{Nu as A,yh as C,He as M,ci as m};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as m,r,n as b,j as t,X as D}from"./index-BWSnB6Kr.js";import{e as z,f as S}from"./TitanCanvas-cnb7R1gS.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const K=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],R=m("pause",K);/**
|
|
7
|
-
* @license lucide-react v0.513.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],T=m("target",I);function F({value:s,onSave:k,placeholder:x,multiline:c=!1,className:E,displayValue:j,emptyLabel:v="—",hidePencil:C=!1,maxLength:p,title:w}){const[a,i]=r.useState(!1),[o,l]=r.useState(s),[f,y]=r.useState(!1),n=r.useRef(null);r.useEffect(()=>{a&&n.current&&(n.current.focus(),"select"in n.current&&n.current.select())},[a]),r.useEffect(()=>{a||l(s)},[s,a]);const u=async()=>{if(o===s){i(!1);return}y(!0);try{await k(o),i(!1)}catch{}finally{y(!1)}},g=()=>{l(s),i(!1)},h=e=>{e.key==="Enter"&&!c||e.key==="Enter"&&c&&e.metaKey?(e.preventDefault(),u()):e.key==="Escape"&&(e.preventDefault(),g())};if(a){const e=b("bg-bg-tertiary border border-accent/60 rounded px-2 py-1 text-sm text-text","focus:outline-none focus:border-accent","w-full",c&&"resize-none min-h-[60px]");return t.jsxs("span",{className:"inline-flex items-start gap-1 w-full",children:[c?t.jsx("textarea",{ref:n,value:o,onChange:d=>l(d.target.value),onKeyDown:h,placeholder:x,maxLength:p,className:e,disabled:f}):t.jsx("input",{ref:n,type:"text",value:o,onChange:d=>l(d.target.value),onKeyDown:h,placeholder:x,maxLength:p,className:e,disabled:f}),t.jsx("button",{onClick:u,disabled:f,className:"text-success hover:bg-success/10 rounded p-1 shrink-0",title:c?"Save (Cmd+Enter)":"Save (Enter)",type:"button",children:t.jsx(z,{size:14})}),t.jsx("button",{onClick:g,disabled:f,className:"text-text-muted hover:bg-bg-tertiary rounded p-1 shrink-0",title:"Cancel (Esc)",type:"button",children:t.jsx(D,{size:14})})]})}const N=j??(s&&s.length>0?s:v);return t.jsxs("span",{className:b("inline-flex items-center gap-1 cursor-pointer group","hover:bg-bg-tertiary rounded px-1 -mx-1",E),onClick:()=>i(!0),title:w??"Click to edit",role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),i(!0))},children:[t.jsx("span",{children:N}),!C&&t.jsx(S,{size:10,className:"text-text-muted opacity-0 group-hover:opacity-60 transition-opacity shrink-0"})]})}export{F as I,R as P,T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,C as F,J as S,b as C,Y as K}from"./index-BWSnB6Kr.js";import{P as A}from"./plug-DhvhYYy_.js";import{C as U}from"./circle-check-big-BiMDFx6C.js";import{E as T,a as I}from"./eye-BfW7UcEC.js";import{c as O}from"./TitanCanvas-cnb7R1gS.js";import{a as R,C as q}from"./VoiceOverlay-XIyCbAP7.js";const k=[{id:"anthropic",label:"Anthropic",fieldKey:"anthropicKey",fieldType:"key",placeholder:"sk-ant-..."},{id:"openai",label:"OpenAI",fieldKey:"openaiKey",fieldType:"key",placeholder:"sk-..."},{id:"google",label:"Google AI",fieldKey:"googleKey",fieldType:"key",placeholder:"AIza..."},{id:"groq",label:"Groq",fieldKey:"groqKey",fieldType:"key",placeholder:"gsk_..."},{id:"mistral",label:"Mistral",fieldKey:"mistralKey",fieldType:"key",placeholder:"API key"},{id:"openrouter",label:"OpenRouter",fieldKey:"openrouterKey",fieldType:"key",placeholder:"sk-or-..."},{id:"fireworks",label:"Fireworks AI",fieldKey:"fireworksKey",fieldType:"key",placeholder:"API key"},{id:"xai",label:"xAI (Grok)",fieldKey:"xaiKey",fieldType:"key",placeholder:"xai-..."},{id:"together",label:"Together AI",fieldKey:"togetherKey",fieldType:"key",placeholder:"API key"},{id:"deepseek",label:"DeepSeek",fieldKey:"deepseekKey",fieldType:"key",placeholder:"sk-..."},{id:"perplexity",label:"Perplexity",fieldKey:"perplexityKey",fieldType:"key",placeholder:"pplx-..."},{id:"ollama",label:"Ollama",fieldKey:"ollamaUrl",fieldType:"url",placeholder:"http://localhost:11434"}];function P({configured:a}){return e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${a?"bg-success/10 text-success":"bg-border-light/20 text-text-muted"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${a?"bg-success":"bg-border-light"}`}),a?"Configured":"Not configured"]})}function M({provider:a,configured:b,currentUrl:o,onSave:p,saving:v}){const[f,y]=l.useState(!1),[c,d]=l.useState(a.fieldType==="url"&&o||""),[x,u]=l.useState(!1),h=a.fieldType==="key",i=v===a.id;return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>y(!f),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[f?e.jsx(R,{className:"h-4 w-4 text-text-muted"}):e.jsx(q,{className:"h-4 w-4 text-text-muted"}),e.jsx("span",{className:"text-sm font-medium text-text",children:a.label})]}),e.jsx(P,{configured:b})]}),f&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:h?"API Key":"Base URL"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`integration-${a.id}`,name:`integration-${a.id}`,type:h&&!x?"password":"text",value:c,onChange:j=>d(j.target.value),placeholder:a.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),h&&e.jsx("button",{type:"button",onClick:()=>u(!x),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:x?e.jsx(T,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>p(a.fieldKey,c),disabled:i||!c,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),i?"Saving...":"Save"]})})]})]})}function H(){const[a,b]=l.useState({}),[o,p]=l.useState({clientIdSet:!1,clientSecretSet:!1}),[v,f]=l.useState(!0),[y,c]=l.useState(null),[d,x]=l.useState(null),[u,h]=l.useState(""),[i,j]=l.useState(""),[N,G]=l.useState(!1);l.useEffect(()=>{(async()=>{var t;try{const n=await S();if(n.providers&&b(n.providers),(t=n.oauth)!=null&&t.google){const g=n.oauth.google;try{const r=await(await C("/api/auth/google/status")).json();g.connected=r.connected,g.email=r.email}catch{}p(g)}}catch{}finally{f(!1)}})()},[]);const E=()=>{window.location.href="/api/auth/google/start"},D=async()=>{try{await C("/api/auth/google/disconnect",{method:"POST"}),p(s=>({...s,connected:!1,email:void 0})),m("success","Google account disconnected")}catch{m("error","Failed to disconnect")}},m=(s,t)=>{x({type:s,message:t}),setTimeout(()=>x(null),3e3)},$=async(s,t)=>{var g,w;const n=((g=k.find(r=>r.fieldKey===s))==null?void 0:g.id)||s;c(n);try{await K({[s]:t});const r=await S();r.providers&&b(r.providers),m("success",`${((w=k.find(B=>B.fieldKey===s))==null?void 0:w.label)||"Provider"} saved`)}catch(r){m("error",r instanceof Error?r.message:"Failed to save")}finally{c(null)}},L=async()=>{var s;c("oauth");try{const t={};u&&(t.googleOAuthClientId=u),i&&(t.googleOAuthClientSecret=i),await K(t);const n=await S();(s=n.oauth)!=null&&s.google&&p(n.oauth.google),m("success","Google OAuth settings saved"),h(""),j("")}catch(t){m("error",t instanceof Error?t.message:"Failed to save")}finally{c(null)}};return v?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,t)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-accent/10",children:e.jsx(A,{className:"h-4 w-4 text-accent-hover"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"Integrations"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Configure LLM providers and external service connections"})]})]}),d&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${d.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[d.type==="success"?e.jsx(U,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"}),d.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"LLM Providers"}),e.jsx("div",{className:"space-y-2",children:k.map(s=>{const t=a[s.id],n=s.id==="ollama"?!!(t!=null&&t.baseUrl):!!(t!=null&&t.configured);return e.jsx(M,{provider:s,configured:n,currentUrl:s.fieldType==="url"?(t==null?void 0:t.baseUrl)||"":void 0,onSave:$,saving:y},s.id)})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Google Services (OAuth)"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"Google OAuth 2.0"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:o.connected&&o.email?`Connected as ${o.email}`:"Gmail, Drive, Calendar, Docs, Sheets, Tasks"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{configured:!!o.connected}),o.clientIdSet&&!o.connected&&e.jsxs("button",{onClick:E,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white hover:bg-accent/80 transition-colors",children:[e.jsx(A,{className:"h-3.5 w-3.5"}),"Connect Google"]}),o.connected&&e.jsx("button",{onClick:D,className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 px-3 py-1.5 text-xs font-medium text-red-400 hover:bg-red-500/10 transition-colors",children:"Disconnect"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Client ID"}),e.jsx("input",{id:"integration-google-client-id",name:"integration-google-client-id",type:"text",value:u,onChange:s=>h(s.target.value),placeholder:o.clientIdSet?"(configured)":"your-client-id.apps.googleusercontent.com",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Client Secret"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"integration-google-client-secret",name:"integration-google-client-secret",type:N?"text":"password",value:i,onChange:s=>j(s.target.value),placeholder:o.clientSecretSet?"(configured)":"GOCSPX-...",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>G(!N),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:N?e.jsx(T,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:L,disabled:y==="oauth"||!u&&!i,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),y==="oauth"?"Saving...":"Save OAuth Settings"]})})]})]})]})}export{H as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AutopilotPanel-CHRjxdh0.js","assets/index-BWSnB6Kr.js","assets/index-Dtw1pbjc.css","assets/PageHeader-BdvxKoad.js","assets/VoiceOverlay-XIyCbAP7.js","assets/WorkflowsPanel-B91LeW7r.js","assets/Input-DYukme8A.js","assets/TitanCanvas-cnb7R1gS.js","assets/TitanCanvas-BfitWg9R.css","assets/InlineEditableField-CH-jR3LC.js","assets/play-2xR4_zUG.js","assets/trash-2-DmRaMz9e.js","assets/LearningPanel-BPx05bBu.js","assets/lightbulb-D_y0Mtyq.js","assets/trending-up-DsDcs3Jo.js","assets/MemoryGraphPanel-BFovwaSG.js","assets/SelfImprovePanel-PSCYO6sx.js","assets/circle-check-big-BiMDFx6C.js","assets/PersonasPanel-BpI6Npxv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as s,j as e,n as a,_ as t}from"./index-BWSnB6Kr.js";const i=s.lazy(()=>t(()=>import("./AutopilotPanel-CHRjxdh0.js"),__vite__mapDeps([0,1,2,3,4]))),n=s.lazy(()=>t(()=>import("./WorkflowsPanel-B91LeW7r.js"),__vite__mapDeps([5,1,2,3,4,6,7,8,9,10,11]))),d=s.lazy(()=>t(()=>import("./LearningPanel-BPx05bBu.js"),__vite__mapDeps([12,1,2,3,4,7,8,13,14]))),c=s.lazy(()=>t(()=>import("./MemoryGraphPanel-BFovwaSG.js"),__vite__mapDeps([15,1,2,7,4,8,11]))),m=s.lazy(()=>t(()=>import("./SelfImprovePanel-PSCYO6sx.js"),__vite__mapDeps([16,1,2,7,4,8,17,14,10,11]))),x=s.lazy(()=>t(()=>import("./PersonasPanel-BpI6Npxv.js"),__vite__mapDeps([18,1,2]))),p=[{id:"autopilot",label:"Autopilot"},{id:"workflows",label:"Workflows"},{id:"learning",label:"Learning"},{id:"memory",label:"Memory & Graph"},{id:"self-improve",label:"Self-Improve"},{id:"personas",label:"Personas"}];function u(){const[l,r]=s.useState("autopilot");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-4 pb-0",children:[e.jsx("h1",{className:"text-sm font-semibold text-text mb-3",children:"Intelligence"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:p.map(o=>e.jsxs("button",{onClick:()=>r(o.id),className:a("px-3 py-2 text-xs font-medium transition-colors relative",l===o.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[o.label,l===o.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},o.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(s.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="autopilot"&&e.jsx(i,{}),l==="workflows"&&e.jsx(n,{}),l==="learning"&&e.jsx(d,{}),l==="memory"&&e.jsx(c,{}),l==="self-improve"&&e.jsx(m,{}),l==="personas"&&e.jsx(x,{})]})})]})}export{u as default};
|