agentinbox-cli 0.0.0 → 0.1.0-nightly.10

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 (176) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +337 -0
  3. package/dist/admin-CXkmdTYo.js +196 -0
  4. package/dist/admin-CXkmdTYo.js.map +1 -0
  5. package/dist/audit-bItbJYFP.js +65 -0
  6. package/dist/audit-bItbJYFP.js.map +1 -0
  7. package/dist/audit-gVdDzkAE.js +2 -0
  8. package/dist/auth-0NrMvHdE.js +550 -0
  9. package/dist/auth-0NrMvHdE.js.map +1 -0
  10. package/dist/auth-CoHvbWgO.js +2 -0
  11. package/dist/bus-Cz0flS37.js +12 -0
  12. package/dist/bus-Cz0flS37.js.map +1 -0
  13. package/dist/bus-OKIGut72.js +2 -0
  14. package/dist/cli.js +220 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/commands-DZ60j8_y.js +103 -0
  17. package/dist/commands-DZ60j8_y.js.map +1 -0
  18. package/dist/config-CIvgMqLx.js +2 -0
  19. package/dist/config-v975gxv4.js +44 -0
  20. package/dist/config-v975gxv4.js.map +1 -0
  21. package/dist/connect-BHC2trBi.js +292 -0
  22. package/dist/connect-BHC2trBi.js.map +1 -0
  23. package/dist/content-BXblC_Qs.js +1162 -0
  24. package/dist/content-BXblC_Qs.js.map +1 -0
  25. package/dist/content-worker.js +28 -0
  26. package/dist/content-worker.js.map +1 -0
  27. package/dist/crypto-DYZ4R7c2.js +74 -0
  28. package/dist/crypto-DYZ4R7c2.js.map +1 -0
  29. package/dist/db-B6gLQGBK.js +2 -0
  30. package/dist/db-D0gvshCc.js +282 -0
  31. package/dist/db-D0gvshCc.js.map +1 -0
  32. package/dist/errors-FbMS3QBo.js +39 -0
  33. package/dist/errors-FbMS3QBo.js.map +1 -0
  34. package/dist/filter-DGVz6-P1.js +140 -0
  35. package/dist/filter-DGVz6-P1.js.map +1 -0
  36. package/dist/instance-BBzEsYZO.js +175 -0
  37. package/dist/instance-BBzEsYZO.js.map +1 -0
  38. package/dist/instance-DLNTj9nm.js +2 -0
  39. package/dist/listen-D8DkEhqM.js +1724 -0
  40. package/dist/listen-D8DkEhqM.js.map +1 -0
  41. package/dist/listen-DT-omyD6.js +2 -0
  42. package/dist/mcpheader-By2dIyZq.js +2 -0
  43. package/dist/mcpheader-D9rrI-aa.js +65 -0
  44. package/dist/mcpheader-D9rrI-aa.js.map +1 -0
  45. package/dist/mcpsetup-7KxroOCp.js +2 -0
  46. package/dist/mcpsetup-DJ7ebFGJ.js +266 -0
  47. package/dist/mcpsetup-DJ7ebFGJ.js.map +1 -0
  48. package/dist/paths-BCBp8vrG.js +2 -0
  49. package/dist/paths-TLp8hiMt.js +40 -0
  50. package/dist/paths-TLp8hiMt.js.map +1 -0
  51. package/dist/profile-CgGgJ4Dm.js +181 -0
  52. package/dist/profile-CgGgJ4Dm.js.map +1 -0
  53. package/dist/profile-RbN2FRz7.js +2 -0
  54. package/dist/recipes-7d_Xws4M.js +2 -0
  55. package/dist/recipes-UalOc_LB.js +100 -0
  56. package/dist/recipes-UalOc_LB.js.map +1 -0
  57. package/dist/send-Dk-t8ia-.js +108 -0
  58. package/dist/send-Dk-t8ia-.js.map +1 -0
  59. package/dist/server-Hunjpt8n.js +8103 -0
  60. package/dist/server-Hunjpt8n.js.map +1 -0
  61. package/dist/service-BAgZDh22.js +2 -0
  62. package/dist/service-DYdD92CC.js +2 -0
  63. package/dist/service-D_ZEs3Zk.js +508 -0
  64. package/dist/service-D_ZEs3Zk.js.map +1 -0
  65. package/dist/service-whbugeQp.js +295 -0
  66. package/dist/service-whbugeQp.js.map +1 -0
  67. package/dist/settings-CeEsv4CE.js +2 -0
  68. package/dist/settings-DLUStIN7.js +109 -0
  69. package/dist/settings-DLUStIN7.js.map +1 -0
  70. package/dist/setup-token-BO89xnpb.js +48 -0
  71. package/dist/setup-token-BO89xnpb.js.map +1 -0
  72. package/dist/skill/SKILL.md +277 -0
  73. package/dist/skill-BJFn2bHK.js +2 -0
  74. package/dist/skill-WKbeyNct.js +43 -0
  75. package/dist/skill-WKbeyNct.js.map +1 -0
  76. package/dist/types-3eEsBFVj.js +37 -0
  77. package/dist/types-3eEsBFVj.js.map +1 -0
  78. package/dist/ui-B8Sd4Y7Y.js +81 -0
  79. package/dist/ui-B8Sd4Y7Y.js.map +1 -0
  80. package/dist/urls-Dp8pBGMU.js +2 -0
  81. package/dist/urls-U_LfYV61.js +27 -0
  82. package/dist/urls-U_LfYV61.js.map +1 -0
  83. package/dist/web/assets/_agentId-DAj08NDq.js +1 -0
  84. package/dist/web/assets/_app-B6q_HS9y.js +1 -0
  85. package/dist/web/assets/_app-CAQ6Mu1s.js +63 -0
  86. package/dist/web/assets/_webhookId-CMgBUN2Z.js +1 -0
  87. package/dist/web/assets/account-status-omoUlgBI.js +1 -0
  88. package/dist/web/assets/accounts-DyLfACj_.js +1 -0
  89. package/dist/web/assets/accounts-list-DiXACW0-.js +1 -0
  90. package/dist/web/assets/activity-zrckFhPk.js +1 -0
  91. package/dist/web/assets/agent-create-form-DKwaY1Dg.js +1 -0
  92. package/dist/web/assets/agents-Drvjccgt.js +1 -0
  93. package/dist/web/assets/approvals-4kd0_J8X.js +2 -0
  94. package/dist/web/assets/arrow-left-DVJV4Zx7.js +1 -0
  95. package/dist/web/assets/arrow-right-4PFX6MSS.js +1 -0
  96. package/dist/web/assets/audit-76H45orR.js +1 -0
  97. package/dist/web/assets/audit-bits-B1We-fQ3.js +1 -0
  98. package/dist/web/assets/bot-DVw15lBn.js +1 -0
  99. package/dist/web/assets/card-EQTpqntn.js +1 -0
  100. package/dist/web/assets/checkbox-DDZZurgK.js +1 -0
  101. package/dist/web/assets/chevron-down-892ylB4R.js +1 -0
  102. package/dist/web/assets/chevron-right-CbBKS6-T.js +1 -0
  103. package/dist/web/assets/chips-input--xgMZpg2.js +1 -0
  104. package/dist/web/assets/circle-x-Bi4IGwky.js +1 -0
  105. package/dist/web/assets/common-PG6weTqi.js +1 -0
  106. package/dist/web/assets/connect-host-DdkOJnMu.js +1 -0
  107. package/dist/web/assets/data-table-Ca9aQZKR.js +1 -0
  108. package/dist/web/assets/dialog-CxNRCZdE.js +1 -0
  109. package/dist/web/assets/dist-B0e3Ju3r.js +1 -0
  110. package/dist/web/assets/empty-CE_WZGEC.js +1 -0
  111. package/dist/web/assets/es2015-DPaldoxG.js +41 -0
  112. package/dist/web/assets/event-row-2xoyzgbP.js +1 -0
  113. package/dist/web/assets/events-Bizq3DPC.js +1 -0
  114. package/dist/web/assets/eye-off-DjpaihHf.js +1 -0
  115. package/dist/web/assets/field-CcyMn3ey.js +1 -0
  116. package/dist/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  117. package/dist/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  118. package/dist/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  119. package/dist/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  120. package/dist/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  121. package/dist/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  122. package/dist/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  123. package/dist/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  124. package/dist/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  125. package/dist/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  126. package/dist/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  127. package/dist/web/assets/get-started-DXUVmyNX.js +1 -0
  128. package/dist/web/assets/grants-BhXj1Pew.js +1 -0
  129. package/dist/web/assets/index-Bd4Y5wSp.js +10 -0
  130. package/dist/web/assets/index-akvt_1UI.css +2 -0
  131. package/dist/web/assets/input-CMhmmHiH.js +1 -0
  132. package/dist/web/assets/input-group-DRs3TNaT.js +1 -0
  133. package/dist/web/assets/key-round-CVIZRCLM.js +1 -0
  134. package/dist/web/assets/labels-C_Pwium9.js +1 -0
  135. package/dist/web/assets/login-aCr-cPqJ.js +1 -0
  136. package/dist/web/assets/mail-CAVmuESo.js +1 -0
  137. package/dist/web/assets/mutations-DVlbDx0M.js +1 -0
  138. package/dist/web/assets/paperclip-QFjM4y6n.js +1 -0
  139. package/dist/web/assets/password-input-_m9Ycphv.js +1 -0
  140. package/dist/web/assets/pencil-Bf1JhsG0.js +1 -0
  141. package/dist/web/assets/play-DiPk49JH.js +1 -0
  142. package/dist/web/assets/plus-CETmK0SB.js +1 -0
  143. package/dist/web/assets/preload-helper-BFuRUfdt.js +1 -0
  144. package/dist/web/assets/progress-3ZOsbLSK.js +6 -0
  145. package/dist/web/assets/queries-a3M5_loa.js +2 -0
  146. package/dist/web/assets/refresh-cw-DOn9kD7g.js +1 -0
  147. package/dist/web/assets/search-gcYjitzV.js +1 -0
  148. package/dist/web/assets/select-C8tJBHb5.js +1 -0
  149. package/dist/web/assets/send-BhQwhuJo.js +1 -0
  150. package/dist/web/assets/settings-H7ExHD9L.js +1 -0
  151. package/dist/web/assets/settings-form-CNUionsI.js +1 -0
  152. package/dist/web/assets/setup-DLbH5Dvl.js +1 -0
  153. package/dist/web/assets/sheet-BQKpA2xa.js +1 -0
  154. package/dist/web/assets/shield-alert-CbFgd06X.js +1 -0
  155. package/dist/web/assets/stamp-CH2OvjH2.js +1 -0
  156. package/dist/web/assets/stream-C2Tr2d5O.js +1 -0
  157. package/dist/web/assets/tabs-ySiz7Mni.js +1 -0
  158. package/dist/web/assets/tag-CP72Kk6Y.js +1 -0
  159. package/dist/web/assets/test-connection-Bd2Gac0O.js +1 -0
  160. package/dist/web/assets/textarea-CCokBZIw.js +1 -0
  161. package/dist/web/assets/toggle-group-ne0pVDg6.js +1 -0
  162. package/dist/web/assets/trash-DxdMNg8B.js +1 -0
  163. package/dist/web/assets/use-sign-out-BuzlTb0Q.js +1 -0
  164. package/dist/web/assets/useInfiniteQuery-DE6WChlb.js +1 -0
  165. package/dist/web/assets/useMatch-BKUnm54_.js +1 -0
  166. package/dist/web/assets/useMutation-DeWvLw1a.js +1 -0
  167. package/dist/web/assets/useQuery-DAhf1YDH.js +1 -0
  168. package/dist/web/assets/useSelector-D70eKNYs.js +1 -0
  169. package/dist/web/assets/webhook-BWT75M78.js +1 -0
  170. package/dist/web/assets/webhook-sheet-Cy_jHIqG.js +34 -0
  171. package/dist/web/assets/webhooks-CTAj5Ovp.js +1 -0
  172. package/dist/web/assets/with-selector-CkNyXYMW.js +1 -0
  173. package/dist/web/assets/x-BHjDLXNO.js +1 -0
  174. package/dist/web/favicon.svg +1 -0
  175. package/dist/web/index.html +31 -0
  176. package/package.json +95 -1
@@ -0,0 +1 @@
1
+ import{B as e,G as t,f as n,ht as r,mt as i,n as a,o,pt as s,q as c,r as l,t as u,vt as d}from"./queries-a3M5_loa.js";import{t as f}from"./useQuery-DAhf1YDH.js";import{t as p}from"./useInfiniteQuery-DE6WChlb.js";import{n as m,t as h}from"./data-table-Ca9aQZKR.js";import{r as ee}from"./dist-B0e3Ju3r.js";import{t as te}from"./arrow-left-DVJV4Zx7.js";import{t as g}from"./bot-DVw15lBn.js";import{a as _,i as v,n as y,r as b,t as ne}from"./select-C8tJBHb5.js";import{c as re,i as x,o as ie,s as S}from"./toggle-group-ne0pVDg6.js";import{i as C,o as w,r as T,s as E,t as D}from"./card-EQTpqntn.js";import{A as ae,_ as O,k,n as A,o as j,r as oe,u as M,v as N}from"./common-PG6weTqi.js";import{n as se,t as ce}from"./trash-DxdMNg8B.js";import{t as P}from"./key-round-CVIZRCLM.js";import{t as F}from"./pencil-Bf1JhsG0.js";import{t as I}from"./send-BhQwhuJo.js";import{i as L,n as R,r as z,t as B}from"./webhook-sheet-Cy_jHIqG.js";import{l as V}from"./field-CcyMn3ey.js";import{D as H,E as U,O as W,T as G,k as le,t as ue,x as K}from"./index-Bd4Y5wSp.js";import{i as de,n as fe,o as pe,r as me,t as he}from"./empty-CE_WZGEC.js";import{a as q}from"./labels-C_Pwium9.js";import{t as J}from"./mutations-DVlbDx0M.js";var Y={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Y.node;var ge=t(Y),X=d(r(),1),Z=i(),Q=m();function _e(){return J({mutationFn:e=>o(`/api/deliveries/${encodeURIComponent(e.id)}/replay`,{method:`POST`}),invalidate:[u.deliveries,u.webhooks],success:e=>e.status===`succeeded`?`Replayed: delivered`:e.status===`pending`?`Replay queued`:`Replay ${q[e.status].label.toLowerCase()}`,errorTitle:`Couldn't replay`})}function $({delivery:e}){return(0,Z.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,Z.jsxs)(`dl`,{className:`grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Delivery`}),(0,Z.jsx)(`dd`,{className:`font-mono break-all`,children:e.id}),(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Event`}),(0,Z.jsxs)(`dd`,{className:`font-mono break-all`,children:[e.eventId,` · `,e.eventType]}),(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`First attempt`}),(0,Z.jsx)(`dd`,{children:O(e.createdAt)}),(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last update`}),(0,Z.jsx)(`dd`,{children:O(e.updatedAt)}),e.nextAttemptAt&&e.status===`pending`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Next retry`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(M,{date:e.nextAttemptAt})})]})]}),e.lastError&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Error`}),(0,Z.jsx)(`pre`,{className:`rounded-md border border-critical/30 bg-critical/5 p-2 font-mono text-xs whitespace-pre-wrap break-words`,children:e.lastError})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:[`Response body `,e.lastStatusCode!=null&&`(HTTP ${e.lastStatusCode})`]}),e.lastResponse?(0,Z.jsx)(`pre`,{className:`max-h-60 overflow-auto rounded-md border bg-background p-2 font-mono text-xs whitespace-pre-wrap break-words`,children:e.lastResponse}):(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`Empty`})]})]})}function ve({delivery:e}){let t=_e();return(0,Z.jsxs)(n,{variant:`ghost`,size:`sm`,disabled:t.isPending,onClick:()=>t.mutate(e),children:[t.isPending?(0,Z.jsx)(l,{}):(0,Z.jsx)(ge,{}),(0,Z.jsx)(`span`,{className:`hidden sm:inline`,children:`Replay`})]})}var ye=[Q.accessor(`status`,{header:`Status`,cell:e=>(0,Z.jsx)(x,{status:e.getValue()})}),Q.accessor(`eventType`,{header:`Event`,cell:e=>(0,Z.jsx)(`code`,{className:`font-mono text-xs`,children:e.getValue()}),meta:{className:`hidden md:table-cell`}}),Q.accessor(`lastStatusCode`,{header:`Code`,cell:t=>(0,Z.jsx)(`span`,{className:e(`font-mono tabular`,S(t.getValue())),children:t.getValue()??`—`})}),Q.accessor(`attempts`,{header:`Attempts`,cell:e=>(0,Z.jsx)(`span`,{className:`tabular`,children:e.getValue()}),meta:{className:`hidden text-right sm:table-cell`}}),Q.accessor(`durationMs`,{header:`Duration`,cell:e=>(0,Z.jsx)(`span`,{className:`text-muted-foreground tabular`,children:N(e.getValue())}),meta:{className:`hidden text-right sm:table-cell`}}),Q.accessor(`updatedAt`,{header:`When`,cell:e=>(0,Z.jsx)(M,{date:e.getValue(),className:`text-xs`})}),Q.display({id:`replay`,header:()=>(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`}),cell:e=>(0,Z.jsx)(ve,{delivery:e.row.original}),meta:{className:`w-0 text-right`}})];function be({webhookId:e}){let[t,r]=(0,X.useState)(),i=p(a.deliveries(e,t)),o=i.data?.pages.flatMap(e=>e.items)??[];return(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Delivery log`}),(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every attempt to deliver an event, newest first. Click a row for the response.`})]}),(0,Z.jsxs)(ne,{value:t??`all`,onValueChange:e=>r(e===`all`?void 0:e),children:[(0,Z.jsx)(v,{className:`w-40`,"aria-label":`Status`,children:(0,Z.jsx)(_,{})}),(0,Z.jsxs)(y,{children:[(0,Z.jsx)(b,{value:`all`,children:`All statuses`}),Object.keys(q).map(e=>(0,Z.jsx)(b,{value:e,children:q[e].label},e))]})]})]}),i.isPending?(0,Z.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,Z.jsx)(k,{className:`h-10`},e))}):i.isError?(0,Z.jsx)(j,{error:i.error,onRetry:()=>void i.refetch()}):(0,Z.jsx)(h,{columns:ye,data:o,getRowId:e=>e.id,rowClassName:e=>e.status===`dead`||e.status===`failed`?`bg-critical/5`:void 0,renderExpanded:e=>(0,Z.jsx)($,{delivery:e}),empty:t?(0,Z.jsxs)(Z.Fragment,{children:[`No `,q[t].label.toLowerCase(),` deliveries.`]}):(0,Z.jsxs)(Z.Fragment,{children:[`No deliveries yet. Use `,(0,Z.jsx)(ae,{variant:`outline`,children:`Send test`}),` to try the endpoint now.`]})}),i.hasNextPage&&(0,Z.jsx)(`div`,{className:`flex justify-center`,children:(0,Z.jsxs)(n,{variant:`outline`,onClick:()=>void i.fetchNextPage(),disabled:i.isFetchingNextPage,children:[i.isFetchingNextPage&&(0,Z.jsx)(l,{}),` Load older deliveries`]})})]})}function xe({webhookId:t}){let r=s(),[i,a]=(0,X.useState)(),[c,d]=(0,X.useState)(),[f,p]=(0,X.useState)(!1),m=async()=>{p(!0),d(void 0);try{a(await o(`/api/webhooks/${encodeURIComponent(t)}/test`,{method:`POST`})),r.invalidateQueries({queryKey:u.deliveries}),r.invalidateQueries({queryKey:u.webhooks})}catch(e){a(void 0),d(e)}finally{p(!1)}},h=i?.status===`succeeded`;return(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Z.jsxs)(n,{variant:`outline`,onClick:m,disabled:f,children:[f?(0,Z.jsx)(l,{}):(0,Z.jsx)(I,{}),` Send test event`]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Delivers a sample message.received payload, signed like the real thing.`})]}),c!==void 0&&(0,Z.jsx)(oe,{error:c,title:`Couldn't send the test`}),i&&(0,Z.jsxs)(`div`,{className:e(`space-y-3 rounded-lg border p-3`,h?`border-success/30 bg-success/5`:`border-critical/30 bg-critical/5`),children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm`,children:[(0,Z.jsx)(x,{status:i.status}),(0,Z.jsx)(`span`,{className:e(`font-mono`,S(i.lastStatusCode)),children:i.lastStatusCode==null?`No response`:`HTTP ${i.lastStatusCode}`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:N(i.durationMs)}),(0,Z.jsx)(`span`,{className:`font-medium`,children:h?`Your endpoint accepted it.`:`Your endpoint didn't accept it.`})]}),(0,Z.jsx)($,{delivery:i})]})]})}function Se(){let{webhookId:e}=ue.useParams(),t=f(a.webhooks()),r=t.data?.find(t=>t.id===e);return t.isPending?(0,Z.jsxs)(`div`,{className:`space-y-6`,children:[(0,Z.jsx)(k,{className:`h-16 w-80`}),(0,Z.jsx)(k,{className:`h-48 rounded-xl`})]}):t.isError?(0,Z.jsx)(j,{error:t.error,onRetry:()=>void t.refetch()}):r?(0,Z.jsx)(Ce,{webhook:r}):(0,Z.jsx)(D,{children:(0,Z.jsxs)(he,{children:[(0,Z.jsxs)(de,{children:[(0,Z.jsx)(pe,{children:`Webhook not found`}),(0,Z.jsx)(me,{children:`It may have been deleted.`})]}),(0,Z.jsx)(fe,{children:(0,Z.jsx)(n,{asChild:!0,children:(0,Z.jsx)(c,{to:`/webhooks`,children:`All webhooks`})})})]})})}function Ce({webhook:e}){let t=ee(),r=f(a.agents()),i=f(a.accounts()),[s,l]=(0,X.useState)(!1),[d,p]=(0,X.useState)(),m=r.data?.find(t=>t.id===e.agentId),h=`/api/webhooks/${encodeURIComponent(e.id)}`,_=J({mutationFn:e=>o(h,{method:`PATCH`,body:{enabled:e}}),invalidate:[u.webhooks],success:(e,t)=>t?`Webhook enabled`:`Webhook paused`,errorTitle:`Couldn't update the webhook`}),v=J({mutationFn:()=>o(`${h}/rotate-secret`,{method:`POST`}),invalidate:[u.webhooks],errorTitle:!1,onSuccess:e=>p(e.secret)}),y=J({mutationFn:()=>o(h,{method:`DELETE`}),invalidate:[u.webhooks],success:`Webhook "${e.name}" deleted`,errorTitle:!1,onSuccess:()=>void t({to:`/webhooks`})});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsx)(n,{variant:`ghost`,size:`sm`,asChild:!0,className:`-ml-2 text-muted-foreground`,children:(0,Z.jsxs)(c,{to:`/webhooks`,children:[(0,Z.jsx)(te,{}),` Webhooks`]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Z.jsx)(`h1`,{className:`truncate text-2xl font-semibold tracking-tight`,children:e.name}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[m&&(0,Z.jsxs)(c,{to:`/agents/$agentId`,params:{agentId:m.id},className:`flex items-center gap-1 hover:text-foreground hover:underline`,children:[(0,Z.jsx)(g,{className:`size-3.5`}),` `,m.name]}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-1 font-mono`,children:[(0,Z.jsx)(P,{className:`size-3.5`}),` `,e.secretPrefix,`…`]}),(0,Z.jsxs)(`span`,{children:[`Created `,(0,Z.jsx)(M,{date:e.createdAt})]})]}),(0,Z.jsx)(ie,{webhook:e,className:`pt-1`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(re,{id:`wh-enabled`,checked:e.enabled,disabled:_.isPending,onCheckedChange:e=>_.mutate(e)}),(0,Z.jsx)(V,{htmlFor:`wh-enabled`,children:e.enabled?`Enabled`:`Paused`})]}),(0,Z.jsxs)(n,{variant:`outline`,onClick:()=>l(!0),children:[(0,Z.jsx)(F,{}),` Edit`]}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(le,{asChild:!0,children:(0,Z.jsx)(n,{variant:`outline`,size:`icon`,"aria-label":`Webhook actions`,children:(0,Z.jsx)(se,{})})}),(0,Z.jsxs)(U,{align:`end`,className:`w-48`,children:[(0,Z.jsxs)(H,{onSelect:()=>K({title:`Rotate the signing secret?`,description:`A new secret is created and signatures made with the old one stop verifying. Update your receiver right after.`,confirmLabel:`Rotate secret`,onConfirm:()=>v.mutateAsync()}),children:[(0,Z.jsx)(P,{}),` Rotate secret…`]}),(0,Z.jsx)(W,{}),(0,Z.jsxs)(H,{variant:`destructive`,onSelect:()=>K({title:`Delete ${e.name}?`,description:`Pending retries are cancelled and the delivery log is removed. This can't be undone.`,confirmLabel:`Delete webhook`,destructive:!0,onConfirm:()=>y.mutateAsync()}),children:[(0,Z.jsx)(ce,{}),` Delete webhook…`]})]})]})]})]})]}),(0,Z.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,Z.jsxs)(D,{children:[(0,Z.jsxs)(w,{children:[(0,Z.jsx)(E,{children:`What it sends`}),(0,Z.jsx)(C,{children:`POSTs JSON to:`})]}),(0,Z.jsxs)(T,{className:`space-y-3`,children:[(0,Z.jsx)(A,{value:e.url}),(0,Z.jsx)(`ul`,{className:`list-disc space-y-1 pl-5 text-sm`,children:R(e,i.data??[]).map(e=>(0,Z.jsx)(`li`,{children:e},e))})]})]}),(0,Z.jsxs)(D,{children:[(0,Z.jsxs)(w,{children:[(0,Z.jsx)(E,{children:`Test it`}),(0,Z.jsx)(C,{children:`Check your endpoint is reachable and verifies the signature.`})]}),(0,Z.jsx)(T,{children:(0,Z.jsx)(xe,{webhookId:e.id})})]})]}),(0,Z.jsx)(be,{webhookId:e.id}),(0,Z.jsxs)(D,{children:[(0,Z.jsx)(w,{children:(0,Z.jsx)(E,{children:`Verifying signatures`})}),(0,Z.jsx)(T,{children:(0,Z.jsx)(L,{})})]}),(0,Z.jsx)(B,{open:s,onOpenChange:l,webhook:e}),(0,Z.jsx)(z,{secret:d,title:`New signing secret`,description:`The old secret no longer verifies. Update your receiver with this one.`,onClose:()=>p(void 0)})]})}export{Se as component};
@@ -0,0 +1 @@
1
+ import{mt as e}from"./queries-a3M5_loa.js";import{d as t}from"./common-PG6weTqi.js";import{b as n,v as r,y as i}from"./index-Bd4Y5wSp.js";import{t as a}from"./labels-C_Pwium9.js";var o=e();function s({status:e}){let s=a[e];return(0,o.jsxs)(r,{children:[(0,o.jsx)(n,{asChild:!0,children:(0,o.jsx)(`span`,{tabIndex:0,className:`rounded-4xl outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,o.jsx)(t,{tone:s.tone,children:s.label})})}),(0,o.jsx)(i,{children:s.description})]})}function c({email:e,className:t}){return(0,o.jsx)(`span`,{"aria-hidden":!0,className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-medium uppercase ${t??``}`,children:e.slice(0,1)})}export{s as n,c as t};
@@ -0,0 +1 @@
1
+ import{d as e,ht as t,mt as n,pt as r,t as i,vt as a}from"./queries-a3M5_loa.js";import{r as o}from"./dist-B0e3Ju3r.js";import{a as s}from"./common-PG6weTqi.js";import{n as c,t as l}from"./accounts-list-DiXACW0-.js";import{h as u}from"./index-Bd4Y5wSp.js";var d=a(t()),f=n();function p(){let{connected:t,error:n}=u.useSearch(),a=o({from:u.fullPath}),p=r();return(0,d.useEffect)(()=>{(t||n)&&(t&&e.success(`${t} is connected`,{description:`Mail starts syncing now.`}),n&&e.error(`Couldn't connect the account`,{description:n,duration:1e4}),p.invalidateQueries({queryKey:i.accounts}),a({search:{},replace:!0}))},[t,n,a,p]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s,{title:`Gmail accounts`,description:`Mailboxes agentinbox syncs. Credentials stay here; agents get access per account through grants.`,actions:(0,f.jsx)(c,{})}),(0,f.jsx)(l,{})]})}export{p as component};
@@ -0,0 +1 @@
1
+ import{G as e,f as t,mt as n,n as r,o as i,t as a}from"./queries-a3M5_loa.js";import{t as o}from"./useQuery-DAhf1YDH.js";import{t as s}from"./card-EQTpqntn.js";import{O as c,k as l,o as u,u as d}from"./common-PG6weTqi.js";import{n as f,t as p}from"./trash-DxdMNg8B.js";import{n as m,t as h}from"./play-DiPk49JH.js";import{t as g}from"./refresh-cw-DOn9kD7g.js";import{D as _,E as v,H as y,O as b,T as x,U as S,k as C,x as w}from"./index-Bd4Y5wSp.js";import{n as T}from"./connect-host-DdkOJnMu.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./empty-CE_WZGEC.js";import{n as M,t as N}from"./account-status-omoUlgBI.js";import{t as P}from"./mutations-DVlbDx0M.js";var F={name:`mail-plus`,size:24,node:[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M16 19h6`,key:`xwg31i`}]]};F.node;var I=e(F),L=[a.accounts,a.setupState,a.overview,a.agents],R=(e,t=``)=>`/api/accounts/${encodeURIComponent(e)}${t}`;function z(){return{resync:P({mutationFn:e=>i(R(e.id,`/resync`),{method:`POST`}),invalidate:L,success:(e,t)=>`Resync started for ${t.email}`,errorTitle:`Couldn't resync`}),pause:P({mutationFn:e=>i(R(e.id,`/pause`),{method:`POST`}),invalidate:L,success:(e,t)=>`${t.email} paused`,errorTitle:`Couldn't pause`}),resume:P({mutationFn:e=>i(R(e.id,`/resume`),{method:`POST`}),invalidate:L,success:(e,t)=>`${t.email} resumed`,errorTitle:`Couldn't resume`}),remove:P({mutationFn:e=>i(R(e.id),{method:`DELETE`}),invalidate:L,success:(e,t)=>`${t.email} removed`,errorTitle:!1})}}var B=n();function V({account:e,showWatch:n}){let{resync:r,pause:i,resume:a,remove:o}=z(),s=()=>T({reauthAccountId:e.id,email:e.email}),l=c(6e4),u=e.watchExpiresAt?new Date(e.watchExpiresAt).getTime()-l:null,E=u!==null&&u<432e5;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-center`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,B.jsx)(N,{email:e.email}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,B.jsx)(`span`,{className:`truncate font-medium`,children:e.email}),(0,B.jsx)(M,{status:e.status})]}),(0,B.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap gap-x-4 gap-y-0.5 text-xs text-muted-foreground`,children:[e.displayName&&(0,B.jsx)(`span`,{className:`truncate`,children:e.displayName}),(0,B.jsxs)(`span`,{children:[`Last sync `,(0,B.jsx)(d,{date:e.lastSyncAt,fallback:`never`})]}),n&&(0,B.jsxs)(`span`,{className:E?`text-warning`:void 0,children:[`Gmail watch `,u===null?``:u<0?`expired `:`renews `,(0,B.jsx)(d,{date:e.watchExpiresAt,fallback:`not set`})]}),(0,B.jsxs)(`span`,{children:[`Connected `,(0,B.jsx)(d,{date:e.createdAt})]})]}),e.lastError&&(0,B.jsxs)(`p`,{className:`mt-1.5 flex items-start gap-1.5 text-xs text-critical`,children:[(0,B.jsx)(S,{className:`mt-px size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`break-words`,children:e.lastError})]})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 self-end sm:self-center`,children:[e.status===`needs_reauth`&&(0,B.jsxs)(t,{size:`sm`,onClick:s,children:[(0,B.jsx)(y,{}),` Reconnect`]}),e.status===`paused`&&(0,B.jsxs)(t,{size:`sm`,variant:`outline`,disabled:a.isPending,onClick:()=>a.mutate(e),children:[(0,B.jsx)(h,{}),` Resume`]}),(0,B.jsxs)(x,{children:[(0,B.jsx)(C,{asChild:!0,children:(0,B.jsx)(t,{variant:`ghost`,size:`icon-sm`,"aria-label":`Actions for ${e.email}`,children:(0,B.jsx)(f,{})})}),(0,B.jsxs)(v,{align:`end`,className:`w-48`,children:[(0,B.jsxs)(_,{onSelect:s,children:[(0,B.jsx)(y,{}),` Reconnect`]}),(0,B.jsxs)(_,{disabled:e.status===`paused`,onSelect:()=>r.mutate(e),children:[(0,B.jsx)(g,{}),` Resync now`]}),e.status===`paused`?(0,B.jsxs)(_,{onSelect:()=>a.mutate(e),children:[(0,B.jsx)(h,{}),` Resume`]}):(0,B.jsxs)(_,{onSelect:()=>i.mutate(e),children:[(0,B.jsx)(m,{}),` Pause`]}),(0,B.jsx)(b,{}),(0,B.jsxs)(_,{variant:`destructive`,onSelect:()=>w({title:`Remove ${e.email}?`,destructive:!0,confirmLabel:`Remove account`,description:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{children:`agentinbox stops syncing this mailbox, revokes its Google token and deletes every agent grant for it. Agents lose access immediately.`}),(0,B.jsx)(`p`,{children:`Mail in Gmail isn't touched. You can connect the account again later, but you'll need to recreate its grants.`})]}),onConfirm:()=>o.mutateAsync(e)}),children:[(0,B.jsx)(p,{}),` Remove…`]})]})]})]})]})}function H({label:e=`Connect Gmail account`,variant:n=`default`}){return(0,B.jsxs)(t,{variant:n,onClick:()=>T(),children:[(0,B.jsx)(I,{}),` `,e]})}function U(){let e=o(r.accounts()),t=o(r.settings()).data?.ingestMode===`pubsub`;return e.isPending?(0,B.jsx)(s,{className:`gap-0 divide-y py-0`,children:[0,1].map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,B.jsx)(l,{className:`size-9 rounded-full`}),(0,B.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,B.jsx)(l,{className:`h-4 w-48`}),(0,B.jsx)(l,{className:`h-3 w-64`})]})]},e))}):e.isError?(0,B.jsx)(u,{error:e.error,onRetry:()=>void e.refetch()}):e.data.length?(0,B.jsx)(s,{className:`gap-0 divide-y py-0`,children:e.data.map(e=>(0,B.jsx)(V,{account:e,showWatch:t},e.id))}):(0,B.jsx)(s,{children:(0,B.jsxs)(j,{children:[(0,B.jsxs)(D,{children:[(0,B.jsx)(E,{variant:`icon`,children:(0,B.jsx)(I,{})}),(0,B.jsx)(k,{children:`No Gmail accounts yet`}),(0,B.jsx)(A,{children:`Connect a mailbox to start syncing mail. agentinbox holds the credentials; agents only get the access you grant them.`})]}),(0,B.jsx)(O,{children:(0,B.jsx)(H,{})})]})})}export{H as n,I as r,U as t};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{A as e,B as t,M as n,N as r,f as i,ht as a,k as o,mt as s,n as c,o as l,r as u,t as d,v as f,vt as p,z as m}from"./queries-a3M5_loa.js";import{t as h}from"./useQuery-DAhf1YDH.js";import{t as g}from"./dist-B0e3Ju3r.js";import{r as _}from"./common-PG6weTqi.js";import{t as v}from"./checkbox-DDZZurgK.js";import{a as y,i as b,n as x,o as S,r as C,s as w,t as T}from"./field-CcyMn3ey.js";import{A as E,M as D,j as O}from"./index-Bd4Y5wSp.js";import{t as k}from"./textarea-CCokBZIw.js";import{t as ee}from"./input-CMhmmHiH.js";import{t as A}from"./mutations-DVlbDx0M.js";import{d as j,n as M,r as N}from"./grants-BhXj1Pew.js";var P=p(a(),1),F=s(),I=Object.defineProperty,L=(e,t)=>I(e,`name`,{value:t,configurable:!0}),R=`Radio`,[z,B]=n(R),[V,H]=z(R);function U(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,f]=P.useState(null),[p,m]=P.useState(null),[h,g]=P.useState(null),_={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,userClick:h,onUserClick:g,isFormControl:!d||!!a||!!d.closest(`form`),bubbleInput:p,setBubbleInput:m,onCheck:L(()=>s?.(),`onCheck`)};return(0,F.jsx)(V,{scope:t,..._,children:W(u)?u(_):r})}L(U,`RadioProvider`);var te=`RadioTrigger`,ne=P.forwardRef(L(function({__scopeRadio:t,onClick:n,...i},a){let{checked:o,disabled:s,value:c,setControl:l,onCheck:u,onUserClick:d,isFormControl:f,bubbleInput:p}=H(te,t),h=m(a,l);return(0,F.jsx)(r.button,{type:`button`,role:`radio`,"aria-checked":o,"data-state":G(o),"data-disabled":s?``:void 0,disabled:s,value:c,...i,ref:h,onClick:e(n,e=>{let t=e.isPropagationStopped();o||(d({hasConsumerStoppedPropagation:t}),u()),p&&f&&(t||e.stopPropagation())})})},`RadioTrigger`)),re=`RadioBubbleInput`,ie=P.forwardRef(L(function({__scopeRadio:t,onClick:n,...i},a){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:p,bubbleInput:h,setBubbleInput:g,userClick:_}=H(re,t),v=m(a,g),y=f(o),b=P.useRef(!1),x=P.useRef(s),S=P.useRef(_),C=P.useRef(null);P.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=x.current!==s;x.current=s;let i=_!==null&&_!==S.current;if(S.current=_,i)C.current=r?null:_,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!_.hasConsumerStoppedPropagation}));else if(r){let t=C.current;C.current=null;let r=s&&t!==null;b.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),b.current=!1}},[h,s,_]);let w=P.useRef(s);return(0,F.jsx)(r.input,{type:`radio`,"aria-hidden":!0,defaultChecked:w.current,required:c,disabled:l,name:u,value:d,form:p,...i,tabIndex:-1,ref:v,onClick:e(n,e=>{b.current&&e.stopPropagation()}),style:{...i.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function W(e){return typeof e==`function`}L(W,`isFunction`);function G(e){return e?`checked`:`unchecked`}L(G,`getState`);var K=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],q=`RadioGroup`,[J,ae]=n(q,[D,B]),Y=D(),X=B(),[oe,se]=J(q),Z=P.forwardRef(L(function(e,t){let{__scopeRadioGroup:n,name:i,form:a,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:h,..._}=e,v=Y(n),y=g(f),[b,x]=o({prop:c,defaultProp:s??null,onChange:h,caller:q}),[S,C]=P.useState(null),w=m(t,C),T=P.useRef(b);return P.useEffect(()=>{let e=a?S?.ownerDocument.getElementById(a):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=L(()=>x(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,a,x]),(0,F.jsx)(oe,{scope:n,name:i,form:a,required:l,disabled:u,value:b,onValueChange:x,children:(0,F.jsx)(E,{asChild:!0,...v,orientation:d,dir:y,loop:p,children:(0,F.jsx)(r.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:y,..._,ref:w})})})},`RadioGroup`)),ce=`RadioGroupItemProvider`,le=`RadioGroupItemTrigger`;function Q(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=se(ce,t),s=X(t),c=o.disabled||r;return(0,F.jsx)(U,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}L(Q,`RadioGroupItemProvider`);var ue=P.forwardRef(L(function(t,n){let{__scopeRadioGroup:r,...i}=t,a=Y(r),o=X(r),{checked:s,disabled:c}=H(le,o.__scopeRadio),l=P.useRef(null),u=m(n,l),d=P.useRef(!1);return P.useEffect(()=>{let e=L(e=>{K.includes(e.key)&&(d.current=!0)},`handleKeyDown`),t=L(()=>d.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,F.jsx)(O,{asChild:!0,...a,focusable:!c,active:s,children:(0,F.jsx)(ne,{...o,...i,ref:u,onKeyDown:e(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:e(i.onFocus,()=>{d.current&&l.current?.click()})})})},`RadioGroupItemTrigger`)),de=P.forwardRef(L(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,F.jsx)(Q,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ue,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,F.jsx)(fe,{__scopeRadioGroup:n})]})})},`RadioGroupItem`)),fe=P.forwardRef(L(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=X(n);return(0,F.jsx)(ie,{...i,...r,ref:t})},`RadioGroupItemBubbleInput`));function $({value:e,onChange:n,choices:r,className:i,columns:a=1,"aria-label":o}){return(0,F.jsx)(Z,{value:e??``,onValueChange:e=>n(e),"aria-label":o,className:t(`grid gap-2`,a===2&&`sm:grid-cols-2`,i),children:r.map(e=>(0,F.jsxs)(de,{value:e.value,className:t(`group flex w-full items-start gap-3 rounded-lg border bg-card p-3 text-left text-sm transition-colors outline-none`,`hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`data-[state=checked]:border-primary data-[state=checked]:bg-muted/40 data-[state=checked]:ring-1 data-[state=checked]:ring-primary`),children:[(0,F.jsx)(`span`,{"aria-hidden":!0,className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-input group-data-[state=checked]:border-primary`,children:(0,F.jsx)(`span`,{className:`size-2 rounded-full bg-primary opacity-0 transition-opacity group-data-[state=checked]:opacity-100`})}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 font-medium`,children:[e.icon&&(0,F.jsx)(e.icon,{className:`size-4 text-muted-foreground`}),e.title,e.badge]}),e.description&&(0,F.jsx)(`span`,{className:`block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]},e.value))})}function pe({onCreated:e,defaultName:t=``,submitLabel:n=`Create agent`,onCancel:r}){let a=h(c.accounts()),[o,s]=(0,P.useState)(t),[f,p]=(0,P.useState)(``),[m,g]=(0,P.useState)(null),[E,D]=(0,P.useState)(M[0].id),[O,I]=(0,P.useState)(!1),L=m??(a.data??[]).map(e=>e.id),R=A({mutationFn:e=>l(`/api/agents`,{body:e}),invalidate:[d.agents,d.setupState,d.overview],success:e=>`Agent "${e.agent.name}" created`,errorTitle:!1,onSuccess:t=>{j(t.agent.id,t.apiKey),e(t)}}),z=o.trim()?o.trim().length>80?`Keep it under 80 characters.`:null:`Give the agent a name.`,B=e=>{if(e.preventDefault(),I(!0),z)return;let t=M.find(e=>e.id===E);R.mutate({name:o.trim(),description:f.trim()||null,grants:L.map(e=>({...N(t),accountId:e}))})},V=(e,t)=>g(t?[...new Set([...L,e])]:L.filter(t=>t!==e));return(0,F.jsx)(`form`,{onSubmit:B,noValidate:!0,children:(0,F.jsxs)(b,{children:[(0,F.jsxs)(T,{"data-invalid":O&&!!z,children:[(0,F.jsx)(y,{htmlFor:`agent-name`,children:`Name`}),(0,F.jsx)(ee,{id:`agent-name`,autoFocus:!0,placeholder:`e.g. Support triage, Claude Code on laptop`,value:o,onChange:e=>s(e.target.value),"aria-invalid":O&&!!z}),O&&z?(0,F.jsx)(C,{children:z}):(0,F.jsx)(x,{children:`Shown in audit logs and approval requests.`})]}),(0,F.jsxs)(T,{children:[(0,F.jsxs)(y,{htmlFor:`agent-desc`,children:[`Description `,(0,F.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,F.jsx)(k,{id:`agent-desc`,rows:2,placeholder:`What does this agent do?`,value:f,onChange:e=>p(e.target.value)})]}),(0,F.jsxs)(w,{children:[(0,F.jsx)(S,{variant:`label`,children:`Mailboxes it can use`}),a.data?.length?(0,F.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:a.data.map(e=>(0,F.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded-lg border p-2.5 text-sm has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/50`,children:[(0,F.jsx)(v,{checked:L.includes(e.id),onCheckedChange:t=>V(e.id,t===!0)}),(0,F.jsx)(`span`,{className:`truncate`,children:e.email})]},e.id))}):(0,F.jsx)(x,{children:`No Gmail accounts connected yet. You can create the agent now and grant access later.`})]}),L.length>0&&(0,F.jsxs)(w,{children:[(0,F.jsx)(S,{variant:`label`,children:`Starting permissions`}),(0,F.jsx)(x,{children:`Fine-tune capabilities, labels, recipients and limits per mailbox afterwards.`}),(0,F.jsx)($,{"aria-label":`Starting permissions`,value:E,onChange:D,columns:2,choices:M.map(e=>({value:e.id,title:e.label,description:e.description}))})]}),R.isError&&(0,F.jsx)(_,{error:R.error,title:`Couldn't create the agent`}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[r&&(0,F.jsx)(i,{type:`button`,variant:`ghost`,onClick:r,children:`Cancel`}),(0,F.jsxs)(i,{type:`submit`,disabled:R.isPending,children:[R.isPending&&(0,F.jsx)(u,{}),n]})]})]})})}export{$ as n,pe as t};
@@ -0,0 +1 @@
1
+ import{G as e,f as t,ht as n,mt as r,n as i,q as a,vt as o}from"./queries-a3M5_loa.js";import{t as s}from"./useQuery-DAhf1YDH.js";import{r as c}from"./dist-B0e3Ju3r.js";import{t as l}from"./bot-DVw15lBn.js";import{t as u}from"./chevron-right-CbBKS6-T.js";import{t as d}from"./card-EQTpqntn.js";import{a as f,d as p,k as m,o as h,u as g}from"./common-PG6weTqi.js";import{t as _}from"./key-round-CVIZRCLM.js";import{t as v}from"./mail-CAVmuESo.js";import{t as y}from"./plus-CETmK0SB.js";import{t as b}from"./agent-create-form-DKwaY1Dg.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./dialog-CxNRCZdE.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./empty-CE_WZGEC.js";import{l as P}from"./labels-C_Pwium9.js";import{s as F}from"./grants-BhXj1Pew.js";var I={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};I.node;var L=e(I),R=r();function z({agent:e,accounts:t}){let n=e=>t.find(t=>t.id===e)?.email??`Removed account`;return(0,R.jsx)(d,{className:`gap-0 py-0 transition-colors hover:bg-muted/30`,children:(0,R.jsxs)(a,{to:`/agents/$agentId`,params:{agentId:e.id},className:`flex h-full flex-col gap-3 rounded-xl p-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,R.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,R.jsx)(l,{className:`size-4`})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),e.disabled&&(0,R.jsx)(p,{tone:`idle`,children:`Disabled`})]}),(0,R.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.description||`No description`})]}),(0,R.jsx)(u,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsx)(`div`,{className:`space-y-1.5 text-xs`,children:e.grants.length?e.grants.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,R.jsx)(v,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate text-foreground`,children:n(e.accountId)}),(0,R.jsxs)(`span`,{className:`shrink-0`,children:[`· `,e.capabilities.length,` capabilit`,e.capabilities.length===1?`y`:`ies`,e.capabilities.includes(`send`)&&` · ${P[e.sendMode].short.toLowerCase()}`]})]},e.id)):(0,R.jsx)(`div`,{className:`text-warning`,children:`No mailbox access yet`})}),(0,R.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-4 gap-y-1 border-t pt-3 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono`,children:[(0,R.jsx)(_,{className:`size-3.5`}),e.keyPrefix,`…`]}),(0,R.jsxs)(`span`,{children:[`Last used `,(0,R.jsx)(g,{date:e.lastUsedAt,fallback:`never`})]})]})]})})}var B=o(n(),1);function V({trigger:e}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(),o=c(),s=e=>{r(e),e||setTimeout(()=>a(void 0),200)};return(0,R.jsxs)(D,{open:n,onOpenChange:s,children:[(0,R.jsx)(E,{asChild:!0,children:e??(0,R.jsxs)(t,{children:[(0,R.jsx)(y,{}),` New agent`]})}),(0,R.jsx)(C,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-2xl`,onInteractOutside:e=>i&&e.preventDefault(),children:i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(x,{children:[(0,R.jsxs)(w,{children:[i.agent.name,` is ready`]}),(0,R.jsx)(T,{children:`Save the key, then add agentinbox to your agent with one of the snippets below.`})]}),(0,R.jsx)(F,{res:i}),(0,R.jsxs)(S,{children:[(0,R.jsxs)(t,{variant:`outline`,onClick:()=>{s(!1),o({to:`/agents/$agentId`,params:{agentId:i.agent.id}})},children:[(0,R.jsx)(L,{}),` Fine-tune permissions`]}),(0,R.jsx)(t,{onClick:()=>s(!1),children:`I've saved the key`})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(x,{children:[(0,R.jsx)(w,{children:`New agent`}),(0,R.jsx)(T,{children:`Each agent gets its own API key and its own permissions per mailbox.`})]}),(0,R.jsx)(b,{onCreated:a,onCancel:()=>s(!1)})]})})]})}function H(){let e=s(i.agents()),n=s(i.accounts());return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(f,{title:`Agents`,description:`Each agent has its own API key and per-mailbox permissions. Agents connect over MCP and can receive events by webhook.`,actions:(0,R.jsx)(V,{})}),e.isPending?(0,R.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[0,1,2].map(e=>(0,R.jsx)(m,{className:`h-44 rounded-xl`},e))}):e.isError?(0,R.jsx)(h,{error:e.error,onRetry:()=>void e.refetch()}):e.data.length===0?(0,R.jsx)(d,{children:(0,R.jsxs)(N,{children:[(0,R.jsxs)(k,{children:[(0,R.jsx)(O,{variant:`icon`,children:(0,R.jsx)(l,{})}),(0,R.jsx)(j,{children:`No agents yet`}),(0,R.jsx)(M,{children:`Create an agent to get an API key, then add agentinbox to Claude Code, Codex, Cursor or any MCP client.`})]}),(0,R.jsx)(A,{children:(0,R.jsx)(V,{trigger:(0,R.jsxs)(t,{children:[(0,R.jsx)(y,{}),` Create your first agent`]})})})]})}):(0,R.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:e.data.map(e=>(0,R.jsx)(z,{agent:e,accounts:n.data??[]},e.id))})]})}export{H as component};
@@ -0,0 +1,2 @@
1
+ import{B as e,G as t,W as n,d as r,f as i,ht as a,l as o,mt as s,n as c,o as l,pt as ee,q as u,r as d,t as f,vt as p}from"./queries-a3M5_loa.js";import{t as m}from"./useQuery-DAhf1YDH.js";import{t as te}from"./useMutation-DeWvLw1a.js";import{r as h}from"./dist-B0e3Ju3r.js";import{t as ne}from"./bot-DVw15lBn.js";import{t as g}from"./chevron-down-892ylB4R.js";import{t as _}from"./chevron-right-CbBKS6-T.js";import{a as v,o as y,r as b,t as x}from"./card-EQTpqntn.js";import{A as S,O as C,a as w,d as T,f as E,g as re,k as D,m as ie,o as O,u as k}from"./common-PG6weTqi.js";import{t as ae}from"./paperclip-QFjM4y6n.js";import{t as oe}from"./stamp-CH2OvjH2.js";import{t as A}from"./x-BHjDLXNO.js";import{i as j,n as M,r as N,t as P}from"./tabs-ySiz7Mni.js";import{m as F}from"./index-Bd4Y5wSp.js";import{t as I}from"./textarea-CCokBZIw.js";import{a as L,i as R,o as z,r as B,t as V}from"./empty-CE_WZGEC.js";import{c as H,n as U}from"./labels-C_Pwium9.js";var W={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};W.node;var G=t(W),K={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};K.node;var se=t(K),q={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};q.node;var ce=t(q),J=p(a(),1),Y=s();function le({status:e}){let t=U[e];return(0,Y.jsx)(T,{tone:t.tone,children:t.label})}function X({expiresAt:t}){let n=C(1e3),r=new Date(t).getTime()-n;return r<=0?(0,Y.jsx)(`span`,{className:`text-critical`,children:`Expired`}):(0,Y.jsxs)(`span`,{className:e(`tabular`,r<36e5&&`font-medium text-warning`),title:new Date(t).toLocaleString(),children:[`Expires in `,re(r)]})}function Z({approval:e}){let t=[[`To`,e.to],[`Cc`,e.cc],[`Bcc`,e.bcc]];return(0,Y.jsx)(`dl`,{className:`grid grid-cols-[2.5rem_1fr] gap-y-1 text-sm`,children:t.filter(([,e])=>e.length>0).map(([e,t])=>(0,Y.jsxs)(`div`,{className:`contents`,children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Y.jsx)(`dd`,{className:`min-w-0 break-words`,children:t.map(E).join(`, `)})]},e))})}function Q({body:t,className:n}){let r=t.length>1200||t.split(`
2
+ `).length>24,[a,o]=(0,J.useState)(!r);return(0,Y.jsxs)(`div`,{className:e(`relative rounded-lg border bg-muted/30`,n),children:[(0,Y.jsx)(`pre`,{className:e(`overflow-x-auto p-3 font-sans text-sm leading-relaxed whitespace-pre-wrap break-words`,!a&&`max-h-80 overflow-hidden`),children:t||(0,Y.jsx)(`span`,{className:`text-muted-foreground italic`,children:`(empty body)`})}),r&&(0,Y.jsx)(`div`,{className:e(`flex justify-center p-2`,!a&&`absolute inset-x-0 bottom-0 rounded-b-lg bg-gradient-to-t from-card via-card/90 to-transparent pt-10`),children:(0,Y.jsxs)(i,{variant:`outline`,size:`sm`,onClick:()=>o(!a),children:[(0,Y.jsx)(g,{className:e(`transition-transform`,a&&`rotate-180`)}),a?`Collapse`:`Show full message`]})})]})}function $({items:e}){return e.length?(0,Y.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.map((e,t)=>(0,Y.jsxs)(`li`,{className:`flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs`,children:[(0,Y.jsx)(ae,{className:`size-3.5 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`max-w-48 truncate`,children:e.filename}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:ie(e.size)})]},t))}):null}function ue({approval:e}){let t=ee(),[a,s]=(0,J.useState)(``),[c,p]=(0,J.useState)(!1),m=te({mutationFn:t=>l(`/api/approvals/${encodeURIComponent(e.id)}/${t}`,{body:a.trim()?{note:a.trim()}:{}}),onSuccess:(n,i)=>{t.setQueryData([...f.approvals,`pending`],t=>t?.filter(t=>t.id!==e.id)),t.invalidateQueries({queryKey:f.approvals}),t.invalidateQueries({queryKey:f.overview}),i===`reject`?r.success(`Rejected`,{description:`The draft was deleted and the agent is told it was rejected.`}):n.status===`failed`?r.error(`Approved, but sending failed`,{description:n.error??void 0}):r.success(`Approved and sent`,{description:`"${e.subject||`(no subject)`}" is on its way.`})},onError:e=>o(e,`Couldn't record the decision`)}),h=m.isPending?m.variables:void 0;return(0,Y.jsxs)(x,{children:[(0,Y.jsx)(y,{className:`gap-2`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm`,children:[(0,Y.jsxs)(u,{to:`/agents/$agentId`,params:{agentId:e.agentId},className:`flex items-center gap-1.5 font-medium hover:underline`,children:[(0,Y.jsx)(ne,{className:`size-4 text-muted-foreground`}),e.agentName]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`wants to send from`}),(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:e.accountEmail}),(0,Y.jsx)(S,{variant:`secondary`,children:H[e.kind]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,Y.jsx)(k,{date:e.createdAt}),(0,Y.jsx)(X,{expiresAt:e.expiresAt})]})]})}),(0,Y.jsxs)(b,{className:`space-y-4`,children:[e.reason&&(0,Y.jsxs)(`div`,{className:`flex gap-2 rounded-lg border-l-2 border-chart-1 bg-chart-1/5 px-3 py-2 text-sm`,children:[(0,Y.jsx)(G,{className:`mt-0.5 size-4 shrink-0 text-chart-1`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Agent's reason`}),(0,Y.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.reason})]})]}),(0,Y.jsx)(Z,{approval:e}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(`div`,{className:`text-base font-semibold break-words`,children:e.subject||(0,Y.jsx)(`span`,{className:`text-muted-foreground italic`,children:`(no subject)`})}),(0,Y.jsx)(Q,{body:e.body})]}),(0,Y.jsx)($,{items:e.attachments}),c&&(0,Y.jsx)(I,{autoFocus:!0,rows:2,placeholder:`Optional note. The agent sees it with your decision (e.g. why you rejected).`,value:a,onChange:e=>s(e.target.value),"aria-label":`Decision note`})]}),(0,Y.jsxs)(v,{className:`flex-wrap justify-between gap-2 border-t`,children:[(0,Y.jsxs)(i,{variant:`ghost`,size:`sm`,onClick:()=>p(!c),"aria-expanded":c,children:[(0,Y.jsx)(ce,{}),` `,c?`Hide note`:`Add a note`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsxs)(i,{variant:`outline`,disabled:m.isPending,onClick:()=>m.mutate(`reject`),children:[h===`reject`?(0,Y.jsx)(d,{}):(0,Y.jsx)(A,{}),` Reject`]}),(0,Y.jsxs)(i,{disabled:m.isPending,onClick:()=>m.mutate(`approve`),children:[h===`approve`?(0,Y.jsx)(d,{}):(0,Y.jsx)(n,{}),` Approve & send`]})]})]})]})}function de({items:e}){return(0,Y.jsx)(x,{className:`gap-0 py-0`,children:(0,Y.jsx)(`ul`,{className:`divide-y`,children:e.map(e=>(0,Y.jsx)(fe,{approval:e},e.id))})})}function fe({approval:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsxs)(`li`,{children:[(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(!n),className:`flex w-full items-center gap-3 px-4 py-3 text-left outline-none hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(le,{status:t.status}),(0,Y.jsx)(`span`,{children:H[t.kind]}),(0,Y.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[t.agentName,` via `,t.accountEmail]})]}),(0,Y.jsx)(`div`,{className:`truncate text-sm font-medium`,children:t.subject||`(no subject)`}),(t.decisionNote||t.error)&&(0,Y.jsx)(`div`,{className:e(`truncate text-xs`,t.error?`text-critical`:`text-muted-foreground`),children:t.error??`Note: ${t.decisionNote}`})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,Y.jsx)(k,{date:t.decidedAt??t.expiresAt}),(0,Y.jsx)(_,{className:e(`size-4 transition-transform`,n&&`rotate-90`)})]})]}),n&&(0,Y.jsxs)(`div`,{className:`space-y-3 border-t bg-muted/20 px-4 py-3`,children:[t.reason&&(0,Y.jsxs)(`p`,{className:`text-sm`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`Agent's reason: `}),t.reason]}),t.decisionNote&&(0,Y.jsxs)(`p`,{className:`text-sm`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`Your note: `}),t.decisionNote]}),t.error&&(0,Y.jsx)(`p`,{className:`text-sm text-critical`,children:t.error}),(0,Y.jsx)(Z,{approval:t}),(0,Y.jsx)(Q,{body:t.body}),(0,Y.jsx)($,{items:t.attachments})]})]})}function pe(){let{tab:e}=F.useSearch(),t=h({from:F.fullPath}),n=m(c.approvals(`pending`)),r=m({...c.approvals(),enabled:e===`history`}),i=(r.data??[]).filter(e=>e.status!==`pending`),a=n.data?.length??0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(w,{title:`Approvals`,description:`Messages from agents whose grant is set to “Needs approval”. Approving sends the draft; rejecting deletes it. Unanswered requests expire.`}),(0,Y.jsxs)(P,{value:e??`pending`,onValueChange:e=>void t({search:{tab:e===`history`?`history`:void 0},replace:!0}),children:[(0,Y.jsxs)(N,{children:[(0,Y.jsxs)(j,{value:`pending`,children:[`Pending`,a>0&&(0,Y.jsx)(S,{variant:`secondary`,className:`ml-1 h-4 min-w-4 px-1 tabular`,children:a})]}),(0,Y.jsx)(j,{value:`history`,children:`History`})]}),(0,Y.jsx)(M,{value:`pending`,className:`mt-4 space-y-4`,children:n.isPending?(0,Y.jsx)(D,{className:`h-80 rounded-xl`}):n.isError?(0,Y.jsx)(O,{error:n.error,onRetry:()=>void n.refetch()}):a===0?(0,Y.jsx)(x,{children:(0,Y.jsx)(V,{children:(0,Y.jsxs)(R,{children:[(0,Y.jsx)(L,{variant:`icon`,children:(0,Y.jsx)(oe,{})}),(0,Y.jsx)(z,{children:`Nothing waiting for you`}),(0,Y.jsx)(B,{children:`When an agent with send mode “Needs approval” sends a message, it shows up here. The sidebar shows a count when something's pending.`})]})})}):n.data.map(e=>(0,Y.jsx)(ue,{approval:e},e.id))}),(0,Y.jsx)(M,{value:`history`,className:`mt-4`,children:r.isPending?(0,Y.jsx)(D,{className:`h-60 rounded-xl`}):r.isError?(0,Y.jsx)(O,{error:r.error,onRetry:()=>void r.refetch()}):i.length===0?(0,Y.jsx)(x,{children:(0,Y.jsx)(V,{children:(0,Y.jsxs)(R,{children:[(0,Y.jsx)(L,{variant:`icon`,children:(0,Y.jsx)(se,{})}),(0,Y.jsx)(z,{children:`No decisions yet`}),(0,Y.jsx)(B,{children:`Approved, rejected and expired requests are listed here.`})]})})}):(0,Y.jsx)(de,{items:i})})]})]})}export{pe as component};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{G as e,f as t,ht as n,mt as r,n as i,pt as a,r as o,vt as s}from"./queries-a3M5_loa.js";import{t as c}from"./useQuery-DAhf1YDH.js";import{t as l}from"./useInfiniteQuery-DE6WChlb.js";import{n as u,t as d}from"./data-table-Ca9aQZKR.js";import{r as f}from"./dist-B0e3Ju3r.js";import{a as p,i as m,n as h,r as g,t as _}from"./select-C8tJBHb5.js";import{_ as v,a as y,k as b,o as x,t as S,u as C,v as w}from"./common-PG6weTqi.js";import{i as T,n as E,r as D,t as O}from"./audit-bits-B1We-fQ3.js";import{t as k}from"./search-gcYjitzV.js";import{p as A}from"./index-Bd4Y5wSp.js";import{n as j}from"./stream-C2Tr2d5O.js";import{i as M,n as N,t as P}from"./input-group-DRs3TNaT.js";var F={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};F.node;var I=e(F),L=s(n(),1),R=r(),z=u();function B({entries:e,accounts:t,empty:n}){let r=(0,L.useMemo)(()=>{let e=e=>e?t.find(t=>t.id===e)?.email??e:`—`;return[z.accessor(`ts`,{header:`Time`,cell:e=>(0,R.jsx)(C,{date:e.getValue(),className:`text-xs`}),meta:{className:`w-28`}}),z.display({id:`actor`,header:`Actor`,cell:e=>(0,R.jsx)(E,{entry:e.row.original}),meta:{className:`max-w-40`}}),z.accessor(`action`,{header:`Action`,cell:e=>(0,R.jsx)(O,{action:e.getValue()})}),z.accessor(`accountId`,{header:`Account`,cell:t=>(0,R.jsx)(`span`,{className:`block max-w-48 truncate text-muted-foreground`,children:e(t.getValue())}),meta:{className:`hidden lg:table-cell`}}),z.accessor(`outcome`,{header:`Outcome`,cell:e=>(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,R.jsx)(T,{outcome:e.getValue()}),e.row.original.outcome!==`ok`&&e.row.original.reason&&(0,R.jsx)(`span`,{className:`hidden md:inline`,children:(0,R.jsx)(D,{reason:e.row.original.reason})})]})}),z.accessor(`durationMs`,{header:`Duration`,cell:e=>(0,R.jsx)(`span`,{className:`text-muted-foreground tabular`,children:w(e.getValue())}),meta:{className:`hidden text-right sm:table-cell`}})]},[t]);return(0,R.jsx)(d,{columns:r,data:e,getRowId:e=>String(e.id),empty:n,rowClassName:e=>e.outcome===`denied`?`bg-warning/5`:e.outcome===`error`?`bg-critical/5`:void 0,renderExpanded:e=>(0,R.jsx)(V,{entry:e,email:t.find(t=>t.id===e.accountId)?.email})})}function V({entry:e,email:t}){return(0,R.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[e.reason&&(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:e.outcome===`denied`?`Blocked by`:`Reason`}),(0,R.jsx)(D,{reason:e.reason})]}),(0,R.jsxs)(`dl`,{className:`grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`When`}),(0,R.jsx)(`dd`,{children:v(e.ts)}),(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Actor`}),(0,R.jsxs)(`dd`,{className:`font-mono break-all`,children:[e.actorType,e.actorId&&` · ${e.actorId}`]}),e.accountId&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Account`}),(0,R.jsx)(`dd`,{className:`break-all`,children:t??e.accountId})]}),e.target&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,R.jsx)(`dd`,{className:`font-mono break-all`,children:e.target})]}),(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Entry`}),(0,R.jsxs)(`dd`,{className:`font-mono`,children:[`#`,e.id]})]}),e.detail&&Object.keys(e.detail).length>0&&(0,R.jsx)(S,{code:JSON.stringify(e.detail,null,2)})]})}function H(){let{agentId:e,outcome:n}=A.useSearch(),r=f({from:A.fullPath}),s=a(),[u,d]=(0,L.useState)(``),[v,S]=(0,L.useState)(0),C=c(i.agents()),w=c(i.accounts()),T=i.audit({agentId:e,outcome:n}),E=l(T);j(t=>{t.kind===`audit`&&(e&&t.data.actorId!==e||n&&t.data.outcome!==n||S(e=>e+1))});let D=()=>{S(0),s.resetQueries({queryKey:T.queryKey})},O=e=>{S(0),r({search:t=>({...t,...e}),replace:!0})},F=u.trim().toLowerCase(),z=(E.data?.pages.flatMap(e=>e.items)??[]).filter(e=>!F||e.action.toLowerCase().includes(F)),V=!!(e||n||F);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(y,{title:`Audit log`,description:`Every tool call agents make and every change made in this console. Denied rows show which guardrail blocked the action.`}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsxs)(_,{value:e??`all`,onValueChange:e=>O({agentId:e===`all`?void 0:e}),children:[(0,R.jsx)(m,{className:`w-full sm:w-52`,"aria-label":`Agent`,children:(0,R.jsx)(p,{})}),(0,R.jsxs)(h,{children:[(0,R.jsx)(g,{value:`all`,children:`All actors`}),C.data?.map(e=>(0,R.jsx)(g,{value:e.id,children:e.name},e.id))]})]}),(0,R.jsxs)(_,{value:n??`all`,onValueChange:e=>O({outcome:e===`all`?void 0:e}),children:[(0,R.jsx)(m,{className:`w-full sm:w-40`,"aria-label":`Outcome`,children:(0,R.jsx)(p,{})}),(0,R.jsxs)(h,{children:[(0,R.jsx)(g,{value:`all`,children:`Any outcome`}),(0,R.jsx)(g,{value:`ok`,children:`OK`}),(0,R.jsx)(g,{value:`denied`,children:`Denied`}),(0,R.jsx)(g,{value:`error`,children:`Error`})]})]}),(0,R.jsxs)(P,{className:`w-full sm:w-60`,children:[(0,R.jsx)(N,{children:(0,R.jsx)(k,{})}),(0,R.jsx)(M,{placeholder:`Filter by action…`,value:u,onChange:e=>d(e.target.value),"aria-label":`Filter by action`})]}),V&&(0,R.jsx)(t,{variant:`ghost`,size:`sm`,onClick:()=>{d(``),O({agentId:void 0,outcome:void 0})},children:`Clear filters`})]}),v>0&&(0,R.jsx)(`div`,{className:`flex justify-center`,children:(0,R.jsxs)(t,{size:`sm`,variant:`secondary`,onClick:D,className:`rounded-full shadow-sm`,children:[(0,R.jsx)(I,{}),` `,v,` new entr`,v===1?`y`:`ies`]})}),E.isPending?(0,R.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:8},(e,t)=>(0,R.jsx)(b,{className:`h-10`},t))}):E.isError?(0,R.jsx)(x,{error:E.error,onRetry:()=>void E.refetch()}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B,{entries:z,accounts:w.data??[],empty:V?F&&E.hasNextPage?`No matching entries in the loaded pages. Load more to search further back.`:`No entries match these filters.`:`Nothing recorded yet. Agent tool calls and console changes will show up here.`}),E.hasNextPage&&(0,R.jsx)(`div`,{className:`flex justify-center`,children:(0,R.jsxs)(t,{variant:`outline`,onClick:()=>void E.fetchNextPage(),disabled:E.isFetchingNextPage,children:[E.isFetchingNextPage&&(0,R.jsx)(o,{}),` Load older entries`]})})]})]})}export{H as component};
@@ -0,0 +1 @@
1
+ import{G as e,mt as t}from"./queries-a3M5_loa.js";import{t as n}from"./bot-DVw15lBn.js";import{d as r}from"./common-PG6weTqi.js";import{o as i,r as a}from"./labels-C_Pwium9.js";var o={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};o.node;var s=e(o),c={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};c.node;var l=e(c),u=t();function d({outcome:e}){let t=a[e];return(0,u.jsx)(r,{tone:t.tone,children:t.label})}function f({entry:e}){let t=e.actorType===`agent`?n:e.actorType===`admin`?l:s,r=e.actorName??(e.actorType===`admin`?`Admin`:e.actorType===`system`?`System`:e.actorId??`Unknown agent`);return(0,u.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,u.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,u.jsx)(`span`,{className:`truncate`,children:r})]})}function p({reason:e}){return e?(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md bg-warning/15 px-1.5 py-0.5 text-xs`,children:[(0,u.jsx)(`code`,{className:`font-mono`,children:e}),i[e]&&(0,u.jsx)(`span`,{className:`text-muted-foreground`,children:i[e]})]}):null}function m({action:e}){return(0,u.jsx)(`code`,{className:`font-mono text-[13px]`,children:e})}export{d as i,f as n,p as r,m as t};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{B as e,G as t,V as n,ht as r,mt as i}from"./queries-a3M5_loa.js";var a={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};a.node;var o=t(a);r();var s=i(),c=n(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`,warning:`border-warning/40 bg-warning/10 text-foreground *:data-[slot=alert-description]:text-foreground/80 *:[svg]:text-warning`,success:`border-success/30 bg-success/10 text-foreground *:data-[slot=alert-description]:text-foreground/80 *:[svg]:text-success`,info:`border-chart-1/30 bg-chart-1/5 text-foreground *:data-[slot=alert-description]:text-foreground/80 *:[svg]:text-chart-1`}},defaultVariants:{variant:`default`}});function l({className:t,variant:n,...r}){return(0,s.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:e(c({variant:n}),t),...r})}function u({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`alert-title`,className:e(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,t),...n})}function d({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`alert-description`,className:e(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,t),...n})}function f({className:t,size:n=`default`,...r}){return(0,s.jsx)(`div`,{"data-slot":`card`,"data-size":n,className:e(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,t),...r})}function p({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`card-header`,className:e(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,t),...n})}function m({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`card-title`,className:e(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,t),...n})}function h({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`card-description`,className:e(`text-sm text-muted-foreground`,t),...n})}function g({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`card-action`,className:e(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,t),...n})}function _({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`card-content`,className:e(`px-(--card-spacing)`,t),...n})}function v({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`card-footer`,className:e(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,t),...n})}export{v as a,l as c,o as d,h as i,d as l,g as n,p as o,_ as r,m as s,f as t,u};
@@ -0,0 +1 @@
1
+ import{A as e,B as t,M as n,N as r,O as i,W as a,ht as o,k as s,mt as c,v as l,vt as u,z as d}from"./queries-a3M5_loa.js";var f=u(o(),1),p=c(),m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Checkbox`,[_,v]=n(g),[y,b]=_(g);function x(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:m}=e,[h,_]=s({prop:n,defaultProp:i??!1,onChange:l,caller:g}),[v,b]=f.useState(null),[x,S]=f.useState(null),[C,w]=f.useState(null),T=!v||!!o||!!v.closest(`form`),E={checked:h,disabled:a,setChecked:_,control:v,setControl:b,name:c,form:o,value:d,userClick:C,onUserClick:w,required:u,defaultChecked:!A(i)&&i,isFormControl:T,bubbleInput:x,setBubbleInput:S};return(0,p.jsx)(y,{scope:t,...E,children:k(m)?m(E):r})}h(x,`CheckboxProvider`);var S=`CheckboxTrigger`,C=f.forwardRef(h(function({__scopeCheckbox:t,onKeyDown:n,onClick:i,...a},o){let{control:s,value:c,disabled:l,checked:u,required:m,setControl:g,setChecked:_,onUserClick:v,isFormControl:y,bubbleInput:x}=b(S,t),C=d(o,g),w=f.useRef(u);return f.useEffect(()=>{let e=s?.form;if(e){let t=h(()=>_(w.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,_]),(0,p.jsx)(r.button,{type:`button`,role:`checkbox`,"aria-checked":A(u)?`mixed`:u,"aria-required":m,"data-state":j(u),"data-disabled":l?``:void 0,disabled:l,value:c,...a,ref:C,onKeyDown:e(n,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:e(i,e=>{let t=e.isPropagationStopped();v({requestedChecked:A(u)?!0:!u,hasConsumerStoppedPropagation:t}),_(e=>A(e)?!0:!e),x&&y&&(t||e.stopPropagation())})})},`CheckboxTrigger`)),w=f.forwardRef(h(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,p.jsx)(x,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(C,{...d,ref:t,__scopeCheckbox:n}),e&&(0,p.jsx)(O,{__scopeCheckbox:n})]})})},`Checkbox`)),T=`CheckboxIndicator`,E=f.forwardRef(h(function(e,t){let{__scopeCheckbox:n,forceMount:a,...o}=e,s=b(T,n);return(0,p.jsx)(i,{present:a||A(s.checked)||s.checked===!0,children:(0,p.jsx)(r.span,{"data-state":j(s.checked),"data-disabled":s.disabled?``:void 0,...o,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),D=`CheckboxBubbleInput`,O=f.forwardRef(h(function({__scopeCheckbox:t,onClick:n,...i},a){let{control:o,userClick:s,checked:c,defaultChecked:u,required:m,disabled:h,name:g,value:_,form:v,bubbleInput:y,setBubbleInput:x}=b(D,t),S=d(a,x),C=l(o),w=f.useRef(!1),T=f.useRef(c),E=f.useRef(s),O=f.useRef(null);f.useEffect(()=>{let e=y;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=T.current!==c;T.current=c;let i=s!==null&&s!==E.current;if(E.current=s,i)O.current=r?null:s,r&&(e.indeterminate=A(c),n.call(e,!A(c)&&c)),e.dispatchEvent(new Event(`click`,{bubbles:!s.hasConsumerStoppedPropagation}));else if(r){let t=O.current;O.current=null;let r=t?.requestedChecked===c;w.current=!0,e.indeterminate=A(c),n.call(e,!A(c)&&c),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),w.current=!1}},[y,c,s]);let k=f.useRef(!A(c)&&c);return(0,p.jsx)(r.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??k.current,required:m,disabled:h,name:g,value:_,form:v,...i,tabIndex:-1,ref:S,onClick:e(n,e=>{w.current&&e.stopPropagation()}),style:{...i.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e===`indeterminate`}h(A,`isIndeterminate`);function j(e){return A(e)?`indeterminate`:e?`checked`:`unchecked`}h(j,`getState`);function M({className:e,...n}){return(0,p.jsx)(w,{"data-slot":`checkbox`,className:t(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...n,children:(0,p.jsx)(E,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,p.jsx)(a,{})})})}export{M as t};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{B as e,ht as t,mt as n,vt as r}from"./queries-a3M5_loa.js";import{A as i}from"./common-PG6weTqi.js";import{t as a}from"./x-BHjDLXNO.js";var o=r(t(),1),s=n();function c({id:t,value:n,onChange:r,placeholder:c,validate:l,className:u,"aria-describedby":d}){let[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(null),g=e=>{let t=e.split(/[\s,;]+/).map(e=>e.trim()).filter(Boolean);if(!t.length)return!0;for(let e of t){let t=l?.(e)??null;if(t)return h(`${e}: ${t}`),!1}return r([...new Set([...n,...t])]),p(``),h(null),!0};return(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsxs)(`div`,{className:e(`flex min-h-8 w-full flex-wrap items-center gap-1 rounded-lg border border-input px-1.5 py-1 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 dark:bg-input/30`,m&&`border-destructive ring-3 ring-destructive/20`,u),onClick:e=>e.currentTarget.querySelector(`input`)?.focus(),children:[n.map(e=>(0,s.jsxs)(i,{variant:`secondary`,className:`h-6 gap-1 pr-1 font-mono text-xs font-normal`,children:[e,(0,s.jsx)(`button`,{type:`button`,className:`rounded-sm p-0.5 text-muted-foreground hover:bg-background hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,"aria-label":`Remove ${e}`,onClick:()=>r(n.filter(t=>t!==e)),children:(0,s.jsx)(a,{className:`size-3`})})]},e)),(0,s.jsx)(`input`,{id:t,className:`h-6 min-w-32 flex-1 bg-transparent px-1 font-mono text-sm outline-none placeholder:font-sans placeholder:text-muted-foreground`,value:f,placeholder:n.length?``:c,"aria-invalid":!!m,"aria-describedby":d,onChange:e=>{p(e.target.value),h(null)},onKeyDown:e=>{e.key===`Enter`||e.key===`,`||e.key===` `&&f.trim()?(e.preventDefault(),g(f)):e.key===`Backspace`&&!f&&n.length&&r(n.slice(0,-1))},onBlur:()=>f.trim()&&g(f),onPaste:e=>{let t=e.clipboardData.getData(`text`);/[\s,;]/.test(t)&&(e.preventDefault(),g(f+t))}})]}),m&&(0,s.jsx)(`p`,{className:`text-xs text-destructive`,children:m})]})}export{c as t};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{B as e,F as t,G as n,V as r,W as i,c as a,d as o,f as s,ht as c,mt as l,vt as u}from"./queries-a3M5_loa.js";import{c as d,d as f,l as p,r as m,t as ee,u as te}from"./card-EQTpqntn.js";import{W as h,b as g,v as _,y as v}from"./index-Bd4Y5wSp.js";var y={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};y.node;var b=n(y),x={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};x.node;var S=n(x),C=u(c(),1),w=l(),ne=r(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function T({className:n,variant:r=`default`,asChild:i=!1,...a}){let o=i?t:`span`;return(0,w.jsx)(o,{"data-slot":`badge`,"data-variant":r,className:e(ne({variant:r}),n),...a})}function E({className:t,...n}){return(0,w.jsx)(`div`,{"data-slot":`skeleton`,className:e(`animate-pulse rounded-md bg-muted`,t),...n})}var D=new Set,O=Date.now(),k;function re(e){return D.add(e),k??=setInterval(()=>{O=Date.now();for(let e of D)e()},1e3),()=>{D.delete(e),!D.size&&k&&(clearInterval(k),k=void 0)}}function A(e=1e3){return(0,C.useSyncExternalStore)(re,()=>Math.floor(O/e)*e)}var ie=6048e5,ae=864e5,j=6e4,oe=525600,se=43200,ce=1440,M=Symbol.for(`constructDateFrom`);function N(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&M in e?e[M](t):e instanceof Date?new e.constructor(t):new Date(t)}function P(e,t){return N(t||e,e)}var le={};function F(){return le}function I(e){let t=P(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}function L(e,...t){let n=N.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function ue(e,t){let n=+P(e)-P(t);return n<0?-1:n>0?1:n}function de(e){return N(e,Date.now())}function R(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}var z={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},B=(e,t,n)=>{let r,i=z[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function V(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var H={date:V({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:V({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:V({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},fe={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},pe=(e,t,n,r)=>fe[e];function U(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var me={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:U({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:U({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:U({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:U({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:U({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function W(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ge(s,e=>e.test(o)):he(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function he(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _e(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var G={code:`en-US`,formatDistance:B,formatLong:H,formatRelative:pe,localize:me,match:{ordinalNumber:_e({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:W({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:W({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:W({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:W({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:W({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ve(e,t,n){let r=F(),i=n?.locale??r.locale??G,a=ue(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=L(n?.in,...a>0?[t,e]:[e,t]),l=R(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/j,f=(u-(I(c)-I(s)))/j,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<1440?`hour`:f<43200?`day`:f<525600?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}if(m===`day`){let e=l(f/ce);return i.formatDistance(`xDays`,e,o)}if(m===`month`){let e=l(f/se);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}{let e=l(f/oe);return i.formatDistance(`xYears`,e,o)}}function ye(e,t){return ve(e,de(e),t)}var be=new Intl.NumberFormat(`en`),xe=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),Se=e=>e==null?`—`:be.format(e),Ce=e=>e==null?`—`:xe.format(e);function we(e){return e==null||Number.isNaN(e)?`—`:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(e<1e4?2:1)} s`:K(e)}function K(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return n?`${n}d ${r}h`:r?`${r}h ${i}m`:i?`${i}m ${t%60}s`:`${t}s`}function Te(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:`${(e/1024**2).toFixed(1)} MB`}function q(e){if(e==null||e===``)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Ee(e){let t=q(e);return t?ye(t,{addSuffix:!0}):`—`}function J(e){let t=q(e);return t?t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`short`}):`—`}function De(e){return e?e.name?`${e.name} <${e.email}>`:e.email:`—`}function Oe(e){return e?e.name||e.email:`—`}function ke({title:e,description:t,actions:n}){return(0,w.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,w.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e}),t&&(0,w.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:t})]}),n&&(0,w.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n})]})}async function Ae(e,t){if(window.isSecureContext&&navigator.clipboard)return navigator.clipboard.writeText(e);let n=document.createElement(`textarea`);n.value=e,n.readOnly=!0,n.style.cssText=`position:fixed;top:0;left:0;opacity:0;pointer-events:none`,t.after(n),n.select();let r=document.execCommand(`copy`);if(n.remove(),t.focus(),!r)throw Error(`Copy failed`)}function je(e,t){let[n,r]=(0,C.useState)(!1);return{copied:n,onClick:async n=>{n.stopPropagation();try{await Ae(e,n.currentTarget)}catch{o.error(`Couldn't copy`,{description:`Select the text and copy it with your keyboard instead.`});return}r(!0),o.success(t??`Copied to clipboard`),setTimeout(()=>r(!1),1500)}}}function Y({value:t,label:n=`Copy`,className:r,withText:a,variant:o=`ghost`}){let{copied:c,onClick:l}=je(t);return a?(0,w.jsxs)(s,{type:`button`,variant:o,size:`sm`,className:r,onClick:l,children:[c?(0,w.jsx)(i,{}):(0,w.jsx)(b,{}),c?`Copied`:n]}):(0,w.jsxs)(_,{children:[(0,w.jsx)(g,{asChild:!0,children:(0,w.jsx)(s,{type:`button`,variant:o,size:`icon-sm`,className:e(`text-muted-foreground`,r),"aria-label":n,onClick:l,children:c?(0,w.jsx)(i,{}):(0,w.jsx)(b,{})})}),(0,w.jsx)(v,{children:n})]})}function Me({value:t,className:n,size:r=`default`}){return(0,w.jsxs)(`div`,{className:e(`flex min-w-0 items-center gap-1 rounded-lg border bg-muted/40 pl-3`,r===`lg`?`py-1.5 pr-1.5`:`py-0.5 pr-0.5`,n),children:[(0,w.jsx)(`code`,{className:e(`min-w-0 flex-1 font-mono break-all select-all`,r===`lg`?`text-sm`:`text-[13px]`),children:t}),(0,w.jsx)(Y,{value:t,withText:r===`lg`,variant:r===`lg`?`outline`:`ghost`})]})}function Ne({code:t,className:n,title:r}){return(0,w.jsxs)(`div`,{className:e(`overflow-hidden rounded-lg border bg-muted/40`,n),children:[r&&(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b bg-muted/40 py-1 pr-1 pl-3 text-xs text-muted-foreground`,children:[(0,w.jsx)(`span`,{className:`truncate font-mono`,children:r}),(0,w.jsx)(Y,{value:t})]}),(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(`pre`,{className:e(`overflow-x-auto p-3 font-mono text-xs leading-relaxed`,!r&&`pr-10`),children:t}),!r&&(0,w.jsx)(Y,{value:t,className:`absolute top-1.5 right-1.5`})]})]})}function X({label:t,value:n,hint:r,icon:i,loading:a,tone:o}){return(0,w.jsx)(ee,{className:`gap-0 py-4`,children:(0,w.jsxs)(m,{className:`space-y-1.5 px-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm text-muted-foreground`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:t}),i&&(0,w.jsx)(i,{className:e(`size-4 shrink-0`,o&&Pe[o])})]}),a?(0,w.jsx)(E,{className:`h-8 w-20`}):(0,w.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight tabular`,children:n}),r&&(0,w.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:r})]})})}var Z={good:`bg-success`,warn:`bg-warning`,bad:`bg-critical`,idle:`bg-muted-foreground/50`,info:`bg-chart-1`},Pe={good:`text-success`,warn:`text-warning`,bad:`text-critical`,idle:`text-muted-foreground`,info:`text-chart-1`};function Q({tone:t,pulse:n,className:r}){return(0,w.jsxs)(`span`,{className:e(`relative inline-flex size-2 shrink-0`,r),"aria-hidden":!0,children:[n&&(0,w.jsx)(`span`,{className:e(`absolute inset-0 animate-ping rounded-full opacity-60`,Z[t])}),(0,w.jsx)(`span`,{className:e(`relative inline-flex size-2 rounded-full`,Z[t])})]})}function Fe({tone:t,children:n,className:r,pulse:i}){return(0,w.jsxs)(T,{variant:`outline`,className:e(`gap-1.5 font-normal`,r),children:[(0,w.jsx)(Q,{tone:t,pulse:i,className:`size-1.5 [&>span]:size-1.5`}),n]})}function Ie({date:t,className:n,fallback:r=`—`}){return A(15e3),t?(0,w.jsxs)(_,{children:[(0,w.jsx)(g,{asChild:!0,children:(0,w.jsx)(`time`,{dateTime:t,className:e(`whitespace-nowrap underline decoration-dotted decoration-muted-foreground/40 underline-offset-4`,n),tabIndex:0,children:Ee(t)})}),(0,w.jsx)(v,{children:J(t)})]}):(0,w.jsx)(`span`,{className:e(`text-muted-foreground`,n),children:r})}function Le({href:t,children:n,className:r}){return(0,w.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:e(`inline-flex items-center gap-1 font-medium text-foreground underline underline-offset-4 hover:text-chart-1`,r),children:[n,(0,w.jsx)(S,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,w.jsx)(`span`,{className:`sr-only`,children:`(opens in a new tab)`})]})}function $({error:e,title:t,children:n,className:r}){let{message:i,hint:o}=a(e);return(0,w.jsxs)(d,{variant:`destructive`,className:r,children:[(0,w.jsx)(f,{}),(0,w.jsx)(te,{children:t??i}),(0,w.jsxs)(p,{children:[t&&(0,w.jsx)(`p`,{children:i}),o&&(0,w.jsx)(`p`,{className:`text-foreground/80`,children:o}),n]})]})}function Re({error:e,onRetry:t,className:n}){return(0,w.jsx)($,{error:e,title:`Couldn't load this`,className:n,children:t&&(0,w.jsx)(`div`,{className:`pt-2`,children:(0,w.jsxs)(s,{size:`sm`,variant:`outline`,onClick:t,children:[(0,w.jsx)(h,{}),` Try again`]})})})}function ze({children:t,className:n}){return(0,w.jsx)(`div`,{className:e(`text-xs font-medium tracking-wide text-muted-foreground uppercase`,n),children:t})}export{T as A,F as C,ie as D,ae as E,A as O,I as S,N as T,J as _,ke as a,G as b,X as c,Fe as d,De as f,K as g,Ce as h,Le as i,S as j,E as k,Q as l,Te as m,Me as n,Re as o,Oe as p,$ as r,ze as s,Ne as t,Ie as u,we as v,P as w,L as x,Se as y};
@@ -0,0 +1 @@
1
+ import{d as e,f as t,ht as n,mt as r,n as i,o as a,pt as o,q as s,r as c,t as l,vt as u}from"./queries-a3M5_loa.js";import{t as d}from"./useQuery-DAhf1YDH.js";import{c as f,l as p,u as m}from"./card-EQTpqntn.js";import{j as h,r as g}from"./common-PG6weTqi.js";import{a as _,n as v,r as y,t as b}from"./field-CcyMn3ey.js";import{G as x,K as S,W as C}from"./index-Bd4Y5wSp.js";import{a as w,i as T,n as E,o as D,r as O,t as k}from"./dialog-CxNRCZdE.js";import{n as A}from"./stream-C2Tr2d5O.js";import{t as j}from"./textarea-CCokBZIw.js";var M=u(n(),1),N=r();function P(){return(0,N.jsxs)(f,{variant:`info`,children:[(0,N.jsx)(x,{}),(0,N.jsx)(m,{children:`Seeing "Google hasn't verified this app"?`}),(0,N.jsxs)(p,{children:[`That's expected: it's your own OAuth app, not a third party's. Click `,(0,N.jsx)(`strong`,{children:`Advanced`}),`, then `,(0,N.jsx)(`strong`,{children:`Go to … (unsafe)`}),`. On the permissions screen, make sure every Gmail checkbox is ticked.`]})]})}function F(e,t){let n;try{n=new URL(e.trim())}catch{return`That isn't a full address. Copy everything in the address bar, starting with http.`}let r=n.searchParams.get(`error`);if(r)return r===`access_denied`?`Google says access was denied. Start again and click Allow.`:`Google returned an error: ${r}`;if(!n.searchParams.get(`code`))return`This address has no authorization code. Make sure you copied it after clicking Allow.`;let i=n.searchParams.get(`state`);return i&&i!==t?`This address belongs to an older sign-in attempt. Use the newest one.`:null}function I({res:e,onConnected:n}){let[r,i]=(0,M.useState)(!1),[o,s]=(0,M.useState)(``),[l,u]=(0,M.useState)(),[d,f]=(0,M.useState)(!1),p=o.trim()?F(o,e.state):null;return(0,N.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),o.trim()&&!p){f(!0),u(void 0);try{n(await a(`/api/accounts/connect/complete`,{body:{url:o.trim()}}))}catch(e){u(e)}finally{f(!1)}}},className:`space-y-4`,children:[(0,N.jsxs)(`ol`,{className:`space-y-4 text-sm`,children:[(0,N.jsxs)(`li`,{className:`flex gap-3`,children:[(0,N.jsx)(L,{n:1}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,N.jsx)(`p`,{children:`Open Google sign-in and allow access.`}),(0,N.jsx)(t,{asChild:!0,variant:r?`outline`:`default`,size:`sm`,children:(0,N.jsxs)(`a`,{href:e.authUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>i(!0),children:[(0,N.jsx)(h,{}),` `,r?`Open sign-in again`:`Open Google sign-in`]})})]})]}),(0,N.jsxs)(`li`,{className:`flex gap-3`,children:[(0,N.jsx)(L,{n:2}),(0,N.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[`After you click `,(0,N.jsx)(`strong`,{children:`Allow`}),`, the tab lands on a page that probably won't load (like "This site can't be reached"). That's expected.`]})]}),(0,N.jsxs)(`li`,{className:`flex gap-3`,children:[(0,N.jsx)(L,{n:3}),(0,N.jsxs)(b,{className:`min-w-0 flex-1`,"data-invalid":!!p,children:[(0,N.jsx)(_,{htmlFor:`pasted-url`,children:`Copy the full address from that tab's address bar and paste it here`}),(0,N.jsx)(j,{id:`pasted-url`,rows:3,spellCheck:!1,placeholder:`http://localhost:8425/oauth/callback?state=…&code=…`,className:`font-mono text-xs break-all`,value:o,onChange:e=>s(e.target.value),"aria-invalid":!!p}),p?(0,N.jsx)(y,{children:p}):(0,N.jsx)(v,{children:`It contains a one-time code; it can't be reused.`})]})]})]}),l!==void 0&&(0,N.jsx)(g,{error:l,title:`Couldn't finish connecting`}),(0,N.jsx)(`div`,{className:`flex justify-end`,children:(0,N.jsxs)(t,{type:`submit`,disabled:!o.trim()||!!p||d,children:[d&&(0,N.jsx)(c,{}),`Finish connecting`]})}),(0,N.jsx)(P,{})]})}function L({n:e}){return(0,N.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-medium tabular`,"aria-hidden":!0,children:e})}var R=e=>!!e&&typeof e==`object`&&e.type===`agentinbox:oauth`,z=null;function B(e={}){z?.(e)}function V(){let e=Math.max(0,window.screenX+(window.outerWidth-520)/2),t=Math.max(0,window.screenY+(window.outerHeight-700)/2),n=window.open(``,`agentinbox-oauth`,`popup,width=520,height=700,left=${e},top=${t}`);try{n?.document.write(`<title>Connecting…</title><body style="font:14px system-ui;display:grid;place-items:center;height:90vh;color:#666">Opening Google sign-in…</body>`)}catch{}return n}function H(){let n=o(),r=d(i.googleClient()),[u,_]=(0,M.useState)(null),[v,y]=(0,M.useState)({}),b=(0,M.useRef)(new Set),j=e=>{_(t=>(t?.kind===`waiting`&&t.popup?.close(),{kind:`done`,email:e})),n.invalidateQueries({queryKey:l.accounts}),n.invalidateQueries({queryKey:l.setupState}),n.invalidateQueries({queryKey:l.overview})},F=(0,M.useRef)(j),L=(0,M.useRef)(!1),H=(0,M.useRef)(null);(0,M.useEffect)(()=>{F.current=j,L.current=u?.kind===`starting`||u?.kind===`waiting`;try{H.current=r.data?new URL(r.data.redirectUri).origin:null}catch{H.current=null}});let U=async e=>{y(e);let t=r.data,o=t?.callbackMode===`paste`?null:V();_({kind:`starting`});let s=t??await n.fetchQuery(i.googleClient()).catch(()=>void 0);if(s&&(!s.clientId||!s.hasSecret)){o?.close(),_({kind:`not-configured`});return}let c=n.getQueryData(l.accounts)??await n.fetchQuery(i.accounts()).catch(()=>[]);b.current=new Set(c.map(e=>e.id));try{let t=await a(`/api/accounts/connect`,{body:e.reauthAccountId?{reauthAccountId:e.reauthAccountId}:{}});o&&t.callbackMode===`direct`?o.location.href=t.authUrl:o?.close(),_({kind:`waiting`,res:t,popup:t.callbackMode===`direct`?o:null,closed:!1})}catch(e){o?.close(),_({kind:`error`,error:e})}},W=(0,M.useRef)(U);(0,M.useEffect)(()=>{W.current=U}),(0,M.useEffect)(()=>(z=e=>void W.current(e),()=>{z=null}),[]),(0,M.useEffect)(()=>{let e=e=>{R(e.data)&&L.current&&(e.origin&&e.origin!==window.location.origin&&e.origin!==H.current||(e.data.ok?F.current(e.data.email??`Your account`):_({kind:`error`,error:Error(e.data.error??`Google sign-in failed`)})))};window.addEventListener(`message`,e);let t=`BroadcastChannel`in window?new BroadcastChannel(`agentinbox-oauth`):void 0;return t&&(t.onmessage=e),()=>{window.removeEventListener(`message`,e),t?.close()}},[]),A(e=>{if(e.kind!==`account`||u?.kind!==`waiting`&&u?.kind!==`starting`)return;let t=e.data,n=v.reauthAccountId;(n?t.id===n&&t.status===`active`:!b.current.has(t.id))&&j(t.email)});let G=u?.kind===`waiting`?u.popup:null;(0,M.useEffect)(()=>{if(!G)return;let e=setInterval(()=>{G.closed&&(clearInterval(e),_(e=>e?.kind===`waiting`?{...e,closed:!0}:e))},600);return()=>clearInterval(e)},[G]);let K=async()=>{let t=await n.fetchQuery({...i.accounts(),staleTime:0}),r=v.reauthAccountId,a=t.find(e=>r?e.id===r&&e.status===`active`:!b.current.has(e.id));a?j(a.email):e.info(`No new account yet`,{description:`Finish signing in with Google, or start again.`})},q=()=>{u?.kind===`waiting`&&u.popup?.close(),_(null)},J=()=>void U(v),Y=v.email;return(0,N.jsx)(k,{open:!!u,onOpenChange:e=>!e&&q(),children:(0,N.jsxs)(E,{className:`sm:max-w-lg`,children:[(0,N.jsxs)(w,{children:[(0,N.jsx)(D,{children:Y?`Reconnect ${Y}`:`Connect a Gmail account`}),(0,N.jsx)(O,{children:u?.kind===`waiting`&&u.res.callbackMode===`paste`?`Sign in with Google in a new tab, then paste back the address you land on.`:`Sign in with Google and allow agentinbox to manage the mailbox.`})]}),u?.kind===`starting`&&(0,N.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-sm text-muted-foreground`,children:[(0,N.jsx)(c,{}),` Preparing Google sign-in…`]}),u?.kind===`not-configured`&&(0,N.jsxs)(f,{variant:`warning`,children:[(0,N.jsx)(x,{}),(0,N.jsx)(m,{children:`Set up the Google OAuth client first`}),(0,N.jsx)(p,{children:`agentinbox signs in to Gmail with your own Google OAuth client. Add its client ID and secret, then come back here.`})]}),u?.kind===`error`&&(0,N.jsx)(g,{error:u.error,title:`Couldn't connect the account`}),u?.kind===`done`&&(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-6 text-center`,children:[(0,N.jsx)(S,{className:`size-10 text-success`}),(0,N.jsxs)(`div`,{className:`font-medium`,children:[u.email,` is connected`]}),(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Mail starts syncing now. Give agents access from the Agents page.`})]}),u?.kind===`waiting`&&u.res.callbackMode===`direct`&&(0,N.jsxs)(`div`,{className:`space-y-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border bg-muted/40 p-3 text-sm`,children:[(0,N.jsx)(c,{className:`mt-0.5`}),(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsx)(`div`,{className:`font-medium`,children:u.closed?`Finished in the other window?`:`Waiting for Google…`}),(0,N.jsx)(`p`,{className:`text-muted-foreground`,children:u.closed?`If you approved access, this updates automatically in a moment. If you closed the window early, open sign-in again.`:u.popup?`Complete sign-in in the pop-up window. This dialog updates on its own when you're done.`:`Your browser blocked the pop-up. Open sign-in with the button below.`})]})]}),(0,N.jsx)(P,{})]}),u?.kind===`waiting`&&u.res.callbackMode===`paste`&&(0,N.jsx)(I,{res:u.res,onConnected:e=>j(e.email)}),(0,N.jsxs)(T,{children:[u?.kind===`not-configured`&&(0,N.jsx)(t,{asChild:!0,onClick:q,children:(0,N.jsx)(s,{to:`/get-started`,search:{step:`client`},children:`Set up OAuth client`})}),u?.kind===`error`&&(0,N.jsxs)(t,{onClick:J,children:[(0,N.jsx)(C,{}),` Try again`]}),u?.kind===`waiting`&&u.res.callbackMode===`direct`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(t,{variant:`ghost`,onClick:K,children:`I'm done, check again`}),(0,N.jsx)(t,{variant:`outline`,asChild:!0,children:(0,N.jsxs)(`a`,{href:u.res.authUrl,target:`agentinbox-oauth`,rel:`opener`,children:[(0,N.jsx)(h,{}),` Open sign-in again`]})})]}),u?.kind===`done`&&(0,N.jsxs)(N.Fragment,{children:[!Y&&(0,N.jsx)(t,{variant:`outline`,onClick:()=>B(),children:`Connect another`}),(0,N.jsx)(t,{onClick:q,children:`Done`})]})]})]})})}export{B as n,P as r,H as t};
@@ -0,0 +1 @@
1
+ import{B as e,ht as t,mt as n,vt as r}from"./queries-a3M5_loa.js";import{t as i}from"./useSelector-D70eKNYs.js";import{t as a}from"./chevron-right-CbBKS6-T.js";import{J as o,Y as s}from"./index-Bd4Y5wSp.js";function c(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=l(e);if(n.length!==l(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function l(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var u=r(t(),1);function d(e){return f(e)||typeof e==`function`||p(e)}function f(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function p(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function m(e,t){return e==null?null:d(e)?u.createElement(e,t):e}function h(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?m(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:m(n.cell,t.getContext())}return`header`in e&&e.header?m(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?m(e.footer.column.columnDef.footer,e.footer.getContext()):null}function ee(e){let t=i(e.source,e.selector,{compare:c});return typeof e.children==`function`?e.children(t):e.children}function g(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function te(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return(!a||!i(o,t))&&(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function _(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{(!n||!t(r,e))&&i(e)})}}function v(){return te({createAtom:s,batch:o})}function y(e,t){return typeof e==`function`?e(t):e}function b(e){if(Array.isArray(e))return e.map(b);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?x():{},r=Object.keys(e);for(let t=0;t<r.length;t++){let i=r[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:b(e[i]),writable:!0})}return n}return e}function x(){return Object.create(null)}function S(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ne(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var re=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e<l.length;e++)if(l[e]!==o[e]){u=!0;break}}return n?.(u),u&&(o=l,a?.(),s=e(...l??[]),r?.(s)),s}};function ie(e){let t=!1;return()=>{t?e():t=!0}}function C({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o={onAfterUpdate:r?()=>{let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))}:void 0};return re({...a,...o})}function w(e,t=`_`){let[n,r]=e.replace(t,` `).split(` `);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function T(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=w(r);t[n]=a?C({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function E(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=w(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=C({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function ae(e){return e.row.getValue(e.column.id)}function oe(e){return e.getValue()??e.table.options.renderFallbackValue}function se(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var ce={assignCellPrototype:(e,t)=>{E(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>ae(e)},cell_renderValue:{fn:e=>oe(e)},cell_getContext:{fn:e=>se(e),memoDeps:e=>[e]}})}};function le(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function ue(e,t,n,r){let i={...e.getDefaultColumnDef(),...t},a=i.accessorKey,o=a===void 0?void 0:String(a),s=i.id??o?.replaceAll(`.`,`_`)??(typeof i.header==`string`?i.header:void 0),c;if(i.accessorFn)c=i.accessorFn;else if(a!==void 0){if(typeof a==`string`&&a.includes(`.`)){let e=a.split(`.`);c=t=>{let n=t;for(let t=0;t<e.length;t++){let r=e[t];n=n?.[r]}return n}}else c=e=>e[i.accessorKey]}if(!s)throw Error();let l=le(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function D(e){return e.getIsVisible?.()??!0}function de(e){return e.getVisibleLeafColumns?.()??e.getAllLeafColumns()}function O(e,t){let n=e,r=t;return n.getOrderColumnsFn?.()(r)??n._orderGroupedColumns?.(r)??t}function fe(e,t,n,r){return e._orderByColumnPinning?.(t,n,r)??t}function pe(e,t){return e._expandRows?.(t)??t}function me(e){e.autoResetExpanded?.()}function k(e){e.autoResetPageIndex?.()}function A(e){e.autoResetSorting?.()}function j(e){e.autoResetCellSelection?.()}function M(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}function N(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return O(e.table,t)}return[e]}function P(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function F(e,t,n,r=0){let i=Array(t.length);for(let a=0;a<t.length;a++){if(!(a in t))continue;let o=t[a],s=ue(e,o,r,n),c=o;s.columns=c.columns?F(e,c.columns,s,r+1):[],i[a]=s}return i}function I(e){return F(e,e.options.columns)}function L(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}function R(e){let t=x(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function z(e){return O(e,e.getAllColumns().flatMap(e=>e.getLeafColumns()))}function he(e){let t=x(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function ge(e,t){return e.getAllFlatColumnsById()[t]}var _e={assignColumnPrototype:(e,t)=>{E(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>M(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>N(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{T(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>P(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>I(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>L(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>R(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>z(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>he(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>ge(e,t)}})}};function ve(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function B(e,t,n){let r=ve(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];let a=e._headerInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function V(e,t=1){let n=t;for(let r=0;r<e.length;r++){let i=e[r];D(i)&&i.columns.length&&(n=Math.max(n,V(i.columns,t+1)))}return n}function ye(e,t){return e?`${e}_${t}`:String(t)}function be(e,t,n,r){let i=e??``;return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function xe(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function H(e,t,n,r,i,a){let o={depth:t,id:ye(r,t),headers:[]},s=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i],c=s[s.length-1],l=a.column.depth===o.depth,u,d=!1;if(l&&a.column.parent?u=a.column.parent:(u=a.column,d=!0),c&&c.column===u)c.subHeaders.push(a);else{let e=B(n,u,{id:be(r,t,u.id,a.id),isPlaceholder:d,placeholderId:d?String(xe(s,u)):void 0,depth:t,index:s.length});e.subHeaders.push(a),s.push(e)}o.headers.push(a),a.headerGroup=o}for(let e=0;e<a.length;e++)a[e](o);i.push(o),t>0&&H(s,t-1,n,r,i,a)}function U(e){for(let t=0;t<e.length;t++){let n=e[t];if(!D(n.column))continue;let r=0;if(n.subHeaders.length){U(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){let t=n.subHeaders[e];D(t.column)&&(r+=t.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=t.subHeaders.length===1&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function Se(e,t,n,r){let i=V(e),a=[],o=n._headerGroupInstanceInitFns,s=Array(t.length);for(let e=0;e<t.length;e++)e in t&&(s[e]=B(n,t[e],{depth:i,index:e}));return H(s,i-1,n,r,a,o),a.reverse(),U(a[0]?.headers??[]),a}function W(e,t){for(let n=0;n<e.subHeaders.length;n++)W(e.subHeaders[n],t);t.push(e)}function Ce(e){let t=[];return W(e,t),t}function we(e){return{column:e.column,header:e,table:e.column.table}}function Te(e){return Se(e.getAllColumns(),fe(e,de(e),e=>e.id),e)}function Ee(e){return[...e.getHeaderGroups()].reverse()}function De(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Oe(e){let t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){let r=t[e].getLeafHeaders();for(let e=0;e<r.length;e++)n.push(r[e])}return n}var ke={assignHeaderPrototype:(e,t)=>{E(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>Ce(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>we(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{T(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>Te(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>Ee(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>De(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>Oe(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function Ae(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}var je=(e,t,n,r,i,a,o)=>{let s=Ae(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=x(),c._valuesCache=x(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e<l.length;e++)l[e](c);return c};function Me(){return e=>C({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>Ne(e,e.options.data),onAfterUpdate:ie(()=>{me(e),k(e),A(e),j(e)})})}function G(e,t,n,r=0,i){let a=[];for(let o=0;o<n.length;o++){let s=n[o],c=je(e,e.getRowId(s,o,i),s,o,r,void 0,i?.id);t.flatRows.push(c),t.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(s,o),c.originalSubRows?.length&&(c.subRows=G(e,t,c.originalSubRows,r+1,c)))}return a}function Ne(e,t){let n={rows:[],flatRows:[],rowsById:x()};return n.rows=G(e,n,t),n}function K(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??Me()(e)),e._rowModels.coreRowModel()}function Pe(e){return e.getCoreRowModel()}function Fe(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function Ie(e){return e.getFilteredRowModel()}function Le(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function Re(e){return e.getGroupedRowModel()}function ze(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function Be(e){return e.getSortedRowModel()}function Ve(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function He(e){return e.getExpandedRowModel()}function Ue(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function We(e){return e.getPaginatedRowModel()}var Ge={constructTableAPIs:e=>{T(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>K(e)},table_getPreFilteredRowModel:{fn:()=>Pe(e)},table_getFilteredRowModel:{fn:()=>Fe(e)},table_getPreGroupedRowModel:{fn:()=>Ie(e)},table_getGroupedRowModel:{fn:()=>Le(e)},table_getPreSortedRowModel:{fn:()=>Re(e)},table_getSortedRowModel:{fn:()=>ze(e)},table_getPreExpandedRowModel:{fn:()=>Be(e)},table_getExpandedRowModel:{fn:()=>Ve(e)},table_getPrePaginatedRowModel:{fn:()=>He(e)},table_getPaginatedRowModel:{fn:()=>Ue(e)},table_getRowModel:{fn:()=>We(e)}})}};function Ke(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function qe(e,t,n){let r=Ke(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;let a=n._cellInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function Je(e){let t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function Ye(e){let t=e.getPrePaginatedRowModel(),n=e.options.paginateExpandedRows===!1?pe(e,t).rows:t.rows;for(let e=0;e<n.length;e++)n[e]._displayIndexCache=e;return n}function Xe(e,t){if(S(e._valuesCache,t))return e._valuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function Ze(e,t){if(S(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function Qe(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function $e(e){return ne(e.subRows,e=>e.subRows)}function et(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}function tt(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function nt(e){let t=[],n=e;for(;;){let e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}function rt(e){let t=e.table.getAllLeafColumns(),n=e._cellsCache;n||=e._cellsCache=new WeakMap;let r=Array(t.length);for(let i=0;i<t.length;i++){let a=t[i],o=n.get(a);o||(o=qe(a,e,e.table),n.set(a,o)),r[i]=o}return r}function it(e){let t=x(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];t[r.column.id]=r}return t}function at(e,t,n,r){return t.options.getRowId?.(e,n,r)??(r?`${r.id}.${n}`:String(n))}function ot(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw Error();return r}var st={assignRowPrototype:(e,t)=>{E(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>Je(e)},row_getAllCellsByColumnId:{fn:e=>it(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>rt(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>$e(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>tt(e)},row_getParentRows:{fn:e=>nt(e)},row_getUniqueValues:{fn:(e,t)=>Ze(e,t)},row_getValue:{fn:(e,t)=>Xe(e,t)},row_renderValue:{fn:(e,t)=>Qe(e,t)}})},constructTableAPIs:e=>{T(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>Ye(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>at(t,e,n,r)},table_getRow:{fn:(t,n)=>ot(e,t,n)},table_getMaxSubRowDepth:{fn:()=>et(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function q(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function J(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{q(e,t,n),e._reactivity.commit?.()})}function ct(e){let t=b(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];e.baseAtoms[i].set(t[i])}});let n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}function lt(e,t){let{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};let a=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...o,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function Y(e,t,n){let r=lt(e,y(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,n?.syncExternalState!==!1&&J(e,r.state??null)}var ut={coreCellsFeature:ce,coreColumnsFeature:_e,coreHeadersFeature:ke,coreRowModelsFeature:Ge,coreRowsFeature:st,coreTablesFeature:{constructTableAPIs:e=>{T(`coreTablesFeature`,e,{table_reset:{fn:()=>ct(e)},table_setOptions:{fn:t=>Y(e,t)}})}}};function dt(){return{accessor:(e,t)=>typeof e==`function`?{...t,accessorFn:e}:{...t,accessorKey:e},columns:e=>e,display:e=>e,group:e=>e}}function ft(e){return e}function pt(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),b(t)}function mt(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:l,filterFns:u,filterMeta:d,filteredRowModel:f,groupedRowModel:p,paginatedRowModel:m,sortFns:h,sortedRowModel:ee,tableMeta:te,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...ut,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:u,sortFns:h},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=pt(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&S(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}q(v),v.store=g(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:c,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}var ht=typeof window>`u`?u.useEffect:u.useLayoutEffect;function gt(e,t){let[{table:n,rootSource:r}]=(0,u.useState)(()=>{let t=mt({...e,features:{coreReactivityFeature:v(),...e.features}});return t.Subscribe=(e=>ee({...e,source:e.source??t.store})),t.FlexRender=h,{table:t,rootSource:_(t.store,c)}}),a=n;Y(a,t=>({...t,...e}),{syncExternalState:!1});let o=a.options.state,s=r.get(),l=i(r,t,{compare:c});return ht(()=>{r.markCommitted(s),J(a,o??null,c)}),(0,u.useMemo)(()=>({...n,options:e,state:l}),[n,e,l])}var X=n();function _t({className:t,...n}){return(0,X.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,X.jsx)(`table`,{"data-slot":`table`,className:e(`w-full caption-bottom text-sm`,t),...n})})}function vt({className:t,...n}){return(0,X.jsx)(`thead`,{"data-slot":`table-header`,className:e(`[&_tr]:border-b`,t),...n})}function yt({className:t,...n}){return(0,X.jsx)(`tbody`,{"data-slot":`table-body`,className:e(`[&_tr:last-child]:border-0`,t),...n})}function Z({className:t,...n}){return(0,X.jsx)(`tr`,{"data-slot":`table-row`,className:e(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,t),...n})}function Q({className:t,...n}){return(0,X.jsx)(`th`,{"data-slot":`table-head`,className:e(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,t),...n})}function $({className:t,...n}){return(0,X.jsx)(`td`,{"data-slot":`table-cell`,className:e(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,t),...n})}var bt=ft({columnMeta:{}}),xt=()=>dt();function St({columns:t,data:n,getRowId:r,renderExpanded:i,rowClassName:o,empty:s,className:c}){let l=gt({features:bt,columns:t,data:n,getRowId:e=>r(e)}),[d,f]=(0,u.useState)(()=>new Set),p=e=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),m=t.length+ +!!i,h=l.getRowModel().rows;return(0,X.jsx)(`div`,{className:e(`overflow-hidden rounded-xl border`,c),children:(0,X.jsxs)(_t,{children:[(0,X.jsx)(vt,{className:`bg-muted/40`,children:l.getHeaderGroups().map(t=>(0,X.jsxs)(Z,{className:`hover:bg-transparent`,children:[i&&(0,X.jsx)(Q,{className:`w-8 pr-0`,"aria-label":`Expand`}),t.headers.map(t=>(0,X.jsx)(Q,{className:e(`text-xs`,t.column.columnDef.meta?.className),children:t.isPlaceholder?null:(0,X.jsx)(l.FlexRender,{header:t})},t.id))]},t.id))}),(0,X.jsxs)(yt,{children:[h.length===0&&(0,X.jsx)(Z,{className:`hover:bg-transparent`,children:(0,X.jsx)($,{colSpan:m,className:`h-32 text-center text-sm whitespace-normal text-muted-foreground`,children:s??`Nothing here.`})}),h.map(t=>{let n=d.has(t.id);return(0,X.jsxs)(u.Fragment,{children:[(0,X.jsxs)(Z,{"data-state":n?`selected`:void 0,className:e(i&&`cursor-pointer`,o?.(t.original)),onClick:i?e=>{e.target.closest(`button, a, input, [role=switch]`)||p(t.id)}:void 0,children:[i&&(0,X.jsx)($,{className:`w-8 pr-0`,children:(0,X.jsx)(`button`,{type:`button`,className:`flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,"aria-expanded":n,"aria-label":n?`Hide details`:`Show details`,onClick:()=>p(t.id),children:(0,X.jsx)(a,{className:e(`size-4 transition-transform`,n&&`rotate-90`)})})}),t.getAllCells().map(e=>(0,X.jsx)($,{className:e.column.columnDef.meta?.className,children:(0,X.jsx)(l.FlexRender,{cell:e})},e.id))]}),n&&i&&(0,X.jsx)(Z,{className:`bg-muted/20 hover:bg-muted/20`,children:(0,X.jsx)($,{colSpan:m,className:`p-0 whitespace-normal`,children:(0,X.jsx)(`div`,{className:`p-4`,children:i(t.original)})})})]},t.id)})]})]})})}export{xt as n,St as t};
@@ -0,0 +1 @@
1
+ import{B as e,f as t,ht as n,mt as r}from"./queries-a3M5_loa.js";import{t as i}from"./x-BHjDLXNO.js";import{B as a,F as o,I as s,L as c,N as l,P as u,R as d,z as f}from"./index-Bd4Y5wSp.js";n();var p=r();function m({...e}){return(0,p.jsx)(l,{"data-slot":`dialog`,...e})}function h({...e}){return(0,p.jsx)(a,{"data-slot":`dialog-trigger`,...e})}function g({...e}){return(0,p.jsx)(d,{"data-slot":`dialog-portal`,...e})}function _({className:t,...n}){return(0,p.jsx)(c,{"data-slot":`dialog-overlay`,className:e(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,t),...n})}function v({className:n,children:r,showCloseButton:a=!0,onInteractOutside:s,...c}){return(0,p.jsxs)(g,{children:[(0,p.jsx)(_,{}),(0,p.jsxs)(o,{"data-slot":`dialog-content`,className:e(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),onInteractOutside:e=>{e.target?.closest?.(`[data-sonner-toaster]`)&&e.preventDefault(),s?.(e)},...c,children:[r,a&&(0,p.jsx)(u,{"data-slot":`dialog-close`,asChild:!0,children:(0,p.jsxs)(t,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,p.jsx)(i,{}),(0,p.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function y({className:t,...n}){return(0,p.jsx)(`div`,{"data-slot":`dialog-header`,className:e(`flex flex-col gap-2`,t),...n})}function b({className:n,showCloseButton:r=!1,children:i,...a}){return(0,p.jsxs)(`div`,{"data-slot":`dialog-footer`,className:e(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,n),...a,children:[i,r&&(0,p.jsx)(u,{asChild:!0,children:(0,p.jsx)(t,{variant:`outline`,children:`Close`})})]})}function x({className:t,...n}){return(0,p.jsx)(f,{"data-slot":`dialog-title`,className:e(`font-heading text-base leading-none font-medium`,t),...n})}function S({className:t,...n}){return(0,p.jsx)(s,{"data-slot":`dialog-description`,className:e(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,t),...n})}export{y as a,b as i,v as n,x as o,S as r,h as s,m as t};
@@ -0,0 +1 @@
1
+ import{I as e,M as t,X as n,ht as r,j as i,mt as a,vt as o,z as s}from"./queries-a3M5_loa.js";var c=o(r(),1);function l(e){let t=n();return c.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var u=a(),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(n){let r=n+`CollectionProvider`,[i,a]=t(r),[o,l]=i(r,{collectionRef:{current:null},itemMap:new Map}),d=f(e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,u.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);d.displayName=r;let p=n+`CollectionSlot`,m=e(p),h=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=l(p,n),a=s(t,i.collectionRef);return(0,u.jsx)(m,{ref:a,children:r})});h.displayName=p;let g=n+`CollectionItemSlot`,_=`data-radix-collection-item`,v=e(g),y=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=c.useRef(null),o=s(t,a),d=l(g,n);return c.useEffect(()=>(d.itemMap.set(a,{ref:a,...i}),()=>void d.itemMap.delete(a))),(0,u.jsx)(v,{[_]:``,ref:o,children:r})});y.displayName=g;function b(e){let t=l(n+`CollectionConsumer`,e);return c.useCallback(()=>{let e=t.collectionRef.current;if(!e)return[];let n=Array.from(e.querySelectorAll(`[${_}]`));return Array.from(t.itemMap.values()).sort((e,t)=>n.indexOf(e.ref.current)-n.indexOf(t.ref.current))},[t.collectionRef,t.itemMap])}return f(b,`useCollection`),[{Provider:d,Slot:h,ItemSlot:y},b,a]}f(p,`createCollection`);var m=new WeakMap,h=class e extends Map{static{f(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],m.set(this,!0)}set(e,t){return m.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=v(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=g(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=g(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return g(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function g(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=_(e,t);return n===-1?void 0:e[n]}f(g,`at`);function _(e,t){let n=e.length,r=v(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}f(_,`toSafeIndex`);function v(e){return e!==e||e===0?0:Math.trunc(e)}f(v,`toSafeInteger`);function y(n){let r=n+`CollectionProvider`,[a,o]=t(r),[l,d]=a(r);l.displayName=n+`CollectionStableContextProvider`;let[p,m]=a(r);p.displayName=n+`CollectionStatefulContextProvider`;let g=f(({state:e,...t})=>e?(0,u.jsx)(v,{...t,state:e}):(0,u.jsx)(_,{...t}),`CollectionProvider`);g.displayName=r;let _=f(e=>{let t=k();return(0,u.jsx)(v,{...e,state:t})},`CollectionInit`);_.displayName=n+`CollectionInit`;let v=f(e=>{let{scope:t,children:n,state:r}=e,i=c.useRef(null),[a,o]=c.useState(null),d=s(i,o),[f,m]=r,g=c.useRef(new h),_=c.useCallback(()=>{let e=g.current;return S(e)||e.sort(C),e},[]);return c.useEffect(()=>{if(!a)return;let e=w(()=>{m(e=>{let t=e.toSorted(C);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(a,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[a,m]),(0,u.jsx)(l,{scope:t,collectionElementRef:d,collectionElementRefObject:i,getCollection:_,setCollection:m,registryRef:g,children:(0,u.jsx)(p,{scope:t,collectionElement:a,collection:f,children:n})})},`CollectionProviderImpl`);v.displayName=n+`CollectionProviderImpl`;let y=n+`CollectionSlot`,x=e(y),T=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=d(y,n),a=s(t,i.collectionElementRef);return(0,u.jsx)(x,{ref:a,children:r})});T.displayName=y;let E=n+`CollectionItemSlot`,D=e(E),O=c.forwardRef((e,t)=>{let{scope:n,children:r,...a}=e,o=c.useRef(null),{setCollection:l,registryRef:f}=d(E,n),p=c.useRef(a);b(p.current,a)||(p.current=a);let m=p.current,g=c.useCallback(e=>{let t=f.current;e?t.set(e,{...p.current,element:e}):o.current&&t.delete(o.current)},[f]),_=s(t,g,o);i(()=>{let e=o.current,t=f.current;e&&t.has(e)&&t.set(e,{...m,element:e})},[m,f]);let v=c.useRef(null);return c.useEffect(()=>{let e=o.current,t=v.current;((t?.element??null)!==e||e&&t?.itemData!==m)&&(v.current=e?{element:e,itemData:m}:null,l(n=>{let r=new h(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...m,element:e}),r.sort(C)}))}),c.useEffect(()=>()=>{let e=v.current;v.current=null,e&&l(t=>{if(!t.has(e.element))return t;let n=new h(t);return n.delete(e.element),n})},[l]),(0,u.jsx)(D,{"data-radix-collection-item":``,ref:_,children:r})});O.displayName=E;function k(){return c.useState(new h)}f(k,`useInitCollection`);function A(e){let{collection:t}=m(n+`CollectionConsumer`,e);return t}f(A,`useCollection`);function j(e){let{getCollection:t}=d(n+`CollectionConsumer`,e);return t}return f(j,`useGetCollection`),[{Provider:g,Slot:T,ItemSlot:O},{createCollectionScope:o,useCollection:A,useGetCollection:j,useInitCollection:k}]}f(y,`createCollection`);function b(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}f(b,`shallowEqual`);function x(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}f(x,`isElementPreceding`);function S(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}f(S,`isInDocumentOrder`);function C(e,t){return!e[1].element||!t[1].element?0:x(e[1].element,t[1].element)?-1:1}f(C,`sortByDocumentPosition`);function w(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}f(w,`getChildListObserver`);var T=Object.defineProperty,E=(e,t)=>T(e,`name`,{value:t,configurable:!0}),D={LTR:`ltr`,RTL:`rtl`},O=c.createContext(void 0);function k(e){let t=c.useContext(O);return e||t||D.LTR}E(k,`useDirection`);export{p as n,l as r,k as t};
@@ -0,0 +1 @@
1
+ import{B as e,V as t,mt as n}from"./queries-a3M5_loa.js";var r=n();function i({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty`,className:e(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,t),...n})}function a({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-header`,className:e(`flex max-w-sm flex-col items-center gap-2`,t),...n})}var o=t(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function s({className:t,variant:n=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":n,className:e(o({variant:n,className:t})),...i})}function c({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-title`,className:e(`font-heading text-sm font-medium tracking-tight`,t),...n})}function l({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-description`,className:e(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function u({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`empty-content`,className:e(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance`,t),...n})}export{s as a,a as i,u as n,c as o,l as r,i as t};
@@ -0,0 +1,41 @@
1
+ import{ht as e,vt as t}from"./queries-a3M5_loa.js";var n=t(e(),1),r=Object.defineProperty,i=(e,t)=>r(e,`name`,{value:t,configurable:!0}),a=0,o=null;function s(e){return c(),e.children}i(s,`FocusGuards`);function c(){n.useEffect(()=>{o||={start:l(),end:l()};let{start:e,end:t}=o;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),a++,()=>{a===1&&(o?.start.remove(),o?.end.remove(),o=null),a=Math.max(0,a-1)}},[])}i(c,`useFocusGuards`);function l(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}i(l,`createFocusGuard`);var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},u.apply(this,arguments)};function d(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function f(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var p=`right-scroll-bar-position`,m=`width-before-scroll-bar`,h=`with-scroll-bars-hidden`,g=`--removed-body-scroll-bar-size`;function _(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function v(e,t){var r=(0,n.useState)(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}})[0];return r.callback=t,r.facade}var y=typeof window<`u`?n.useLayoutEffect:n.useEffect,b=new WeakMap;function ee(e,t){var n=v(t||null,function(t){return e.forEach(function(e){return _(e,t)})});return y(function(){var t=b.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||_(e,null)}),i.forEach(function(e){r.has(e)||_(e,a)})}b.set(n,e)},[e]),n}function x(e){return e}function S(e,t){t===void 0&&(t=x);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function C(e){e===void 0&&(e={});var t=S(null);return t.options=u({async:!0,ssr:!1},e),t}var w=function(e){var t=e.sideCar,r=d(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw Error(`Sidecar medium not found`);return n.createElement(i,u({},r))};w.isSideCarExport=!0;function T(e,t){return e.useMedium(t),w}var E=C(),D=function(){},O=n.forwardRef(function(e,t){var r=n.useRef(null),i=n.useState({onScrollCapture:D,onWheelCapture:D,onTouchMoveCapture:D}),a=i[0],o=i[1],s=e.forwardProps,c=e.children,l=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,h=e.sideCar,g=e.noRelative,_=e.noIsolation,v=e.inert,y=e.allowPinchZoom,b=e.as,x=b===void 0?`div`:b,S=e.gapMode,C=d(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),w=h,T=ee([r,t]),O=u(u({},C),a);return n.createElement(n.Fragment,null,p&&n.createElement(w,{sideCar:E,removeScrollBar:f,shards:m,noRelative:g,noIsolation:_,inert:v,setCallbacks:o,allowPinchZoom:!!y,lockRef:r,gapMode:S}),s?n.cloneElement(n.Children.only(c),u(u({},O),{ref:T})):n.createElement(x,u({},O,{className:l,ref:T}),c))});O.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},O.classNames={fullWidth:m,zeroRight:p};var te=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ne(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=te();return t&&e.setAttribute(`nonce`,t),e}function re(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ie(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ae=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ne())&&(re(t,n),ie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oe=function(){var e=ae();return function(t,r){n.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},k=function(){var e=oe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},se={left:0,top:0,right:0,gap:0},A=function(e){return parseInt(e||``,10)||0},ce=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[A(n),A(r),A(i)]},le=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return se;var t=ce(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ue=k(),j=`data-scroll-locked`,M=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${h} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${j}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${p} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${m} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${p} .${p} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${m} .${m} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${j}] {
36
+ ${g}: ${s}px;
37
+ }
38
+ `},N=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},de=function(){n.useEffect(function(){return document.body.setAttribute(j,(N()+1).toString()),function(){var e=N()-1;e<=0?document.body.removeAttribute(j):document.body.setAttribute(j,e.toString())}},[])},fe=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,a=i===void 0?`margin`:i;de();var o=n.useMemo(function(){return le(a)},[a]);return n.createElement(ue,{styles:M(o,!t,a,r?``:`!important`)})},P=!1;if(typeof window<`u`)try{var F=Object.defineProperty({},"passive",{get:function(){return P=!0,!0}});window.addEventListener(`test`,F,F),window.removeEventListener(`test`,F,F)}catch{P=!1}var I=P?{passive:!1}:!1,pe=function(e){return e.tagName===`TEXTAREA`},L=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!pe(e)&&n[t]===`visible`)},R=function(e){return L(e,`overflowY`)},z=function(e){return L(e,`overflowX`)},B=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),H(e,r)){var i=U(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},V=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},me=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},H=function(e,t){return e===`v`?R(t):z(t)},U=function(e,t){return e===`v`?V(t):me(t)},he=function(e,t){return e===`h`&&t===`rtl`?-1:1},ge=function(e,t,n,r,i){var a=he(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=U(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&H(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},W=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},G=function(e){return[e.deltaX,e.deltaY]},K=function(e){return e&&`current`in e?e.current:e},_e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ve=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},ye=0,q=[];function be(e){var t=n.useRef([]),r=n.useRef([0,0]),i=n.useRef(),a=n.useState(ye++)[0],o=n.useState(k)[0],s=n.useRef(e);n.useEffect(function(){s.current=e},[e]),n.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${a}`);var t=f([e.lockRef.current],(e.shards||[]).map(K),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${a}`)}),function(){document.body.classList.remove(`block-interactivity-${a}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${a}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=n.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var n=W(e),a=r.current,o=`deltaX`in e?e.deltaX:a[0]-n[0],c=`deltaY`in e?e.deltaY:a[1]-n[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=B(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=B(d,u)),!m)return!1;if(!i.current&&`changedTouches`in e&&(o||c)&&(i.current=l),!l)return!0;var h=i.current||l;return ge(h,t,e,h===`h`?o:c,!0)},[]),l=n.useCallback(function(e){var n=e;if(q.length&&q[q.length-1]===o){var r=`deltaY`in n?G(n):W(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&_e(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var a=(s.current.shards||[]).map(K).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?c(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=n.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:xe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=n.useCallback(function(e){r.current=W(e),i.current=void 0},[]),p=n.useCallback(function(t){u(t.type,G(t),t.target,c(t,e.lockRef.current))},[]),m=n.useCallback(function(t){u(t.type,W(t),t.target,c(t,e.lockRef.current))},[]);n.useEffect(function(){return q.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener(`wheel`,l,I),document.addEventListener(`touchmove`,l,I),document.addEventListener(`touchstart`,d,I),function(){q=q.filter(function(e){return e!==o}),document.removeEventListener(`wheel`,l,I),document.removeEventListener(`touchmove`,l,I),document.removeEventListener(`touchstart`,d,I)}},[]);var h=e.removeScrollBar,g=e.inert;return n.createElement(n.Fragment,null,g?n.createElement(o,{styles:ve(a)}):null,h?n.createElement(fe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Se=T(E,be),J=n.forwardRef(function(e,t){return n.createElement(O,u({},e,{ref:t,sideCar:Se}))});J.classNames=O.classNames;var Ce=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Y=new WeakMap,X=new WeakMap,Z={},Q=0,$=function(e){return e&&(e.host||$(e.parentNode))},we=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Te=function(e,t,n,r){var i=we(t,Array.isArray(e)?e:[e]);Z[n]||(Z[n]=new WeakMap);var a=Z[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Y.get(e)||0)+1,l=(a.get(e)||0)+1;Y.set(e,c),a.set(e,l),o.push(e),c===1&&i&&X.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Q++,function(){o.forEach(function(e){var t=Y.get(e)-1,i=a.get(e)-1;Y.set(e,t),a.set(e,i),t||(X.has(e)||e.removeAttribute(r),X.delete(e)),i||e.removeAttribute(n)}),Q--,Q||(Y=new WeakMap,Y=new WeakMap,X=new WeakMap,Z={})}},Ee=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ce(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Te(r,i,n,`aria-hidden`)):function(){return null}};export{J as n,c as r,Ee as t};
@@ -0,0 +1 @@
1
+ import{B as e,G as t,ht as n,mt as r,vt as i}from"./queries-a3M5_loa.js";import{t as a}from"./chevron-right-CbBKS6-T.js";import{A as o,_ as s,f as c,p as l,t as u,u as d}from"./common-PG6weTqi.js";import{t as f}from"./key-round-CVIZRCLM.js";import{t as p}from"./mail-CAVmuESo.js";import{t as m}from"./paperclip-QFjM4y6n.js";import{t as h}from"./send-BhQwhuJo.js";import{t as g}from"./tag-CP72Kk6Y.js";import{U as _}from"./index-Bd4Y5wSp.js";import{s as v}from"./labels-C_Pwium9.js";var y={name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]};y.node;var b=t(y),x=i(n(),1),S=r(),C={"message.received":p,"message.sent":h,"thread.reply_received":b,"label.added":g,"label.removed":g,"account.auth_failed":f,"sync.gap":_},w=[`account.auth_failed`,`sync.gap`];function T({type:t,className:n}){let r=C[t]??p;return(0,S.jsx)(`span`,{className:e(`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted`,w.includes(t)&&`bg-warning/15 text-warning`,n),"aria-hidden":!0,children:(0,S.jsx)(r,{className:`size-4`})})}function E(e){return e.message?e.message.subject||`(no subject)`:e.type===`account.auth_failed`?`Google rejected the account's token. Reconnect it on the Accounts page.`:e.type===`sync.gap`?`Events may be missing: history was too old, so a bounded resync ran.`:v[e.type]?.description??e.type}function D({event:t,fresh:n}){let[r,i]=(0,x.useState)(!1),s=t.message,c=v[t.type];return(0,S.jsxs)(`li`,{className:e(n&&`animate-in duration-500 fade-in slide-in-from-top-1`),children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`flex w-full items-start gap-3 px-4 py-3 text-left outline-none hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:[(0,S.jsx)(T,{type:t.type}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,S.jsx)(o,{variant:`outline`,className:`font-normal`,children:c?.label??t.type}),(0,S.jsx)(`span`,{className:`truncate`,children:t.accountEmail}),s?.from&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,S.jsxs)(`span`,{className:`truncate`,children:[`from `,l(s.from)]})]}),s?.hasAttachments&&(0,S.jsx)(m,{className:`size-3.5`,"aria-label":`Has attachments`})]}),(0,S.jsx)(`div`,{className:e(`truncate text-sm`,s?`font-medium`:`text-muted-foreground`),children:E(t)}),s?.snippet&&(0,S.jsx)(`div`,{className:`line-clamp-1 text-xs text-muted-foreground`,children:s.snippet})]}),(0,S.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 pt-0.5 text-xs text-muted-foreground`,children:[(0,S.jsx)(d,{date:t.createdAt}),(0,S.jsx)(a,{className:e(`size-4 transition-transform`,r&&`rotate-90`)})]})]}),r&&(0,S.jsx)(O,{event:t})]})}function O({event:e}){let t=e.message,n=[[`Event`,(0,S.jsxs)(`code`,{className:`font-mono`,children:[e.id,` · #`,e.seq]},`id`)],[`When`,s(e.createdAt)],[`Account`,e.accountEmail]];return t&&n.push([`From`,c(t.from)],[`To`,t.to.map(c).join(`, `)||`—`],...t.cc.length?[[`Cc`,t.cc.map(c).join(`, `)]]:[],[`Date`,s(t.date)],[`Labels`,t.labelIds.join(`, `)||`—`],[`Message`,(0,S.jsx)(`code`,{className:`font-mono break-all`,children:t.id},`msg`)],[`Thread`,(0,S.jsx)(`code`,{className:`font-mono break-all`,children:t.threadId},`thread`)]),e.labelIds?.length&&n.push([e.type===`label.removed`?`Removed`:`Added`,e.labelIds.join(`, `)]),(0,S.jsxs)(`div`,{className:`space-y-3 border-t bg-muted/20 px-4 py-3 sm:pl-15`,children:[(0,S.jsx)(`dl`,{className:`grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs`,children:n.map(([e,t])=>(0,S.jsxs)(`div`,{className:`contents`,children:[(0,S.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,S.jsx)(`dd`,{className:`min-w-0 break-words`,children:t})]},e))}),t?.snippet&&(0,S.jsx)(`p`,{className:`rounded-md border bg-background p-2 text-xs whitespace-pre-wrap text-muted-foreground`,children:t.snippet}),e.detail&&Object.keys(e.detail).length>0&&(0,S.jsx)(u,{code:JSON.stringify(e.detail,null,2)})]})}export{D as t};
@@ -0,0 +1 @@
1
+ import{f as e,ht as t,mt as n,n as r,r as i,vt as a}from"./queries-a3M5_loa.js";import{t as o}from"./useQuery-DAhf1YDH.js";import{t as s}from"./useInfiniteQuery-DE6WChlb.js";import{r as c}from"./dist-B0e3Ju3r.js";import{t as l}from"./activity-zrckFhPk.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-C8tJBHb5.js";import{t as h}from"./card-EQTpqntn.js";import{a as g,k as _,l as v,o as y}from"./common-PG6weTqi.js";import{t as b}from"./event-row-2xoyzgbP.js";import{n as x,t as S}from"./play-DiPk49JH.js";import{f as C,u as w}from"./index-Bd4Y5wSp.js";import{n as T,r as E}from"./stream-C2Tr2d5O.js";import{a as D,i as O,o as k,r as A,t as j}from"./empty-CE_WZGEC.js";import{s as M}from"./labels-C_Pwium9.js";var N=a(t()),P=n(),F=500;function I(){let{accountId:t,type:n}=w.useSearch(),a=c({from:w.fullPath}),I=o(r.accounts()),L=s(r.eventHistory({accountId:t,type:n})),R=E(),[z,B]=(0,N.useState)([]),[V,H]=(0,N.useState)([]),[U,W]=(0,N.useState)(!1),[G,K]=(0,N.useState)(()=>new Set);T(e=>{e.kind===`event`&&(U?H(t=>[e.data,...t].slice(0,F)):(B(t=>[e.data,...t].slice(0,F)),K(t=>new Set(t).add(e.data.id))))});let q=()=>{B(e=>[...V,...e].slice(0,F)),K(new Set(V.map(e=>e.id))),H([]),W(!1)},J=e=>(!t||e.accountId===t)&&(!n||e.type===n),Y=new Set,X=[...z.filter(J),...L.data?.pages.flatMap(e=>e.items)??[]].filter(e=>!Y.has(e.id)&&(Y.add(e.id),!0)).sort((e,t)=>t.seq-e.seq),Z=V.filter(J).length,Q=!!(t||n);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(g,{title:`Live events`,description:`Mail activity across your accounts as agentinbox sees it: what webhooks and wait_for_events deliver to agents.`,actions:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,P.jsx)(v,{tone:U?`idle`:R===`open`?`good`:`warn`,pulse:!U&&R===`open`}),U?`Paused`:R===`open`?`Streaming`:`Reconnecting…`]}),U?(0,P.jsxs)(e,{variant:`outline`,onClick:q,children:[(0,P.jsx)(S,{}),` Resume`,Z>0&&` (${Z} new)`]}):(0,P.jsxs)(e,{variant:`outline`,onClick:()=>W(!0),children:[(0,P.jsx)(x,{}),` Pause`]})]})}),(0,P.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,P.jsxs)(m,{value:t??`all`,onValueChange:e=>void a({search:t=>({...t,accountId:e===`all`?void 0:e}),replace:!0}),children:[(0,P.jsx)(d,{className:`w-full sm:w-64`,"aria-label":`Account`,children:(0,P.jsx)(u,{})}),(0,P.jsxs)(f,{children:[(0,P.jsx)(p,{value:`all`,children:`All accounts`}),I.data?.map(e=>(0,P.jsx)(p,{value:e.id,children:e.email},e.id))]})]}),(0,P.jsxs)(m,{value:n??`all`,onValueChange:e=>void a({search:t=>({...t,type:e===`all`?void 0:e}),replace:!0}),children:[(0,P.jsx)(d,{className:`w-full sm:w-56`,"aria-label":`Event type`,children:(0,P.jsx)(u,{})}),(0,P.jsxs)(f,{children:[(0,P.jsx)(p,{value:`all`,children:`All event types`}),C.map(e=>(0,P.jsx)(p,{value:e,children:M[e].label},e))]})]}),Q&&(0,P.jsx)(e,{variant:`ghost`,onClick:()=>void a({search:{},replace:!0}),children:`Clear filters`})]}),L.isPending?(0,P.jsx)(h,{className:`gap-0 divide-y py-0`,children:Array.from({length:6},(e,t)=>(0,P.jsxs)(`div`,{className:`flex gap-3 p-4`,children:[(0,P.jsx)(_,{className:`size-8`}),(0,P.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,P.jsx)(_,{className:`h-3 w-40`}),(0,P.jsx)(_,{className:`h-4 w-3/4`})]})]},t))}):L.isError?(0,P.jsx)(y,{error:L.error,onRetry:()=>void L.refetch()}):X.length===0?(0,P.jsx)(h,{children:(0,P.jsx)(j,{children:(0,P.jsxs)(O,{children:[(0,P.jsx)(D,{variant:`icon`,children:(0,P.jsx)(l,{})}),(0,P.jsx)(k,{children:Q?`No events match these filters`:`No events yet`}),(0,P.jsx)(A,{children:Q?`Try another account or event type.`:`Events appear here live as mail arrives, is sent or relabeled. Send yourself an email to see one.`})]})})}):(0,P.jsx)(h,{className:`gap-0 py-0`,children:(0,P.jsx)(`ul`,{className:`divide-y`,"aria-live":`polite`,"aria-relevant":`additions`,children:X.map(e=>(0,P.jsx)(b,{event:e,fresh:G.has(e.id)},e.id))})}),L.hasNextPage&&(0,P.jsx)(`div`,{className:`flex justify-center`,children:(0,P.jsxs)(e,{variant:`outline`,onClick:()=>void L.fetchNextPage(),disabled:L.isFetchingNextPage,children:[L.isFetchingNextPage&&(0,P.jsx)(i,{}),` Load older events`]})})]})}export{I as component};
@@ -0,0 +1 @@
1
+ import{G as e}from"./queries-a3M5_loa.js";var t={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{B as e,N as t,V as n,ht as r,mt as i,vt as a}from"./queries-a3M5_loa.js";var o=a(r(),1),s=i(),c=Object.defineProperty,l=o.forwardRef(((e,t)=>c(e,`name`,{value:t,configurable:!0}))(function(e,n){return(0,s.jsx)(t.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),u=Object.defineProperty,d=(e,t)=>u(e,`name`,{value:t,configurable:!0}),f={Horizontal:`horizontal`,Vertical:`vertical`},p=f.Horizontal,m=Object.values(f),h=o.forwardRef(d(function(e,n){let{decorative:r,orientation:i=p,...a}=e,o=g(i)?i:p,c=o===f.Vertical?o:void 0,l=r?{role:`none`}:{"aria-orientation":c,role:`separator`};return(0,s.jsx)(t.div,{"data-orientation":o,...l,...a,ref:n})},`Separator`));function g(e){return m.includes(e)}d(g,`isValidOrientation`);function _({className:t,...n}){return(0,s.jsx)(l,{"data-slot":`label`,className:e(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,t),...n})}function v({className:t,orientation:n=`horizontal`,decorative:r=!0,...i}){return(0,s.jsx)(h,{"data-slot":`separator`,decorative:r,orientation:n,className:e(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,t),...i})}function y({className:t,...n}){return(0,s.jsx)(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function b({className:t,variant:n=`legend`,...r}){return(0,s.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...r})}function x({className:t,...n}){return(0,s.jsx)(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}var S=n(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function C({className:t,orientation:n=`vertical`,...r}){return(0,s.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":n,className:e(S({orientation:n}),t),...r})}function w({className:t,...n}){return(0,s.jsx)(_,{"data-slot":`field-label`,className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,t),...n})}function T({className:t,...n}){return(0,s.jsx)(`p`,{"data-slot":`field-description`,className:e(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function E({className:t,children:n,errors:r,...i}){let a=(0,o.useMemo)(()=>{if(n)return n;if(!r?.length)return null;let e=[...new Map(r.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,s.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,s.jsx)(`li`,{children:e.message},t))})},[n,r]);return a?(0,s.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-sm font-normal text-destructive`,t),...i,children:a}):null}export{w as a,v as c,x as i,_ as l,T as n,b as o,E as r,y as s,C as t};