dorkos 0.92.0 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/core-extensions/hello-world/index.ts +69 -4
  2. package/dist/bin/cli.js +1199 -319
  3. package/dist/client/assets/{AboutPage-CtAhGJVI.js → AboutPage-R35A-Uu-.js} +1 -1
  4. package/dist/client/assets/{AdapterIcon-DTXuj6Zu.js → AdapterIcon-kPDXiFU1.js} +1 -1
  5. package/dist/client/assets/{AppearancePage-EJF8LarY.js → AppearancePage-COqDtruX.js} +1 -1
  6. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-COy_dBa2.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CIKvkn5X.js} +24 -24
  7. package/dist/client/assets/{BlintzCanvas-Bb84mtl-.js → BlintzCanvas-4FX_eaSh.js} +1 -1
  8. package/dist/client/assets/{CanvasCsvContent-D1y22lqg.js → CanvasCsvContent-Dq2X1kUl.js} +1 -1
  9. package/dist/client/assets/{CanvasFileContent-CbOnIUPF.js → CanvasFileContent-CZUc62IR.js} +2 -2
  10. package/dist/client/assets/{CanvasModel3dContent-Bv86PZ-y.js → CanvasModel3dContent-D1IN_nl9.js} +2 -2
  11. package/dist/client/assets/{CodeMirrorDiff-CXqMnztG.js → CodeMirrorDiff-BeEhMSvL.js} +1 -1
  12. package/dist/client/assets/{CodeMirrorEditor-DHSY565t.js → CodeMirrorEditor-BlNLMvbo.js} +1 -1
  13. package/dist/client/assets/{ConnectionAccessLists-D5Qo1i-D.js → ConnectionAccessLists-s7RnRr1y.js} +1 -1
  14. package/dist/client/assets/{ConnectionsPage-DFvJRdx7.js → ConnectionsPage-BTTdQBdS.js} +2 -2
  15. package/dist/client/assets/ConventionPage-CI3PeUHm.js +11 -0
  16. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BDQA6n2J.js → FloatingTanStackRouterDevtools-CqogiFob-D6OvDT9K.js} +1 -1
  17. package/dist/client/assets/HandlePage-Dvqztr0N.js +1 -0
  18. package/dist/client/assets/{LexicalField-a7Ov2ETq.js → LexicalField-Bqq5KeUW.js} +1 -1
  19. package/dist/client/assets/{ManagesPage-Czapr6qD.js → ManagesPage-CWdKDvw1.js} +1 -1
  20. package/dist/client/assets/{Model3dViewer-C_lFbWIi.js → Model3dViewer-ClJVGLDb.js} +1 -1
  21. package/dist/client/assets/NamePage-BgVZ-KD1.js +1 -0
  22. package/dist/client/assets/{NotificationsPage-CdQCyMJk.js → NotificationsPage-C6tE8iuE.js} +1 -1
  23. package/dist/client/assets/{PermissionsPage-DLT-RkUE.js → PermissionsPage-BqDl7shN.js} +1 -1
  24. package/dist/client/assets/{PersonalityPopover-BeOdD7eK.js → PersonalityPopover-B3q8QYcS.js} +1 -1
  25. package/dist/client/assets/PhotoPage-lt6ZevHW.js +1 -0
  26. package/dist/client/assets/{RoomsPage-CuZJdN_k.js → RoomsPage-DwYtOhd7.js} +1 -1
  27. package/dist/client/assets/{RunsOnPopover-DspQEAdG.js → RunsOnPopover-BDPs-RYB.js} +1 -1
  28. package/dist/client/assets/{SessionsPage-Ctwlg7GN.js → SessionsPage-Du24E934.js} +2 -2
  29. package/dist/client/assets/{SkillsPage-DJdFnWfL.js → SkillsPage-DjLUEngt.js} +1 -1
  30. package/dist/client/assets/{TasksPage-9jCfZB7f.js → TasksPage-B6i3r76o.js} +1 -1
  31. package/dist/client/assets/{ToolsPage-W7zK5P0s.js → ToolsPage-DNoC2MMz.js} +2 -2
  32. package/dist/client/assets/{TopologyGraph-CQga4Nuw.js → TopologyGraph-DtBDaHqX.js} +1 -1
  33. package/dist/client/assets/{agent-browser-CoSmBP5N.js → agent-browser-da9rKrej.js} +1 -1
  34. package/dist/client/assets/{highlighted-body-KPVGNVTW-Bq_O6Zlj.js → highlighted-body-KPVGNVTW-DJ5Xz8gv.js} +1 -1
  35. package/dist/client/assets/{index-CKY7hz-9.js → index-1o6WO7iZ.js} +1 -1
  36. package/dist/client/assets/{index-Dx0uYGgf.js → index-3DE2Q3OD.js} +1 -1
  37. package/dist/client/assets/index-B5yJddXH.js +1 -0
  38. package/dist/client/assets/{index-DrD7x9EL.js → index-BC9LsNlJ.js} +1 -1
  39. package/dist/client/assets/{index-bYhLX3oQ.js → index-BCGiD7pg.js} +410 -405
  40. package/dist/client/assets/index-BG-HtbEP.css +1 -0
  41. package/dist/client/assets/{index-BBMfKdj-.js → index-BQ-o6bQ0.js} +1 -1
  42. package/dist/client/assets/{index-D4nkiaT7.js → index-BVpHI-1y.js} +1 -1
  43. package/dist/client/assets/{index-DCmzSFWM.js → index-Bl2j_xjE.js} +1 -1
  44. package/dist/client/assets/{index-THAVeZRE.js → index-BnORUrPC.js} +1 -1
  45. package/dist/client/assets/{index-OidZkt6z.js → index-Bp2CiCey.js} +1 -1
  46. package/dist/client/assets/{index-BfoOBbWz.js → index-Bu16-jWo.js} +1 -1
  47. package/dist/client/assets/{index-DT9R_NnS.js → index-BzDP7VXZ.js} +1 -1
  48. package/dist/client/assets/{index-Bj32H2Xz.js → index-C9wgMNj5.js} +3 -3
  49. package/dist/client/assets/{index-CpCOMkMm.js → index-CJK5Iw50.js} +1 -1
  50. package/dist/client/assets/{index-Bat0bq64.js → index-CObinYlG.js} +1 -1
  51. package/dist/client/assets/{index-CdNENSm7.js → index-CQXxVt4A.js} +1 -1
  52. package/dist/client/assets/{index-Bn-vRpKY.js → index-CZ0BaV1t.js} +1 -1
  53. package/dist/client/assets/index-Ca5JlBEc.js +1 -0
  54. package/dist/client/assets/{index-CmQbhXN6.js → index-CfUAagLY.js} +1 -1
  55. package/dist/client/assets/{index-ULWpcSAZ.js → index-CotYqF0w.js} +1 -1
  56. package/dist/client/assets/{index-7AN8MIhq.js → index-CtJTMcuR.js} +1 -1
  57. package/dist/client/assets/{index-nztBriGg.js → index-CtlzkOJ3.js} +3 -3
  58. package/dist/client/assets/{index-9RHYMIP_.js → index-Cvzimc0W.js} +1 -1
  59. package/dist/client/assets/{index-cNE108-h.js → index-D0sn-ct6.js} +1 -1
  60. package/dist/client/assets/{index-BI051zYq.js → index-D1kH8Sr2.js} +2 -2
  61. package/dist/client/assets/{index-DV_54TKu.js → index-DJGEk3-H.js} +1 -1
  62. package/dist/client/assets/{index-B7fRxuTQ.js → index-DQWAoAN-.js} +1 -1
  63. package/dist/client/assets/{index-B4oYDFdX.js → index-DdsOOmtz.js} +1 -1
  64. package/dist/client/assets/{index-CIPmtIuV.js → index-DnN4PJaN.js} +1 -1
  65. package/dist/client/assets/{index-BiqiwP26.js → index-DsH33VjO.js} +4 -4
  66. package/dist/client/assets/{index-ahTVwxpJ.js → index-DwfaFQZo.js} +1 -1
  67. package/dist/client/assets/{index-BuAy0fEx.js → index-Dyeo69l2.js} +1 -1
  68. package/dist/client/assets/{index-E7ZNee_E.js → index-FsBhOkNr.js} +1 -1
  69. package/dist/client/assets/{index-DcwZU98u.js → index-LcH-4hgH.js} +1 -1
  70. package/dist/client/assets/{index-EmzeTf1X.js → index-gHd4-GL-.js} +1 -1
  71. package/dist/client/assets/{index-CFdScmIU.js → index-gIAwAMkn.js} +1 -1
  72. package/dist/client/assets/{room-files-source-CMj0pEdy.js → room-files-source-DRQNpCWs.js} +1 -1
  73. package/dist/client/assets/{soul-file-C_AT0A8U.js → soul-file-DcQD5pcS.js} +1 -1
  74. package/dist/client/assets/{use-personality-commit-ClM-Ahk5.js → use-personality-commit-Dsy9tqWY.js} +1 -1
  75. package/dist/client/index.html +2 -2
  76. package/dist/drizzle/0132_connection_access_levels.sql +84 -0
  77. package/dist/drizzle/0134_query_indexes.sql +8 -0
  78. package/dist/drizzle/0135_session_started_by.sql +13 -0
  79. package/dist/drizzle/meta/0132_snapshot.json +10075 -0
  80. package/dist/drizzle/meta/0134_snapshot.json +10095 -0
  81. package/dist/drizzle/meta/0135_snapshot.json +10176 -0
  82. package/dist/drizzle/meta/_journal.json +22 -1
  83. package/dist/server/index.js +18659 -13468
  84. package/dist/server/index.js.map +2 -2
  85. package/package.json +9 -7
  86. package/dist/client/assets/ConventionPage-fMfStY8d.js +0 -11
  87. package/dist/client/assets/HandlePage-8Gv3fBBC.js +0 -1
  88. package/dist/client/assets/NamePage-CrZUfKVe.js +0 -1
  89. package/dist/client/assets/PhotoPage-C2mHVHvV.js +0 -1
  90. package/dist/client/assets/index-B0qJNUoh.css +0 -1
  91. package/dist/client/assets/index-CtxpF7aO.js +0 -1
  92. package/dist/client/assets/index-N8BCc19i.js +0 -1
@@ -1 +1 @@
1
- import{O as u,j as e,a as x,Q as g,B as o,R as h,U as p,V as l,W as m,Y as j,Z as f,$ as N}from"./index-bYhLX3oQ.js";const v={agent:"Inherited from agent",this_chat:"Allowed only in this session"};function A({agentId:n,onManage:s}){var i;const a=u(n);if(a.isPending)return e.jsx(x,{className:"h-24 w-full rounded-lg"});if(a.isError)return e.jsx(g,{title:"Couldn’t load account access",description:"No access details were changed. Try again.",onRetry:()=>void a.refetch(),isRetrying:a.isFetching});const c=((i=a.data)==null?void 0:i.connections)??[];return e.jsxs("section",{"aria-labelledby":"agent-account-access",className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"agent-account-access",className:"text-sm font-semibold",children:"Account access"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Accounts this agent may use for approved actions."})]}),s&&e.jsxs(o,{variant:"ghost",size:"sm",onClick:s,children:["Manage",e.jsx(h,{className:"size-3.5","aria-hidden":!0})]})]}),c.length===0?e.jsxs("div",{className:"bg-muted/40 rounded-lg p-4 text-sm",children:[e.jsx("p",{className:"font-medium",children:"No account access"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Grant an account from Connections when this agent needs it."})]}):e.jsx("ul",{className:"space-y-1.5",children:c.map(t=>{const r=t.readiness.state==="ready";return e.jsxs("li",{"data-testid":`agent-connection-${t.connectionId}`,className:"bg-muted/40 flex min-h-11 items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(p,{iconKey:t.toolkit,displayName:l(t.toolkit),className:"size-7"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"truncate text-sm font-medium",children:[l(t.toolkit)," (",t.label,")"]}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.operationRevisionIds.length," approved"," ",t.operationRevisionIds.length===1?"action":"actions",t.everyAgent&&" · given to every agent"]})]}),e.jsx(m,{size:"xs",variant:r?"secondary":"outline",title:r?void 0:t.readiness.copy.owner,children:r?"Available":"Unavailable"})]},t.connectionId)})})]})}const y="Turning an app off here only affects this chat. Turning it back on puts back the access this chat had, and never adds any.",C="Couldn’t change it. Nothing changed. Try again.";function b(n){return(n==null?void 0:n.code)==="session_access_other_agent"?n.message:C}function k({sessionId:n,onManage:s,emptyAction:a,footer:c}){var r;const i=j(n);if(i.isPending)return e.jsx(x,{className:"h-16 w-full rounded-lg"});if(i.isError)return e.jsxs("section",{"data-testid":"session-connectors",className:"space-y-2",children:[e.jsx("p",{role:"alert",className:"text-destructive px-1 text-xs",children:"Couldn’t load account access."}),e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]});const t=((r=i.data)==null?void 0:r.connections)??[];return e.jsxs("section",{"data-testid":"session-connectors","aria-labelledby":"session-account-access",className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsx("h3",{id:"session-account-access",className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Connections"}),s&&e.jsxs(o,{variant:"ghost",size:"xs",onClick:s,children:["Manage agent access",e.jsx(h,{className:"size-3","aria-hidden":!0})]})]}),t.length===0?e.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md px-2.5 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"No account access"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Ask this agent to request the service and actions it needs."})]}),a]}):e.jsxs(e.Fragment,{children:[t.some(d=>d.thisChat)&&e.jsx("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:y}),t.map(d=>e.jsx(w,{sessionId:n,connection:d},d.connectionId))]}),t.length>0&&c]})}function w({sessionId:n,connection:s}){const a=f(n),c=s.readiness.state==="ready",i=`${l(s.toolkit)} (${s.label})`;return e.jsxs("div",{"data-testid":`session-connection-${s.connectionId}`,"data-reason":s.readiness.reason,className:"bg-muted/40 rounded-md px-2.5 py-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium",children:i}),e.jsx(m,{size:"xs",variant:c?"secondary":"outline",children:c?v[s.source]:"Not available"})]}),e.jsx("p",{className:c?"text-muted-foreground mt-1 text-xs":"text-status-warning-fg mt-1 text-xs",children:c?`${s.operationRevisionIds.length} actions available in this session.`:s.readiness.copy.owner})]}),s.thisChat&&e.jsx(N,{"aria-label":`${i} in this chat`,"data-testid":`session-connection-switch-${s.connectionId}`,checked:s.thisChat==="on",disabled:a.isPending,onCheckedChange:t=>a.mutate({connectionId:s.connectionId,on:t}),className:"mt-0.5 shrink-0"})]}),a.isError&&s.thisChat&&e.jsx("p",{role:"alert",className:"text-destructive mt-1 text-xs",children:b(a.error)})]})}export{A,k as S};
1
+ import{O as u,j as e,a as x,Q as g,B as o,R as h,U as p,V as l,W as m,Y as j,Z as f,$ as N}from"./index-BCGiD7pg.js";const v={agent:"Inherited from agent",this_chat:"Allowed only in this session"};function A({agentId:n,onManage:s}){var i;const a=u(n);if(a.isPending)return e.jsx(x,{className:"h-24 w-full rounded-lg"});if(a.isError)return e.jsx(g,{title:"Couldn’t load account access",description:"No access details were changed. Try again.",onRetry:()=>void a.refetch(),isRetrying:a.isFetching});const c=((i=a.data)==null?void 0:i.connections)??[];return e.jsxs("section",{"aria-labelledby":"agent-account-access",className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"agent-account-access",className:"text-sm font-semibold",children:"Account access"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Accounts this agent may use for approved actions."})]}),s&&e.jsxs(o,{variant:"ghost",size:"sm",onClick:s,children:["Manage",e.jsx(h,{className:"size-3.5","aria-hidden":!0})]})]}),c.length===0?e.jsxs("div",{className:"bg-muted/40 rounded-lg p-4 text-sm",children:[e.jsx("p",{className:"font-medium",children:"No account access"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Grant an account from Connections when this agent needs it."})]}):e.jsx("ul",{className:"space-y-1.5",children:c.map(t=>{const r=t.readiness.state==="ready";return e.jsxs("li",{"data-testid":`agent-connection-${t.connectionId}`,className:"bg-muted/40 flex min-h-11 items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(p,{iconKey:t.toolkit,displayName:l(t.toolkit),className:"size-7"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"truncate text-sm font-medium",children:[l(t.toolkit)," (",t.label,")"]}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.operationRevisionIds.length," approved"," ",t.operationRevisionIds.length===1?"action":"actions",t.everyAgent&&" · given to every agent"]})]}),e.jsx(m,{size:"xs",variant:r?"secondary":"outline",title:r?void 0:t.readiness.copy.owner,children:r?"Available":"Unavailable"})]},t.connectionId)})})]})}const y="Turning an app off here only affects this chat. Turning it back on puts back the access this chat had, and never adds any.",C="Couldn’t change it. Nothing changed. Try again.";function b(n){return(n==null?void 0:n.code)==="session_access_other_agent"?n.message:C}function k({sessionId:n,onManage:s,emptyAction:a,footer:c}){var r;const i=j(n);if(i.isPending)return e.jsx(x,{className:"h-16 w-full rounded-lg"});if(i.isError)return e.jsxs("section",{"data-testid":"session-connectors",className:"space-y-2",children:[e.jsx("p",{role:"alert",className:"text-destructive px-1 text-xs",children:"Couldn’t load account access."}),e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]});const t=((r=i.data)==null?void 0:r.connections)??[];return e.jsxs("section",{"data-testid":"session-connectors","aria-labelledby":"session-account-access",className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsx("h3",{id:"session-account-access",className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Connections"}),s&&e.jsxs(o,{variant:"ghost",size:"xs",onClick:s,children:["Manage agent access",e.jsx(h,{className:"size-3","aria-hidden":!0})]})]}),t.length===0?e.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md px-2.5 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"No account access"}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Ask this agent to request the service and actions it needs."})]}),a]}):e.jsxs(e.Fragment,{children:[t.some(d=>d.thisChat)&&e.jsx("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:y}),t.map(d=>e.jsx(w,{sessionId:n,connection:d},d.connectionId))]}),t.length>0&&c]})}function w({sessionId:n,connection:s}){const a=f(n),c=s.readiness.state==="ready",i=`${l(s.toolkit)} (${s.label})`;return e.jsxs("div",{"data-testid":`session-connection-${s.connectionId}`,"data-reason":s.readiness.reason,className:"bg-muted/40 rounded-md px-2.5 py-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium",children:i}),e.jsx(m,{size:"xs",variant:c?"secondary":"outline",children:c?v[s.source]:"Not available"})]}),e.jsx("p",{className:c?"text-muted-foreground mt-1 text-xs":"text-status-warning-fg mt-1 text-xs",children:c?`${s.operationRevisionIds.length} actions available in this session.`:s.readiness.copy.owner})]}),s.thisChat&&e.jsx(N,{"aria-label":`${i} in this chat`,"data-testid":`session-connection-switch-${s.connectionId}`,checked:s.thisChat==="on",disabled:a.isPending,onCheckedChange:t=>a.mutate({connectionId:s.connectionId,on:t}),className:"mt-0.5 shrink-0"})]}),a.isError&&s.thisChat&&e.jsx("p",{role:"alert",className:"text-destructive mt-1 text-xs",children:b(a.error)})]})}export{A,k as S};
@@ -1,4 +1,4 @@
1
- import{dR as U,af as K,df as J,r,e6 as Q,aG as X,j as e,al as I,b5 as Y,W as F,cM as ee,cN as se,cO as ae,e7 as te,e8 as ne,B as z,e9 as ie,ea as re,eb as R,aF as ce,ec as oe,ed as L,ee as de,ef as le,eg as me,eh as ue,ei as pe,ej as xe,ek as he,el as ge,em as fe,en as je,eo as ye,ep as ve,P as Ne,eq as Ce,er as be,es as Te,et as Ie,eu as we,ev as ke,ew as Ae,ex as G,a_ as N,ey as Se,ez as De,eA as Re,eB as Me,eC as $,u as Pe,a as ze}from"./index-bYhLX3oQ.js";import{A as Be}from"./ConnectionAccessLists-D5Qo1i-D.js";import{A as _,a as P,b as Ee}from"./AdapterIcon-DTXuj6Zu.js";import"./agent-browser-CoSmBP5N.js";/**
1
+ import{dT as U,af as K,dh as J,r,e8 as Q,aG as X,j as e,al as I,aO as Y,W as F,ct as ee,cu as se,cv as ae,e9 as te,ea as ne,B as E,eb as ie,ec as re,ed as R,aF as ce,ee as oe,ef as L,eg as de,eh as le,ei as me,ej as ue,ek as pe,el as xe,em as he,en as ge,eo as fe,ep as je,eq as ye,er as ve,P as Ne,es as Ce,et as be,eu as Te,ev as Ie,ew as we,ex as ke,ey as Ae,ez as G,cS as N,eA as Se,eB as De,eC as Re,eD as Pe,eE as $,u as Me,a as Ee}from"./index-BCGiD7pg.js";import{A as ze}from"./ConnectionAccessLists-s7RnRr1y.js";import{A as _,a as M,b as Be}from"./AdapterIcon-kPDXiFU1.js";import"./agent-browser-da9rKrej.js";/**
2
2
  * @license lucide-react v1.47.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{dR as U,af as K,df as J,r,e6 as Q,aG as X,j as e,al as I,b5 as Y,W as F,c
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const Z={name:"plug-2",size:24,node:[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0Z",key:"wtfw2c"}]]};Z.node;const _e=U(Z);function Fe(){const t=K();return J({mutationFn:i=>t.testBinding(i),meta:{errorLabel:"Test failed"}})}const Le={connected:P.connected,disconnected:Y.warning,error:P.error,connecting:P.starting};function $e(t){const i=[];return t.canInitiate&&i.push("Can start conversations"),t.canReply||i.push("Cannot reply"),t.canReceive||i.push("Cannot receive"),i.join(" · ")}function qe({binding:t,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:g,lastMessageAt:d,onTogglePause:f,onTest:n,onEdit:m,onRemove:u}){const[a,o]=r.useState(!1),[j,v]=r.useState(!1),p=t.enabled===!1,[w,k]=r.useState(0);r.useEffect(()=>{if(!d||p)return;const C=setInterval(()=>k(s=>s+1),6e4);return()=>clearInterval(C)},[d,p]);const B=g?`${i} · ${g}`:i,A=Q({sessionStrategy:t.sessionStrategy,chatDisplayName:g,channelType:t.channelType}),S=t.canInitiate||!t.canReply||!t.canReceive,E=S?$e(t):"",D=r.useMemo(()=>p?"Paused — no messages routing":d?`Last received ${X(d).toLowerCase()}`:"No recent activity",[p,d,w]),O=async()=>{v(!0);try{await n()}finally{v(!1)}};return e.jsxs("div",{className:I("relative rounded-xl border px-4 py-3 transition-colors",x==="error"&&!p&&"border-red-500/50 bg-red-500/[0.02]",p&&"opacity-60"),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:y,adapterType:l,size:32}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2",p?"bg-muted-foreground/40":Le[x])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:B}),p&&e.jsx(F,{variant:"secondary",children:"Paused"})]}),p?e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D}):x==="error"&&h?e.jsx("p",{className:"text-destructive text-xs",children:h}):e.jsxs(e.Fragment,{children:[A&&e.jsx("p",{className:"text-muted-foreground truncate text-xs italic",children:A}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D})]})]}),S&&e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsx(F,{variant:"outline",children:"Restricted"})}),e.jsx(ae,{children:E})]}),e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsxs(z,{variant:"ghost",size:"icon-md",responsive:!1,className:"h-8 w-8 shrink-0",children:[e.jsx(ie,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Actions"})]})}),e.jsxs(re,{align:"end",children:[e.jsxs(R,{onClick:O,disabled:j||p,children:[j?e.jsx(ce,{className:"mr-2"}):e.jsx(oe,{className:"mr-2 size-(--size-icon-sm)"}),"Send test"]}),e.jsx(L,{}),e.jsx(R,{onClick:()=>f(!t.enabled),children:p?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"mr-2 size-4"}),"Resume"]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"mr-2 size-4"}),"Pause"]})}),e.jsx(L,{}),e.jsx(R,{onClick:m,children:"Edit"}),e.jsx(R,{onClick:()=>o(!0),className:"text-destructive focus:text-destructive",children:"Remove"})]})]})]}),e.jsx(le,{open:a,onOpenChange:o,children:e.jsxs(me,{children:[e.jsxs(ue,{children:[e.jsx(pe,{children:"Remove connection"}),e.jsxs(xe,{children:["Remove the connection to ",i,"? The agent will no longer receive messages from it."]})]}),e.jsxs(he,{children:[e.jsx(ge,{children:"Cancel"}),e.jsx(fe,{onClick:()=>{u(),o(!1)},className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})})]})}function We({binding:t,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,onTogglePause:g,onTest:d,onEdit:f,onRemove:n}){const{data:m=[]}=je(t.adapterId),u=t.chatId?m.find(j=>j.chatId===t.chatId):void 0,a=(u==null?void 0:u.displayName)??(t.chatId?`#${t.chatId.slice(-4)}`:void 0),o=r.useMemo(()=>{if(u)return u.lastMessageAt;if(m.length!==0)return m.reduce((j,v)=>v.lastMessageAt>j?v.lastMessageAt:j,m[0].lastMessageAt)},[u,m]);return e.jsx(qe,{binding:t,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:a,lastMessageAt:o,onTogglePause:g,onTest:d,onEdit:f,onRemove:n})}function q({catalog:t,boundAdapterIds:i,onSelectIntegration:y,onRequestSetup:l,disabled:x}){const[h,g]=r.useState(!1),d=r.useMemo(()=>t.flatMap(a=>a.instances.map(o=>({id:o.id,displayName:o.status.displayName??a.manifest.displayName,label:o.label,state:o.status.state,isDisabled:o.status.state==="error"||!o.enabled,alreadyBound:i.has(o.id),iconId:a.manifest.iconId,adapterType:a.manifest.type}))),[t,i]),f=r.useMemo(()=>t.filter(a=>!a.manifest.deprecated&&(a.instances.length===0||a.manifest.multiInstance)),[t]);function n(a){y(a),g(!1)}function m(a){g(!1),l(a)}const u=d.length===0&&f.length===0;return e.jsxs(ye,{open:h,onOpenChange:g,children:[e.jsx(ve,{asChild:!0,children:e.jsxs(z,{variant:"outline",size:"sm",disabled:x,children:[e.jsx(Ne,{className:"mr-1.5 size-3.5"}),"Add connection"]})}),e.jsx(Ce,{className:"w-72 p-0",align:"start",children:e.jsx("div",{className:"max-h-64 overflow-y-auto",children:u?e.jsx("div",{className:"px-3 py-4 text-center",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"No connections available"})}):e.jsxs(e.Fragment,{children:[d.length>0&&e.jsx("div",{className:"py-1",children:d.map(a=>e.jsxs("button",{disabled:a.isDisabled||a.alreadyBound,onClick:()=>n(a.id),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:a.iconId,adapterType:a.adapterType,size:20,className:"text-muted-foreground"}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-[1.5px]",P[a.state])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate font-medium",children:a.displayName}),a.label&&e.jsx("p",{className:"text-muted-foreground truncate text-xs",children:a.label})]}),e.jsx("span",{className:"text-muted-foreground/60 text-xs",children:a.alreadyBound?"Connected":Ee[a.state]})]},a.id))}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"text-muted-foreground px-3 py-1 text-xs font-medium",children:"Available to set up"}),f.map(a=>e.jsxs("button",{onClick:()=>m(a.manifest),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent"),children:[e.jsx(_,{iconId:a.manifest.iconId,adapterType:a.manifest.type,size:14,className:"text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate font-medium",children:a.manifest.displayName})]},a.manifest.type))]})]})]})})})]})}const M={open:!1,binding:null,adapterName:""},W={open:!1};function Ue({agent:t}){const i=be(),{data:y=[]}=Te(),{data:l=[]}=Ie(i),x=we(),h=ke(),g=Fe(),d=Ae(),f=G(),[n,m]=r.useState(M),[u,a]=r.useState(W),o=y.filter(s=>s.agentId===t.id),j=r.useMemo(()=>{const s=new Map;for(const c of l)for(const b of c.instances){const T=b.status.state,H=T==="connected"||T==="error"?T:T==="starting"||T==="stopping"||T==="reconnecting"?"connecting":"disconnected";s.set(b.id,{state:H,name:b.status.displayName??c.manifest.displayName,iconId:c.manifest.iconId,adapterType:c.manifest.type,errorMessage:b.status.lastError??void 0})}return s},[l]),v=r.useCallback(s=>j.get(s)??{state:"disconnected",name:s,adapterType:s},[j]),p=r.useMemo(()=>new Set(o.map(s=>s.adapterId)),[o]),w=r.useCallback(async s=>{try{await x.mutateAsync({adapterId:s,agentId:t.id,sessionStrategy:"per-chat",label:"",canInitiate:!1,canReply:!0,canReceive:!0}),N.success("Connection added")}catch{}},[t.id,x]),k=r.useCallback(s=>{a({open:!0,manifest:s})},[]),B=r.useCallback(s=>{m({open:!0,binding:s,adapterName:v(s.adapterId).name})},[v]),A=r.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed")}catch{}},[h]),S=r.useCallback(async(s,c)=>{try{await d.mutateAsync({id:s,updates:{enabled:c}}),N.success(c?"Connection resumed":"Connection paused")}catch{}},[d]),E=r.useCallback(async s=>{const c=await g.mutateAsync(s);return c.ok?N.success(`Test OK: routed in ${c.latencyMs}ms`):N.error(`Test failed: ${c.reason??"unknown error"}`),c},[g]),D=r.useCallback(async s=>{if(n.binding)try{await d.mutateAsync({id:n.binding.id,updates:Se(s)}),N.success("Connection updated"),m(M)}catch{}},[n.binding,d]),O=r.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed"),m(M)}catch{}},[h]),C=e.jsxs(e.Fragment,{children:[n.binding&&e.jsx(De,{open:n.open,onOpenChange:s=>{s||m(M)},mode:"edit",initialValues:{adapterId:n.binding.adapterId,agentId:n.binding.agentId,sessionStrategy:n.binding.sessionStrategy,label:n.binding.label,permissionMode:n.binding.permissionMode,chatId:n.binding.chatId,channelType:n.binding.channelType,canInitiate:n.binding.canInitiate,canReply:n.binding.canReply,canReceive:n.binding.canReceive,notifyOnTaskComplete:n.binding.notifyOnTaskComplete},adapterName:n.adapterName,agentName:Re(t),bindingId:n.binding.id,onConfirm:D,onDelete:O,isPending:d.isPending||h.isPending}),u.manifest&&e.jsx(Me,{open:u.open,onOpenChange:s=>{s||a(W)},manifest:u.manifest,existingAdapterIds:l.flatMap(s=>s.instances.map(c=>c.id))})]});return i?l.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"No connections available"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"To connect this agent to Telegram, Slack, or a webhook, add a connection first. It will appear here as soon as it’s ready."})]}),e.jsx(z,{variant:"outline",size:"sm",onClick:()=>f(),children:"Add a connection"})]}),C]}):o.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Let this agent reach the outside world"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Connect Telegram, Slack, or a webhook so this agent can send and receive messages while you are away."})]}),e.jsx(q,{catalog:l,boundAdapterIds:p,onSelectIntegration:w,onRequestSetup:k,disabled:x.isPending})]}),C]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"space-y-2",children:o.map(s=>{const c=v(s.adapterId);return e.jsx(We,{binding:s,integrationName:c.name,integrationIconId:c.iconId,integrationAdapterType:c.adapterType,adapterState:c.state,errorMessage:c.errorMessage,onTogglePause:b=>S(s.id,b),onTest:()=>E(s.id),onEdit:()=>B(s),onRemove:()=>A(s.id)},s.id)})}),e.jsx(q,{catalog:l,boundAdapterIds:p,onSelectIntegration:w,onRequestSetup:k,disabled:x.isPending}),C]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx(_e,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Chat apps are off"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Chat apps let people reach this agent from Telegram, Slack or a webhook. They are turned off on this computer; the Connections page says how to turn them on."})]}),e.jsx(z,{variant:"outline",size:"sm",onClick:()=>f(),children:"Open Connections"})]}),C]})}function Ke({member:t}){const{agent:i,isPending:y}=Pe(t),l=G();return y?e.jsx(ze,{className:"h-32 w-full"}):i?e.jsxs("div",{className:"space-y-6",children:[e.jsx(Be,{agentId:i.id,onManage:()=>l()}),e.jsxs("section",{"aria-labelledby":"agent-messaging-access",className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"agent-messaging-access",className:"text-sm font-semibold",children:"Messaging"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Places where people can reach this agent."})]}),e.jsx(Ue,{agent:i})]})]}):e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s connections."})}export{Ke as ConnectionsPage};
11
+ */const Z={name:"plug-2",size:24,node:[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0Z",key:"wtfw2c"}]]};Z.node;const _e=U(Z);function Fe(){const t=K();return J({mutationFn:i=>t.testBinding(i),meta:{errorLabel:"Test failed"}})}const Le={connected:M.connected,disconnected:Y.warning,error:M.error,connecting:M.starting};function $e(t){const i=[];return t.canInitiate&&i.push("Can start conversations"),t.canReply||i.push("Cannot reply"),t.canReceive||i.push("Cannot receive"),i.join(" · ")}function qe({binding:t,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:g,lastMessageAt:d,onTogglePause:f,onTest:n,onEdit:m,onRemove:u}){const[a,o]=r.useState(!1),[j,v]=r.useState(!1),p=t.enabled===!1,[w,k]=r.useState(0);r.useEffect(()=>{if(!d||p)return;const C=setInterval(()=>k(s=>s+1),6e4);return()=>clearInterval(C)},[d,p]);const z=g?`${i} · ${g}`:i,A=Q({sessionStrategy:t.sessionStrategy,chatDisplayName:g,channelType:t.channelType}),S=t.canInitiate||!t.canReply||!t.canReceive,B=S?$e(t):"",D=r.useMemo(()=>p?"Paused — no messages routing":d?`Last received ${X(d).toLowerCase()}`:"No recent activity",[p,d,w]),O=async()=>{v(!0);try{await n()}finally{v(!1)}};return e.jsxs("div",{className:I("relative rounded-xl border px-4 py-3 transition-colors",x==="error"&&!p&&"border-red-500/50 bg-red-500/[0.02]",p&&"opacity-60"),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:y,adapterType:l,size:32}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2",p?"bg-muted-foreground/40":Le[x])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:z}),p&&e.jsx(F,{variant:"secondary",children:"Paused"})]}),p?e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D}):x==="error"&&h?e.jsx("p",{className:"text-destructive text-xs",children:h}):e.jsxs(e.Fragment,{children:[A&&e.jsx("p",{className:"text-muted-foreground truncate text-xs italic",children:A}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D})]})]}),S&&e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsx(F,{variant:"outline",children:"Restricted"})}),e.jsx(ae,{children:B})]}),e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsxs(E,{variant:"ghost",size:"icon-md",responsive:!1,className:"h-8 w-8 shrink-0",children:[e.jsx(ie,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Actions"})]})}),e.jsxs(re,{align:"end",children:[e.jsxs(R,{onClick:O,disabled:j||p,children:[j?e.jsx(ce,{className:"mr-2"}):e.jsx(oe,{className:"mr-2 size-(--size-icon-sm)"}),"Send test"]}),e.jsx(L,{}),e.jsx(R,{onClick:()=>f(!t.enabled),children:p?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"mr-2 size-4"}),"Resume"]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"mr-2 size-4"}),"Pause"]})}),e.jsx(L,{}),e.jsx(R,{onClick:m,children:"Edit"}),e.jsx(R,{onClick:()=>o(!0),className:"text-destructive focus:text-destructive",children:"Remove"})]})]})]}),e.jsx(le,{open:a,onOpenChange:o,children:e.jsxs(me,{children:[e.jsxs(ue,{children:[e.jsx(pe,{children:"Remove connection"}),e.jsxs(xe,{children:["Remove the connection to ",i,"? The agent will no longer receive messages from it."]})]}),e.jsxs(he,{children:[e.jsx(ge,{children:"Cancel"}),e.jsx(fe,{onClick:()=>{u(),o(!1)},className:"bg-red-600 hover:bg-red-700",children:"Remove"})]})]})})]})}function We({binding:t,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,onTogglePause:g,onTest:d,onEdit:f,onRemove:n}){const{data:m=[]}=je(t.adapterId),u=t.chatId?m.find(j=>j.chatId===t.chatId):void 0,a=(u==null?void 0:u.displayName)??(t.chatId?`#${t.chatId.slice(-4)}`:void 0),o=r.useMemo(()=>{if(u)return u.lastMessageAt;if(m.length!==0)return m.reduce((j,v)=>v.lastMessageAt>j?v.lastMessageAt:j,m[0].lastMessageAt)},[u,m]);return e.jsx(qe,{binding:t,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:a,lastMessageAt:o,onTogglePause:g,onTest:d,onEdit:f,onRemove:n})}function q({catalog:t,boundAdapterIds:i,onSelectIntegration:y,onRequestSetup:l,disabled:x}){const[h,g]=r.useState(!1),d=r.useMemo(()=>t.flatMap(a=>a.instances.map(o=>({id:o.id,displayName:o.status.displayName??a.manifest.displayName,label:o.label,state:o.status.state,isDisabled:o.status.state==="error"||!o.enabled,alreadyBound:i.has(o.id),iconId:a.manifest.iconId,adapterType:a.manifest.type}))),[t,i]),f=r.useMemo(()=>t.filter(a=>!a.manifest.deprecated&&(a.instances.length===0||a.manifest.multiInstance)),[t]);function n(a){y(a),g(!1)}function m(a){g(!1),l(a)}const u=d.length===0&&f.length===0;return e.jsxs(ye,{open:h,onOpenChange:g,children:[e.jsx(ve,{asChild:!0,children:e.jsxs(E,{variant:"outline",size:"sm",disabled:x,children:[e.jsx(Ne,{className:"mr-1.5 size-3.5"}),"Add connection"]})}),e.jsx(Ce,{className:"w-72 p-0",align:"start",children:e.jsx("div",{className:"max-h-64 overflow-y-auto",children:u?e.jsx("div",{className:"px-3 py-4 text-center",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"No connections available"})}):e.jsxs(e.Fragment,{children:[d.length>0&&e.jsx("div",{className:"py-1",children:d.map(a=>e.jsxs("button",{disabled:a.isDisabled||a.alreadyBound,onClick:()=>n(a.id),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:a.iconId,adapterType:a.adapterType,size:20,className:"text-muted-foreground"}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-[1.5px]",M[a.state])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate font-medium",children:a.displayName}),a.label&&e.jsx("p",{className:"text-muted-foreground truncate text-xs",children:a.label})]}),e.jsx("span",{className:"text-muted-foreground/60 text-xs",children:a.alreadyBound?"Connected":Be[a.state]})]},a.id))}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"text-muted-foreground px-3 py-1 text-xs font-medium",children:"Available to set up"}),f.map(a=>e.jsxs("button",{onClick:()=>m(a.manifest),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent"),children:[e.jsx(_,{iconId:a.manifest.iconId,adapterType:a.manifest.type,size:14,className:"text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate font-medium",children:a.manifest.displayName})]},a.manifest.type))]})]})]})})})]})}const P={open:!1,binding:null,adapterName:""},W={open:!1};function Ue({agent:t}){const i=be(),{data:y=[]}=Te(),{data:l=[]}=Ie(i),x=we(),h=ke(),g=Fe(),d=Ae(),f=G(),[n,m]=r.useState(P),[u,a]=r.useState(W),o=y.filter(s=>s.agentId===t.id),j=r.useMemo(()=>{const s=new Map;for(const c of l)for(const b of c.instances){const T=b.status.state,H=T==="connected"||T==="error"?T:T==="starting"||T==="stopping"||T==="reconnecting"?"connecting":"disconnected";s.set(b.id,{state:H,name:b.status.displayName??c.manifest.displayName,iconId:c.manifest.iconId,adapterType:c.manifest.type,errorMessage:b.status.lastError??void 0})}return s},[l]),v=r.useCallback(s=>j.get(s)??{state:"disconnected",name:s,adapterType:s},[j]),p=r.useMemo(()=>new Set(o.map(s=>s.adapterId)),[o]),w=r.useCallback(async s=>{try{await x.mutateAsync({adapterId:s,agentId:t.id,sessionStrategy:"per-chat",label:"",canInitiate:!1,canReply:!0,canReceive:!0}),N.success("Connection added")}catch{}},[t.id,x]),k=r.useCallback(s=>{a({open:!0,manifest:s})},[]),z=r.useCallback(s=>{m({open:!0,binding:s,adapterName:v(s.adapterId).name})},[v]),A=r.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed")}catch{}},[h]),S=r.useCallback(async(s,c)=>{try{await d.mutateAsync({id:s,updates:{enabled:c}}),N.success(c?"Connection resumed":"Connection paused")}catch{}},[d]),B=r.useCallback(async s=>{const c=await g.mutateAsync(s);return c.ok?N.success(`Test OK: routed in ${c.latencyMs}ms`):N.error(`Test failed: ${c.reason??"unknown error"}`),c},[g]),D=r.useCallback(async s=>{if(n.binding)try{await d.mutateAsync({id:n.binding.id,updates:Se(s)}),N.success("Connection updated"),m(P)}catch{}},[n.binding,d]),O=r.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed"),m(P)}catch{}},[h]),C=e.jsxs(e.Fragment,{children:[n.binding&&e.jsx(De,{open:n.open,onOpenChange:s=>{s||m(P)},mode:"edit",initialValues:{adapterId:n.binding.adapterId,agentId:n.binding.agentId,sessionStrategy:n.binding.sessionStrategy,label:n.binding.label,permissionMode:n.binding.permissionMode,chatId:n.binding.chatId,channelType:n.binding.channelType,canInitiate:n.binding.canInitiate,canReply:n.binding.canReply,canReceive:n.binding.canReceive,notifyOnTaskComplete:n.binding.notifyOnTaskComplete},adapterName:n.adapterName,agentName:Re(t),bindingId:n.binding.id,onConfirm:D,onDelete:O,isPending:d.isPending||h.isPending}),u.manifest&&e.jsx(Pe,{open:u.open,onOpenChange:s=>{s||a(W)},manifest:u.manifest,existingAdapterIds:l.flatMap(s=>s.instances.map(c=>c.id))})]});return i?l.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"No connections available"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"To connect this agent to Telegram, Slack, or a webhook, add a connection first. It will appear here as soon as it’s ready."})]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>f(),children:"Add a connection"})]}),C]}):o.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Let this agent reach the outside world"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Connect Telegram, Slack, or a webhook so this agent can send and receive messages while you are away."})]}),e.jsx(q,{catalog:l,boundAdapterIds:p,onSelectIntegration:w,onRequestSetup:k,disabled:x.isPending})]}),C]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"space-y-2",children:o.map(s=>{const c=v(s.adapterId);return e.jsx(We,{binding:s,integrationName:c.name,integrationIconId:c.iconId,integrationAdapterType:c.adapterType,adapterState:c.state,errorMessage:c.errorMessage,onTogglePause:b=>S(s.id,b),onTest:()=>B(s.id),onEdit:()=>z(s),onRemove:()=>A(s.id)},s.id)})}),e.jsx(q,{catalog:l,boundAdapterIds:p,onSelectIntegration:w,onRequestSetup:k,disabled:x.isPending}),C]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx(_e,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Chat apps are off"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Chat apps let people reach this agent from Telegram, Slack or a webhook. They are turned off on this computer; the Connections page says how to turn them on."})]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>f(),children:"Open Connections"})]}),C]})}function Ke({member:t}){const{agent:i,isPending:y}=Me(t),l=G();return y?e.jsx(Ee,{className:"h-32 w-full"}):i?e.jsxs("div",{className:"space-y-6",children:[e.jsx(ze,{agentId:i.id,onManage:()=>l()}),e.jsxs("section",{"aria-labelledby":"agent-messaging-access",className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"agent-messaging-access",className:"text-sm font-semibold",children:"Messaging"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Places where people can reach this agent."})]}),e.jsx(Ue,{agent:i})]})]}):e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s connections."})}export{Ke as ConnectionsPage};
@@ -0,0 +1,11 @@
1
+ import{r as l,j as s,cy as k,cz as O,cA as I,cB as P,$,al as d,cC as D,cD as F,C as B,cE as G,cF as Y,A as _,cG as E,cH as z,cI as U,cJ as W,cK as p,cL as X,cM as H,cN as K,cO as V,cP as J,cQ as Q,u as Z,cR as q,a as ee,B as te,cS as ne}from"./index-BCGiD7pg.js";import"./agent-browser-da9rKrej.js";import{s as w}from"./soul-file-DcQD5pcS.js";function se({title:e,content:t,enabled:n,maxChars:o,charCount:a,disclaimer:u,onChange:r,onBlur:i,onToggle:m,fill:c=!1}){const h=l.useCallback(C=>{r(C.target.value)},[r]);return s.jsx(k,{className:d(!n&&"opacity-60",c&&"flex min-h-0 flex-1 flex-col"),children:s.jsxs(O,{className:d(c&&"flex min-h-0 flex-1 flex-col"),children:[s.jsxs(I,{orientation:"horizontal",className:"items-center justify-between",children:[s.jsx(P,{className:"text-sm font-medium",children:e}),s.jsx($,{checked:n,onCheckedChange:m,"aria-label":`Toggle ${e}`})]}),u&&s.jsx("p",{className:"text-muted-foreground text-xs italic",children:u}),s.jsxs("div",{className:d("space-y-2",c&&"flex min-h-0 flex-1 flex-col"),children:[s.jsx("textarea",{value:t,onChange:h,onBlur:i,rows:c?void 0:8,maxLength:o,className:d("border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full resize-none rounded-md border px-3 py-2 font-mono text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",c&&"min-h-40 flex-1"),placeholder:n?"Write markdown here…":"Turn this on to use it"}),s.jsxs("p",{className:"text-muted-foreground text-right text-xs",children:[a??t.length," / ",o.toLocaleString()]})]})]})})}const N="[new code each turn]",oe=[...new Set([...Object.values(V),...K,"system-reminder"])];function ae(e){const t=e.length>E,n=t?e.slice(0,E):e,o=z(n,oe);return["<agent_memory>",U,W,`--- BEGIN ${p} ${N} ---`,X,...t?[H]:[],o,`--- END ${p} ${N} ---`,"</agent_memory>"].join(`
2
+ `)}function re(e){var o;const n=[`<agent_identity>
3
+ ${[`Name: ${e.name}`,`ID: ${e.id}`,e.description?`Description: ${e.description}`:null,(o=e.capabilities)!=null&&o.length?`Capabilities: ${e.capabilities.join(", ")}`:null].filter(a=>a!==null).join(`
4
+ `)}
5
+ </agent_identity>`];if(e.conventions.soul){const a=e.soulContent.includes(Y)?w(e.traits,_(e.soulContent)):e.soulContent;a.trim()&&n.push(`<agent_persona>
6
+ ${a}
7
+ </agent_persona>`)}return e.conventions.nope&&e.nopeContent.trim()&&n.push(`<agent_safety_boundaries>
8
+ ${e.nopeContent}
9
+ </agent_safety_boundaries>`),e.conventions.memory&&e.memoryContent.trim()&&n.push(ae(e.memoryContent)),n.join(`
10
+
11
+ `)}function ie(e){const[t,n]=l.useState(!1),o=l.useMemo(()=>re(e),[e]);return s.jsxs(D,{open:t,onOpenChange:n,"data-slot":"profile-injection-preview",children:[s.jsxs(F,{className:"focus-ring text-muted-foreground hover:text-foreground flex items-center gap-1 rounded-md py-1 text-xs transition-colors",children:[s.jsx(B,{"aria-hidden":!0,className:d("size-3.5 transition-transform",t&&"rotate-90")}),"Preview what ",e.displayName," will see"]}),s.jsx(G,{children:s.jsx("pre",{"data-testid":"injected-prompt","data-slot":"profile-injection-preview-text",className:"bg-muted text-muted-foreground mt-1 max-h-56 overflow-auto rounded-md p-3 text-xs whitespace-pre-wrap",children:s.jsx("code",{children:o})})})]})}const ce="These boundaries guide agent behavior but are not enforced at the tool level. They serve as strong instructions, not hard blocks.",le="Your agent writes notes here as it works, and every note says where it was written. Anything in this file can come up in any conversation the agent joins, including rooms shared with other people, so never keep secrets, passwords or keys here. Deleting a line is forgetting it.";function S(e,t){return w(e.traits,t)}const j={instructions:{title:"Custom Instructions (SOUL.md)",errorLabel:"Couldn’t save your instructions",key:"soul",maxChars:Q,read:e=>_(e.soulContent??""),write:(e,t)=>({soulContent:S(e,t)}),count:(e,t)=>S(e,t).length},boundaries:{title:"Safety Boundaries (NOPE.md)",errorLabel:"Couldn’t save your boundaries",key:"nope",maxChars:J,disclaimer:ce,read:e=>e.nopeContent??"",write:(e,t)=>({nopeContent:t}),count:(e,t)=>t.length},memory:{title:"Agent memory (MEMORY.md)",errorLabel:"Couldn’t save your agent’s memory",key:"memory",maxChars:E,disclaimer:le,read:e=>e.memoryContent??"",write:(e,t)=>({memoryContent:t}),count:(e,t)=>t.length}};function ue(e){const t=Math.max(0,Date.now()-e),n=Math.floor(t/6e4);return n<1?"Saved just now":n<60?`Saved ${n} min ago`:`Saved ${Math.floor(n/60)} h ago`}function de(e,t,n,o){if(e>0){const a=t>0?`. The personality block takes ${t.toLocaleString()} of them`:"";return`Too long by ${e.toLocaleString()} character${e===1?"":"s"}${a}`}return n?"Unsaved changes":o!==null?ue(o):""}function b({member:e,file:t}){const{agent:n,isPending:o,isSaving:a,update:u}=Z(e,{errorLabel:t.errorLabel}),r=n?t.read(n):"",[i,m]=l.useState(r),[c,h]=l.useState(r),[C,M]=l.useState(r),[T,A]=l.useState(null),x=i!==c;if(C!==r&&(M(r),x||(m(r),h(r))),q(x),o)return s.jsx(ee,{className:"h-40 w-full"});if(!n)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this file."});const v=n.conventions??{soul:!0,nope:!0,memory:!0,dorkosKnowledge:!0},y=t.count(n,i),g=y-t.maxChars,L=y-i.length;function R(){if(!n||g>0)return;const f=i;u(t.write(n,f),()=>{h(f),A(Date.now()),ne.success("Saved")})}return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2","data-slot":"profile-convention",children:[s.jsx(se,{fill:!0,title:t.title,content:i,enabled:v[t.key],maxChars:t.maxChars,charCount:y,disclaimer:t.disclaimer,onChange:m,onToggle:f=>u({conventions:{...v,[t.key]:f}})}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx("span",{"data-slot":"profile-convention-status",className:g>0?"text-destructive text-xs":"text-muted-foreground text-xs",children:de(g,L,x,T)}),s.jsx(te,{size:"sm",className:"ml-auto",disabled:!x||g>0||a,onClick:R,children:"Save"})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(ie,{name:n.name,displayName:n.displayName||n.name,id:n.id,description:n.description,capabilities:n.capabilities,traits:n.traits,conventions:v,soulContent:n.soulContent??"",nopeContent:n.nopeContent??"",memoryContent:n.memoryContent??"",...t.write(n,i)})})]})}function ge(e){return s.jsx(b,{...e,file:j.instructions})}function fe(e){return s.jsx(b,{...e,file:j.boundaries})}function Ce(e){return s.jsx(b,{...e,file:j.memory})}export{fe as BoundariesPage,ge as InstructionsPage,Ce as MemoryPage};
@@ -1 +1 @@
1
- import{c as X,a as Z,b as j,d as C,D as Je,m as De,s as Ke,i as ze,e as Ve,f as U,g as Qe,t as je,h as We,j as t}from"./index-BI051zYq.js";import{n as Re,t as Xe,r as Ze,BaseTanStackRouterDevtoolsPanel as et}from"./BaseTanStackRouterDevtoolsPanel-B-iktbLX-COy_dBa2.js";import{ar as Ae}from"./index-bYhLX3oQ.js";var tt=je('<svg xmlns=http://www.w3.org/2000/svg enable-background="new 0 0 634 633"viewBox="0 0 634 633"><g transform=translate(1)><linearGradient x1=-641.486 x2=-641.486 y1=856.648 y2=855.931 gradientTransform="matrix(633 0 0 -633 406377 542258)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#6bdaff></stop><stop offset=0.319 stop-color=#f9ffb5></stop><stop offset=0.706 stop-color=#ffa770></stop><stop offset=1 stop-color=#ff7373></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5 fill-rule=evenodd clip-rule=evenodd></circle><defs><filter width=454 height=396.9 x=-137.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=176.9 height=129.3 x=272.2 y=308 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=176.9 height=129.3 x=272.2 y=308 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><path fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11 d="M436 403.2l-5 28.6m-140-90.3l-10.9 62m52.8-19.4l-4.3 27.1"></path><linearGradient x1=-645.656 x2=-646.499 y1=854.878 y2=854.788 gradientTransform="matrix(-184.159 -32.4722 11.4608 -64.9973 -128419.844 34938.836)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ee2700></stop><stop offset=1 stop-color=#ff008e></stop></linearGradient><path fill-rule=evenodd d="M344.1 363l97.7 17.2c5.8 2.1 8.2 6.2 7.1 12.1-1 5.9-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1.8-12.8 3.7-3.7 8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd></path><path fill=#D8D8D8 fill-rule=evenodd stroke=#FFF stroke-linecap=round stroke-linejoin=bevel stroke-width=7 d="M428.3 384.5l.9-6.5m-33.9 1.5l.9-6.5m-34 .5l.9-6.1m-38.9-16.1l4.2-3.9m-25.2-16.1l4.2-3.9"clip-rule=evenodd></path></g><defs><filter width=280.6 height=317.4 x=73.2 y=113.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=280.6 height=317.4 x=73.2 y=113.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><linearGradient x1=-646.8 x2=-646.8 y1=854.844 y2=853.844 gradientTransform="matrix(-100.1751 48.8587 -97.9753 -200.879 19124.773 203538.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#a17500></stop><stop offset=1 stop-color=#5d2100></stop></linearGradient><path fill-rule=evenodd d="M192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.2-2.9 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6-3.4-18.7-10.8-51.8-22.2-99.6l-25.3 4.6"clip-rule=evenodd></path><linearGradient x1=-635.467 x2=-635.467 y1=852.115 y2=851.115 gradientTransform="matrix(92.6873 4.8575 2.0257 -38.6535 57323.695 36176.047)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd></path><linearGradient x1=-636.573 x2=-636.573 y1=855.444 y2=854.444 gradientTransform="matrix(109.9945 5.7646 6.3597 -121.3507 64719.133 107659.336)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.3 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20 49.6-53.1 49.6-53.1z"clip-rule=evenodd></path><linearGradient x1=-632.145 x2=-632.145 y1=854.174 y2=853.174 gradientTransform="matrix(62.9558 3.2994 3.5021 -66.8246 37035.367 59284.227)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9c-.8-21.9 6-38 20.6-48.2 14.6-10.2 29.8-15.3 45.5-15.3-6.1 21.4-14.5 35.8-25.2 43.4-10.7 7.5-24.4 14.2-40.9 20.1z"clip-rule=evenodd></path><linearGradient x1=-638.224 x2=-638.224 y1=853.801 y2=852.801 gradientTransform="matrix(152.4666 7.9904 3.0934 -59.0251 94939.86 55646.855)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c31.9-30 64.1-39.7 96.7-29 32.6 10.7 50.8 30.4 54.6 59.1-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd></path><linearGradient x1=-637.723 x2=-637.723 y1=855.103 y2=854.103 gradientTransform="matrix(136.467 7.1519 5.2165 -99.5377 82830.875 89859.578)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c35.8-7.6 65.6-.2 89.2 22 23.6 22.2 37.7 49 42.3 80.3-39.8-9.7-68.3-23.8-85.5-42.4-17.2-18.5-32.5-38.5-46-59.9z"clip-rule=evenodd></path><linearGradient x1=-631.79 x2=-631.79 y1=855.872 y2=854.872 gradientTransform="matrix(60.8683 3.19 8.7771 -167.4773 31110.818 145537.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6-6.5 29.9-3.6 63.1 8.7 99.6 27.4-40.3 43.2-69.6 47.4-88 4.2-18.3 5.5-44.1 4-77.2z"clip-rule=evenodd></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4-5.7 18-9.4 33-11.1 45.1"></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M194.8 185.7c-24.4 1.7-43.8 9-58.1 21.8-14.3 12.8-24.7 25.4-31.3 37.8m99.1-68.9c29.7-6.7 52-8.4 67-5 15 3.4 26.9 8.7 35.8 15.9m-110.8-5.9c20.3 9.9 38.2 20.5 53.9 31.9 15.7 11.4 27.4 22.1 35.1 32"></path></g><defs><filter width=532 height=633 x=50.5 y=399 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=532 height=633 x=50.5 y=399 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><linearGradient x1=-641.104 x2=-641.278 y1=856.577 y2=856.183 gradientTransform="matrix(532 0 0 -633 341484.5 542657)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#fff400></stop><stop offset=1 stop-color=#3c8700></stop></linearGradient><ellipse cx=316.5 cy=715.5 fill-rule=evenodd clip-rule=evenodd rx=266 ry=316.5></ellipse><defs><filter width=288 height=283 x=391 y=-24 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=288 height=283 x=391 y=-24 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><g transform="translate(397 -24)"><linearGradient x1=-1036.672 x2=-1036.672 y1=880.018 y2=879.018 gradientTransform="matrix(227 0 0 -227 235493 199764)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffdf00></stop><stop offset=1 stop-color=#ff9d00></stop></linearGradient><circle cx=168.5 cy=113.5 r=113.5 fill-rule=evenodd clip-rule=evenodd></circle><linearGradient x1=-1017.329 x2=-1018.602 y1=658.003 y2=657.998 gradientTransform="matrix(30 0 0 -1 30558 771)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M30 113H0"></path><linearGradient x1=-1014.501 x2=-1015.774 y1=839.985 y2=839.935 gradientTransform="matrix(26.5 0 0 -5.5 26925 4696.5)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M33.5 79.5L7 74"></path><linearGradient x1=-1016.59 x2=-1017.862 y1=852.671 y2=852.595 gradientTransform="matrix(29 0 0 -8 29523 6971)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M34 146l-29 8"></path><linearGradient x1=-1011.984 x2=-1013.257 y1=863.523 y2=863.229 gradientTransform="matrix(24 0 0 -13 24339 11407)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M45 177l-24 13"></path><linearGradient x1=-1006.673 x2=-1007.946 y1=869.279 y2=868.376 gradientTransform="matrix(20 0 0 -19 20205 16720)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M67 204l-20 19"></path><linearGradient x1=-992.85 x2=-993.317 y1=871.258 y2=870.258 gradientTransform="matrix(13.8339 0 0 -22.8467 13825.796 20131.938)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M94.4 227l-13.8 22.8"></path><linearGradient x1=-953.835 x2=-953.965 y1=871.9 y2=870.9 gradientTransform="matrix(7.5 0 0 -24.5 7278 21605)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M127.5 243.5L120 268"></path><linearGradient x1=244.504 x2=244.496 y1=871.898 y2=870.898 gradientTransform="matrix(.5 0 0 -24.5 45.5 21614)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M167.5 252.5l.5 24.5">');function Pe(){const e=We();return(()=>{var w=tt(),O=w.firstChild.firstChild,F=O.nextSibling,M=F.nextSibling,L=M.firstChild,v=M.nextSibling,I=v.firstChild,G=v.nextSibling,c=G.nextSibling,x=c.firstChild,p=c.nextSibling,h=p.firstChild,u=p.nextSibling,T=u.nextSibling,H=T.firstChild,g=T.nextSibling,Y=g.firstChild,B=g.nextSibling,S=B.nextSibling,q=S.firstChild,o=S.nextSibling,N=o.firstChild,E=o.nextSibling,D=E.nextSibling,ee=D.firstChild,y=D.nextSibling,te=y.firstChild,b=y.nextSibling,z=b.nextSibling,J=z.firstChild,$=z.nextSibling,K=$.firstChild,R=$.nextSibling,A=R.nextSibling,l=A.firstChild,r=A.nextSibling,d=r.firstChild,n=r.nextSibling,a=n.firstChild.nextSibling,f=a.nextSibling,i=n.nextSibling,s=i.firstChild,m=i.nextSibling,P=m.firstChild,k=m.nextSibling,_=k.firstChild,ie=_.nextSibling,le=ie.nextSibling,re=le.nextSibling,ne=re.nextSibling,oe=ne.nextSibling,se=oe.nextSibling,ae=se.nextSibling,de=ae.nextSibling,fe=de.nextSibling,ce=fe.nextSibling,pe=ce.nextSibling,ue=pe.nextSibling,Le=ue.nextSibling,ge=k.nextSibling,Ie=ge.firstChild,V=ge.nextSibling,He=V.firstChild,xe=V.nextSibling,Q=xe.nextSibling,he=Q.nextSibling,Ye=he.firstChild,W=he.nextSibling,qe=W.firstChild,$e=W.nextSibling,me=$e.firstChild.firstChild,ke=me.nextSibling,ve=ke.nextSibling,Se=ve.nextSibling,ye=Se.nextSibling,be=ye.nextSibling,_e=be.nextSibling,Ce=_e.nextSibling,Ue=Ce.nextSibling,we=Ue.nextSibling,Oe=we.nextSibling,Fe=Oe.nextSibling,Me=Fe.nextSibling,Ge=Me.nextSibling,Te=Ge.nextSibling,Be=Te.nextSibling,Ee=Be.nextSibling,Ne=Ee.nextSibling;return t(O,"id",`a-${e}`),t(F,"fill",`url(#a-${e})`),t(L,"id",`b-${e}`),t(v,"id",`c-${e}`),t(I,"filter",`url(#b-${e})`),t(G,"mask",`url(#c-${e})`),t(x,"id",`d-${e}`),t(p,"id",`e-${e}`),t(h,"filter",`url(#d-${e})`),t(u,"mask",`url(#e-${e})`),t(H,"id",`f-${e}`),t(g,"id",`g-${e}`),t(Y,"filter",`url(#f-${e})`),t(B,"mask",`url(#g-${e})`),t(q,"id",`h-${e}`),t(o,"id",`i-${e}`),t(N,"filter",`url(#h-${e})`),t(E,"mask",`url(#i-${e})`),t(ee,"id",`j-${e}`),t(y,"id",`k-${e}`),t(te,"filter",`url(#j-${e})`),t(b,"mask",`url(#k-${e})`),t(J,"id",`l-${e}`),t($,"id",`m-${e}`),t(K,"filter",`url(#l-${e})`),t(R,"mask",`url(#m-${e})`),t(l,"id",`n-${e}`),t(r,"id",`o-${e}`),t(d,"filter",`url(#n-${e})`),t(n,"mask",`url(#o-${e})`),t(a,"id",`p-${e}`),t(f,"fill",`url(#p-${e})`),t(s,"id",`q-${e}`),t(m,"id",`r-${e}`),t(P,"filter",`url(#q-${e})`),t(k,"mask",`url(#r-${e})`),t(_,"id",`s-${e}`),t(ie,"fill",`url(#s-${e})`),t(le,"id",`t-${e}`),t(re,"fill",`url(#t-${e})`),t(ne,"id",`u-${e}`),t(oe,"fill",`url(#u-${e})`),t(se,"id",`v-${e}`),t(ae,"fill",`url(#v-${e})`),t(de,"id",`w-${e}`),t(fe,"fill",`url(#w-${e})`),t(ce,"id",`x-${e}`),t(pe,"fill",`url(#x-${e})`),t(ue,"id",`y-${e}`),t(Le,"fill",`url(#y-${e})`),t(Ie,"id",`z-${e}`),t(V,"id",`A-${e}`),t(He,"filter",`url(#z-${e})`),t(xe,"id",`B-${e}`),t(Q,"fill",`url(#B-${e})`),t(Q,"mask",`url(#A-${e})`),t(Ye,"id",`C-${e}`),t(W,"id",`D-${e}`),t(qe,"filter",`url(#C-${e})`),t($e,"mask",`url(#D-${e})`),t(me,"id",`E-${e}`),t(ke,"fill",`url(#E-${e})`),t(ve,"id",`F-${e}`),t(Se,"stroke",`url(#F-${e})`),t(ye,"id",`G-${e}`),t(be,"stroke",`url(#G-${e})`),t(_e,"id",`H-${e}`),t(Ce,"stroke",`url(#H-${e})`),t(Ue,"id",`I-${e}`),t(we,"stroke",`url(#I-${e})`),t(Oe,"id",`J-${e}`),t(Fe,"stroke",`url(#J-${e})`),t(Me,"id",`K-${e}`),t(Ge,"stroke",`url(#K-${e})`),t(Te,"id",`L-${e}`),t(Be,"stroke",`url(#L-${e})`),t(Ee,"id",`M-${e}`),t(Ne,"stroke",`url(#M-${e})`),w})()}var it=je("<button type=button><div><div></div><div></div></div><div>-</div><div>TanStack Router");function ot({initialIsOpen:e,panelProps:w={},closeButtonProps:O={},toggleButtonProps:F={},position:M="bottom-left",containerElement:L="footer",router:v,routerState:I,shadowDOMTarget:G}){const[c,x]=X();let p;const[h,u]=Re("tanstackRouterDevtoolsOpen",e),[T,H]=Re("tanstackRouterDevtoolsHeight",null),[g,Y]=X(!1),[B,S]=X(!1),q=Xe(),o=Ze(),N=(l,r)=>{if(r.button!==0)return;S(!0);const d={originalHeight:(l==null?void 0:l.getBoundingClientRect().height)??0,pageY:r.pageY},n=f=>{const i=d.pageY-f.pageY,s=d.originalHeight+i;H(s),s<70?u(!1):u(!0)},a=()=>{S(!1),document.removeEventListener("mousemove",n),document.removeEventListener("mouseUp",a)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)};h(),Z(()=>{Y(h()??!1)}),Z(()=>{var l,r,d;if(g()){const n=(r=(l=c())==null?void 0:l.parentElement)==null?void 0:r.style.paddingBottom,a=()=>{var i;const f=p.getBoundingClientRect().height;(i=c())!=null&&i.parentElement&&x(s=>(s!=null&&s.parentElement&&(s.parentElement.style.paddingBottom=`${f}px`),s))};if(a(),typeof window<"u")return window.addEventListener("resize",a),()=>{var f;window.removeEventListener("resize",a),(f=c())!=null&&f.parentElement&&typeof n=="string"&&x(i=>(i.parentElement.style.paddingBottom=n,i))}}else(d=c())!=null&&d.parentElement&&x(n=>(n!=null&&n.parentElement&&n.parentElement.removeAttribute("style"),n))}),Z(()=>{if(c()){const l=c(),r=getComputedStyle(l).fontSize;l==null||l.style.setProperty("--tsrd-font-size",r)}});const{style:E={},...D}=w,{style:ee={},onClick:y,...te}=O,{onClick:b,class:z,...J}=F;if(!q())return null;const $=j(()=>T()??500),K=j(()=>Ae(o().devtoolsPanelContainer,o().devtoolsPanelContainerVisibility(!!h()),o().devtoolsPanelContainerResizing(B),o().devtoolsPanelContainerAnimation(g(),$()+16))),R=j(()=>({height:`${$()}px`,...E||{}})),A=j(()=>Ae(o().mainCloseBtn,o().mainCloseBtnPosition(M),o().mainCloseBtnAnimation(!!h()),z));return C(Qe,{component:L,ref:x,class:"TanStackRouterDevtools",get children(){return[C(Je.Provider,{value:{onCloseClick:y??(()=>{})},get children(){return C(et,De({ref(l){var r=p;typeof r=="function"?r(l):p=l}},D,{router:v,routerState:I,className:K,style:R,get isOpen(){return g()},setIsOpen:u,handleDragStart:l=>N(p,l),shadowDOMTarget:G}))}}),(()=>{var l=it(),r=l.firstChild,d=r.firstChild,n=d.nextSibling,a=r.nextSibling,f=a.nextSibling;return Ke(l,De(J,{"aria-label":"Open TanStack Router Devtools",onClick:i=>{u(!0),b&&b(i)},get class(){return A()}}),!1,!0),ze(d,C(Pe,{})),ze(n,C(Pe,{})),Ve(i=>{var s=o().mainCloseBtnIconContainer,m=o().mainCloseBtnIconOuter,P=o().mainCloseBtnIconInner,k=o().mainCloseBtnDivider,_=o().routerLogoCloseButton;return s!==i.e&&U(r,i.e=s),m!==i.t&&U(d,i.t=m),P!==i.a&&U(n,i.a=P),k!==i.o&&U(a,i.o=k),_!==i.i&&U(f,i.i=_),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()]}})}export{ot as FloatingTanStackRouterDevtools,ot as default};
1
+ import{c as X,a as Z,b as j,d as C,D as Je,m as De,s as Ke,i as ze,e as Ve,f as U,g as Qe,t as je,h as We,j as t}from"./index-D1kH8Sr2.js";import{n as Re,t as Xe,r as Ze,BaseTanStackRouterDevtoolsPanel as et}from"./BaseTanStackRouterDevtoolsPanel-B-iktbLX-CIKvkn5X.js";import{ar as Ae}from"./index-BCGiD7pg.js";var tt=je('<svg xmlns=http://www.w3.org/2000/svg enable-background="new 0 0 634 633"viewBox="0 0 634 633"><g transform=translate(1)><linearGradient x1=-641.486 x2=-641.486 y1=856.648 y2=855.931 gradientTransform="matrix(633 0 0 -633 406377 542258)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#6bdaff></stop><stop offset=0.319 stop-color=#f9ffb5></stop><stop offset=0.706 stop-color=#ffa770></stop><stop offset=1 stop-color=#ff7373></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5 fill-rule=evenodd clip-rule=evenodd></circle><defs><filter width=454 height=396.9 x=-137.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=176.9 height=129.3 x=272.2 y=308 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=176.9 height=129.3 x=272.2 y=308 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><path fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11 d="M436 403.2l-5 28.6m-140-90.3l-10.9 62m52.8-19.4l-4.3 27.1"></path><linearGradient x1=-645.656 x2=-646.499 y1=854.878 y2=854.788 gradientTransform="matrix(-184.159 -32.4722 11.4608 -64.9973 -128419.844 34938.836)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ee2700></stop><stop offset=1 stop-color=#ff008e></stop></linearGradient><path fill-rule=evenodd d="M344.1 363l97.7 17.2c5.8 2.1 8.2 6.2 7.1 12.1-1 5.9-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1.8-12.8 3.7-3.7 8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd></path><path fill=#D8D8D8 fill-rule=evenodd stroke=#FFF stroke-linecap=round stroke-linejoin=bevel stroke-width=7 d="M428.3 384.5l.9-6.5m-33.9 1.5l.9-6.5m-34 .5l.9-6.1m-38.9-16.1l4.2-3.9m-25.2-16.1l4.2-3.9"clip-rule=evenodd></path></g><defs><filter width=280.6 height=317.4 x=73.2 y=113.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=280.6 height=317.4 x=73.2 y=113.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><linearGradient x1=-646.8 x2=-646.8 y1=854.844 y2=853.844 gradientTransform="matrix(-100.1751 48.8587 -97.9753 -200.879 19124.773 203538.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#a17500></stop><stop offset=1 stop-color=#5d2100></stop></linearGradient><path fill-rule=evenodd d="M192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.2-2.9 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6-3.4-18.7-10.8-51.8-22.2-99.6l-25.3 4.6"clip-rule=evenodd></path><linearGradient x1=-635.467 x2=-635.467 y1=852.115 y2=851.115 gradientTransform="matrix(92.6873 4.8575 2.0257 -38.6535 57323.695 36176.047)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd></path><linearGradient x1=-636.573 x2=-636.573 y1=855.444 y2=854.444 gradientTransform="matrix(109.9945 5.7646 6.3597 -121.3507 64719.133 107659.336)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.3 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20 49.6-53.1 49.6-53.1z"clip-rule=evenodd></path><linearGradient x1=-632.145 x2=-632.145 y1=854.174 y2=853.174 gradientTransform="matrix(62.9558 3.2994 3.5021 -66.8246 37035.367 59284.227)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9c-.8-21.9 6-38 20.6-48.2 14.6-10.2 29.8-15.3 45.5-15.3-6.1 21.4-14.5 35.8-25.2 43.4-10.7 7.5-24.4 14.2-40.9 20.1z"clip-rule=evenodd></path><linearGradient x1=-638.224 x2=-638.224 y1=853.801 y2=852.801 gradientTransform="matrix(152.4666 7.9904 3.0934 -59.0251 94939.86 55646.855)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c31.9-30 64.1-39.7 96.7-29 32.6 10.7 50.8 30.4 54.6 59.1-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd></path><linearGradient x1=-637.723 x2=-637.723 y1=855.103 y2=854.103 gradientTransform="matrix(136.467 7.1519 5.2165 -99.5377 82830.875 89859.578)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c35.8-7.6 65.6-.2 89.2 22 23.6 22.2 37.7 49 42.3 80.3-39.8-9.7-68.3-23.8-85.5-42.4-17.2-18.5-32.5-38.5-46-59.9z"clip-rule=evenodd></path><linearGradient x1=-631.79 x2=-631.79 y1=855.872 y2=854.872 gradientTransform="matrix(60.8683 3.19 8.7771 -167.4773 31110.818 145537.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6-6.5 29.9-3.6 63.1 8.7 99.6 27.4-40.3 43.2-69.6 47.4-88 4.2-18.3 5.5-44.1 4-77.2z"clip-rule=evenodd></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4-5.7 18-9.4 33-11.1 45.1"></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M194.8 185.7c-24.4 1.7-43.8 9-58.1 21.8-14.3 12.8-24.7 25.4-31.3 37.8m99.1-68.9c29.7-6.7 52-8.4 67-5 15 3.4 26.9 8.7 35.8 15.9m-110.8-5.9c20.3 9.9 38.2 20.5 53.9 31.9 15.7 11.4 27.4 22.1 35.1 32"></path></g><defs><filter width=532 height=633 x=50.5 y=399 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=532 height=633 x=50.5 y=399 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><linearGradient x1=-641.104 x2=-641.278 y1=856.577 y2=856.183 gradientTransform="matrix(532 0 0 -633 341484.5 542657)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#fff400></stop><stop offset=1 stop-color=#3c8700></stop></linearGradient><ellipse cx=316.5 cy=715.5 fill-rule=evenodd clip-rule=evenodd rx=266 ry=316.5></ellipse><defs><filter width=288 height=283 x=391 y=-24 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=288 height=283 x=391 y=-24 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><g transform="translate(397 -24)"><linearGradient x1=-1036.672 x2=-1036.672 y1=880.018 y2=879.018 gradientTransform="matrix(227 0 0 -227 235493 199764)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffdf00></stop><stop offset=1 stop-color=#ff9d00></stop></linearGradient><circle cx=168.5 cy=113.5 r=113.5 fill-rule=evenodd clip-rule=evenodd></circle><linearGradient x1=-1017.329 x2=-1018.602 y1=658.003 y2=657.998 gradientTransform="matrix(30 0 0 -1 30558 771)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M30 113H0"></path><linearGradient x1=-1014.501 x2=-1015.774 y1=839.985 y2=839.935 gradientTransform="matrix(26.5 0 0 -5.5 26925 4696.5)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M33.5 79.5L7 74"></path><linearGradient x1=-1016.59 x2=-1017.862 y1=852.671 y2=852.595 gradientTransform="matrix(29 0 0 -8 29523 6971)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M34 146l-29 8"></path><linearGradient x1=-1011.984 x2=-1013.257 y1=863.523 y2=863.229 gradientTransform="matrix(24 0 0 -13 24339 11407)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M45 177l-24 13"></path><linearGradient x1=-1006.673 x2=-1007.946 y1=869.279 y2=868.376 gradientTransform="matrix(20 0 0 -19 20205 16720)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M67 204l-20 19"></path><linearGradient x1=-992.85 x2=-993.317 y1=871.258 y2=870.258 gradientTransform="matrix(13.8339 0 0 -22.8467 13825.796 20131.938)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M94.4 227l-13.8 22.8"></path><linearGradient x1=-953.835 x2=-953.965 y1=871.9 y2=870.9 gradientTransform="matrix(7.5 0 0 -24.5 7278 21605)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M127.5 243.5L120 268"></path><linearGradient x1=244.504 x2=244.496 y1=871.898 y2=870.898 gradientTransform="matrix(.5 0 0 -24.5 45.5 21614)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M167.5 252.5l.5 24.5">');function Pe(){const e=We();return(()=>{var w=tt(),O=w.firstChild.firstChild,F=O.nextSibling,M=F.nextSibling,L=M.firstChild,v=M.nextSibling,I=v.firstChild,G=v.nextSibling,c=G.nextSibling,x=c.firstChild,p=c.nextSibling,h=p.firstChild,u=p.nextSibling,T=u.nextSibling,H=T.firstChild,g=T.nextSibling,Y=g.firstChild,B=g.nextSibling,S=B.nextSibling,q=S.firstChild,o=S.nextSibling,N=o.firstChild,E=o.nextSibling,D=E.nextSibling,ee=D.firstChild,y=D.nextSibling,te=y.firstChild,b=y.nextSibling,z=b.nextSibling,J=z.firstChild,$=z.nextSibling,K=$.firstChild,R=$.nextSibling,A=R.nextSibling,l=A.firstChild,r=A.nextSibling,d=r.firstChild,n=r.nextSibling,a=n.firstChild.nextSibling,f=a.nextSibling,i=n.nextSibling,s=i.firstChild,m=i.nextSibling,P=m.firstChild,k=m.nextSibling,_=k.firstChild,ie=_.nextSibling,le=ie.nextSibling,re=le.nextSibling,ne=re.nextSibling,oe=ne.nextSibling,se=oe.nextSibling,ae=se.nextSibling,de=ae.nextSibling,fe=de.nextSibling,ce=fe.nextSibling,pe=ce.nextSibling,ue=pe.nextSibling,Le=ue.nextSibling,ge=k.nextSibling,Ie=ge.firstChild,V=ge.nextSibling,He=V.firstChild,xe=V.nextSibling,Q=xe.nextSibling,he=Q.nextSibling,Ye=he.firstChild,W=he.nextSibling,qe=W.firstChild,$e=W.nextSibling,me=$e.firstChild.firstChild,ke=me.nextSibling,ve=ke.nextSibling,Se=ve.nextSibling,ye=Se.nextSibling,be=ye.nextSibling,_e=be.nextSibling,Ce=_e.nextSibling,Ue=Ce.nextSibling,we=Ue.nextSibling,Oe=we.nextSibling,Fe=Oe.nextSibling,Me=Fe.nextSibling,Ge=Me.nextSibling,Te=Ge.nextSibling,Be=Te.nextSibling,Ee=Be.nextSibling,Ne=Ee.nextSibling;return t(O,"id",`a-${e}`),t(F,"fill",`url(#a-${e})`),t(L,"id",`b-${e}`),t(v,"id",`c-${e}`),t(I,"filter",`url(#b-${e})`),t(G,"mask",`url(#c-${e})`),t(x,"id",`d-${e}`),t(p,"id",`e-${e}`),t(h,"filter",`url(#d-${e})`),t(u,"mask",`url(#e-${e})`),t(H,"id",`f-${e}`),t(g,"id",`g-${e}`),t(Y,"filter",`url(#f-${e})`),t(B,"mask",`url(#g-${e})`),t(q,"id",`h-${e}`),t(o,"id",`i-${e}`),t(N,"filter",`url(#h-${e})`),t(E,"mask",`url(#i-${e})`),t(ee,"id",`j-${e}`),t(y,"id",`k-${e}`),t(te,"filter",`url(#j-${e})`),t(b,"mask",`url(#k-${e})`),t(J,"id",`l-${e}`),t($,"id",`m-${e}`),t(K,"filter",`url(#l-${e})`),t(R,"mask",`url(#m-${e})`),t(l,"id",`n-${e}`),t(r,"id",`o-${e}`),t(d,"filter",`url(#n-${e})`),t(n,"mask",`url(#o-${e})`),t(a,"id",`p-${e}`),t(f,"fill",`url(#p-${e})`),t(s,"id",`q-${e}`),t(m,"id",`r-${e}`),t(P,"filter",`url(#q-${e})`),t(k,"mask",`url(#r-${e})`),t(_,"id",`s-${e}`),t(ie,"fill",`url(#s-${e})`),t(le,"id",`t-${e}`),t(re,"fill",`url(#t-${e})`),t(ne,"id",`u-${e}`),t(oe,"fill",`url(#u-${e})`),t(se,"id",`v-${e}`),t(ae,"fill",`url(#v-${e})`),t(de,"id",`w-${e}`),t(fe,"fill",`url(#w-${e})`),t(ce,"id",`x-${e}`),t(pe,"fill",`url(#x-${e})`),t(ue,"id",`y-${e}`),t(Le,"fill",`url(#y-${e})`),t(Ie,"id",`z-${e}`),t(V,"id",`A-${e}`),t(He,"filter",`url(#z-${e})`),t(xe,"id",`B-${e}`),t(Q,"fill",`url(#B-${e})`),t(Q,"mask",`url(#A-${e})`),t(Ye,"id",`C-${e}`),t(W,"id",`D-${e}`),t(qe,"filter",`url(#C-${e})`),t($e,"mask",`url(#D-${e})`),t(me,"id",`E-${e}`),t(ke,"fill",`url(#E-${e})`),t(ve,"id",`F-${e}`),t(Se,"stroke",`url(#F-${e})`),t(ye,"id",`G-${e}`),t(be,"stroke",`url(#G-${e})`),t(_e,"id",`H-${e}`),t(Ce,"stroke",`url(#H-${e})`),t(Ue,"id",`I-${e}`),t(we,"stroke",`url(#I-${e})`),t(Oe,"id",`J-${e}`),t(Fe,"stroke",`url(#J-${e})`),t(Me,"id",`K-${e}`),t(Ge,"stroke",`url(#K-${e})`),t(Te,"id",`L-${e}`),t(Be,"stroke",`url(#L-${e})`),t(Ee,"id",`M-${e}`),t(Ne,"stroke",`url(#M-${e})`),w})()}var it=je("<button type=button><div><div></div><div></div></div><div>-</div><div>TanStack Router");function ot({initialIsOpen:e,panelProps:w={},closeButtonProps:O={},toggleButtonProps:F={},position:M="bottom-left",containerElement:L="footer",router:v,routerState:I,shadowDOMTarget:G}){const[c,x]=X();let p;const[h,u]=Re("tanstackRouterDevtoolsOpen",e),[T,H]=Re("tanstackRouterDevtoolsHeight",null),[g,Y]=X(!1),[B,S]=X(!1),q=Xe(),o=Ze(),N=(l,r)=>{if(r.button!==0)return;S(!0);const d={originalHeight:(l==null?void 0:l.getBoundingClientRect().height)??0,pageY:r.pageY},n=f=>{const i=d.pageY-f.pageY,s=d.originalHeight+i;H(s),s<70?u(!1):u(!0)},a=()=>{S(!1),document.removeEventListener("mousemove",n),document.removeEventListener("mouseUp",a)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)};h(),Z(()=>{Y(h()??!1)}),Z(()=>{var l,r,d;if(g()){const n=(r=(l=c())==null?void 0:l.parentElement)==null?void 0:r.style.paddingBottom,a=()=>{var i;const f=p.getBoundingClientRect().height;(i=c())!=null&&i.parentElement&&x(s=>(s!=null&&s.parentElement&&(s.parentElement.style.paddingBottom=`${f}px`),s))};if(a(),typeof window<"u")return window.addEventListener("resize",a),()=>{var f;window.removeEventListener("resize",a),(f=c())!=null&&f.parentElement&&typeof n=="string"&&x(i=>(i.parentElement.style.paddingBottom=n,i))}}else(d=c())!=null&&d.parentElement&&x(n=>(n!=null&&n.parentElement&&n.parentElement.removeAttribute("style"),n))}),Z(()=>{if(c()){const l=c(),r=getComputedStyle(l).fontSize;l==null||l.style.setProperty("--tsrd-font-size",r)}});const{style:E={},...D}=w,{style:ee={},onClick:y,...te}=O,{onClick:b,class:z,...J}=F;if(!q())return null;const $=j(()=>T()??500),K=j(()=>Ae(o().devtoolsPanelContainer,o().devtoolsPanelContainerVisibility(!!h()),o().devtoolsPanelContainerResizing(B),o().devtoolsPanelContainerAnimation(g(),$()+16))),R=j(()=>({height:`${$()}px`,...E||{}})),A=j(()=>Ae(o().mainCloseBtn,o().mainCloseBtnPosition(M),o().mainCloseBtnAnimation(!!h()),z));return C(Qe,{component:L,ref:x,class:"TanStackRouterDevtools",get children(){return[C(Je.Provider,{value:{onCloseClick:y??(()=>{})},get children(){return C(et,De({ref(l){var r=p;typeof r=="function"?r(l):p=l}},D,{router:v,routerState:I,className:K,style:R,get isOpen(){return g()},setIsOpen:u,handleDragStart:l=>N(p,l),shadowDOMTarget:G}))}}),(()=>{var l=it(),r=l.firstChild,d=r.firstChild,n=d.nextSibling,a=r.nextSibling,f=a.nextSibling;return Ke(l,De(J,{"aria-label":"Open TanStack Router Devtools",onClick:i=>{u(!0),b&&b(i)},get class(){return A()}}),!1,!0),ze(d,C(Pe,{})),ze(n,C(Pe,{})),Ve(i=>{var s=o().mainCloseBtnIconContainer,m=o().mainCloseBtnIconOuter,P=o().mainCloseBtnIconInner,k=o().mainCloseBtnDivider,_=o().routerLogoCloseButton;return s!==i.e&&U(r,i.e=s),m!==i.t&&U(d,i.t=m),P!==i.a&&U(n,i.a=P),k!==i.o&&U(a,i.o=k),_!==i.i&&U(f,i.i=_),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()]}})}export{ot as FloatingTanStackRouterDevtools,ot as default};
@@ -0,0 +1 @@
1
+ import{j as r,i}from"./index-BCGiD7pg.js";function o({member:e}){return r.jsx(i,{member:e})}export{o as HandlePage};
@@ -1,4 +1,4 @@
1
- var Hh=Object.defineProperty;var Vh=(n,t,e)=>t in n?Hh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>Vh(n,typeof t!="symbol"?t+"":t,e);import{r as z,j as lt,gy as qh,gK as Gh,gL as Yh,gw as Xh,gM as Qh}from"./index-bYhLX3oQ.js";function w(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);throw e.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nu(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);e.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zh(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}const ee=Zh();function tg(){return ee&&"documentMode"in document?document.documentMode:null}const eg=tg();function ng(n){return ee&&n.test(navigator.platform)}function ro(n){return ee&&n.test(navigator.userAgent)}const Yn=ng(/Mac|iPod|iPhone|iPad/),Oe=ro(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function rg(){return!(!ee||!("InputEvent"in window)||eg)&&"getTargetRanges"in new window.InputEvent("input")}const Xn=rg();function og(){return ee&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}const $e=og(),Eu=ro(/Android/),oo=ro(/Version\/[\d.]+.*Safari/)&&!Eu,wu=ro(/^(?=.*Chrome).*/i),Wo=ee&&Eu&&wu,io=ro(/AppleWebKit\/[\d.]+/)&&Yn&&!wu,Ou=128;function ig(){return 2047}const sg=ig(),Br=oo||$e||io?" ":"​",cn=`
1
+ var Hh=Object.defineProperty;var Vh=(n,t,e)=>t in n?Hh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>Vh(n,typeof t!="symbol"?t+"":t,e);import{r as z,j as lt,gA as qh,gM as Gh,gN as Yh,gy as Xh,gO as Qh}from"./index-BCGiD7pg.js";function w(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);throw e.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nu(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);e.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zh(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}const ee=Zh();function tg(){return ee&&"documentMode"in document?document.documentMode:null}const eg=tg();function ng(n){return ee&&n.test(navigator.platform)}function ro(n){return ee&&n.test(navigator.userAgent)}const Yn=ng(/Mac|iPod|iPhone|iPad/),Oe=ro(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function rg(){return!(!ee||!("InputEvent"in window)||eg)&&"getTargetRanges"in new window.InputEvent("input")}const Xn=rg();function og(){return ee&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}const $e=og(),Eu=ro(/Android/),oo=ro(/Version\/[\d.]+.*Safari/)&&!Eu,wu=ro(/^(?=.*Chrome).*/i),Wo=ee&&Eu&&wu,io=ro(/AppleWebKit\/[\d.]+/)&&Yn&&!wu,Ou=128;function ig(){return 2047}const sg=ig(),Br=oo||$e||io?" ":"​",cn=`
2
2
 
3
3
  `,ol=Oe?" ":Br,Ct={bold:1,capitalize:1024,code:16,highlight:Ou,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},$u={directionless:1,unmergeable:2},Qn={center:2,end:6,justify:4,left:1,right:3,start:5};function Mu(n){const t={};for(const e of Object.keys(n))t[n[e]]=e;return t}const Fu=Mu(Qn),il={normal:0,segmented:2,token:1},Au=Mu(il),sl="$",lg=Symbol.for("@lexical/ctrlOrOtherKey"),Ui="$config";function ji(){return gt()._blockCursorElement}function Ji(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-slot")}const cg=io||$e||oo;function ec(){const n=ot().createElement("img");n.setAttribute("data-lexical-decorator-boundary","true"),n.alt="";for(const[t,e]of[["position","absolute"],["width","0px"],["height","0px"],["border","0px"],["margin","0px"],["padding","0px"]])n.style.setProperty(t,e,"important");return n}function Uo(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-decorator-boundary")}let Du=class $o{constructor(t,e,r){k(this,"element");k(this,"before");k(this,"after");this.element=t,this.before=e||null,this.after=r||null}withBefore(t){return new $o(this.element,t,this.after)}withAfter(t){return new $o(this.element,this.before,t)}withElement(t){return this.element===t?this:new $o(t,this.before,this.after)}insertChild(t){const e=this.getInsertionAnchor();return e!==null&&e.parentElement!==this.element&&w(357),this.element.insertBefore(t,e),this}removeChild(t){return t.parentElement!==this.element&&w(358),this.element.removeChild(t),this}replaceChild(t,e){return e.parentElement!==this.element&&w(359),this.element.replaceChild(t,e),this}getFirstChild(){const t=this.getFirstChildAnchor(),e=t?t.nextSibling:this.element.firstChild;return e===this.getInsertionAnchor()?null:e}getFirstChildAnchor(){return this.after}resolveLeafPosition(t,e,r){if(this.element===t)return e===t&&r===0?"before":"after";const o=nc(t,this.element);if(o===null)return"after";const i=Array.prototype.indexOf.call(t.childNodes,o);if(i<0)return"after";if(e===t)return r<=i?"before":"after";const s=nc(t,e);if(s===null)return"after";const l=Array.prototype.indexOf.call(t.childNodes,s);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}};function nc(n,t){let e=t;for(;e!==null&&e.parentNode!==n;)e=e.parentNode;return e}let Pu=class Mo extends Du{withBefore(t){return new Mo(this.element,t,this.after)}withAfter(t){return new Mo(this.element,this.before,t)}withElement(t){return this.element===t?this:new Mo(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor("trailing")}getFirstChildAnchor(){let t=super.getFirstChildAnchor(),e=t?t.nextSibling:this.element.firstChild;for(;Ji(e);)t=e,e=e.nextSibling;Uo(e)&&(t=e,e=e.nextSibling);const r=t?t.nextSibling:this.element.firstChild;return r!==null&&r===ji()?r:t}getDecoratorBoundaryAnchor(t){let e;if(t==="leading"){const r=super.getFirstChildAnchor();for(e=r?r.nextSibling:this.element.firstChild;Ji(e);)e=e.nextSibling}else e=this.before?this.before.previousSibling:this.element.lastChild,e!==null&&e===ji()&&(e=e.previousSibling);return Uo(e)?e:null}setDecoratorBoundaryAnchor(t,e){const r=this.getDecoratorBoundaryAnchor(t);if(e!==(r!==null))if(r!==null)this.element.removeChild(r);else if(t==="leading"){const o=this.getFirstChildAnchor();this.element.insertBefore(ec(),o?o.nextSibling:this.element.firstChild)}else this.element.insertBefore(ec(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){const e=this.element,r=this.after===null?e.firstChild:this.after.nextSibling,o=t==="empty"&&Ji(r)?null:t;if(e.__lexicalLastChildKind!==o)if(e.__lexicalLastChildKind=o,o===null)this.removeManagedLineBreak();else{const i=o==="decorator"&&cg;this.insertManagedLineBreak(i)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const e=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&e.removeChild(r),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const e=this.getManagedLineBreak();if(e){if(t===(e.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before||this.getDecoratorBoundaryAnchor("trailing"),i=ot().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,o),t){const s=ot().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){const t=this.getFirstChild(),e=this.getInsertionAnchor();let r=0;for(let o=this.element.firstChild;o!==null&&o!==t&&o!==e;o=o.nextSibling)r++;return r}resolveChildIndex(t,e,r,o){if(r===this.element){const c=this.getFirstChildOffset(),a=ji(),u=this.element.childNodes,f=Math.min(o,u.length);let d=0;for(let h=c;h<f;h++)u[h]!==a&&d++;return[t,Math.min(d,t.getChildrenSize())]}const i=rc(e,r);i.push(o);const s=rc(e,this.element);let l=t.getIndexWithinParent();for(let c=0;c<s.length;c++){const a=i[c],u=s[c];if(a===void 0||a<u)break;if(a>u){l+=1;break}}return[t.getParentOrThrow(),l]}};function rc(n,t){const e=[];let r=t;for(;r!==n&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;e.push(o)}return r!==n&&w(225),e.reverse()}function ag(){let n;try{n="0.51.0+prod.esm"}catch{}return n??'"<unknown>+source"'}const Iu=ag();let vr=class{constructor(){k(this,"_front",new Set);k(this,"_back",new Set);k(this,"_cache")}get size(){return this._front.size+this._back.size}addBack(t){return delete this._cache,this._front.has(t)||this._back.add(t),this}addFront(t){return delete this._cache,this._back.has(t)||this._front.add(t),this}delete(t){return delete this._cache,this._front.delete(t)||this._back.delete(t)}toArray(){const t=Array.from(this._front).reverse();for(const e of this._back)t.push(e);return t}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const en=null;function Lu(n,t=1e3){return n instanceof ps?n.clone():n.size<t?new Map(n):new ps().init(new Map(n),void 0,n.size)}let ps=class Ru{constructor(){k(this,"_mutable",!1);k(this,"_old");k(this,"_nursery");k(this,"_size",0)}clone(){return this._mutable=!1,new Ru().init(this._old,this._nursery,this._size)}init(t,e,r){return this._old=t,this._nursery=e,this._size=r,this}get size(){return this._size}has(t){return this.get(t)!==void 0}getWithTombstone(t){const e=this._nursery&&this._nursery.get(t);return e!==void 0?e:this._old&&this._old.get(t)}get(t){const e=this.getWithTombstone(t);return e===en?void 0:e}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(t=!1){if(this._nursery&&this._nursery.size>0&&(t||this.shouldCompact())){const e=new Map(this._old);for(const[r,o]of this._nursery)o!==en?e.set(r,o):e.delete(r);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(t,e){const r=this.getWithTombstone(t);if(r===e)return this;const o=this.getNursery();return r!==en&&r!==void 0||(this._size++,r===en&&o.delete(t)),o.set(t,e),this}delete(t){const e=this.has(t);return e&&(this.getNursery().set(t,en),this._size--),e}getOrInsert(t,e){const r=this.get(t);return r!==void 0?r:(this.set(t,e),e)}getOrInsertComputed(t,e){const r=this.get(t);if(r!==void 0)return r;const o=e(t);return this.set(t,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const t of this.entries())yield t[0]}*values(){for(const t of this.entries())yield t[1]}*entries(){const t=this._nursery,e=this._old;if(t){if(e)for(const r of e){const o=r[0],i=t.get(o);i!==en&&(i!==void 0&&(r[1]=i),yield r)}for(const r of t)r[1]===en||e&&e.has(r[0])||(yield r)}else e&&(yield*e)}forEach(t,e){e!==void 0&&(t=t.bind(e));for(const[r,o]of this.entries())t(o,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}},Or=!1;function ug(n,t,...e){const r=Or;let o;try{Or=n,o=t()}finally{Or=r}var i;return(i=o)===null||typeof i!="object"&&typeof i!="function"||typeof i.then!="function"||w(421),o}function fg(){return Or}function zu(n){const t=n.exportJSON(Or),e=n.constructor;return t.type!==e.getType()&&w(130,e.name),b(n)&&!Array.isArray(t.children)&&w(59,e.name),t}function jo(n,t,e,r,o,i){if(b(n)){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===t&&((b(s)||un(s)&&s.__slots!==null)&&jo(s,l,e,r,o,i),e.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}for(const s of un(n)&&n.__slots!==null?n.__slots.values():[]){const l=r.get(s);l!==void 0&&Sn(l)&&l.__slotHost===t&&((b(l)||un(l)&&l.__slots!==null)&&jo(l,s,e,r,o,i),e.has(s)||i.delete(s),o.push(s))}}let _s=!1,ll=0;function dg(n){ll=n.timeStamp}function Hi(n,t,e){const r=n.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(n===o||r&&n.previousSibling===o)||r&&gr(n,e)!==void 0}function hg(n,t,e){const r=Lt(Kt(e)),o=r&&Bt(r,e._rootElement);let i=null,s=null;o!==null&&o.anchorNode===n&&(i=o.anchorOffset,s=o.focusOffset);const l=n.nodeValue;l!==null&&Fl(t,l,i,s,!1)}function gg(n,t,e){if(O(n)){const r=n.anchor.getNode();if(r.is(e)&&n.format!==r.getFormat())return!1}return ve(t)&&e.isAttached()}function pg(n,t,e){for(let r=n;r&&!Td(r);r=$n(r)){const o=gr(r,t);if(o!==void 0){const i=nt(o,e);if(i)return J(i)||!q(r)?void 0:[r,i]}}}function Bu(n,t,e){_s=!0;const r=performance.now()-ll>100;try{te(n,()=>{const o=A()||(function(f){return f.read("latest",()=>{const d=A();return d!==null?d.clone():null})})(n),i=new Map,s=n._editorState,l=n._blockCursorElement;let c=!1,a="";for(let f=0;f<t.length;f++){const d=t[f],h=d.type,g=d.target,_=pg(g,n,s);if(!_)continue;const[m,p]=_;if(h==="characterData")r&&M(p)&&ve(g)&&gg(o,g,p)&&hg(g,p,n);else if(h==="childList"){c=!0;const y=d.addedNodes;for(let S=0;S<y.length;S++){const C=y[S],N=ud(C),T=C.parentNode;if(!(T==null||C===l||N!==null||Hi(C,T,n)||Uo(C)||n._slotsUsed&&q(C)&&C.hasAttribute("data-lexical-slot")||Td(C))){if(Oe){const E=(q(C)?C.innerText:null)||C.nodeValue;E&&(a+=E)}T.removeChild(C)}}const x=d.removedNodes,v=x.length;if(v>0){let S=0;for(let C=0;C<v;C++){const N=x[C];Hi(N,g,n)||l===N?(g.appendChild(N),S++):Uo(N)&&S++}v!==S&&i.set(m,p)}}}if(i.size>0)for(const[f,d]of i)d.reconcileObservedMutation(f,n);const u=e.takeRecords();if(u.length>0){for(let f=0;f<u.length;f++){const d=u[f],h=d.addedNodes,g=d.target;for(let _=0;_<h.length;_++){const m=h[_],p=m.parentNode;p==null||m.nodeName!=="BR"||Hi(m,g,n)||p.removeChild(m)}}e.takeRecords()}o!==null&&(c&&St(o),Oe&&_d(n)&&o.insertRawText(a))})}finally{_s=!1}}function Ku(n){const t=n._observer;t!==null&&Bu(n,t.takeRecords(),t)}function Wu(n){(function(t){ll===0&&Kt(t).addEventListener("textInput",dg,!0)})(n),n._observer=new MutationObserver((t,e)=>{Bu(n,t,e)})}function Uu(n,t,e){const{isEqual:r}=n;return t===e||r!==void 0&&r(t,e)}function cl(n,t){return Uu(n,t,n.defaultValue)}function Je(n){return typeof n=="object"&&n!==null}function ne(n,t){const e=Ni(n,t).getter;return Je(e)&&e.getterTable!==void 0||w(405,t),al(e.getterTable)}function ce(n,t){const e=Ni(n,t).setter;return Je(e)&&e.setterTable!==void 0||w(406,t),al(e.setterTable)}function Zn(n,t,e){let{meta:r}=Ni(n,t);for(let o=0;;){if(r.kind==="aliased")return al(r.aliases);r.kind==="nullable"||r.kind==="optional"?r=r.inner.meta:r.kind==="array"?r=r.item.meta:w(407,t,String(e))}}function ae(n,t){const e=Ni(n,t),{setter:r}=e;Je(r)&&r.setterTable!==void 0||w(408,t);const o=String(e.defaultValue);return Ke(r.setterTable,o)||w(409,t,o),r.setterTable[o]}function al(n){return Object.assign(Object.create(null),n)}function Ni(n,t){const e=n.get(t);return e===void 0&&w(410,t),e}function Nn(n,t,e,r,o){o!==void 0&&_g.add(o);const i=e===void 0,s=i?n(void 0):e;return i&&Ju(s),Object.assign(n,{accepts:o,defaultValue:s,isEqual:r,meta:t})}const _g=new WeakSet,ju=new WeakSet;function mg(n){return n!==null&&typeof n=="object"&&ju.add(n),n}function Ju(n){if(n!==null&&typeof n=="object"&&!Object.isFrozen(n)&&!ju.has(n)){Object.freeze(n);for(const t of Object.values(n))Ju(t)}}function Hu(n){const{isEqual:t}=n;return t===void 0?void 0:(e,r)=>e==null||r==null?e===r:t(e,r)}function Vu(n,t){return e=>t(e)||ul(n,e)}function ul(n,t){const{accepts:e}=n;return e!==void 0?e.call(n,t):(function(r,o){const{accepts:i}=r;if(i!==void 0)return ul(r,o)?{parsed:r(o)}:void 0;const s=r(o);return cl(r,s)&&o!==r.defaultValue?void 0:{parsed:s}})(n,t)!==void 0}function Ke(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function re(n=""){return Nn(t=>typeof t=="string"?t:n,{kind:"string"},void 0,void 0,t=>typeof t=="string")}const yg=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function He(n=0,t={}){const{integer:e,clamp:r}=t,o=e&&t.min!==void 0?Math.ceil(t.min):t.min,i=e&&t.max!==void 0?Math.floor(t.max):t.max,s=a=>typeof a=="string"&&yg.test(a)?Number(a):a,l=a=>typeof a=="number"&&Number.isFinite(a)&&(!e||Number.isInteger(a)),c=a=>l(a)&&(o===void 0||a>=o)&&(i===void 0||a<=i);return Nn(a=>{const u=s(a);return r&&l(u)?o!==void 0&&u<o?o:i!==void 0&&u>i?i:u:c(u)?u:n},{clamp:r,integer:e,kind:"number",max:i,min:o},void 0,void 0,a=>r?l(s(a)):c(s(a)))}function fl(n=!1){return Nn(t=>typeof t=="boolean"?t:n,{kind:"boolean"},void 0,void 0,t=>typeof t=="boolean")}function dn(n,...t){const e=mg(t.length!==0?t[0]:n[0]),r=new Set(n);return Nn(o=>o!==void 0&&r.has(o)?o:e,{kind:"enum",values:n},e,void 0,o=>r.has(o)&&(o!==void 0||e===void 0))}function $r(n,t={}){const{defaultAsNull:e}=t;return Nn(r=>{if(r==null)return null;const o=n(r);return e&&cl(n,o)?null:o},{defaultAsNull:e,inner:n,kind:"nullable"},void 0,Hu(n),Vu(n,r=>r==null))}function Jo(n,t={}){const{omitDefault:e}=t;return Nn(r=>{if(r===void 0)return;const o=n(r);return e&&cl(n,o)?void 0:o},{inner:n,kind:"optional",omitDefault:e},void 0,Hu(n),Vu(n,r=>r===void 0))}function xe(){return n=>(function(t){return{meta:{fields:t,kind:"node"}}})(n)}function ms(n,t){const e=r=>typeof r=="string"&&Ke(t,r);return Nn(r=>e(r)?t[r]:n(r),{aliases:t,inner:n,kind:"aliased"},n.defaultValue,n.isEqual,r=>e(r)||ul(n,r))}function Mt(n,t){return qu("withField",n,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}})}function ie(n,t){return qu("withAccessors",n,t)}function qu(n,t,e){return Object.assign(r=>t(r),{accepts:t.accepts,defaultValue:t.defaultValue,getter:e.getter,isEqual:t.isEqual,meta:t.meta,setter:e.setter})}const oc="latest";class xg{constructor(t,e){k(this,"key");k(this,"parse");k(this,"unparse");k(this,"isEqual");k(this,"defaultValue");k(this,"resetOnCopyNode");k(this,"schema");this.key=t;const r="meta"in(o=e.parse)&&typeof o.meta=="object"&&o.meta!==null&&"kind"in o.meta&&typeof o.meta.kind=="string"&&"defaultValue"in o?e.parse:void 0;var o;this.schema=r,this.parse=e.parse.bind(e),this.unparse=(e.unparse||Cg).bind(e),this.isEqual=e.isEqual?e.isEqual.bind(e):r!==void 0&&r.isEqual!==void 0?(i,s)=>Uu(r,i,s):Object.is,this.defaultValue=r!==void 0?r.defaultValue:this.parse(void 0),this.resetOnCopyNode=e.resetOnCopyNode||!1}}function ur(n,t){return new xg(n,t)}function Kr(n,t,e=oc){const r=(e===oc?n.getLatest():n).__state;return r?r.getValue(t):t.defaultValue}function fr(n,t,e){let r;if(xt(),typeof e=="function"){const i=n.getLatest(),s=Kr(i,t);if(r=e(s),t.isEqual(s,r))return i}else r=e;const o=n.getWritable();return Yu(o).updateFromKnown(t,r),o}function vg(n){const t=new Map,e=new Set;for(const{ownNodeConfig:r}of vn(typeof n=="function"?n:n.replace))if(r&&r.stateConfigs)for(const o of r.stateConfigs){let i;"stateConfig"in o?(i=o.stateConfig,o.flat&&e.add(i.key)):i=o,t.set(i.key,i)}return{flatKeys:e,sharedConfigMap:t}}const ic=new Set(["__proto__","constructor","prototype"]);let Sg=class Gu{constructor(t,e,r=void 0,o=new Map,i=void 0){k(this,"node");k(this,"knownState");k(this,"unknownState");k(this,"sharedNodeState");k(this,"size");this.node=t,this.sharedNodeState=e,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,l=i!==void 0?i:(function(c,a,u){let f=u.size;if(a)for(const d in a){const h=c.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=l}getValue(t){const e=this.knownState.get(t);if(e!==void 0)return e;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},e={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(e[r]=t[r],delete t[r]);return sc(t)&&(e[sl]=t),e}getWritable(t){if(this.node===t)return this;const{sharedNodeState:e,unknownState:r}=this,o=new Map(this.knownState);return new Gu(t,e,(function(i,s,l){let c;if(l)for(const[a,u]of Object.entries(l)){if(ic.has(a))continue;const f=i.get(a);f?s.has(f)||s.set(f,f.parse(u)):(c=c||{},c[a]=u)}return c})(e.sharedConfigMap,o,r),o,this.size)}resetOnCopyNode(){for(const t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,e){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=sc(i)),this.size++),o.set(t,e)}updateFromUnknown(t,e){if(ic.has(t))return;const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(e)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=e)}updateFromJSON(t){const{knownState:e}=this;for(const r of e.keys())e.set(r,r.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function Yu(n){const t=n.getWritable(),e=t.__state?t.__state.getWritable(t):new Sg(t,(function(r){return r.__state?r.__state.sharedNodeState:ld(gt(),r.getType()).sharedNodeState})(t));return t.__state=e,e}function Xu(n,t){const e=n.getWritable(),r=t[sl];return(e.__state||r)&&Yu(n).updateFromJSON(r),e}function sc(n){if(n)for(const t in n)return n}function Cg(n){return n}function lc(n,t,e){for(const[r,o]of t.knownState){if(n.has(r.key))continue;n.add(r.key);const i=e?e.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function cc(n,t,e){const{unknownState:r}=t,o=e?e.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!n.has(i)&&(n.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function ac(n,t){const e=n.__state;return e&&e.node===n?e.getWritable(t):e}function uc(n,t){const e=n.__mode,r=n.__format,o=n.__style,i=t.__mode,s=t.__format,l=t.__style,c=n.__state,a=t.__state;return(e===null||e===i)&&(r===null||r===s)&&(o===null||o===l)&&(n.__state===null||c===a||(function(u,f){if(u===f)return!0;const d=new Set;return!(u&&lc(d,u,f)||f&&lc(d,f,u)||u&&cc(d,u,f)||f&&cc(d,f,u))})(c,a))}function fc(n,t){const e=n.mergeWithSibling(t),r=G()._normalizedNodes;return r.add(n.__key),r.add(t.__key),e}function dc(n){let t,e,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&M(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(uc(t,r)){r=fc(t,r);break}break}t.remove()}for(;(e=r.getNextSibling())!==null&&M(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(uc(r,e)){r=fc(r,e);break}break}e.remove()}}else r.remove()}function dl(n){return hc(n.anchor),hc(n.focus),n}function hc(n){for(;n.type==="element";){const t=n.getNode(),e=n.offset;let r,o;if(e===t.getChildrenSize()?(r=t.getChildAtIndex(e-1),o=!0):(r=t.getChildAtIndex(e),o=!1),M(r)){n.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!b(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}const Ho=Symbol.for("@lexical/CachedTextSize");function gc(n,t){return xs.read(()=>{let e=0,r=n;for(let o=0;o<t&&r!==null;o++){const i=oe.get(r);if(i===void 0&&w(345,r),b(i)){const s=st.get(r);if(s!==void 0&&b(s)&&s.__parent!==i.__parent)e+=i.getTextContentSize();else{const l=hn.get(r),c=l&&l.__lexicalTextContent;typeof c!="string"&&w(346,i.getType()),e+=c.length}o<t-1&&!i.isInline()&&(e+=2)}else{const s=i[Ho];s===void 0&&w(347,i.getType(),r),e+=s}r=i.__next}return e},{editor:V})}function Qu(n){b(n)||n[Ho]===void 0&&(n[Ho]=M(n)?n.__text.length:n.getTextContentSize())}const bg=4;let Wr,V,Ur,j="",ht=null,$t=null,wt=null;function he(){return{firstTextKey:wt,format:ht,style:$t}}function Vt(n){n.firstTextKey!==null&&(ht=n.format,$t=n.style,wt=n.firstTextKey)}function ys(n){if(wt!==null)return;const t=n.__lexicalFirstTextKey;if(t===void 0&&w(348),t===null)return;const e=st.get(t);M(e)&&(ht=e.getFormat(),$t=e.getStyle(),wt=t)}let Ei,Mr,Fr,oe,xs,st,hn,vs,jr,gn,ke=!1,Vo=!1;function We(n,t){const e=oe.get(n),r=st.has(n);if(t!==null){const o=ks(n);o.parentNode===t&&t.removeChild(o)}if(!r){if(V._keyToDOMMap.delete(n),b(e)){const o=_i(e,oe);Ss(o,0,o.length-1,null)}if(e!==void 0){for(const o of qt(e).values()){const i=bs(o);We(o,null),i!==null&&i.remove()}Al(jr,Ur,Ei,e,"destroyed")}}}function Ss(n,t,e,r){for(let o=t;o<=e;++o){const i=n[o];i!==void 0&&We(i,r)}}function nn(n,t){n.setProperty("text-align",t)}const Tg="40px";function Zu(n,t){const e=Wr.theme.indent;if(typeof e=="string"){const r=n.classList.contains(e);t>0&&!r?n.classList.add(e):t<1&&r&&n.classList.remove(e)}n.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${Tg}))`),Xr(n,"class"),Xr(n,"style")}function tf(n,t){const e=n.style;t===0?nn(e,""):t===1?nn(e,"left"):t===2?nn(e,"center"):t===3?nn(e,"right"):t===4?nn(e,"justify"):t===5?nn(e,"start"):t===6&&nn(e,"end"),Xr(n,"style")}function Cs(n,t){const e=(function(r){const o=r.__dir;if(o!==null)return o;if(ut(r))return null;const i=r.getParent();return i===null||Z(i)&&i.__dir===null?"auto":null})(t);e!==null?n.dir=e:n.removeAttribute("dir")}function ef(n){const t=ot().createElement("div");return t.setAttribute("data-lexical-slot",n),t.style.display="none",t}function nf(n,t,e){t||n.contentEditable==="false"?__(e,V):e.removeAttribute("contenteditable")}function pc(n,t,e){const r=j,o=he();j="";let i="";const s=J(n);for(const[l,c]of e){const a=ef(l);nf(t,s,a),t.appendChild(a),j="";const u=he();Ue(c,Ut(n,a,V)),Vt(u),rf(n,l,t,a),i+=j}return Vt(o),j=r,i}function qt(n){return un(n)&&n.__slots!==null?n.__slots:Od}function rf(n,t,e,r){const o=gn.$getSlotTargetElement(n,t,e,V);o!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display="")}function bs(n){const t=hn.get(n);return t!==void 0?t.parentElement:null}function _c(n,t,e){const r=qt(n),o=qt(t);for(const[u,f]of r)if(!o.has(u)){const d=bs(f);We(f,null),d!==null&&d.remove()}const i=j,s=he();let l="",c=null;const a=J(t);for(const[u,f]of o){const d=r.get(u);let h=d!==void 0?bs(d):null;j="";const g=he();if(h===null){h=ef(u);let _=null;for(const m of e.children)if(!m.hasAttribute("data-lexical-slot")){_=m;break}e.insertBefore(h,_),Ue(f,Ut(t,h,V))}else d===f?Te(f,h):(d!==void 0&&We(d,h),Ue(f,Ut(t,h,V)));if(Vt(g),nf(e,a,h),rf(t,u,e,h),l+=j,h.parentElement===e){const _=c===null?e.firstChild:c.nextSibling;_!==h&&e.insertBefore(h,_),c=h}}return Vt(s),j=i,l}function Ue(n,t){const e=st.get(n);if(e===void 0&&w(60),t!==null){const o=oe.get(n);if(o!==void 0){const i=hn.get(n);if(i!==void 0){const s=Sn(o)?o.__slotHost:null,l=Sn(e)?e.__slotHost:null,c=o.__parent!==e.__parent||s!==l,a=l!==null&&i.parentElement!==t.element;if(c||a)return t.insertChild(i),Te(n,t.element)}}}const r=gn.$createDOM(e,V);if((function(o,i,s){const l=s._keyToDOMMap;fd(i,s,o),l.set(o,i)})(n,r,V),M(e)?r.setAttribute("data-lexical-text","true"):J(e)&&(r.setAttribute("data-lexical-decorator","true"),p_(r,{captureSelection:!0})),b(e)){const o=e.__indent,i=e.__size;Cs(r,e),o!==0&&Zu(r,o);const s=qt(e),l=s.size>0?pc(e,r,s):"";if(i===0)r.__lexicalTextContent=l,r.__lexicalFirstTextKey=null,j+=l,s.size>0&&(r.__lexicalSlotTextLength=l.length);else{const a=j,u=i-1;if(Ts(_i(e,st),e,0,u,Ut(e,r,V)),l!==""){const f=r.__lexicalTextContent||"";r.__lexicalTextContent=l+f,j=a+l+f}s.size>0&&(r.__lexicalSlotTextLength=l.length)}const c=e.__format;c!==0&&tf(r,c),e.isInline()||(sf(null,e,r),of(e,r))}else{const o=e.getTextContent();if(J(e)){const i=e.decorate(V,Wr);i!==null&&lf(n,i),r.contentEditable="false";const s=qt(e);s.size>0&&pc(e,r,s)}j+=o}return t!==null&&t.insertChild(r),gn.$decorateDOM(e,null,r,V),Qu(e),Al(jr,Ur,Ei,e,"created"),r}function Ts(n,t,e,r,o){const i=j,s=he();j="",ht=null,$t=null,wt=null;let l=e;for(;l<=r;++l){const a=he();Ue(n[l],o);const u=st.get(n[l]);u!==null&&M(u)?ht===null&&(ht=u.getFormat(),$t=u.getStyle(),wt=u.__key):b(u)&&l<r&&!u.isInline()&&(j+=cn),Vt(a)}const c=V._keyToDOMMap.get(t.__key);c===void 0&&w(349,t.__key),c.__lexicalTextContent=j,c.__lexicalFirstTextKey=wt,j=i+j,Vt(s)}function mc(n,t){if(!n)return!1;const e=t.get(n);return J(e)&&!e.isInline()}function of(n,t){const e=Ut(n,t,V);e.setDecoratorBoundaryAnchor("leading",mc(n.__first,st)),e.setDecoratorBoundaryAnchor("trailing",mc(n.__last,st))}function sf(n,t,e){const r=Ut(t,e,V),o=(function(i,s){if(i){const l=i.__last;if(l){const c=s.get(l);if(c)return Nt(c)?"line-break":J(c)&&c.isInline()?"decorator":null}return"empty"}return null})(t,st);r.setManagedLineBreak(o)}function kg(n,t,e){var r;ht=null,$t=null,wt=null,(function(o,i,s){const l=j,c=o.__size,a=i.__size;j="";const u=s.element,f=V._keyToDOMMap.get(i.__key);f===void 0&&w(351,i.__key);const d=a-c;if(!ke&&Math.abs(d)<=1&&c>=bg&&o.__first===i.__first&&(d!==0||!V._cloneNotNeeded.has(o.__key))){const h=f.__lexicalTextContent,g=vs.get(o.__key);if(!ke&&typeof h=="string"&&g!==void 0){const _=(function(m,p){const y=p.size;if(y===0||y>=m.__size)return null;let x=m.__last,v=null,S=0;for(;x!==null&&S<y;){if(!p.has(x))return null;v=x;const C=st.get(x);if(C===void 0)return null;x=C.__prev,S++}return S!==y||x!==null&&p.has(x)?null:v})(i,g);if(_!==null){const m=g.size;if(d===0){const p=gc(_,m);let y=_,x=0;for(;y!==null&&x<m;){const T=st.get(y);if(T===void 0)break;const E=he();Te(y,u),M(T)&&ht===null&&(ht=T.getFormat(),$t=T.getStyle(),wt=T.__key),Vt(E),y=T.__next,x++}let v="";for(y=_,x=0;y!==null&&x<m;){const T=st.get(y);if(T===void 0)break;let E;if(b(T)){const $=V._keyToDOMMap.get(y),F=$&&$.__lexicalTextContent;typeof F!="string"&&w(352,T.getType()),E=F}else E=T.getTextContent();v+=E,x<m-1&&b(T)&&!T.isInline()&&(v+=cn),y=T.__next,x++}const S=f.__lexicalSlotTextLength||0,C=S>0?h.slice(S):h,N=C.slice(0,C.length-p)+v;return f.__lexicalTextContent=N,j=l+N,void yc(i,f,g)}if((function(p,y,x,v,S,C,N,T){if(T!==1&&T!==-1||N!==(T===1?2:1))return!1;const $=N-T;let F=p.__last;for(let it=0;it<$-1;it++){if(F===null)return!1;const _t=oe.get(F);if(_t===void 0)return!1;F=_t.__prev}if(F===null)return!1;const D=st.get(C),L=oe.get(F);if(D===void 0||L===void 0||D.__prev!==L.__prev)return!1;const B=[];let U=C;for(let it=0;it<N;it++){if(U===null)return!1;B.push(U);const _t=st.get(U);U=_t?_t.__next:null}const Q=[];U=F;for(let it=0;it<$;it++){if(U===null)return!1;Q.push(U);const _t=oe.get(U);U=_t?_t.__next:null}const H=new Set(Q),Et=new Set(B),et=[];let ft=0,dt=0;for(;ft<$&&dt<N;)if(B[dt]===Q[ft])et.push({key:B[dt],kind:"reconcile"}),ft++,dt++;else if(Et.has(Q[ft])){if(H.has(B[dt]))return!1;et.push({key:B[dt],kind:"create",nextIndex:dt}),dt++}else et.push({key:Q[ft],kind:"destroy"}),ft++;for(;ft<$;)et.push({key:Q[ft++],kind:"destroy"});for(;dt<N;)et.push({key:B[dt],kind:"create",nextIndex:dt}),dt++;const Se=gc(F,$);for(const it of et){const _t=he();if(it.kind==="reconcile")Te(it.key,x.element);else if(it.kind==="destroy")We(it.key,x.element);else{let Ht=null;for(let Fn=it.nextIndex+1;Fn<N;Fn++){const xr=V._keyToDOMMap.get(B[Fn]);if(xr!==void 0){Ht=xr;break}}Ue(it.key,x.withBefore(Ht??x.before))}if(it.kind!=="destroy"){const Ht=st.get(it.key);Ht&&M(Ht)&&ht===null&&(ht=Ht.getFormat(),$t=Ht.getStyle(),wt=Ht.__key)}Vt(_t)}let Jt="";for(let it=0;it<N;it++){const _t=st.get(B[it]);if(_t===void 0)return!1;let Ht;if(b(_t)){const Fn=V._keyToDOMMap.get(B[it]),xr=Fn&&Fn.__lexicalTextContent;typeof xr!="string"&&w(350,_t.getType()),Ht=xr}else Ht=_t.getTextContent();Jt+=Ht,it<N-1&&b(_t)&&!_t.isInline()&&(Jt+=cn)}const Ae=v.__lexicalSlotTextLength||0,yr=Ae>0?S.slice(Ae):S;return v.__lexicalTextContent=yr.slice(0,yr.length-Se)+Jt,!0})(o,0,s,f,h,_,m,d)){const p=f.__lexicalTextContent;return typeof p!="string"&&w(353),j=l+p,void yc(i,f,g)}}}if(d===0){let _=o.__first,m=0;for(;_!==null;){const p=st.get(_);if(p===void 0)break;const y=ke||Fr.has(_)||Mr.has(_),x=he();if(y)Te(_,u);else{let v,S;if(b(p)){S=hn.get(_);const C=S&&S.__lexicalTextContent;typeof C!="string"&&w(354,p.getType()),v=C}else v=p.getTextContent();j+=v,S!==void 0&&ys(S)}M(p)?ht===null&&(ht=p.getFormat(),$t=p.getStyle(),wt=p.__key):b(p)&&m<a-1&&!p.isInline()&&(j+=cn),Vt(x),_=p.__next,m++}return f.__lexicalTextContent=j,f.__lexicalFirstTextKey=wt,void(j=l+j)}}if(c===1&&a===1){const h=o.__first,g=i.__first;if(h===g)Te(h,u);else{const m=ks(h),p=Ue(g,null);try{m.parentNode===u?u.replaceChild(p,m):s.insertChild(p)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${g}}, old child: {tag: ${m.tagName}, key: ${h}}.`;throw new Error(x)}throw y}We(h,null)}const _=st.get(g);M(_)&&ht===null&&(ht=_.getFormat(),$t=_.getStyle(),wt=_.__key)}else{const h=_i(o,oe),g=_i(i,st);if(h.length!==c&&w(227),g.length!==a&&w(228),c===0)a!==0&&Ts(g,i,0,a-1,s);else if(a===0){if(c!==0){const _=s.after==null&&s.before==null&&qt(i).size===0&&s.element.__lexicalLineBreak==null;Ss(h,0,c-1,_?null:u),_&&(u.textContent="")}}else(function(_,m,p,y,x,v){const S=y-1,C=x-1;let N,T,E=v.getFirstChild(),$=0,F=0;for(;$<=S&&F<=C;){const B=m[$],U=p[F],Q=he();if(B===U)E=Vi(Te(U,v.element)),$++,F++;else{if(T===void 0&&(T=xc(p,F)),N===void 0)N=xc(m,$);else if(!N.has(B)){$++,Vt(Q);continue}if(!T.has(B)){E=Vi(ks(B)),We(B,v.element),$++,N.delete(B),Vt(Q);continue}if(N.has(U)){const Et=rr(V,U);Et!==E&&v.withBefore(E??v.before).insertChild(Et),E=Vi(Te(U,v.element)),$++,F++}else Ue(U,v.withBefore(E??v.before)),F++}const H=st.get(U);H!==null&&M(H)?ht===null&&(ht=H.getFormat(),$t=H.getStyle(),wt=H.__key):b(H)&&F<=C&&!H.isInline()&&(j+=cn),Vt(Q)}const D=$>S,L=F>C;if(D&&!L){const B=p[C+1],U=B===void 0?null:V.getElementByKey(B);Ts(p,_,F,C,v.withBefore(U??v.before))}else L&&!D&&Ss(m,$,S,v.element)})(i,h,g,c,a,s)}f.__lexicalTextContent=j,f.__lexicalFirstTextKey=wt,j=l+j})(n,t,Ut(t,e,V)),Z(t)||(r=t,ht==null||ht===r.__textFormat||Vo||r.setTextFormat(ht),(function(o){$t==null||$t===o.__textStyle||Vo||o.setTextStyle($t)})(t))}function yc(n,t,e){const r=t.__lexicalFirstTextKey;if(r!=null){const o=n.__key;let i=r;for(;i!==null;){const s=st.get(i);if(s===void 0){i=null;break}if(s.__parent===o)break;i=s.__parent}if(i!==null&&!e.has(i)){const s=st.get(r);if(M(s))return ht=s.getFormat(),void($t=s.getStyle())}}t.__lexicalFirstTextKey=wt}function Te(n,t){const e=oe.get(n);let r=st.get(n);e!==void 0&&r!==void 0||w(61);const o=ke||Fr.has(n)||Mr.has(n),i=rr(V,n);if(e===r&&!o){let s;if(b(e)){const l=i.__lexicalTextContent;typeof l!="string"&&w(355,e.getType()),s=l,ys(i)}else s=e.getTextContent();return j+=s,i}if(e!==r&&o&&Al(jr,Ur,Ei,r,"updated"),gn.$updateDOM(r,e,i,V)){const s=Ue(n,null);return t===null&&w(62),t.replaceChild(s,i),We(n,null),s}if(b(e)){b(r)||w(334,n);const s=r.__indent;(ke||s!==e.__indent)&&Zu(i,s);const l=r.__format;(ke||l!==e.__format)&&tf(i,l);const c=o&&(qt(r).size>0||qt(e).size>0)?_c(e,r,i):"";if(o){const a=j;if(kg(e,r,i),r.isInline()||(ut(r)||sf(0,r,i),of(r,i)),c!==""){const u=i.__lexicalTextContent||"";i.__lexicalTextContent=c+u,j=a+c+u,i.__lexicalSlotTextLength=c.length}else(qt(r).size>0||qt(e).size>0)&&(i.__lexicalSlotTextLength=0)}else{const a=i.__lexicalTextContent;typeof a!="string"&&w(356,e.getType()),j+=a,ys(i)}if((ke||r.__dir!==e.__dir||r.__parent!==e.__parent)&&(Cs(i,r),ut(r)&&!ke))for(const a of r.getChildren())b(a)&&Cs(rr(V,a.getKey()),a)}else{const s=r.getTextContent();if(J(r)){const l=r.decorate(V,Wr);l!==null&&lf(n,l),o&&(qt(r).size>0||qt(e).size>0)&&_c(e,r,i)}j+=s}if(!Vo&&ut(r)){const s=r.getLatest();if(s.__cachedText!==j){const l=s.getWritable();l.__cachedText=j,r=l}}return gn.$decorateDOM(r,e,i,V),Qu(r),i}function lf(n,t){let e=V._pendingDecorators;const r=V._decorators;if(e===null){if(r[n]===t)return;e=dd(V)}e[n]=t}function Vi(n){let t=n.nextSibling;return t!==null&&t===V._blockCursorElement&&(t=t.nextSibling),t}function xc(n,t){const e=new Set;for(let r=t;r<n.length;r++)e.add(n[r]);return e}function Ng(n,t,e,r,o,i){j="",ht=null,$t=null,wt=null,ke=r===2,V=e,Wr=e._config,gn=e._config.dom||ci,Ur=e._nodes,Ei=V._listeners.mutation,Mr=o,Fr=i,oe=n._nodeMap,xs=n,st=t._nodeMap,Vo=t._readOnly,hn=Lu(e._keyToDOMMap),vs=(function(){const l=new Map,c=a=>{for(const u of a){const f=st.get(u);if(f===void 0)continue;const d=f.__parent;if(d===null)continue;let h=l.get(d);h===void 0&&(h=new Set,l.set(d,h)),h.add(u)}};return c(Mr.keys()),c(Fr),l})();const s=new Map;return jr=s,Te("root",null),V=void 0,Ur=void 0,Mr=void 0,Fr=void 0,oe=void 0,xs=void 0,st=void 0,Wr=void 0,hn=void 0,vs=void 0,jr=void 0,gn=ci,s}function ks(n){const t=hn.get(n);return t===void 0&&w(75,n),t}function P(n){return{type:n}}const cf=P("SELECTION_CHANGE_COMMAND"),Eg=P("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),af=P("CLICK_COMMAND"),uf=P("BEFORE_INPUT_COMMAND"),ff=P("INPUT_COMMAND"),df=P("COMPOSITION_START_COMMAND"),hf=P("COMPOSITION_END_COMMAND"),an=P("DELETE_CHARACTER_COMMAND"),zn=P("INSERT_LINE_BREAK_COMMAND"),Jr=P("INSERT_PARAGRAPH_COMMAND"),Bn=P("CONTROLLED_TEXT_INSERTION_COMMAND"),wi=P("PASTE_COMMAND"),Fo=P("REMOVE_TEXT_COMMAND"),Hr=P("DELETE_WORD_COMMAND"),Kn=P("DELETE_LINE_COMMAND"),Le=P("FORMAT_TEXT_COMMAND"),wg=P("SET_TEXT_FORMAT_COMMAND"),qo=P("UNDO_COMMAND"),Vr=P("REDO_COMMAND"),gf=P("KEYDOWN_COMMAND"),pf=P("KEY_ARROW_RIGHT_COMMAND"),Ns=P("MOVE_TO_END"),_f=P("KEY_ARROW_LEFT_COMMAND"),Es=P("MOVE_TO_START"),hl=P("KEY_ARROW_UP_COMMAND"),gl=P("KEY_ARROW_DOWN_COMMAND"),so=P("KEY_ENTER_COMMAND"),mf=P("KEY_SPACE_COMMAND"),pl=P("KEY_BACKSPACE_COMMAND"),_l=P("KEY_ESCAPE_COMMAND"),yf=P("KEY_DELETE_COMMAND"),ml=P("KEY_TAB_COMMAND"),Og=P("INSERT_TAB_COMMAND"),$g=P("INDENT_CONTENT_COMMAND"),vc=P("OUTDENT_CONTENT_COMMAND"),yl=P("DROP_COMMAND"),Mg=P("FORMAT_ELEMENT_COMMAND"),xf=P("DRAGSTART_COMMAND"),xl=P("DRAGOVER_COMMAND"),Fg=P("DRAGEND_COMMAND"),Oi=P("COPY_COMMAND"),vl=P("CUT_COMMAND"),vf=P("SELECT_ALL_COMMAND"),Ag=P("CLEAR_EDITOR_COMMAND"),Dg=P("CLEAR_HISTORY_COMMAND"),po=P("CAN_REDO_COMMAND"),_o=P("CAN_UNDO_COMMAND"),Pg=P("FOCUS_COMMAND"),Ig=P("BLUR_COMMAND"),Lg=P("KEY_MODIFIER_COMMAND");function Sf(n,t){return{...t,[lg]:n}}const rn=Sf("metaKey",{ctrlKey:!Yn,metaKey:Yn}),Sc=Sf("altKey",{altKey:Yn,ctrlKey:!Yn}),Cc=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function qi(n,t,e){const r=n.get(t);r?r.push(e):n.set(t,[e])}class Rg{constructor(){k(this,"byKey",new Map);k(this,"byCode",new Map)}add(t){const{key:e,modifiers:r={}}=t;e.length>0||w(399);const o=e.toLowerCase();for(const i of(function(s){let l=[0];for(const[c,a]of Cc){const u=s[c]||!1;u==="any"?l=l.concat(l.map(f=>f|a)):u&&(l=l.map(f=>f|a))}return l})(r))qi(this.byKey,`${i}:${o}`,t),e.length===1&&(/[0-9]/.test(e)?qi(this.byCode,`${i}:Digit${e}`,t):/[a-z]/.test(o)&&qi(this.byCode,`${i}:Key${o.toUpperCase()}`,t));return this}matches(t){const e=t.key;if(!e)return[];const r=(function(s){let l=0;for(const[c,a]of Cc)s[c]&&(l|=a);return l})(t),o=this.byKey.get(`${r}:${e.toLowerCase()}`),i=o?o.slice():[];if(this.byCode.size>0&&!(e.length===1&&e.charCodeAt(0)<=127)){const s=this.byCode.get(`${r}:${t.code}`);s&&i.push(...s)}return i}match(t){return this.matches(t)[0]}}function zg(n){const t=new Rg;for(const e of n)t.add(e);return t}function Bg(n){const t=new Map;return{dispose(){for(const e of t.values())e.dispose();t.clear()},register(e,r){let o=t.get(e);o===void 0&&(o={dispose:n(e,r),holders:new Set},t.set(e,o));const i=()=>{const s=t.get(e);s&&s.holders.delete(i)&&s.holders.size===0&&(t.delete(e),s.dispose())};return o.holders.add(i),i}}}function Kg(n,t,e,r){return n.addEventListener(t,e,r),n.removeEventListener.bind(n,t,e,r)}const Ce=Object.freeze({});let Gi;function Wg(){if(Gi!==void 0)return Gi;const n=[["keydown",Zg],["pointerdown",Jg],["compositionstart",Gg],["compositionend",Qg],["input",Vg],["click",jg],["cut",Ce],["copy",Ce],["dragstart",Ce],["dragover",Ce],["dragend",Ce],["paste",Ce],["focus",Ce],["blur",Ce],["drop",Ce]];return Xn&&n.push(["beforeinput",(t,e)=>(function(r,o){const i=r.inputType;i==="deleteCompositionText"||Oe&&_d(o)||i!=="insertCompositionText"&&te(o,()=>{kf(r,o)||R(o,uf,r)},{event:r})})(t,e)]),Gi=n,n}const ws=new WeakMap,Go=new WeakMap,Ug=Bg(n=>(n.addEventListener("selectionchange",Oc),()=>n.removeEventListener("selectionchange",Oc)));function Cf(n,t,e,r,o,i){const s=n.anchor,l=n.focus,c=s.getNode(),a=G();let u;if(i!==void 0)u=i;else{const _=Lt(Kt(a));u=_!==null?Bt(_,a._rootElement):null}const f=u!==null?u.anchorNode:null,d=s.key,h=a.getElementByKey(d),g=e.length;return d!==l.key||!M(c)||(!o&&(!Xn||a._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&g<2||hd(e))&&s.offset!==l.offset&&!c.isComposing()||Yt(c)||c.isDirty()&&g>1||(o||!Xn)&&h!==null&&!c.isComposing()&&f!==je(c,h,a)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==n.format||c.getStyle()!==n.style)||(function(_,m){if(m.isSegmented())return!0;if(!_.isCollapsed())return!1;const p=_.anchor.offset,y=m.getParentOrThrow(),x=ai(m);return p===0?!m.canInsertTextBefore()||!y.canInsertTextBefore()&&!m.isComposing()||x||(function(v){const S=v.getPreviousSibling();return(M(S)||b(S)&&S.isInline())&&!S.canInsertTextAfter()})(m):p===m.getTextContentSize()&&(!m.canInsertTextAfter()||!y.canInsertTextAfter()&&!m.isComposing()||x)})(n,c)}function bc(n,t){return ve(n)&&n.nodeValue!==null&&t!==0&&t!==n.nodeValue.length}function Tc(n,t,e){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=Bt(n,t._rootElement),l=t._inputState,c=l.isSelectionChangeFromDOMUpdate;if(c){l.isSelectionChangeFromDOMUpdate=!1;const a=l.selectionChangeFromDOMUpdatePoints;if(l.selectionChangeFromDOMUpdatePoints=null,bc(r,o)&&bc(i,s)&&!l.postDeleteSelectionToRestore&&(a===null||a.anchorNode===r&&a.anchorOffset===o&&a.focusNode===i&&a.focusOffset===s))return}te(t,()=>{if(!e)return void St(null);if(!uo(t,r,i))return;let a=A();if(l.postDeleteSelectionToRestore&&O(a)&&a.isCollapsed()){const f=a.anchor,d=l.postDeleteSelectionToRestore.anchor;(f.key===d.key&&f.offset===d.offset+1||f.offset===1&&d.getNode().is(f.getNode().getPreviousSibling()))&&(a=l.postDeleteSelectionToRestore.clone(),St(a))}if(l.postDeleteSelectionToRestore=null,O(a)){const f=a.anchor,d=f.getNode();if(a.isCollapsed()){n.type==="Range"&&r===i&&(a.dirty=!0);const h=Kt(t).event,g=h?h.timeStamp:performance.now(),{format:_,style:m,offset:p,key:y,timeStamp:x}=l.collapsedSelectionFormat,v=Y(),S=t.isComposing()===!1&&v.getTextContent()==="";if(g<x+200&&f.offset===p&&f.key===y)Ao(a,_,m);else if(f.type==="text")M(d)||w(141),bf(a,d);else if(f.type==="element"&&!S){b(d)||w(259);const C=f.getNode();C.isEmpty()?(function(N,T){const E=T.getTextFormat(),$=T.getTextStyle();Ao(N,E,$)})(a,C):Ao(a,a.format,"")}}else{const h=f.key,g=a.focus.key,_=a.getNodes(),m=_.length,p=a.isBackward(),y=p?s:o,x=p?o:s,v=p?g:h,S=p?h:g;let C=sg,N=!1;for(let T=0;T<m;T++){const E=_[T],$=E.getTextContentSize();if(M(E)&&$!==0&&!(T===0&&E.__key===v&&y===$||T===m-1&&E.__key===S&&x===0)&&(N=!0,C&=E.getFormat(),C===0))break}a.format=N?C:0}}const u=wn();(c||(a!==null?a.dirty||!O(a)||!a.is(u):u!==null))&&R(t,cf)})}function Ao(n,t,e){n.format===t&&n.style===e||(n.format=t,n.style=e,n.dirty=!0)}function bf(n,t){Ao(n,t.getFormat(),t.getStyle())}function jg(n,t){te(t,()=>{const e=A(),r=Lt(Kt(t)),o=wn();if(r){if(O(e)){const i=e.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&e.isCollapsed()&&!ut(s)&&Y().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&e.is(o)&&(r.removeAllRanges(),e.dirty=!0)}else if(n.pointerType==="touch"||n.pointerType==="pen"){const i=Bt(r,t._rootElement).anchorNode;(q(i)||ve(i))&&St(ei(o,r,t,n))}}if(Oe&&r!==null&&r.rangeCount===0){const i=t._rootElement;if(i!==null&&n.target===i){const s=n.clientY;let l=i.childNodes.length;for(let a=0;a<i.childNodes.length;a++){const u=i.childNodes[a];if(q(u)){const f=u.getBoundingClientRect();if(s<=(f.top+f.bottom)/2){l=a;break}}}r.setBaseAndExtent(i,l,i,l);const c=ei(o,r,t,n);c!==null?St(c):r.removeAllRanges()}}R(t,af,n)})}function Jg(n,t){const e=Sd(n),r=n.pointerType;pr(e)&&r!=="touch"&&r!=="pen"&&n.button===0&&te(t,()=>{gi(e,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function Tf(n){if(!n.getTargetRanges)return null;const t=n.getTargetRanges();return t.length===0?null:t[0]}function kc(n){const{lastKeyCode:t}=G()._inputState;if(n==null||n.length<=1||t==null)return;const e=t.length===1?t:t==="Enter"?`
4
4
  `:t==="Tab"?" ":null;if(!e)return;const r=A();if(!O(r)||!r.isCollapsed())return;const o=r.anchor.getNode();if(!M(o))return;const{offset:i}=r.anchor;if(o.getTextContentSize()===i){const s=o.getNextSibling();if(e===`
@@ -1 +1 @@
1
- import{j as e,t as o,p as r,b as l,C as d}from"./index-bYhLX3oQ.js";function c({member:a,onOpen:i}){const t=o(a),n=r(a);return e.jsxs("button",{type:"button",onClick:i,"data-slot":"profile-managed-row",className:"focus-ring hover:bg-muted/50 flex h-11 w-full items-center gap-2.5 rounded-md px-2 text-left transition-colors",children:[e.jsx(l,{size:"sm",kind:t.kind,color:t.color,emoji:t.emoji,imageUrl:t.imageUrl,fallback:t.fallback,origin:t.origin}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-sm",children:a.displayName}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n.text})]}),e.jsx(d,{"aria-hidden":!0,className:"text-muted-foreground/70 ml-auto size-3.5 shrink-0"})]})}function x({member:a,roster:i,onPush:t}){const n=i.filter(s=>s.kind==="agent"&&s.ownerId===a.id);return n.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.isSelf?"You manage":`${a.displayName} manages`," no agents yet."]}):e.jsx("div",{className:"flex flex-col",children:n.map(s=>e.jsx(c,{member:s,onOpen:()=>t({kind:"profile",memberId:s.id})},s.id))})}export{x as ManagesPage};
1
+ import{j as e,t as o,p as r,b as l,C as d}from"./index-BCGiD7pg.js";function c({member:a,onOpen:i}){const t=o(a),n=r(a);return e.jsxs("button",{type:"button",onClick:i,"data-slot":"profile-managed-row",className:"focus-ring hover:bg-muted/50 flex h-11 w-full items-center gap-2.5 rounded-md px-2 text-left transition-colors",children:[e.jsx(l,{size:"sm",kind:t.kind,color:t.color,emoji:t.emoji,imageUrl:t.imageUrl,fallback:t.fallback,origin:t.origin}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-sm",children:a.displayName}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n.text})]}),e.jsx(d,{"aria-hidden":!0,className:"text-muted-foreground/70 ml-auto size-3.5 shrink-0"})]})}function x({member:a,roster:i,onPush:t}){const n=i.filter(s=>s.kind==="agent"&&s.ownerId===a.id);return n.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.isSelf?"You manage":`${a.displayName} manages`," no agents yet."]}):e.jsx("div",{className:"flex flex-col",children:n.map(s=>e.jsx(c,{member:s,onOpen:()=>t({kind:"profile",memberId:s.id})},s.id))})}export{x as ManagesPage};
@@ -1,4 +1,4 @@
1
- var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-bYhLX3oQ.js";/**
1
+ var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-BCGiD7pg.js";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -0,0 +1 @@
1
+ import{j as r,h as o}from"./index-BCGiD7pg.js";function a({member:e}){return r.jsx(o,{member:e})}export{a as NamePage};
@@ -1 +1 @@
1
- import{j as t,l as s}from"./index-bYhLX3oQ.js";function o({member:i}){var e;const n=((e=i.agent)==null?void 0:e.manifestId)??null;return n===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are kept per agent, and this profile is not one."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:n},emptyLabel:`${i.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
1
+ import{j as t,l as s}from"./index-BCGiD7pg.js";function o({member:i}){var e;const n=((e=i.agent)==null?void 0:e.manifestId)??null;return n===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are kept per agent, and this profile is not one."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:n},emptyLabel:`${i.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
@@ -1 +1 @@
1
- import{m as i,j as s,n as r,o as a}from"./index-bYhLX3oQ.js";function d({member:t}){var n;const e=i((n=t.agent)==null?void 0:n.runtime),o=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[o?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s runtime can’t use DorkOS tools, so these settings don’t change anything for it."}),s.jsx(r,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(a,{agentId:t.id})]})]})}export{d as PermissionsPage};
1
+ import{m as i,j as s,n as r,o as a}from"./index-BCGiD7pg.js";function d({member:t}){var n;const e=i((n=t.agent)==null?void 0:n.runtime),o=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[o?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s runtime can’t use DorkOS tools, so these settings don’t change anything for it."}),s.jsx(r,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(a,{agentId:t.id})]})]})}export{d as PermissionsPage};
@@ -1 +1 @@
1
- import{u as o,j as t,a as i,z as u}from"./index-bYhLX3oQ.js";import{u as l}from"./use-personality-commit-ClM-Ahk5.js";import"./soul-file-C_AT0A8U.js";function f({member:r}){const{agent:e,isPending:a,update:n}=o(r),s=l(e,n);return a?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(u,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{f as PersonalityPopover};
1
+ import{u as o,j as t,a as i,z as u}from"./index-BCGiD7pg.js";import{u as l}from"./use-personality-commit-Dsy9tqWY.js";import"./soul-file-DcQD5pcS.js";function f({member:r}){const{agent:e,isPending:a,update:n}=o(r),s=l(e,n);return a?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(u,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{f as PersonalityPopover};
@@ -0,0 +1 @@
1
+ import{j as t,k as r}from"./index-BCGiD7pg.js";function i({member:o}){return t.jsx(r,{member:o})}export{i as PhotoPage};
@@ -1 +1 @@
1
- import{e as d,f as l,j as e,a as m,g as u,C as c,M as x,H as f}from"./index-bYhLX3oQ.js";function h({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(x,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function g(s){return s===1?"1 member":`${s} members`}function j({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You are":`${s.displayName} is`," not in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(h,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:g(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({to:"/channels",search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{j as RoomsPage};
1
+ import{e as d,f as l,j as e,a as m,g as u,C as c,M as x,H as f}from"./index-BCGiD7pg.js";function h({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(x,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function g(s){return s===1?"1 member":`${s} members`}function j({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You are":`${s.displayName} is`," not in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(h,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:g(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({to:"/channels",search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{j as RoomsPage};
@@ -1 +1 @@
1
- import{r as E,j as e,aP as ce,cL as de,J as ue,al as b,d9 as G,da as J,db as Y,dc as F,dd as Z,de as fe,af as pe,aj as me,df as xe,dg as ee,dh as he,di as te,dj as ge,dk as be,dl as je,dm as ve,dn as Ne,dp as T,dq as Se,dr as S,ds as Ee,dt as se,aR as ye,u as Ce,a as we,du as ke,dv as Ae,dw as Te,dx as Le,dy as Ie,dz as Pe}from"./index-bYhLX3oQ.js";const $e={duration:.12,ease:"easeOut"},_e={type:"spring",stiffness:320,damping:28};function ae({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:o,className:n,"data-testid":d}){const[f,m]=E.useState(!1),r=a?"set here":`server default · ${l??"none"}`,s=a&&!!i,p=e.jsxs("span",{className:b("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",o?G.warning:G.neutral,s&&"hover:bg-accent hover:text-accent-foreground transition-colors",n),"data-testid":d,children:[o&&e.jsx(ce,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(de,{mode:"wait",initial:!1,children:e.jsx(ue.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:_e},exit:{opacity:0},transition:$e,children:r},r)})]});return s?e.jsxs(J,{open:f,onOpenChange:m,children:[e.jsx(Y,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${o?`: ${o}`:""}`,children:p})}),e.jsxs(F,{className:"w-64 p-2",align:"start",children:[e.jsx(Z,{children:"Where this value comes from"}),o&&e.jsx("p",{className:b("px-2 pt-1 text-xs",fe.warning),children:o}),e.jsxs("button",{type:"button",onClick:()=>{i(),m(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"the runtime picks, nothing is set"})]})]})]}):o?e.jsx("span",{title:o,"aria-label":`${r}: ${o}`,children:p}):p}const Me=["agents"];function Oe(a){const l=pe(),i=me();return xe({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:o=>l.updateMeshAgent(o.id,o.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:Me})}})}const ne="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function k({label:a,valueLabel:l,options:i,selected:o,isSetHere:n,serverDefault:d,warning:f,onSelect:m,onInherit:r,testId:s,showHeader:p=!0,className:y,describedBy:h}){const N=ee(),[g,c]=E.useState(!1);return e.jsxs("div",{className:b("space-y-1",y),children:[p&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:a}),!N&&e.jsx(ae,{isSetHere:n,serverDefault:d,warning:f,onUseServerDefault:r,"data-testid":`${s}-chip`})]}),e.jsxs(J,{open:g,onOpenChange:c,children:[e.jsx(Y,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...h?{"aria-describedby":h}:{},"data-testid":s,children:[e.jsx("span",{className:b("truncate",f?"text-status-warning-fg":n?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(ye,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(F,{className:"w-64 p-1",align:"start",children:[e.jsx(Z,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(u=>e.jsxs("button",{type:"button","data-testid":`${s}-option-${u.value}`,onClick:()=>{m(u.value),c(!1)},className:b("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",u.value===o&&"bg-accent"),children:[u.label,u.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:u.hint})]},u.value))}),e.jsx("button",{type:"button",onClick:()=>{r(),c(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${s}-inherit`,children:d?`Using server default: ${d}. Tap to restore`:"Use server default: the runtime picks"})]})]})]})}function He({agent:a,onUpdate:l,className:i}){var z,K,Q,V,B,W;const o=ee(),{data:n}=he(),{data:d,isPending:f}=te(),m=((z=n==null?void 0:n.executionDefaults)==null?void 0:z.runtime)??"claude-code",r=a.runtime??m,s=(K=n==null?void 0:n.executionDefaults)==null?void 0:K.perRuntime.find(t=>t.runtime===r),{data:p}=ge({runtime:r}),y=a.model!=null,h=a.effort!=null,N=(s==null?void 0:s.model)??null,g=a.model??N,c=g?(p??[]).find(t=>t.value===g):void 0,u=(s==null?void 0:s.supportsEffort)??((Q=be(d,r))==null?void 0:Q.supportsEffort),L=u===void 0&&f,I=u!==!1,P=c?c.supportsEffort??!1:void 0,C=(V=n==null?void 0:n.claudeCode)==null?void 0:V.accounts,{nameFor:$}=je(),x=C==null?void 0:C.flatMap(t=>t.id===null?[]:[{id:t.id,label:$(t.path),path:t.path}]),j=a.account??null,_=j!==null,M=n!=null&&n.claudeCode?$(n.claudeCode.resolvedAccount):null,O=Oe({errorLabel:"Couldn’t change this agent’s account"}),H=E.useCallback(t=>{O.mutate({id:a.id,updates:{account:t}})},[a.id,O]),le=ve({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:m,serverDefaultModel:N,knownModels:Ne(p),knownAccounts:x,accountsUnavailable:(B=n==null?void 0:n.claudeCode)==null?void 0:B.accountsUnavailable,modelSupportsEffort:P,runtimeSupportsEffort:u,runtimeLabel:t=>T(t).label}),v=t=>{var X;return((X=le.breakages.find(ie=>t.includes(ie.kind)))==null?void 0:X.message)??null},w=!L&&I&&P!==!1,U=a.effort??(s==null?void 0:s.effort)??null,D=T(r).label,oe=r==="claude-code"&&x!==void 0&&(x.length>1||_),re=v(["account-unregistered"]),R=(p??[]).some(t=>t.unverified),q=E.useId();return e.jsxs("div",{className:b("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(k,{label:"Model",valueLabel:(c==null?void 0:c.displayName)??g??"Automatic",options:[...(p??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:g,isSetHere:y,serverDefault:(s==null?void 0:s.model)??null,warning:v(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:R?q:void 0}),R&&e.jsx(Se,{id:q})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:"Effort"}),(!o||!w)&&(h||w)&&e.jsx(ae,{isSetHere:h,serverDefault:s!=null&&s.effort?S(s.effort):null,warning:v(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),L?e.jsx(A,{testId:"agent-effort-pending",text:`Checking what ${D} supports`,warning:null}):I?w?e.jsx(k,{label:"Effort",valueLabel:S(U),options:Ee.filter(t=>!(c!=null&&c.supportedEffortLevels)||c.supportedEffortLevels.includes(t)).map(t=>({value:t,label:S(t)})),selected:U,isSetHere:h,serverDefault:s!=null&&s.effort?S(s.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(A,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:v(["effort-unsupported-model"])}):e.jsx(A,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${D}`,warning:v(["effort-unsupported-runtime"])})]}),oe&&e.jsx(k,{label:"Account",valueLabel:j!==null?((W=x==null?void 0:x.find(t=>t.id===j))==null?void 0:W.label)??j:M??"Default account",options:(x??[]).map(t=>({value:t.id,label:t.label,hint:se(t.path)})),selected:j,isSetHere:_,serverDefault:M,warning:re,onSelect:t=>H(t),onInherit:()=>H(null),testId:"agent-account-row",className:"col-span-full"})]})}function A({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const Ue="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function Re({member:a}){const{agent:l,projectPath:i,isPending:o,update:n}=Ce(a),{data:d}=te();if(o)return e.jsx(we,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const f=d?Object.keys(d.capabilities):[l.runtime],m=f.includes(l.runtime)?f:[l.runtime,...f];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:Ue,children:"Runtime"}),e.jsxs(ke,{value:l.runtime??"claude-code",onValueChange:r=>n({runtime:r}),children:[e.jsx(Ae,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Te,{})}),e.jsx(Le,{children:m.map(r=>e.jsx(Ie,{value:r,responsive:!1,children:T(r).label},r))})]})]}),e.jsx(He,{agent:l,onUpdate:n,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Pe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:se(i)})]})]})}export{Re as RunsOnPopover};
1
+ import{r as E,j as e,cU as ce,cs as de,J as ue,al as b,db as G,dc as J,dd as Y,de as F,df as Z,dg as fe,af as pe,aj as me,dh as xe,di as ee,dj as he,dk as te,dl as ge,dm as be,dn as je,dp as ve,dq as Ne,dr as T,ds as Se,dt as S,du as Ee,dv as se,cW as ye,u as Ce,a as we,dw as ke,dx as Ae,dy as Te,dz as Le,dA as Ie,dB as Pe}from"./index-BCGiD7pg.js";const $e={duration:.12,ease:"easeOut"},_e={type:"spring",stiffness:320,damping:28};function ae({isSetHere:a,serverDefault:l,onUseServerDefault:i,warning:o,className:n,"data-testid":d}){const[f,m]=E.useState(!1),r=a?"set here":`server default · ${l??"none"}`,s=a&&!!i,p=e.jsxs("span",{className:b("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",o?G.warning:G.neutral,s&&"hover:bg-accent hover:text-accent-foreground transition-colors",n),"data-testid":d,children:[o&&e.jsx(ce,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(de,{mode:"wait",initial:!1,children:e.jsx(ue.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:_e},exit:{opacity:0},transition:$e,children:r},r)})]});return s?e.jsxs(J,{open:f,onOpenChange:m,children:[e.jsx(Y,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${o?`: ${o}`:""}`,children:p})}),e.jsxs(F,{className:"w-64 p-2",align:"start",children:[e.jsx(Z,{children:"Where this value comes from"}),o&&e.jsx("p",{className:b("px-2 pt-1 text-xs",fe.warning),children:o}),e.jsxs("button",{type:"button",onClick:()=>{i(),m(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":d?`${d}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"the runtime picks, nothing is set"})]})]})]}):o?e.jsx("span",{title:o,"aria-label":`${r}: ${o}`,children:p}):p}const Me=["agents"];function Oe(a){const l=pe(),i=me();return xe({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:o=>l.updateMeshAgent(o.id,o.updates),onSuccess:()=>{i.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{i.invalidateQueries({queryKey:Me})}})}const ne="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function k({label:a,valueLabel:l,options:i,selected:o,isSetHere:n,serverDefault:d,warning:f,onSelect:m,onInherit:r,testId:s,showHeader:p=!0,className:y,describedBy:h}){const N=ee(),[g,c]=E.useState(!1);return e.jsxs("div",{className:b("space-y-1",y),children:[p&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:a}),!N&&e.jsx(ae,{isSetHere:n,serverDefault:d,warning:f,onUseServerDefault:r,"data-testid":`${s}-chip`})]}),e.jsxs(J,{open:g,onOpenChange:c,children:[e.jsx(Y,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...h?{"aria-describedby":h}:{},"data-testid":s,children:[e.jsx("span",{className:b("truncate",f?"text-status-warning-fg":n?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(ye,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(F,{className:"w-64 p-1",align:"start",children:[e.jsx(Z,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:i.map(u=>e.jsxs("button",{type:"button","data-testid":`${s}-option-${u.value}`,onClick:()=>{m(u.value),c(!1)},className:b("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",u.value===o&&"bg-accent"),children:[u.label,u.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:u.hint})]},u.value))}),e.jsx("button",{type:"button",onClick:()=>{r(),c(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${s}-inherit`,children:d?`Using server default: ${d}. Tap to restore`:"Use server default: the runtime picks"})]})]})]})}function Ue({agent:a,onUpdate:l,className:i}){var z,B,K,Q,V,W;const o=ee(),{data:n}=he(),{data:d,isPending:f}=te(),m=((z=n==null?void 0:n.executionDefaults)==null?void 0:z.runtime)??"claude-code",r=a.runtime??m,s=(B=n==null?void 0:n.executionDefaults)==null?void 0:B.perRuntime.find(t=>t.runtime===r),{data:p}=ge({runtime:r}),y=a.model!=null,h=a.effort!=null,N=(s==null?void 0:s.model)??null,g=a.model??N,c=g?(p??[]).find(t=>t.value===g):void 0,u=(s==null?void 0:s.supportsEffort)??((K=be(d,r))==null?void 0:K.supportsEffort),L=u===void 0&&f,I=u!==!1,P=c?c.supportsEffort??!1:void 0,C=(Q=n==null?void 0:n.claudeCode)==null?void 0:Q.accounts,{nameFor:$}=je(),x=C==null?void 0:C.flatMap(t=>t.id===null?[]:[{id:t.id,label:$(t.path),path:t.path}]),j=a.account??null,_=j!==null,M=n!=null&&n.claudeCode?$(n.claudeCode.resolvedAccount):null,O=Oe({errorLabel:"Couldn’t change this agent’s account"}),U=E.useCallback(t=>{O.mutate({id:a.id,updates:{account:t}})},[a.id,O]),le=ve({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:m,serverDefaultModel:N,knownModels:Ne(p),knownAccounts:x,accountsUnavailable:(V=n==null?void 0:n.claudeCode)==null?void 0:V.accountsUnavailable,modelSupportsEffort:P,runtimeSupportsEffort:u,runtimeLabel:t=>T(t).label}),v=t=>{var X;return((X=le.breakages.find(ie=>t.includes(ie.kind)))==null?void 0:X.message)??null},w=!L&&I&&P!==!1,H=a.effort??(s==null?void 0:s.effort)??null,D=T(r).label,oe=r==="claude-code"&&x!==void 0&&(x.length>1||_),re=v(["account-unregistered"]),R=(p??[]).some(t=>t.unverified),q=E.useId();return e.jsxs("div",{className:b("grid grid-cols-2 gap-3",i),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(k,{label:"Model",valueLabel:(c==null?void 0:c.displayName)??g??"Automatic",options:[...(p??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:g,isSetHere:y,serverDefault:(s==null?void 0:s.model)??null,warning:v(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:R?q:void 0}),R&&e.jsx(Se,{id:q})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:"Effort"}),(!o||!w)&&(h||w)&&e.jsx(ae,{isSetHere:h,serverDefault:s!=null&&s.effort?S(s.effort):null,warning:v(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),L?e.jsx(A,{testId:"agent-effort-pending",text:`Checking what ${D} supports`,warning:null}):I?w?e.jsx(k,{label:"Effort",valueLabel:S(H),options:Ee.filter(t=>!(c!=null&&c.supportedEffortLevels)||c.supportedEffortLevels.includes(t)).map(t=>({value:t,label:S(t)})),selected:H,isSetHere:h,serverDefault:s!=null&&s.effort?S(s.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(A,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:v(["effort-unsupported-model"])}):e.jsx(A,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${D}`,warning:v(["effort-unsupported-runtime"])})]}),oe&&e.jsx(k,{label:"Account",valueLabel:j!==null?((W=x==null?void 0:x.find(t=>t.id===j))==null?void 0:W.label)??j:M??"Default account",options:(x??[]).map(t=>({value:t.id,label:t.label,hint:se(t.path)})),selected:j,isSetHere:_,serverDefault:M,warning:re,onSelect:t=>U(t),onInherit:()=>U(null),testId:"agent-account-row",className:"col-span-full"})]})}function A({text:a,warning:l,testId:i}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":i,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const He="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function Re({member:a}){const{agent:l,projectPath:i,isPending:o,update:n}=Ce(a),{data:d}=te();if(o)return e.jsx(we,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const f=d?Object.keys(d.capabilities):[l.runtime],m=f.includes(l.runtime)?f:[l.runtime,...f];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:He,children:"Runtime"}),e.jsxs(ke,{value:l.runtime??"claude-code",onValueChange:r=>n({runtime:r}),children:[e.jsx(Ae,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Te,{})}),e.jsx(Le,{children:m.map(r=>e.jsx(Ie,{value:r,responsive:!1,children:T(r).label},r))})]})]}),e.jsx(Ue,{agent:l,onUpdate:n,className:"grid-cols-1"}),i&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Pe,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:se(i)})]})]})}export{Re as RunsOnPopover};