@lobu/runtime-server 20.0.0 → 20.0.1

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 (194) hide show
  1. package/dist/catalogs/connectors.json +165 -15
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/chat-automation-events.ts +33 -0
  4. package/dist/connectors/discord.ts +2 -0
  5. package/dist/connectors/gchat.ts +2 -0
  6. package/dist/connectors/google_drive.ts +210 -40
  7. package/dist/connectors/slack-automation-events.ts +0 -31
  8. package/dist/connectors/slack.ts +2 -2
  9. package/dist/connectors/teams.ts +2 -0
  10. package/dist/connectors/telegram.ts +2 -0
  11. package/dist/connectors/whatsapp.ts +2 -0
  12. package/dist/dependencies.bun.lock +4 -4
  13. package/dist/guest.bundle.js +13 -1
  14. package/dist/owletto/dist/apple-touch-icon.png +0 -0
  15. package/dist/owletto/dist/assets/{_-WVpKI9q9.js → _-BTmsEMQo.js} +2 -2
  16. package/dist/owletto/dist/assets/_-ea0K1u_g.js +1 -0
  17. package/dist/owletto/dist/assets/{_agentId-U2D1yGV_.js → _agentId-DON3NuNk.js} +1 -1
  18. package/dist/owletto/dist/assets/_agentId-qF8hi8Cf.js +1 -0
  19. package/dist/owletto/dist/assets/{_automationId-BggDSfkK.js → _automationId-Bprfhhg8.js} +1 -1
  20. package/dist/owletto/dist/assets/{_connectorKey._connectionId-BalfcgLi.js → _connectorKey._connectionId-75LMK1pB.js} +1 -1
  21. package/dist/owletto/dist/assets/{_connectorKey.index-IRfifXtO.js → _connectorKey.index-N0fJPz8N.js} +1 -1
  22. package/dist/owletto/dist/assets/{_conversationId-1GSbJquw.js → _conversationId-BY5q9MHG.js} +1 -1
  23. package/dist/owletto/dist/assets/{_deploymentId-DpMLDfMN.js → _deploymentId-DFh2d5Pm.js} +1 -1
  24. package/dist/owletto/dist/assets/_name-OY_X_Zm-.js +1 -0
  25. package/dist/owletto/dist/assets/{_owner-CZwj2Fc5.js → _owner-B92z-CVu.js} +1 -1
  26. package/dist/owletto/dist/assets/_skillKey-CeEE23_w.js +1 -0
  27. package/dist/owletto/dist/assets/{_slug-5SDJ_Zlr.js → _slug-CvHxtUEf.js} +1 -1
  28. package/dist/owletto/dist/assets/accept-invitation-CXSrxBJN.js +1 -0
  29. package/dist/owletto/dist/assets/activity-route-view-C9W2Ipni.js +1 -0
  30. package/dist/owletto/dist/assets/{agent-card-controls-Duh-6QNV.js → agent-card-controls-CLupkefQ.js} +1 -1
  31. package/dist/owletto/dist/assets/{agent-client-setup-list-u6MIKBDe.js → agent-client-setup-list-DgFv4h0W.js} +1 -1
  32. package/dist/owletto/dist/assets/{agent-connect-pages-22bJIutE.js → agent-connect-pages-DT8R_qnj.js} +1 -1
  33. package/dist/owletto/dist/assets/{agent-editor-form-DIo7SWp4.js → agent-editor-form-ayUg3Ws1.js} +1 -1
  34. package/dist/owletto/dist/assets/{agent-guardrails-route-Duv7Rpd9.js → agent-guardrails-route-D-b6CIt2.js} +1 -1
  35. package/dist/owletto/dist/assets/{agent-loading-shells-D6mLqg3d.js → agent-loading-shells-DjMpSoub.js} +1 -1
  36. package/dist/owletto/dist/assets/agent-permissions-matrix-BuGatiEq.js +1 -0
  37. package/dist/owletto/dist/assets/{agent-skill-context-DjPLOCBS.js → agent-skill-context-DKpIFmCh.js} +1 -1
  38. package/dist/owletto/dist/assets/{agent-skills-route-CdCVU8ZJ.js → agent-skills-route-DqIMttMK.js} +1 -1
  39. package/dist/owletto/dist/assets/{agent-subpage-shell-BfomD6m2.js → agent-subpage-shell-Bojgj1uq.js} +1 -1
  40. package/dist/owletto/dist/assets/{agent-thread-COEinkFo.js → agent-thread-R8Pego9t.js} +2 -2
  41. package/dist/owletto/dist/assets/agents-C9x76gSX.js +1 -0
  42. package/dist/owletto/dist/assets/{agents-workbench-BuIaYVFK.js → agents-workbench-BojDv6gX.js} +1 -1
  43. package/dist/owletto/dist/assets/{app._appId-BULz-FRp.js → app._appId-DNNB5FaI.js} +1 -1
  44. package/dist/owletto/dist/assets/{automation-detail-content-Ck6YhKpX.js → automation-detail-content-CzqrHc4P.js} +1 -1
  45. package/dist/owletto/dist/assets/automations-C9x76gSX.js +1 -0
  46. package/dist/owletto/dist/assets/{calendar-BZSx-Jno.js → calendar-VAaxHxss.js} +1 -1
  47. package/dist/owletto/dist/assets/{callback-DTbt2OS1.js → callback-0VB9tUCF.js} +1 -1
  48. package/dist/owletto/dist/assets/{card-BsWGRkun.js → card-HMQT7vU5.js} +1 -1
  49. package/dist/owletto/dist/assets/{claim-6BXg-jBt.js → claim-C2-YTMw-.js} +1 -1
  50. package/dist/owletto/dist/assets/{clients-CJI4gT-V.js → clients-C0I3V7XE.js} +1 -1
  51. package/dist/owletto/dist/assets/{code-editor-C104Bzj2.js → code-editor-hOZHdlxM.js} +1 -1
  52. package/dist/owletto/dist/assets/connect-DSr_gD8x.js +1 -0
  53. package/dist/owletto/dist/assets/connect._clientId-CTamwGrw.js +1 -0
  54. package/dist/owletto/dist/assets/{connected._clientId-L6cpG1ip.js → connected._clientId-BFuU4-8j.js} +1 -1
  55. package/dist/owletto/dist/assets/{connection-CqXJ7EAc.js → connection-De_2AD46.js} +1 -1
  56. package/dist/owletto/dist/assets/{connection-feed-detail-DgZF0nux.js → connection-feed-detail-Cbn85fG9.js} +1 -1
  57. package/dist/owletto/dist/assets/{connector-provenance-DyEHCwrM.js → connector-provenance-B17-ze5S.js} +1 -1
  58. package/dist/owletto/dist/assets/{connectors-zM9Yv-LM.js → connectors-KnNED_-4.js} +1 -1
  59. package/dist/owletto/dist/assets/{consent-CvL2QShm.js → consent-BOYb4pNu.js} +1 -1
  60. package/dist/owletto/dist/assets/{core.esm-DUExfZp5.js → core.esm-COW6Pfy6.js} +1 -1
  61. package/dist/owletto/dist/assets/{create-BiERXyJD.js → create-BFpUZ_mU.js} +1 -1
  62. package/dist/owletto/dist/assets/create-CblXKFGZ.js +1 -0
  63. package/dist/owletto/dist/assets/create-ChUbSYvl.js +1 -0
  64. package/dist/owletto/dist/assets/create-automation-form-CRenA7Ix.js +1 -0
  65. package/dist/owletto/dist/assets/{create._connectorKey-DWUsdgk7.js → create._connectorKey-D4dIDQIQ.js} +1 -1
  66. package/dist/owletto/dist/assets/{cronstrue-Bmga7mGH.js → cronstrue-BrlFh5Jy.js} +1 -1
  67. package/dist/owletto/dist/assets/deployments-DTFrUY7p.js +1 -0
  68. package/dist/owletto/dist/assets/{deployments-body-Cw9tB9-c.js → deployments-body-CXqfjLqj.js} +1 -1
  69. package/dist/owletto/dist/assets/{device-Dy4u9FiS.js → device-B0BBIdVx.js} +1 -1
  70. package/dist/owletto/dist/assets/{device-pin-tombstone-CmAxFq2z.js → device-pin-tombstone-BBYes4en.js} +1 -1
  71. package/dist/owletto/dist/assets/{device-rows-CVv5-okl.js → device-rows-E63OZ9Cp.js} +1 -1
  72. package/dist/owletto/dist/assets/{device._deviceId-DNKPNnE2.js → device._deviceId-JN0cUCGe.js} +1 -1
  73. package/dist/owletto/dist/assets/{entity-options-C5Mj2ZVk.js → entity-options-qan9-Ycm.js} +1 -1
  74. package/dist/owletto/dist/assets/{entity-page-BdTxty8B.js → entity-page-CozUOlVP.js} +1 -1
  75. package/dist/owletto/dist/assets/{entity-type-page-jhiER8wM.js → entity-type-page-xISySjVW.js} +1 -1
  76. package/dist/owletto/dist/assets/{events-feed-CEQj2uAu.js → events-feed-DmZ3Ig3X.js} +1 -1
  77. package/dist/owletto/dist/assets/{full-page-spinner-BSp5F0ls.js → full-page-spinner-Q_J5Wcop.js} +1 -1
  78. package/dist/owletto/dist/assets/guardrails-BB9iOxE3.js +1 -0
  79. package/dist/owletto/dist/assets/identity-DYbfG4hU.js +1 -0
  80. package/dist/owletto/dist/assets/index-7d9B918E.js +1 -0
  81. package/dist/owletto/dist/assets/{index-C2YGEKPo.js → index-BKZMzuMS.js} +7 -7
  82. package/dist/owletto/dist/assets/index-BsDA0XzK.js +1 -0
  83. package/dist/owletto/dist/assets/{index-1D5YJuZt.js → index-BwN9pHNs.js} +1 -1
  84. package/dist/owletto/dist/assets/{index-DFD8r981.js → index-BwVojwkg.js} +1 -1
  85. package/dist/owletto/dist/assets/index-C4Lz_gB-.js +1 -0
  86. package/dist/owletto/dist/assets/{index-BO8P4P_v.js → index-C78ucWDF.js} +1 -1
  87. package/dist/owletto/dist/assets/{index-D6nIYLM-.js → index-C9Dtjaoi.js} +1 -1
  88. package/dist/owletto/dist/assets/{index-CKWRiFJL.js → index-CGx4og7r.js} +1 -1
  89. package/dist/owletto/dist/assets/index-CO65Rkad.js +1 -0
  90. package/dist/owletto/dist/assets/index-CT_kxGkR.js +1 -0
  91. package/dist/owletto/dist/assets/index-ChcQMdod.css +1 -0
  92. package/dist/owletto/dist/assets/index-CrKgNtiq.js +1 -0
  93. package/dist/owletto/dist/assets/{index-CLQ-2wO3.js → index-DLZbFRSM.js} +1 -1
  94. package/dist/owletto/dist/assets/index-DUIbfL6x.js +1 -0
  95. package/dist/owletto/dist/assets/{index-DtRraJyI.js → index-DmB-3GhU.js} +1 -1
  96. package/dist/owletto/dist/assets/{index-CyT-Rwip.js → index-pKfsEvLt.js} +1 -1
  97. package/dist/owletto/dist/assets/{json-diff-gsOHOgl7.js → json-diff-1FNS_wGA.js} +1 -1
  98. package/dist/owletto/dist/assets/{list-skeleton-Cs18bNnk.js → list-skeleton-B6gjzr8t.js} +1 -1
  99. package/dist/owletto/dist/assets/login-S9EGV_EA.js +1 -0
  100. package/dist/owletto/dist/assets/{logout-DKUiKENJ.js → logout-BOXPSr57.js} +1 -1
  101. package/dist/owletto/dist/assets/{member-scope-gate-g7uB6GYE.js → member-scope-gate-yGr4lrGD.js} +1 -1
  102. package/dist/owletto/dist/assets/{memory-browse-page-BUwnO2o2.js → memory-browse-page-5n3MvqdS.js} +2 -2
  103. package/dist/owletto/dist/assets/{model-selector-DfsEq1db.js → model-selector-9ZRlR7Sa.js} +1 -1
  104. package/dist/owletto/dist/assets/models-LOhfJ0sb.js +1 -0
  105. package/dist/owletto/dist/assets/{new-BWw3u5jE.js → new-BeZJOJgR.js} +1 -1
  106. package/dist/owletto/dist/assets/{new-CW9MfqPX.js → new-D4wlbvAZ.js} +1 -1
  107. package/dist/owletto/dist/assets/{new-BSo83s7P.js → new-Dxn1qrmS.js} +1 -1
  108. package/dist/owletto/dist/assets/{oauth-workspace-access-DM3uXXPM.js → oauth-workspace-access-DoE-9F42.js} +1 -1
  109. package/dist/owletto/dist/assets/{organization-DJtG7bUJ.js → organization-BezNEJK7.js} +1 -1
  110. package/dist/owletto/dist/assets/{permissions-DcYSiYWQ.js → permissions-GkKtC6a5.js} +1 -1
  111. package/dist/owletto/dist/assets/{proposal-review-shell-CLrF2OFP.js → proposal-review-shell-Bk9D_9YN.js} +1 -1
  112. package/dist/owletto/dist/assets/{recent-BAuh77AP.js → recent-BVvscz1V.js} +1 -1
  113. package/dist/owletto/dist/assets/{renderer-BdAH16jE.js → renderer-CAyr3B3s.js} +2 -2
  114. package/dist/owletto/dist/assets/reset-password-atCMI5uQ.js +1 -0
  115. package/dist/owletto/dist/assets/{runs-tK0NlrM5.js → runs-CftQDTkq.js} +1 -1
  116. package/dist/owletto/dist/assets/runs-panel-BkRtr_C4.js +1 -0
  117. package/dist/owletto/dist/assets/{runs-table-BQACrHq5.js → runs-table-CWCl38L5.js} +1 -1
  118. package/dist/owletto/dist/assets/{schema-value-normalization-Dr5Osu6u.js → schema-value-normalization-C9Lm83-q.js} +1 -1
  119. package/dist/owletto/dist/assets/settings-BKMOjfYf.js +1 -0
  120. package/dist/owletto/dist/assets/{settings-D9ezdxp8.js → settings-CgTgofgd.js} +1 -1
  121. package/dist/owletto/dist/assets/skills-DWr8qR3U.js +1 -0
  122. package/dist/owletto/dist/assets/{switch-C1vQiKIo.js → switch-BOGbkDQb.js} +1 -1
  123. package/dist/owletto/dist/assets/{use-mention-search-CCqN_8wM.js → use-mention-search-C9ckRw0s.js} +2 -2
  124. package/dist/owletto/dist/favicon.ico +0 -0
  125. package/dist/owletto/dist/favicon.svg +5 -6
  126. package/dist/owletto/dist/fonts/dm-mono-latin-500-normal.woff2 +0 -0
  127. package/dist/owletto/dist/fonts/dm-sans-latin-400-normal.woff2 +0 -0
  128. package/dist/owletto/dist/fonts/dm-sans-latin-600-normal.woff2 +0 -0
  129. package/dist/owletto/dist/index.html +8 -8
  130. package/dist/owletto/dist/lobu-logo.svg +16 -0
  131. package/dist/server-main.bundle.mjs +2415 -1268
  132. package/npm-shrinkwrap.json +17 -17
  133. package/package.json +1 -1
  134. package/vendor/connector-sdk/dist/index.d.ts +1 -1
  135. package/vendor/connector-sdk/dist/logger.js +4 -1
  136. package/vendor/connector-sdk/dist/reaction-sdk.d.ts +9 -0
  137. package/vendor/connector-sdk/package.json +1 -1
  138. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +16 -0
  139. package/vendor/core/dist/contracts/tools/manage-automations.js +12 -3
  140. package/vendor/core/dist/contracts/worker/protocol.d.ts +9 -0
  141. package/vendor/core/dist/contracts/worker/protocol.js +10 -1
  142. package/vendor/core/dist/logger.js +4 -2
  143. package/vendor/core/package.json +1 -1
  144. package/dist/owletto/dist/assets/_-BjTOSrPW.js +0 -1
  145. package/dist/owletto/dist/assets/_agentId-E5FuvQ_W.js +0 -1
  146. package/dist/owletto/dist/assets/_name-Ca5sRv2h.js +0 -1
  147. package/dist/owletto/dist/assets/_skillKey-BnDO8aEk.js +0 -1
  148. package/dist/owletto/dist/assets/accept-invitation-tMqF2W59.js +0 -1
  149. package/dist/owletto/dist/assets/activity-route-view-DSJj0TBg.js +0 -1
  150. package/dist/owletto/dist/assets/agent-permissions-matrix-QvA6xL8Q.js +0 -1
  151. package/dist/owletto/dist/assets/agents-DztpCplG.js +0 -1
  152. package/dist/owletto/dist/assets/automations-DztpCplG.js +0 -1
  153. package/dist/owletto/dist/assets/connect-9tegWawc.js +0 -1
  154. package/dist/owletto/dist/assets/connect._clientId-Dh6e0n6A.js +0 -1
  155. package/dist/owletto/dist/assets/create-BL_WcDoF.js +0 -1
  156. package/dist/owletto/dist/assets/create-Dyz5QbON.js +0 -1
  157. package/dist/owletto/dist/assets/create-automation-form-DCYFtK4q.js +0 -1
  158. package/dist/owletto/dist/assets/deployments-h8jIWEVy.js +0 -1
  159. package/dist/owletto/dist/assets/guardrails-DrOhJHr5.js +0 -1
  160. package/dist/owletto/dist/assets/identity-BTE8ZlL9.js +0 -1
  161. package/dist/owletto/dist/assets/index-Be4XiWxU.js +0 -1
  162. package/dist/owletto/dist/assets/index-CPqabIYs.css +0 -1
  163. package/dist/owletto/dist/assets/index-CS1UPepo.js +0 -1
  164. package/dist/owletto/dist/assets/index-DGinfBZr.js +0 -1
  165. package/dist/owletto/dist/assets/index-DJs1EEbu.js +0 -1
  166. package/dist/owletto/dist/assets/index-DZb_utnT.js +0 -1
  167. package/dist/owletto/dist/assets/index-RH7aiqHs.js +0 -1
  168. package/dist/owletto/dist/assets/index-xwlLZWva.js +0 -1
  169. package/dist/owletto/dist/assets/login-B3RTCs3p.js +0 -1
  170. package/dist/owletto/dist/assets/models-CZZt4VcZ.js +0 -1
  171. package/dist/owletto/dist/assets/reset-password-DjgDJAYG.js +0 -1
  172. package/dist/owletto/dist/assets/runs-panel-Dqq-0G9H.js +0 -1
  173. package/dist/owletto/dist/assets/settings-DZifZxa5.js +0 -1
  174. package/dist/owletto/dist/assets/skills-CNtoLPU_.js +0 -1
  175. package/dist/owletto/dist/fonts/geist-pixel-square.woff2 +0 -0
  176. package/dist/owletto/dist/fonts/inter-latin-400-normal.woff2 +0 -0
  177. package/dist/owletto/dist/fonts/inter-latin-500-normal.woff2 +0 -0
  178. package/dist/owletto/dist/fonts/inter-latin-600-normal.woff2 +0 -0
  179. package/dist/owletto/dist/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zUTjnTLgNs.woff2 +0 -0
  180. package/dist/owletto/dist/fonts/jizBRFtNs2ka5fXjeivQ4LroWlx-6zsTjnTLgNuZ5w.woff2 +0 -0
  181. package/dist/owletto/dist/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjgn7Motmp5r61.woff2 +0 -0
  182. package/dist/owletto/dist/fonts/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjjH7Motmp5g.woff2 +0 -0
  183. package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD0OwGtT0rU3BE.woff2 +0 -0
  184. package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD1OwGtT0rU3BE.woff2 +0 -0
  185. package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD2OwGtT0rU3BE.woff2 +0 -0
  186. package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD4OwGtT0rU3BE.woff2 +0 -0
  187. package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD7OwGtT0rU.woff2 +0 -0
  188. package/dist/owletto/dist/fonts/tDbV2o-flEEny0FZhsfKu5WU4xD_OwGtT0rU3BE.woff2 +0 -0
  189. package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-Cw2nSGjW7BDEAQ.woff2 +0 -0
  190. package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-Cw6nSGjW7BDEAQ.woff2 +0 -0
  191. package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwCnSGjW7BDEAQ.woff2 +0 -0
  192. package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwOnSGjW7BA.woff2 +0 -0
  193. package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwenSGjW7BDEAQ.woff2 +0 -0
  194. package/dist/owletto/dist/fonts/tDbX2o-flEEny0FZhsfKu5WU4xD-CwynSGjW7BDEAQ.woff2 +0 -0
@@ -1 +1 @@
1
- import{bM as A,bv as $,r as l,j as e,B as p,L as u,bN as C,bm as M,aT as S,bO as B,bP as E,bQ as W,aV as O}from"./index-C2YGEKPo.js";import{A as T}from"./agent-client-setup-list-u6MIKBDe.js";import{L as R}from"./list-skeleton-Cs18bNnk.js";import{u as _}from"./clients-CJI4gT-V.js";import{g as P,c as z}from"./client-rows-EJSKR6z1.js";const F={all:"All",managed:"Managed",connected:"Connected"};function G({owner:t,item:a,last:g}){const c=`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${g?"":"border-b"}`;if(a.kind==="managed"){const n=a.agent,d=[n.status==="active"?"Working":"Idle",`${n.connectionCount} ${n.connectionCount===1?"connection":"connections"}`,`${n.userCount} ${n.userCount===1?"user":"users"}`].filter(Boolean).join(" · ");return e.jsxs(u,{to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:n.agentId},search:{run_id:void 0},className:c,children:[e.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(B,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:n.name}),e.jsx("p",{className:"truncate text-xs",children:d})]}),n.status==="active"?e.jsx("span",{role:"img","aria-label":"Working",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}):null]})}if(a.kind==="connected"){const n=a.group;return e.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:n.clientId},className:c,children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:e.jsx(E,{name:n.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:n.title}),e.jsxs("p",{className:"truncate text-xs",children:["Connected · ",z(n)]})]}),e.jsx("span",{role:"img","aria-label":"Connected",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"})]})}}function q({owner:t,isWorkspaceLoading:a}){const{isMember:g,isLoading:c}=A(),n=g&&!c,{data:d=[],isLoading:y}=$({enabled:n}),{data:f=[]}=_(null),j=l.useMemo(()=>P(f).filter(s=>s.connected),[f]),i=l.useMemo(()=>{const s=d.map(r=>({kind:"managed",key:r.agentId,agent:{agentId:r.agentId,name:r.name,status:r.status,connectionCount:r.connectionCount,userCount:r.userCount}})),h=j.map(r=>({kind:"connected",key:r.key,group:r}));return[...s,...h]},[d,j]),N=l.useMemo(()=>i.length>0?["all","managed","connected"]:[],[i]),[w,v]=l.useState("all"),o=N.includes(w)?w:"all",x=l.useMemo(()=>i.filter(s=>o==="all"?!0:o==="managed"?s.kind==="managed":s.kind==="connected"),[i,o]),b=a||c||y,m=i.length>0,k=!b&&!m&&n,L=n?m?o==="managed"?"No managed agents yet":o==="connected"?"No connected agents yet":"No agents match this filter":"No agents yet":"Workspace membership required",I=n?m?o==="managed"?"Build a managed agent to add one here.":o==="connected"?"Bring an agent you already run to this workspace.":"Try another filter.":"Build a managed agent, or bring one you already run to this workspace.":"Only workspace members can manage agents here.";return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Who works here — your agents and the ones connected to this workspace."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[N.map(s=>e.jsx(p,{type:"button",variant:o===s?"secondary":"ghost","aria-pressed":o===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(s),children:F[s]},s)),k?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect an agent below or build one with Lobu."}):null]}),e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 sm:ml-auto sm:w-auto sm:shrink-0",children:[m?e.jsx(p,{asChild:!0,size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/connect",params:{owner:t},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Connect an agent"]})}):null,e.jsx(p,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/new",params:{owner:t},search:{run_id:void 0},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Build a managed agent"]})})]})]}),b?e.jsx(R,{label:"Loading agents"}):x.length===0?k?e.jsx(T,{owner:t,dashed:!0}):e.jsx(M,{icon:S.agents.icon,title:L,description:I}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:x.map((s,h)=>e.jsx(G,{owner:t,item:s,last:h===x.length-1},s.key))})]})}function J(){const{owner:t}=W.useParams();return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(O,{owner:t,children:a=>e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:e.jsx(q,{owner:a.ownerSlug,isWorkspaceLoading:a.isWorkspaceLoading})})})})})}export{J as component};
1
+ import{bM as A,bv as $,r as l,j as e,B as p,L as u,bN as C,bm as M,aT as S,bO as B,bP as E,bQ as W,aV as O}from"./index-BKZMzuMS.js";import{A as T}from"./agent-client-setup-list-DgFv4h0W.js";import{L as R}from"./list-skeleton-B6gjzr8t.js";import{u as _}from"./clients-C0I3V7XE.js";import{g as P,c as z}from"./client-rows-EJSKR6z1.js";const F={all:"All",managed:"Managed",connected:"Connected"};function G({owner:t,item:a,last:g}){const c=`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${g?"":"border-b"}`;if(a.kind==="managed"){const n=a.agent,d=[n.status==="active"?"Working":"Idle",`${n.connectionCount} ${n.connectionCount===1?"connection":"connections"}`,`${n.userCount} ${n.userCount===1?"user":"users"}`].filter(Boolean).join(" · ");return e.jsxs(u,{to:"/$owner/agents/$agentId/settings",params:{owner:t,agentId:n.agentId},search:{run_id:void 0},className:c,children:[e.jsx("span",{"aria-hidden":"true",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(B,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:n.name}),e.jsx("p",{className:"truncate text-xs",children:d})]}),n.status==="active"?e.jsx("span",{role:"img","aria-label":"Working",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}):null]})}if(a.kind==="connected"){const n=a.group;return e.jsxs(u,{to:"/$owner/agents/connected/$clientId",params:{owner:t,clientId:n.clientId},className:c,children:[e.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-muted-foreground",children:e.jsx(E,{name:n.title})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:n.title}),e.jsxs("p",{className:"truncate text-xs",children:["Connected · ",z(n)]})]}),e.jsx("span",{role:"img","aria-label":"Connected",className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"})]})}}function q({owner:t,isWorkspaceLoading:a}){const{isMember:g,isLoading:c}=A(),n=g&&!c,{data:d=[],isLoading:y}=$({enabled:n}),{data:f=[]}=_(null),j=l.useMemo(()=>P(f).filter(s=>s.connected),[f]),i=l.useMemo(()=>{const s=d.map(r=>({kind:"managed",key:r.agentId,agent:{agentId:r.agentId,name:r.name,status:r.status,connectionCount:r.connectionCount,userCount:r.userCount}})),h=j.map(r=>({kind:"connected",key:r.key,group:r}));return[...s,...h]},[d,j]),N=l.useMemo(()=>i.length>0?["all","managed","connected"]:[],[i]),[w,v]=l.useState("all"),o=N.includes(w)?w:"all",x=l.useMemo(()=>i.filter(s=>o==="all"?!0:o==="managed"?s.kind==="managed":s.kind==="connected"),[i,o]),b=a||c||y,m=i.length>0,k=!b&&!m&&n,L=n?m?o==="managed"?"No managed agents yet":o==="connected"?"No connected agents yet":"No agents match this filter":"No agents yet":"Workspace membership required",I=n?m?o==="managed"?"Build a managed agent to add one here.":o==="connected"?"Bring an agent you already run to this workspace.":"Try another filter.":"Build a managed agent, or bring one you already run to this workspace.":"Only workspace members can manage agents here.";return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Who works here — your agents and the ones connected to this workspace."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[N.map(s=>e.jsx(p,{type:"button",variant:o===s?"secondary":"ghost","aria-pressed":o===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(s),children:F[s]},s)),k?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect an agent below or build one with Lobu."}):null]}),e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 sm:ml-auto sm:w-auto sm:shrink-0",children:[m?e.jsx(p,{asChild:!0,size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/connect",params:{owner:t},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Connect an agent"]})}):null,e.jsx(p,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs(u,{to:"/$owner/agents/new",params:{owner:t},search:{run_id:void 0},children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5"}),"Build a managed agent"]})})]})]}),b?e.jsx(R,{label:"Loading agents"}):x.length===0?k?e.jsx(T,{owner:t,dashed:!0}):e.jsx(M,{icon:S.agents.icon,title:L,description:I}):e.jsx("div",{className:"overflow-hidden rounded-lg border",children:x.map((s,h)=>e.jsx(G,{owner:t,item:s,last:h===x.length-1},s.key))})]})}function J(){const{owner:t}=W.useParams();return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(O,{owner:t,children:a=>e.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:e.jsx(q,{owner:a.ownerSlug,isWorkspaceLoading:a.isWorkspaceLoading})})})})})}export{J as component};
@@ -0,0 +1 @@
1
+ import{bR as t,j as p,bS as m}from"./index-BKZMzuMS.js";import{M as i}from"./memory-browse-page-5n3MvqdS.js";import"./switch-BOGbkDQb.js";import"./entity-type-page-xISySjVW.js";import"./json-diff-1FNS_wGA.js";import"./index-OUb5Mlez.js";import"./index-Vcq4gwWv.js";import"./code-editor-hOZHdlxM.js";import"./schema-value-normalization-C9Lm83-q.js";import"./calendar-VAaxHxss.js";import"./core.esm-COW6Pfy6.js";import"./renderer-CAyr3B3s.js";import"./card-HMQT7vU5.js";import"./member-scope-gate-yGr4lrGD.js";function R(){const{owner:o,entityType:r}=t.useParams(),{create:e}=t.useSearch();return p.jsx(i,{ownerSlug:o,typeScope:m(r),create:e??!1})}export{R as component};
@@ -1 +1 @@
1
- import{gp as n,j as s,gq as r}from"./index-C2YGEKPo.js";function c(){const{owner:e}=n.useParams(),{connector:o,install:t}=n.useSearch();return s.jsx(r,{owner:e,initialConnectorKey:o||t})}export{c as component};
1
+ import{gp as n,j as s,gq as r}from"./index-BKZMzuMS.js";function c(){const{owner:e}=n.useParams(),{connector:o,install:t}=n.useSearch();return s.jsx(r,{owner:e,initialConnectorKey:o||t})}export{c as component};
@@ -1 +1 @@
1
- import{b5 as z,j as n,aV as H,b6 as J,u as Q,b7 as X,b8 as Y,b9 as Z,ba as ee,bb as ne,r as _,bc as se,a2 as oe,bd as te,be as ae,bf as ce,bg as re,bh as ie,bi as K,bj as le,bk as de,S as O,B as U,bl as ue,bm as q,aT as G,bn as me,bo as pe,bp as he,bq as fe,br as xe,bs as ve,af as be,L as D,bt as ge}from"./index-C2YGEKPo.js";import{b as je,c as Ne,d as ye}from"./device-rows-CVv5-okl.js";function Ie(){const{owner:o}=z.useParams(),{filter:r}=z.useSearch();return n.jsx(H,{owner:o,children:a=>n.jsx(_e,{ownerSlug:a.ownerSlug,organizationId:a.organizationId,isWorkspaceLoading:a.isWorkspaceLoading,requestedFilter:r})})}function _e({ownerSlug:o,organizationId:r,isWorkspaceLoading:a,requestedFilter:d}){const{data:u=[],isLoading:i}=J(r??""),{data:S=[],isLoading:C}=Q(r??""),{data:f=[]}=X(r,{}),{data:E=[],isLoading:R}=Y(),{data:w=[]}=Z(),{data:x,isLoading:v}=ee(),{data:l=[]}=ne(),b=a||i||C||R||v,A=x?.sandboxes??[],m=_.useMemo(()=>l.filter(k=>k.organization_slug===o||k.connectors.some(L=>L.organization_slug===o)),[l,o]);return n.jsx(se,{className:"flex flex-1 flex-col gap-6",children:n.jsx(Ce,{ownerSlug:o,isContentLoading:b,groups:u,installedDefs:S,authProfiles:f,inferenceProviders:E,inferenceCatalog:w,sandboxes:A,devices:m,requestedFilter:d})})}function Ce({ownerSlug:o,isContentLoading:r,groups:a,installedDefs:d,authProfiles:u,inferenceProviders:i,inferenceCatalog:S,sandboxes:C,devices:f,requestedFilter:E}){const R=oe(),w=E??"all",x=_.useMemo(()=>{const s=new Map(a.map(e=>[e.connector_key,e])),t=new Map;for(const e of d)t.set(e.key,e);for(const e of a)t.has(e.connector_key)||t.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const N=te(i).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0})),p=ae(C).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!e.sandbox.connected,provider:void 0,sandbox:e.sandbox,device:void 0})),P=je(f,a,o).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device}));return[...Array.from(t.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!Ne(e)).map(e=>{const c=s.get(e.key),F=ce(e.auth_schema),I=u.reduce((j,$)=>($.connector_key!==e.key||(j[$.profile_kind]+=1),j),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),h=re(e,c),y=we(e,c,F,I);return{connector:e,group:c,profileCounts:I,facets:h,needsSetup:y,provider:void 0,sandbox:void 0,device:void 0}}),...N,...p,...P].sort((e,c)=>e.needsSetup&&!c.needsSetup?-1:!e.needsSetup&&c.needsSetup?1:e.connector.name.localeCompare(c.connector.name))},[o,u,f,a,d,i,C]),v=_.useMemo(()=>{const s=ie.filter(t=>t!=="all"&&x.some(N=>K(N,t)));return s.length>1?["all",...s]:[]},[x]),l=v.includes(w)?w:"all",b=_.useMemo(()=>x.filter(s=>K(s,l)),[x,l]),A=b.length,m=_.useMemo(()=>l==="all"?le(o,f,de()):[],[l,o,f]),k=A+m.length,L=n.jsx(U,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(D,{to:"/$owner/connectors/create",params:{owner:o},children:[n.jsx(ge,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})});if(r)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:L}),n.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":"Loading connectors",children:Array.from({length:6}).map((s,t)=>n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${t===5?"":"border-b"}`,children:[n.jsx(O,{className:"h-7 w-7 shrink-0 rounded-md"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[n.jsx(O,{className:"h-4 w-40"}),n.jsx(O,{className:"h-3 w-24"})]})]},t))})]});const T=s=>{R({to:"/$owner/connectors",params:{owner:o},search:t=>({...t,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[v.map(s=>n.jsx(U,{type:"button",variant:l===s?"secondary":"ghost","aria-pressed":l===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>T(s),children:ue[s]},s)),v.length===0&&b.length===0&&m.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps below."}):null]}),n.jsx("div",{className:"ml-auto shrink-0",children:L})]}),b.length===0?v.length>0?n.jsx(q,{icon:G.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>T("all")}):m.length>0?null:n.jsx(q,{icon:G.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:b.map(({connector:s,group:t,facets:N,profileCounts:p,needsSetup:P,provider:g,sandbox:e,device:c},F)=>{const I=new Map(d.map(M=>[M.key,M])),h=me(s.key,I,{name:s.name,iconUrl:g?S.find(M=>M.slug===g.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??t?.favicon_domain??(e?pe(e.providerKind):void 0)}),y=p.oauth_account+p.browser_session,j=t?.connection_count??0,$=c?ye(c):g?[g.isDefault?"Default":null,g.status].filter(Boolean).join(" · "):e?[e.providerKind,e.connected?"Connected":"No credential"].join(" · "):[`${j} ${j===1?"connection":"connections"}`,y>0?`${y} ${y===1?"account":"accounts"}`:null,p.oauth_app>0?`${p.oauth_app} OAuth app${p.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),B=V(F,k),W=n.jsxs(n.Fragment,{children:[c?n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(he,{platform:fe(c)})}):n.jsx(xe,{icon:h.icon,iconUrl:h.iconUrl,name:h.name,faviconDomain:h.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:h.name}),n.jsx(ve,{facets:N})]}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:$})]}),P?n.jsx(be,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Needs setup"}):null]});return c?n.jsx(D,{to:"/$owner/connectors/device/$deviceId",params:{owner:o,deviceId:c.id},className:B,children:W},s.key):n.jsx(D,{to:"/$owner/connectors/$connectorKey",params:{owner:o,connectorKey:s.key},className:B,children:W},s.key)})}),m.length>0?n.jsx("div",{className:"overflow-hidden rounded-lg border border-dashed",children:m.map((s,t)=>n.jsxs(D,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:s.id},className:V(t,m.length),children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-dashed",children:s.icon}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:s.name}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.tagline})]}),n.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},s.id))}):null]})}function V(o,r){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${o===r-1?"":"border-b"}`}function we(o,r,a,d){const u=a.some(i=>i.type==="none");return!!(!u&&a.some(i=>i.type==="oauth")&&d.oauth_app===0||!u&&a.some(i=>i.type==="env_keys")&&d.env===0||!u&&a.some(i=>i.type==="app_installation")&&!r||o.required_capability&&!r)}export{Ie as component};
1
+ import{b5 as z,j as n,aV as H,b6 as J,u as Q,b7 as X,b8 as Y,b9 as Z,ba as ee,bb as ne,r as _,bc as se,a2 as oe,bd as te,be as ae,bf as ce,bg as re,bh as ie,bi as K,bj as le,bk as de,S as O,B as U,bl as ue,bm as q,aT as G,bn as me,bo as pe,bp as he,bq as fe,br as xe,bs as ve,af as be,L as D,bt as ge}from"./index-BKZMzuMS.js";import{b as je,c as Ne,d as ye}from"./device-rows-E63OZ9Cp.js";function Ie(){const{owner:o}=z.useParams(),{filter:r}=z.useSearch();return n.jsx(H,{owner:o,children:a=>n.jsx(_e,{ownerSlug:a.ownerSlug,organizationId:a.organizationId,isWorkspaceLoading:a.isWorkspaceLoading,requestedFilter:r})})}function _e({ownerSlug:o,organizationId:r,isWorkspaceLoading:a,requestedFilter:d}){const{data:u=[],isLoading:i}=J(r??""),{data:S=[],isLoading:C}=Q(r??""),{data:f=[]}=X(r,{}),{data:E=[],isLoading:R}=Y(),{data:w=[]}=Z(),{data:x,isLoading:v}=ee(),{data:l=[]}=ne(),b=a||i||C||R||v,A=x?.sandboxes??[],m=_.useMemo(()=>l.filter(k=>k.organization_slug===o||k.connectors.some(L=>L.organization_slug===o)),[l,o]);return n.jsx(se,{className:"flex flex-1 flex-col gap-6",children:n.jsx(Ce,{ownerSlug:o,isContentLoading:b,groups:u,installedDefs:S,authProfiles:f,inferenceProviders:E,inferenceCatalog:w,sandboxes:A,devices:m,requestedFilter:d})})}function Ce({ownerSlug:o,isContentLoading:r,groups:a,installedDefs:d,authProfiles:u,inferenceProviders:i,inferenceCatalog:S,sandboxes:C,devices:f,requestedFilter:E}){const R=oe(),w=E??"all",x=_.useMemo(()=>{const s=new Map(a.map(e=>[e.connector_key,e])),t=new Map;for(const e of d)t.set(e.key,e);for(const e of a)t.has(e.connector_key)||t.set(e.connector_key,{key:e.connector_key,name:e.connector_name??e.connector_key,description:null,version:"",auth_schema:null,feeds_schema:null,actions_schema:null,options_schema:null,status:"active",login_enabled:!1,favicon_domain:e.favicon_domain,facets:e.facets});const N=te(i).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,provider:e.provider,sandbox:void 0,device:void 0})),p=ae(C).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!e.sandbox.connected,provider:void 0,sandbox:e.sandbox,device:void 0})),P=je(f,a,o).map(e=>({connector:e.connector,group:void 0,profileCounts:{env:0,oauth_app:0,oauth_account:0,browser_session:0},facets:e.facets,needsSetup:!1,isDevice:!0,provider:void 0,sandbox:void 0,device:e.device}));return[...Array.from(t.values()).filter(e=>e.installed||(s.get(e.key)?.connection_count??0)>0).filter(e=>!Ne(e)).map(e=>{const c=s.get(e.key),F=ce(e.auth_schema),I=u.reduce((j,$)=>($.connector_key!==e.key||(j[$.profile_kind]+=1),j),{env:0,oauth_app:0,oauth_account:0,browser_session:0}),h=re(e,c),y=we(e,c,F,I);return{connector:e,group:c,profileCounts:I,facets:h,needsSetup:y,provider:void 0,sandbox:void 0,device:void 0}}),...N,...p,...P].sort((e,c)=>e.needsSetup&&!c.needsSetup?-1:!e.needsSetup&&c.needsSetup?1:e.connector.name.localeCompare(c.connector.name))},[o,u,f,a,d,i,C]),v=_.useMemo(()=>{const s=ie.filter(t=>t!=="all"&&x.some(N=>K(N,t)));return s.length>1?["all",...s]:[]},[x]),l=v.includes(w)?w:"all",b=_.useMemo(()=>x.filter(s=>K(s,l)),[x,l]),A=b.length,m=_.useMemo(()=>l==="all"?le(o,f,de()):[],[l,o,f]),k=A+m.length,L=n.jsx(U,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(D,{to:"/$owner/connectors/create",params:{owner:o},children:[n.jsx(ge,{className:"mr-1.5 h-3.5 w-3.5"}),"Add connector"]})});if(r)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:L}),n.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":"Loading connectors",children:Array.from({length:6}).map((s,t)=>n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${t===5?"":"border-b"}`,children:[n.jsx(O,{className:"h-7 w-7 shrink-0 rounded-md"}),n.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[n.jsx(O,{className:"h-4 w-40"}),n.jsx(O,{className:"h-3 w-24"})]})]},t))})]});const T=s=>{R({to:"/$owner/connectors",params:{owner:o},search:t=>({...t,filter:s==="all"?void 0:s}),replace:!0})};return n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What your agents can reach — data, tools, models, and runtimes."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[v.map(s=>n.jsx(U,{type:"button",variant:l===s?"secondary":"ghost","aria-pressed":l===s,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>T(s),children:ue[s]},s)),v.length===0&&b.length===0&&m.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"Nothing connected yet — set up one of the apps below."}):null]}),n.jsx("div",{className:"ml-auto shrink-0",children:L})]}),b.length===0?v.length>0?n.jsx(q,{icon:G.connectors.icon,title:"No connectors match this filter",description:"Try another capability.",secondaryActionLabel:"Show all",secondaryOnAction:()=>T("all")}):m.length>0?null:n.jsx(q,{icon:G.connectors.icon,title:"No connectors yet",description:"Connect your first connector to this workspace."}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:b.map(({connector:s,group:t,facets:N,profileCounts:p,needsSetup:P,provider:g,sandbox:e,device:c},F)=>{const I=new Map(d.map(M=>[M.key,M])),h=me(s.key,I,{name:s.name,iconUrl:g?S.find(M=>M.slug===g.kind)?.iconUrl:void 0,faviconDomain:s.favicon_domain??t?.favicon_domain??(e?pe(e.providerKind):void 0)}),y=p.oauth_account+p.browser_session,j=t?.connection_count??0,$=c?ye(c):g?[g.isDefault?"Default":null,g.status].filter(Boolean).join(" · "):e?[e.providerKind,e.connected?"Connected":"No credential"].join(" · "):[`${j} ${j===1?"connection":"connections"}`,y>0?`${y} ${y===1?"account":"accounts"}`:null,p.oauth_app>0?`${p.oauth_app} OAuth app${p.oauth_app===1?"":"s"}`:null].filter(Boolean).join(" · "),B=V(F,k),W=n.jsxs(n.Fragment,{children:[c?n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(he,{platform:fe(c)})}):n.jsx(xe,{icon:h.icon,iconUrl:h.iconUrl,name:h.name,faviconDomain:h.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:h.name}),n.jsx(ve,{facets:N})]}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:$})]}),P?n.jsx(be,{variant:"secondary",className:"shrink-0 text-[10px]",children:"Needs setup"}):null]});return c?n.jsx(D,{to:"/$owner/connectors/device/$deviceId",params:{owner:o,deviceId:c.id},className:B,children:W},s.key):n.jsx(D,{to:"/$owner/connectors/$connectorKey",params:{owner:o,connectorKey:s.key},className:B,children:W},s.key)})}),m.length>0?n.jsx("div",{className:"overflow-hidden rounded-lg border border-dashed",children:m.map((s,t)=>n.jsxs(D,{to:"/$owner/connectors/app/$appId",params:{owner:o,appId:s.id},className:V(t,m.length),children:[n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-dashed",children:s.icon}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"truncate text-sm font-medium",children:s.name}),n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.tagline})]}),n.jsx("span",{className:"shrink-0 text-xs",children:"Set up"})]},s.id))}):null]})}function V(o,r){return`flex items-center gap-3 px-3 py-2.5 text-left text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground ${o===r-1?"":"border-b"}`}function we(o,r,a,d){const u=a.some(i=>i.type==="none");return!!(!u&&a.some(i=>i.type==="oauth")&&d.oauth_app===0||!u&&a.some(i=>i.type==="env_keys")&&d.env===0||!u&&a.some(i=>i.type==="app_installation")&&!r||o.required_capability&&!r)}export{Ie as component};
@@ -1,3 +1,3 @@
1
- import{r as _,j as L,cP as Je,dU as Ve,aj as ze,aS as _e}from"./index-C2YGEKPo.js";import{T as Be,P as be,E as S,S as U,g as qe,R as Ke,V as $e,F as ve,a as $,b as H,G as Q,W as Z,D as M,l as Qe,h as Ze,c as Ye,C as Xe,d as le,s as et,e as tt,j as nt}from"./index-OUb5Mlez.js";class x{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new x(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function E(t,e,n,l,i,r){if(t==l)return[];let o=X(t,e,n,l,i,r),a=ee(t,e+o,n,l,i+o,r);e+=o,n-=a,i+=o,r-=a;let d=n-e,c=r-i;if(!d||!c)return[new x(e,n,i,r)];if(d>c){let s=t.slice(e,n).indexOf(l.slice(i,r));if(s>-1)return[new x(e,e+s,i,i),new x(e+s+c,n,r,r)]}else if(c>d){let s=l.slice(i,r).indexOf(t.slice(e,n));if(s>-1)return[new x(e,e,i,i+s),new x(n,n,i+s+d,r)]}if(d==1||c==1)return[new x(e,n,i,r)];let f=Me(t,e,n,l,i,r);if(f){let[s,u,h]=f;return E(t,e,s,l,i,u).concat(E(t,s+h,n,l,u+h,r))}return rt(t,e,n,l,i,r)}let R=1e9,F=0,Y=!1;function rt(t,e,n,l,i,r){let o=n-e,a=r-i;if(R<1e9&&Math.min(o,a)>R*16||F>0&&Date.now()>F)return Math.min(o,a)>R*64?[new x(e,n,i,r)]:oe(t,e,n,l,i,r);let d=Math.ceil((o+a)/2);V.reset(d),z.reset(d);let c=(h,m)=>t.charCodeAt(e+h)==l.charCodeAt(i+m),f=(h,m)=>t.charCodeAt(n-h-1)==l.charCodeAt(r-m-1),s=(o-a)%2!=0?z:null,u=s?null:V;for(let h=0;h<d;h++){if(h>R||F>0&&!(h&63)&&Date.now()>F)return oe(t,e,n,l,i,r);let m=V.advance(h,o,a,d,s,!1,c)||z.advance(h,o,a,d,u,!0,f);if(m)return it(t,e,n,e+m[0],l,i,r,i+m[1])}return[new x(e,n,i,r)]}class Le{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,o,a){for(let d=-e+this.start;d<=e-this.end;d+=2){let c=i+d,f=d==-e||d!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,s=f-d;for(;f<n&&s<l&&a(f,s);)f++,s++;if(this.vec[c]=f,f>n)this.end+=2;else if(s>l)this.start+=2;else if(r){let u=i+(n-l)-d;if(u>=0&&u<this.len&&r.vec[u]!=-1)if(o){let h=r.vec[u];if(h>=n-f)return[h,i+h-u]}else{let h=n-r.vec[u];if(f>=h)return[f,s]}}}return null}}const V=new Le,z=new Le;function it(t,e,n,l,i,r,o,a){let d=!1;return!O(t,l)&&++l==n&&(d=!0),!O(i,a)&&++a==o&&(d=!0),d?[new x(e,n,r,o)]:E(t,e,l,i,r,a).concat(E(t,l,n,i,a,o))}function De(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function X(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let o=De(n-e,r-i);for(let a=e,d=i;;){let c=a+o,f=d+o;if(c>n||f>r||t.slice(a,c)!=l.slice(d,f)){if(o==1)return a-e-(O(t,a)?0:1);o=o>>1}else{if(c==n||f==r)return c-e;a=c,d=f}}}function ee(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let o=De(n-e,r-i);for(let a=n,d=r;;){let c=a-o,f=d-o;if(c<e||f<i||t.slice(c,a)!=l.slice(f,d)){if(o==1)return n-a-(O(t,a)?0:1);o=o>>1}else{if(c==e||f==i)return n-c;a=c,d=f}}}function q(t,e,n,l,i,r,o,a){let d=l.slice(i,r),c=null;for(;;){if(c||o<a)return c;for(let f=e+o;;){O(t,f)||f++;let s=f+o;if(O(t,s)||(s+=s==f+1?1:-1),s>=n)break;let u=t.slice(f,s),h=-1;for(;(h=d.indexOf(u,h+1))!=-1;){let m=X(t,s,n,l,i+h+u.length,r),p=ee(t,e,f,l,i,i+h),g=u.length+m+p;(!c||c[2]<g)&&(c=[f-p,i+h-p,g])}f=s}if(a<0)return c;o=o>>1}}function Me(t,e,n,l,i,r){let o=n-e,a=r-i;if(o<a){let d=Me(l,i,r,t,e,n);return d&&[d[1],d[0],d[2]]}return o<4||a*2<o?null:q(t,e,n,l,i,r,Math.floor(o/4),-1)}function oe(t,e,n,l,i,r){Y=!0;let o=n-e,a=r-i,d;if(o<a){let u=q(l,i,r,t,e,n,Math.floor(o/6),50);d=u&&[u[1],u[0],u[2]]}else d=q(t,e,n,l,i,r,Math.floor(a/6),50);if(!d)return[new x(e,n,i,r)];let[c,f,s]=d;return E(t,e,c,l,i,f).concat(E(t,c+s,n,l,f+s,r))}function Se(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new x(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function lt(t,e,n){for(;;){Se(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],o,a;(o=X(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA+o,r.toA,r.fromB+o,r.toB)),(a=ee(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA,r.toA-a,r.fromB,r.toB-a));let d=r.toA-r.fromA,c=r.toB-r.fromB;if(d&&c)continue;let f=r.fromA-(i?n[i-1].toA:0),s=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!f||!s)continue;let u=d?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);f<=u.length&&t.slice(r.fromA-f,r.fromA)==u.slice(u.length-f)?(n[i]=new x(r.fromA-f,r.toA-f,r.fromB-f,r.toB-f),l=!0):s<=u.length&&t.slice(r.toA,r.toA+s)==u.slice(0,s)&&(n[i]=new x(r.fromA+s,r.toA+s,r.fromB+s,r.toB+s),l=!0)}if(!l)break}return n}function ot(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],o=r.toA-r.fromA,a=r.toB-r.fromB;if(o&&a||o>3||a>3){let d=i==t.length-1?e.length:t[i+1].fromA,c=r.fromA-l,f=d-r.toA,s=fe(e,r.fromA,c),u=ae(e,r.toA,f),h=r.fromA-s,m=u-r.toA;if((!o||!a)&&h&&m){let p=Math.max(o,a),[g,A,T]=o?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>h&&e.slice(s,r.fromA)==g.slice(T-h,T)?(r=t[i]=new x(s,s+o,r.fromB-h,r.toB-h),s=r.fromA,u=ae(e,r.toA,d-r.toA)):p>m&&e.slice(r.toA,u)==g.slice(A,A+m)&&(r=t[i]=new x(u-o,u,r.fromB+m,r.toB+m),u=r.toA,s=fe(e,r.fromA,r.fromA-l)),h=r.fromA-s,m=u-r.toA}if(h||m)r=t[i]=new x(r.fromA-h,r.toA+m,r.fromB-h,r.toB+m);else if(o){if(!a){let p=de(e,r.fromA,r.toA),g,A=p<0?-1:se(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=f&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toA-A)<=c&&e.slice(r.fromA-g,r.fromA)==e.slice(A,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=de(n,r.fromB,r.toB),g,A=p<0?-1:se(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=f&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toB-A)<=c&&n.slice(r.fromB-g,r.fromB)==n.slice(A,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return Se(t,3),t}let y;try{y=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function ye(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ee(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?ye(n)?1:0:y?!Ne(n)||e==t.length-1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e,e+2))?2:0:0}function je(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?ye(n)?1:0:y?!Te(n)||e==1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e-2,e))?2:0:0}const Oe=8;function ae(t,e,n){if(e==t.length||!je(t,e))return e;for(let l=e,i=e+n,r=0;r<Oe;r++){let o=Ee(t,l);if(!o||l+o>i)return l;l+=o}return e}function fe(t,e,n){if(!e||!Ee(t,e))return e;for(let l=e,i=e-n,r=0;r<Oe;r++){let o=je(t,l);if(!o||l-o<i)return l;l-=o}return e}function se(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function de(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Ne=t=>t>=55296&&t<=56319,Te=t=>t>=56320&&t<=57343;function O(t,e){return!e||e==t.length||!Ne(t.charCodeAt(e-1))||!Te(t.charCodeAt(e))}function at(t,e,n){var l;let i=n?.override;return i?i(t,e):(R=((l=n?.scanLimit)!==null&&l!==void 0?l:1e9)>>1,F=n?.timeout?Date.now()+n.timeout:0,Y=!1,lt(t,e,E(t,0,t.length,e,0,e.length)))}function Ge(){return!Y}function Re(t,e,n){return ot(at(t,e,n),t,e)}const D=ve.define({combine:t=>t[0]}),ft=$.define(),Fe=ve.define(),k=U.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ft)&&(t=n.value);for(let n of e.state.facet(Fe))t=n(t,e);return t}});class j{constructor(e,n,l,i,r,o=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=o}offset(e,n){return e||n?new j(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Re(e.toString(),n.toString(),l);return Ie(i,e,n,0,0,Ge())}static updateA(e,n,l,i,r){return ge(me(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return ge(me(e,i,!1,n.length),e,n,l,r)}}function ce(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function ue(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Ie(t,e,n,l,i,r){let o=[];for(let a=0;a<t.length;a++){let d=t[a],[c,f]=ce(d.fromA+l,d.fromB+i,e,n),[s,u]=ue(d.toA+l,d.toB+i,e,n),h=[d.offset(-c+l,-f+i)];for(;a<t.length-1;){let m=t[a+1],[p,g]=ce(m.fromA+l,m.fromB+i,e,n);if(p>s+1&&g>u+1)break;h.push(m.offset(-c+l,-f+i)),[s,u]=ue(m.toA+l,m.toB+i,e,n),a++}o.push(new j(h,c,Math.max(c,s),f,Math.max(f,u),r))}return o}const W=1e3;function he(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let f=0,s=0;i&&({toA:f,toB:s}=t[i-1]);let u=e-(n?f:s);return[f+u,s+u]}let o=i+r>>1,a=t[o],[d,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(d>e)r=o;else if(c<=e)i=o+1;else return l?[a.fromA,a.fromB]:[a.toA,a.toB]}}function me(t,e,n,l){let i=[];return e.iterChangedRanges((r,o,a,d)=>{let c=0,f=n?e.length:l,s=0,u=n?l:e.length;r>W&&([c,s]=he(t,r-W,n,!0)),o<e.length-W&&([f,u]=he(t,o+W,n,!1));let h=d-a-(o-r),m,[p,g]=n?[h,0]:[0,h];i.length&&(m=i[i.length-1]).toA>=c?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:f,toB:u,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:c,toA:f,fromB:s,toB:u,diffA:p,diffB:g})}),i}function ge(t,e,n,l,i){if(!t.length)return e;let r=[];for(let o=0,a=0,d=0,c=0;;o++){let f=o==t.length?null:t[o],s=f?f.fromA+a:n.length,u=f?f.fromB+d:l.length;for(;c<e.length;){let g=e[c];if(f&&(g.toA+a>s||g.toB+d>u))break;r.push(g.offset(a,d)),c++}if(!f)break;let h=f.toA+a+f.diffA,m=f.toB+d+f.diffB,p=Re(n.sliceString(s,h),l.sliceString(u,m),i);for(let g of Ie(p,n,l,s,u,Ge()))r.push(g);for(a+=f.diffA,d+=f.diffB;c<e.length;){let g=e[c];if(g.fromA+a>h&&g.fromB+d>m)break;c++}}return r}const st={scanLimit:500},We=$e.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Ce(t))}update(t){(t.docChanged||t.viewportChanged||dt(t.startState,t.state)||ct(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Ce(t.view))}},{decorations:t=>t.deco});function dt(t,e){return t.field(k,!1)!=e.field(k,!1)}function ct(t,e){return t.facet(D)!=e.facet(D)}const pe=M.line({class:"cm-changedLine"}),He=M.mark({class:"cm-changedText"}),ut=M.mark({tagName:"ins",class:"cm-insertedLine"}),ht=M.mark({tagName:"del",class:"cm-deletedLine"}),xe=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mt(t,e,n,l,i,r){let o=n?t.fromA:t.fromB,a=n?t.toA:t.toB,d=0;if(o!=a){i.add(o,o,pe),i.add(o,a,n?ht:ut),r&&r.add(o,o,xe);for(let c=e.iterRange(o,a-1),f=o;!c.next().done;){if(c.lineBreak){f++,i.add(f,f,pe),r&&r.add(f,f,xe);continue}let s=f+c.value.length;if(l)for(;d<t.changes.length;){let u=t.changes[d],h=o+(n?u.fromA:u.fromB),m=o+(n?u.toA:u.toB),p=Math.max(f,h),g=Math.min(s,m);if(p<g&&i.add(p,g,He),m<s)d++;else break}f=s}}}function Ce(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(D),o=n=="a",a=new H,d=i?new H:null,{from:c,to:f}=t.viewport;for(let s of e){if((o?s.fromA:s.fromB)>=f)break;(o?s.toA:s.toB)>c&&(!r||!r(t.state,s,a,d))&&mt(s,t.state.doc,o,l,a,d)}return{deco:a.finish(),gutter:d&&d.finish()}}const K=$.define({map:(t,e)=>e.mapPos(t)});class gt extends Z{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:K.of(i)});let{side:r,sibling:o}=e.state.facet(D);o&&o().dispatch({effects:K.of(pt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function pt(t,e,n){let l=0,i=0;for(let r=0;;r++){let o=r<e.length?e[r]:null;if(!o||(n?o.fromA:o.fromB)>=t)return i+(t-l);[l,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const xt=U.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(K)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(D).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>S.decorations.from(t)});function Ct({margin:t=3,minSize:e=4}){return xt.init(n=>At(n,t,e))}function At(t,e,n){let l=new H,i=t.facet(D).side=="a",r=t.field(k),o=1;for(let a=0;;a++){let d=a<r.length?r[a]:null,c=a?o+e:1,f=d?t.doc.lineAt(i?d.fromA:d.fromB).number-1-e:t.doc.lines,s=f-c+1;if(s>=n&&l.add(t.doc.line(c).from,t.doc.line(f).to,M.replace({widget:new gt(s),block:!0})),!d)break;o=t.doc.lineAt(Math.min(t.doc.length,i?d.toA:d.toB)).number}return l.finish()}const kt=S.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Bt=be.low(qe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(We))===null||e===void 0?void 0:e.gutter)||Ke.empty},widgetMarker:(t,e)=>e instanceof Pe?wt:null}));function bt(t){var e;let n=typeof t.original=="string"?Be.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||st;return[be.low(We),Mt,kt,S.editorAttributes.of({class:"cm-merge-b"}),Fe.of((i,r)=>{let o=r.effects.find(a=>a.is(te));return o&&(i=j.updateA(i,o.value.doc,r.startState.doc,o.value.changes,l)),r.docChanged&&(i=j.updateB(i,r.state.field(N),r.newDoc,r.changes,l)),i}),D.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?jt:void 0,side:"b"}),N.init(()=>n),t.gutter!==!1?Bt:[],t.collapseUnchanged?Ct(t.collapseUnchanged):[],k.init(i=>j.build(n,i.doc,l))]}const te=$.define(),N=U.define({create:()=>Be.empty,update(t,e){for(let n of e.effects)n.is(te)&&(t=n.value.doc);return t}}),Ae=new WeakMap;class Pe extends Z{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function vt(t,e,n){let l=Ae.get(e.changes);if(l)return l;let i=o=>{let{highlightChanges:a,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:c,mergeControls:f}=t.facet(D),s=document.createElement("div");if(s.className="cm-deletedChunk",f){let w=s.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let b=C=>{C.preventDefault(),Lt(o,o.posAtDOM(s))},v=C=>{C.preventDefault(),Dt(o,o.posAtDOM(s))};if(typeof f=="function")w.appendChild(f("accept",b)),w.appendChild(f("reject",v));else{let C=w.appendChild(document.createElement("button"));C.name="accept",C.textContent=t.phrase("Accept"),C.onmousedown=b;let B=w.appendChild(document.createElement("button"));B.name="reject",B.textContent=t.phrase("Reject"),B.onmousedown=v}}if(n||e.fromA>=e.toA)return s;let u=o.state.field(N).sliceString(e.fromA,e.endA),h=d&&t.facet(Qe),m=T(),p=e.changes,g=0,A=!1;function T(){let w=s.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function I(w,b,v){for(let C=w;C<b;){if(u.charAt(C)==`
1
+ import{r as _,j as L,cP as Je,dU as Ve,aj as ze,aS as _e}from"./index-BKZMzuMS.js";import{T as Be,P as be,E as S,S as U,g as qe,R as Ke,V as $e,F as ve,a as $,b as H,G as Q,W as Z,D as M,l as Qe,h as Ze,c as Ye,C as Xe,d as le,s as et,e as tt,j as nt}from"./index-OUb5Mlez.js";class x{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new x(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function E(t,e,n,l,i,r){if(t==l)return[];let o=X(t,e,n,l,i,r),a=ee(t,e+o,n,l,i+o,r);e+=o,n-=a,i+=o,r-=a;let d=n-e,c=r-i;if(!d||!c)return[new x(e,n,i,r)];if(d>c){let s=t.slice(e,n).indexOf(l.slice(i,r));if(s>-1)return[new x(e,e+s,i,i),new x(e+s+c,n,r,r)]}else if(c>d){let s=l.slice(i,r).indexOf(t.slice(e,n));if(s>-1)return[new x(e,e,i,i+s),new x(n,n,i+s+d,r)]}if(d==1||c==1)return[new x(e,n,i,r)];let f=Me(t,e,n,l,i,r);if(f){let[s,u,h]=f;return E(t,e,s,l,i,u).concat(E(t,s+h,n,l,u+h,r))}return rt(t,e,n,l,i,r)}let R=1e9,F=0,Y=!1;function rt(t,e,n,l,i,r){let o=n-e,a=r-i;if(R<1e9&&Math.min(o,a)>R*16||F>0&&Date.now()>F)return Math.min(o,a)>R*64?[new x(e,n,i,r)]:oe(t,e,n,l,i,r);let d=Math.ceil((o+a)/2);V.reset(d),z.reset(d);let c=(h,m)=>t.charCodeAt(e+h)==l.charCodeAt(i+m),f=(h,m)=>t.charCodeAt(n-h-1)==l.charCodeAt(r-m-1),s=(o-a)%2!=0?z:null,u=s?null:V;for(let h=0;h<d;h++){if(h>R||F>0&&!(h&63)&&Date.now()>F)return oe(t,e,n,l,i,r);let m=V.advance(h,o,a,d,s,!1,c)||z.advance(h,o,a,d,u,!0,f);if(m)return it(t,e,n,e+m[0],l,i,r,i+m[1])}return[new x(e,n,i,r)]}class Le{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,o,a){for(let d=-e+this.start;d<=e-this.end;d+=2){let c=i+d,f=d==-e||d!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,s=f-d;for(;f<n&&s<l&&a(f,s);)f++,s++;if(this.vec[c]=f,f>n)this.end+=2;else if(s>l)this.start+=2;else if(r){let u=i+(n-l)-d;if(u>=0&&u<this.len&&r.vec[u]!=-1)if(o){let h=r.vec[u];if(h>=n-f)return[h,i+h-u]}else{let h=n-r.vec[u];if(f>=h)return[f,s]}}}return null}}const V=new Le,z=new Le;function it(t,e,n,l,i,r,o,a){let d=!1;return!O(t,l)&&++l==n&&(d=!0),!O(i,a)&&++a==o&&(d=!0),d?[new x(e,n,r,o)]:E(t,e,l,i,r,a).concat(E(t,l,n,i,a,o))}function De(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function X(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let o=De(n-e,r-i);for(let a=e,d=i;;){let c=a+o,f=d+o;if(c>n||f>r||t.slice(a,c)!=l.slice(d,f)){if(o==1)return a-e-(O(t,a)?0:1);o=o>>1}else{if(c==n||f==r)return c-e;a=c,d=f}}}function ee(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let o=De(n-e,r-i);for(let a=n,d=r;;){let c=a-o,f=d-o;if(c<e||f<i||t.slice(c,a)!=l.slice(f,d)){if(o==1)return n-a-(O(t,a)?0:1);o=o>>1}else{if(c==e||f==i)return n-c;a=c,d=f}}}function q(t,e,n,l,i,r,o,a){let d=l.slice(i,r),c=null;for(;;){if(c||o<a)return c;for(let f=e+o;;){O(t,f)||f++;let s=f+o;if(O(t,s)||(s+=s==f+1?1:-1),s>=n)break;let u=t.slice(f,s),h=-1;for(;(h=d.indexOf(u,h+1))!=-1;){let m=X(t,s,n,l,i+h+u.length,r),p=ee(t,e,f,l,i,i+h),g=u.length+m+p;(!c||c[2]<g)&&(c=[f-p,i+h-p,g])}f=s}if(a<0)return c;o=o>>1}}function Me(t,e,n,l,i,r){let o=n-e,a=r-i;if(o<a){let d=Me(l,i,r,t,e,n);return d&&[d[1],d[0],d[2]]}return o<4||a*2<o?null:q(t,e,n,l,i,r,Math.floor(o/4),-1)}function oe(t,e,n,l,i,r){Y=!0;let o=n-e,a=r-i,d;if(o<a){let u=q(l,i,r,t,e,n,Math.floor(o/6),50);d=u&&[u[1],u[0],u[2]]}else d=q(t,e,n,l,i,r,Math.floor(a/6),50);if(!d)return[new x(e,n,i,r)];let[c,f,s]=d;return E(t,e,c,l,i,f).concat(E(t,c+s,n,l,f+s,r))}function Se(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new x(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function lt(t,e,n){for(;;){Se(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],o,a;(o=X(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA+o,r.toA,r.fromB+o,r.toB)),(a=ee(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA,r.toA-a,r.fromB,r.toB-a));let d=r.toA-r.fromA,c=r.toB-r.fromB;if(d&&c)continue;let f=r.fromA-(i?n[i-1].toA:0),s=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!f||!s)continue;let u=d?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);f<=u.length&&t.slice(r.fromA-f,r.fromA)==u.slice(u.length-f)?(n[i]=new x(r.fromA-f,r.toA-f,r.fromB-f,r.toB-f),l=!0):s<=u.length&&t.slice(r.toA,r.toA+s)==u.slice(0,s)&&(n[i]=new x(r.fromA+s,r.toA+s,r.fromB+s,r.toB+s),l=!0)}if(!l)break}return n}function ot(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],o=r.toA-r.fromA,a=r.toB-r.fromB;if(o&&a||o>3||a>3){let d=i==t.length-1?e.length:t[i+1].fromA,c=r.fromA-l,f=d-r.toA,s=fe(e,r.fromA,c),u=ae(e,r.toA,f),h=r.fromA-s,m=u-r.toA;if((!o||!a)&&h&&m){let p=Math.max(o,a),[g,A,T]=o?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>h&&e.slice(s,r.fromA)==g.slice(T-h,T)?(r=t[i]=new x(s,s+o,r.fromB-h,r.toB-h),s=r.fromA,u=ae(e,r.toA,d-r.toA)):p>m&&e.slice(r.toA,u)==g.slice(A,A+m)&&(r=t[i]=new x(u-o,u,r.fromB+m,r.toB+m),u=r.toA,s=fe(e,r.fromA,r.fromA-l)),h=r.fromA-s,m=u-r.toA}if(h||m)r=t[i]=new x(r.fromA-h,r.toA+m,r.fromB-h,r.toB+m);else if(o){if(!a){let p=de(e,r.fromA,r.toA),g,A=p<0?-1:se(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=f&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toA-A)<=c&&e.slice(r.fromA-g,r.fromA)==e.slice(A,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=de(n,r.fromB,r.toB),g,A=p<0?-1:se(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=f&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toB-A)<=c&&n.slice(r.fromB-g,r.fromB)==n.slice(A,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return Se(t,3),t}let y;try{y=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function ye(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ee(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?ye(n)?1:0:y?!Ne(n)||e==t.length-1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e,e+2))?2:0:0}function je(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?ye(n)?1:0:y?!Te(n)||e==1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e-2,e))?2:0:0}const Oe=8;function ae(t,e,n){if(e==t.length||!je(t,e))return e;for(let l=e,i=e+n,r=0;r<Oe;r++){let o=Ee(t,l);if(!o||l+o>i)return l;l+=o}return e}function fe(t,e,n){if(!e||!Ee(t,e))return e;for(let l=e,i=e-n,r=0;r<Oe;r++){let o=je(t,l);if(!o||l-o<i)return l;l-=o}return e}function se(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function de(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Ne=t=>t>=55296&&t<=56319,Te=t=>t>=56320&&t<=57343;function O(t,e){return!e||e==t.length||!Ne(t.charCodeAt(e-1))||!Te(t.charCodeAt(e))}function at(t,e,n){var l;let i=n?.override;return i?i(t,e):(R=((l=n?.scanLimit)!==null&&l!==void 0?l:1e9)>>1,F=n?.timeout?Date.now()+n.timeout:0,Y=!1,lt(t,e,E(t,0,t.length,e,0,e.length)))}function Ge(){return!Y}function Re(t,e,n){return ot(at(t,e,n),t,e)}const D=ve.define({combine:t=>t[0]}),ft=$.define(),Fe=ve.define(),k=U.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ft)&&(t=n.value);for(let n of e.state.facet(Fe))t=n(t,e);return t}});class j{constructor(e,n,l,i,r,o=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=o}offset(e,n){return e||n?new j(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Re(e.toString(),n.toString(),l);return Ie(i,e,n,0,0,Ge())}static updateA(e,n,l,i,r){return ge(me(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return ge(me(e,i,!1,n.length),e,n,l,r)}}function ce(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function ue(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Ie(t,e,n,l,i,r){let o=[];for(let a=0;a<t.length;a++){let d=t[a],[c,f]=ce(d.fromA+l,d.fromB+i,e,n),[s,u]=ue(d.toA+l,d.toB+i,e,n),h=[d.offset(-c+l,-f+i)];for(;a<t.length-1;){let m=t[a+1],[p,g]=ce(m.fromA+l,m.fromB+i,e,n);if(p>s+1&&g>u+1)break;h.push(m.offset(-c+l,-f+i)),[s,u]=ue(m.toA+l,m.toB+i,e,n),a++}o.push(new j(h,c,Math.max(c,s),f,Math.max(f,u),r))}return o}const W=1e3;function he(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let f=0,s=0;i&&({toA:f,toB:s}=t[i-1]);let u=e-(n?f:s);return[f+u,s+u]}let o=i+r>>1,a=t[o],[d,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(d>e)r=o;else if(c<=e)i=o+1;else return l?[a.fromA,a.fromB]:[a.toA,a.toB]}}function me(t,e,n,l){let i=[];return e.iterChangedRanges((r,o,a,d)=>{let c=0,f=n?e.length:l,s=0,u=n?l:e.length;r>W&&([c,s]=he(t,r-W,n,!0)),o<e.length-W&&([f,u]=he(t,o+W,n,!1));let h=d-a-(o-r),m,[p,g]=n?[h,0]:[0,h];i.length&&(m=i[i.length-1]).toA>=c?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:f,toB:u,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:c,toA:f,fromB:s,toB:u,diffA:p,diffB:g})}),i}function ge(t,e,n,l,i){if(!t.length)return e;let r=[];for(let o=0,a=0,d=0,c=0;;o++){let f=o==t.length?null:t[o],s=f?f.fromA+a:n.length,u=f?f.fromB+d:l.length;for(;c<e.length;){let g=e[c];if(f&&(g.toA+a>s||g.toB+d>u))break;r.push(g.offset(a,d)),c++}if(!f)break;let h=f.toA+a+f.diffA,m=f.toB+d+f.diffB,p=Re(n.sliceString(s,h),l.sliceString(u,m),i);for(let g of Ie(p,n,l,s,u,Ge()))r.push(g);for(a+=f.diffA,d+=f.diffB;c<e.length;){let g=e[c];if(g.fromA+a>h&&g.fromB+d>m)break;c++}}return r}const st={scanLimit:500},We=$e.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Ce(t))}update(t){(t.docChanged||t.viewportChanged||dt(t.startState,t.state)||ct(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Ce(t.view))}},{decorations:t=>t.deco});function dt(t,e){return t.field(k,!1)!=e.field(k,!1)}function ct(t,e){return t.facet(D)!=e.facet(D)}const pe=M.line({class:"cm-changedLine"}),He=M.mark({class:"cm-changedText"}),ut=M.mark({tagName:"ins",class:"cm-insertedLine"}),ht=M.mark({tagName:"del",class:"cm-deletedLine"}),xe=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mt(t,e,n,l,i,r){let o=n?t.fromA:t.fromB,a=n?t.toA:t.toB,d=0;if(o!=a){i.add(o,o,pe),i.add(o,a,n?ht:ut),r&&r.add(o,o,xe);for(let c=e.iterRange(o,a-1),f=o;!c.next().done;){if(c.lineBreak){f++,i.add(f,f,pe),r&&r.add(f,f,xe);continue}let s=f+c.value.length;if(l)for(;d<t.changes.length;){let u=t.changes[d],h=o+(n?u.fromA:u.fromB),m=o+(n?u.toA:u.toB),p=Math.max(f,h),g=Math.min(s,m);if(p<g&&i.add(p,g,He),m<s)d++;else break}f=s}}}function Ce(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(D),o=n=="a",a=new H,d=i?new H:null,{from:c,to:f}=t.viewport;for(let s of e){if((o?s.fromA:s.fromB)>=f)break;(o?s.toA:s.toB)>c&&(!r||!r(t.state,s,a,d))&&mt(s,t.state.doc,o,l,a,d)}return{deco:a.finish(),gutter:d&&d.finish()}}const K=$.define({map:(t,e)=>e.mapPos(t)});class gt extends Z{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:K.of(i)});let{side:r,sibling:o}=e.state.facet(D);o&&o().dispatch({effects:K.of(pt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function pt(t,e,n){let l=0,i=0;for(let r=0;;r++){let o=r<e.length?e[r]:null;if(!o||(n?o.fromA:o.fromB)>=t)return i+(t-l);[l,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const xt=U.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(K)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(D).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>S.decorations.from(t)});function Ct({margin:t=3,minSize:e=4}){return xt.init(n=>At(n,t,e))}function At(t,e,n){let l=new H,i=t.facet(D).side=="a",r=t.field(k),o=1;for(let a=0;;a++){let d=a<r.length?r[a]:null,c=a?o+e:1,f=d?t.doc.lineAt(i?d.fromA:d.fromB).number-1-e:t.doc.lines,s=f-c+1;if(s>=n&&l.add(t.doc.line(c).from,t.doc.line(f).to,M.replace({widget:new gt(s),block:!0})),!d)break;o=t.doc.lineAt(Math.min(t.doc.length,i?d.toA:d.toB)).number}return l.finish()}const kt=S.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Bt=be.low(qe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(We))===null||e===void 0?void 0:e.gutter)||Ke.empty},widgetMarker:(t,e)=>e instanceof Pe?wt:null}));function bt(t){var e;let n=typeof t.original=="string"?Be.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||st;return[be.low(We),Mt,kt,S.editorAttributes.of({class:"cm-merge-b"}),Fe.of((i,r)=>{let o=r.effects.find(a=>a.is(te));return o&&(i=j.updateA(i,o.value.doc,r.startState.doc,o.value.changes,l)),r.docChanged&&(i=j.updateB(i,r.state.field(N),r.newDoc,r.changes,l)),i}),D.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?jt:void 0,side:"b"}),N.init(()=>n),t.gutter!==!1?Bt:[],t.collapseUnchanged?Ct(t.collapseUnchanged):[],k.init(i=>j.build(n,i.doc,l))]}const te=$.define(),N=U.define({create:()=>Be.empty,update(t,e){for(let n of e.effects)n.is(te)&&(t=n.value.doc);return t}}),Ae=new WeakMap;class Pe extends Z{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function vt(t,e,n){let l=Ae.get(e.changes);if(l)return l;let i=o=>{let{highlightChanges:a,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:c,mergeControls:f}=t.facet(D),s=document.createElement("div");if(s.className="cm-deletedChunk",f){let w=s.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let b=C=>{C.preventDefault(),Lt(o,o.posAtDOM(s))},v=C=>{C.preventDefault(),Dt(o,o.posAtDOM(s))};if(typeof f=="function")w.appendChild(f("accept",b)),w.appendChild(f("reject",v));else{let C=w.appendChild(document.createElement("button"));C.name="accept",C.textContent=t.phrase("Accept"),C.onmousedown=b;let B=w.appendChild(document.createElement("button"));B.name="reject",B.textContent=t.phrase("Reject"),B.onmousedown=v}}if(n||e.fromA>=e.toA)return s;let u=o.state.field(N).sliceString(e.fromA,e.endA),h=d&&t.facet(Qe),m=T(),p=e.changes,g=0,A=!1;function T(){let w=s.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function I(w,b,v){for(let C=w;C<b;){if(u.charAt(C)==`
2
2
  `){m.firstChild||m.appendChild(document.createElement("br")),m=T(),C++;continue}let B=b,ne=v+(A?" cm-deletedText":""),re=!1,J=u.indexOf(`
3
3
  `,C);if(J>-1&&J<b&&(B=J),a&&g<p.length){let G=Math.max(0,A?p[g].toA:p[g].fromA);G<=B&&(B=G,A&&g++,re=!0)}if(B>C){let G=document.createTextNode(u.slice(C,B));if(ne){let ie=m.appendChild(document.createElement("span"));ie.className=ne,ie.appendChild(G)}else m.appendChild(G);C=B}re&&(A=!A)}}if(h&&e.toA-e.fromA<=c){let w=h.parser.parse(u),b=0;Ze(w,{style:v=>Ye(t,v)},(v,C,B)=>{v>b&&I(b,v,""),I(v,C,B),b=C}),I(b,u.length,"")}else I(0,u.length,"");return m.firstChild||m.appendChild(document.createElement("br")),s},r=M.widget({block:!0,side:-1,widget:new Pe(i)});return Ae.set(e.changes,r),r}function Lt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(d=>d.fromB<=l&&d.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=t.state.field(N);i.fromB!=i.toB&&i.toA<=o.length&&(r+=t.state.lineBreak);let a=Xe.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:r},o.length);return t.dispatch({effects:te.of({doc:a.apply(o),changes:a}),userEvent:"accept"}),!0}function Dt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(a=>a.fromB<=l&&a.endB>=l);if(!i)return!1;let o=n.field(N).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(o+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:o},userEvent:"revert"}),!0}function ke(t){let e=new H;for(let n of t.field(k)){let l=t.facet(D).overrideChunk&&Ue(t,n);e.add(n.fromB,n.fromB,vt(t,n,!!l))}return e.finish()}const Mt=U.define({create:t=>ke(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?ke(e.state):t},provide:t=>S.decorations.from(t)}),we=new WeakMap;function Ue(t,e){let n=we.get(e);if(n!==void 0)return n;n=null;let l=t.field(N),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,o=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==o&&r<10){let a=[],d=0,c=e.fromA,f=e.fromB;for(let s of e.changes){if(s.fromA<s.toA){d+=s.toA-s.fromA;let u=l.sliceString(c+s.fromA,c+s.toA);if(/\n/.test(u))break e;a.push(M.widget({widget:new St(u),side:-1}).range(f+s.fromB))}s.fromB<s.toB&&a.push(He.range(f+s.fromB,f+s.toB))}d<e.endA-e.fromA-r*2&&(n=a)}return we.set(e,n),n}class St extends Z{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const yt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Et=M.line({class:"cm-inlineChangedLine"});function jt(t,e,n,l){let i=Ue(t,e),r=0;if(!i)return!1;for(let o=t.doc.lineAt(e.fromB);;){for(l&&l.add(o.from,o.from,yt),n.add(o.from,o.from,Et);r<i.length&&i[r].to<=o.to;){let a=i[r++];n.add(a.from,a.to,a.value)}if(o.to>=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const Ot=S.theme({"&":{backgroundColor:"var(--background)",color:"var(--foreground)",fontSize:"12px",border:"1px solid var(--border)",borderRadius:"0.5rem",overflow:"hidden",width:"100%"},"& .cm-scroller":{overflow:"auto",maxHeight:"20rem",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace'},".cm-content":{padding:"6px 0"},".cm-gutters":{backgroundColor:"var(--muted)",color:"var(--muted-foreground)",border:"none",borderRight:"1px solid var(--border)"},".cm-changedLine":{backgroundColor:"color-mix(in oklch, var(--chart-2) 14%, transparent)"},".cm-changedText":{background:"color-mix(in oklch, var(--chart-2) 32%, transparent)"},".cm-deletedChunk":{backgroundColor:"color-mix(in oklch, var(--destructive) 10%, transparent)"},".cm-deletedText":{background:"color-mix(in oklch, var(--destructive) 28%, transparent)"},".cm-collapsedLines":{background:"var(--muted)",color:"var(--muted-foreground)",padding:"2px 8px"}});function P(t){if(Array.isArray(t))return t.map(P);if(t&&typeof t=="object"){const e={};for(const n of Object.keys(t).sort())e[n]=P(t[n]);return e}return t}function Nt({before:t,after:e}){const n=_.useRef(null);return _.useEffect(()=>{if(!n.current)return;const l=new S({state:le.create({doc:e,extensions:[le.readOnly.of(!0),S.editable.of(!1),S.lineWrapping,et(tt,{fallback:!0}),nt(),bt({original:t,mergeControls:!1,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}),Ot]}),parent:n.current});return()=>l.destroy()},[t,e]),L.jsx("div",{ref:n,className:"w-full"})}function Rt({before:t,after:e}){const[n,l]=_.useState(!1);if(!t&&!e)return null;const i=!!(t&&e);return L.jsxs("div",{className:"mt-2",children:[L.jsxs("button",{type:"button",onClick:()=>l(!n),className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?L.jsx(Je,{className:"h-3 w-3"}):L.jsx(Ve,{className:"h-3 w-3"}),i?n?"Hide diff":"Show diff":n?"Hide details":"Show details"]}),n&&(i?L.jsx("div",{className:"mt-2",children:L.jsx(Nt,{before:JSON.stringify(P(t),null,2),after:JSON.stringify(P(e),null,2)})}):L.jsxs("div",{className:"mt-2",children:[L.jsx("p",{className:"mb-1 text-[10px] font-medium uppercase text-muted-foreground",children:e?"After":"Before"}),L.jsx("pre",{className:ze(_e,"max-h-48 overflow-auto p-2 text-xs"),children:JSON.stringify(e??t,null,2)})]}))]})}export{Rt as J};
@@ -1 +1 @@
1
- import{j as s,S as e}from"./index-C2YGEKPo.js";function m({label:r,actions:l=!1}){return s.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":r,children:Array.from({length:4},(d,a)=>s.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${a===3?"":"border-b"}`,children:[s.jsx(e,{className:"h-7 w-7 shrink-0 rounded-md"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[s.jsx(e,{className:"h-4 w-40"}),s.jsx(e,{className:"h-3 w-24"})]}),l?s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(e,{className:"h-8 w-8 rounded-md"}),s.jsx(e,{className:"h-8 w-8 rounded-md"})]}):null]},a))})}export{m as L};
1
+ import{j as s,S as e}from"./index-BKZMzuMS.js";function m({label:r,actions:l=!1}){return s.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":r,children:Array.from({length:4},(d,a)=>s.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${a===3?"":"border-b"}`,children:[s.jsx(e,{className:"h-7 w-7 shrink-0 rounded-md"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[s.jsx(e,{className:"h-4 w-40"}),s.jsx(e,{className:"h-3 w-24"})]}),l?s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(e,{className:"h-8 w-8 rounded-md"}),s.jsx(e,{className:"h-8 w-8 rounded-md"})]}):null]},a))})}export{m as L};
@@ -0,0 +1 @@
1
+ import{a2 as ye,Y as je,aq as we,a7 as ve,r as i,ar as ne,j as e,s as h,as as ke,at as z,au as Ne,av as Se,aw as Ce,an as Ee,ag as Le,ao as Ue,ax as se}from"./index-BKZMzuMS.js";import{s as Fe}from"./index-C78ucWDF.js";import{C as Pe,c as Me}from"./card-HMQT7vU5.js";function A(m){if(!m||typeof m!="object")return null;const u=m.error;if(typeof u=="string")return u;if(u&&typeof u=="object"){const s=u.message;if(typeof s=="string"&&s.length>0)return s}const x=m.message;return typeof x=="string"&&x.length>0?x:null}async function re(m,u){if(typeof window>"u")return;const x=window.PasswordCredential;if(!(!x||!navigator.credentials?.store))try{const s=new x({id:m,password:u});await navigator.credentials.store(s)}catch{}}function S(m){return m?m.toLowerCase().replaceAll("_"," ").trim().includes("account not linked")?"This social account matches an existing Lobu user. Sign in with a magic link to verify ownership, then continue.":m:null}function Re(){const m=ye(),{session:u,isReady:x}=je(),{data:s,isLoading:E,error:R}=we(),o=ve({from:"/auth/login"}),q=o.invitationOrg,[b,y]=i.useState("social"),[c,L]=i.useState(o.intent??"sign-in"),[$,ie]=i.useState(""),[a,B]=i.useState(()=>o.loginHint??""),[w,ae]=i.useState(""),[v,oe]=i.useState(""),[U,D]=i.useState(""),[le,H]=i.useState(!1),[l,d]=i.useState(null),[F,r]=i.useState(null),[ce,_]=i.useState(!1),[de,V]=i.useState(!1),[J,ue]=i.useState(!1),G=i.useRef(!1),C=o.callbackUrl,Y=o.mode==="extension",O=o.error==="account_not_linked",K=S(o.errorDescription||o.error),P=Object.values(s?.social??{}).some(Boolean),k=!!s?.magicLink,M=!!s?.phone,p=!!s?.emailPassword,Q=!!s?.passkey,f=!!s?.singleUserMode,X=!!s?.hasUser,T=f,j=i.useMemo(()=>{const t=[];return p&&t.push("email-password"),P&&t.push("social"),k&&t.push("magic-link"),M&&t.push("whatsapp"),t},[p,k,P,M]),me=i.useMemo(()=>p?j.filter(t=>t!=="magic-link"&&t!=="social"):j,[j,p]),W=R instanceof Error?R.message:R?"Unable to load sign-in options.":null;i.useEffect(()=>{if(u){const t=ne(C);C?window.location.href=t:m({to:"/"})}},[u,m,C]),i.useEffect(()=>{!s||j.length===0||j.includes(b)||y(j[0])},[s,b,j]),i.useEffect(()=>{!k||!O||(y("magic-link"),o.loginHint&&!a&&B(o.loginHint))},[k,O,o.loginHint,a]),i.useEffect(()=>{o.intent&&L(o.intent)},[o.intent]),i.useEffect(()=>{if(!f||!s)return;const t=X?"sign-in":"sign-up";c!==t&&L(t)},[f,X,s,c]);const N=()=>C?ne(C):"/",Z=async t=>{d(t),r(null);try{const n=await z.social({provider:t,callbackURL:N(),newUserCallbackURL:C?N():`/?onboard_provider=${encodeURIComponent(t)}`}),g=A(n);if(g){const I=S(g);I?.toLowerCase().includes("magic link")&&y("magic-link"),r(I)}}catch(n){r(S(n instanceof Error?n.message:`Failed to sign in with ${t}`))}finally{d(null)}};i.useEffect(()=>{if(G.current||!x||u||E||!s||o.error)return;const t=o.provider;t&&Object.hasOwn(s.social??{},t)&&s.social?.[t]&&(G.current=!0,Z(t))},[s,E,u,x,o.provider,o.error]);const ee=async()=>{if(a){d("magic-link"),r(null);try{return await z.magicLink({email:a,callbackURL:N()}),_(!0),!0}catch(t){return r(t instanceof Error?t.message:"Failed to send magic link"),!1}finally{d(null)}}},ge=async t=>{t.preventDefault(),await ee()},pe=async t=>{if(t.preventDefault(),!(!a||!w)){d("email-password"),r(null);try{if(c==="sign-up"){const n=await Se.email({email:a,password:w,name:$||a.split("@")[0]||"User",callbackURL:N()}),g=A(n);if(g){r(S(g));return}if(await re(a,w),f&&Q)try{await Ce.passkey.addPasskey({name:$||`${navigator.platform||"This device"}`})}catch{}}else{const n=await z.email({email:a,password:w,callbackURL:N()}),g=A(n);if(g){r(S(g));return}if(!n?.data){r("Invalid email or password");return}await re(a,w)}}catch(n){const g=n instanceof Error?n.message:typeof n=="string"?n:A(n);r(g||"Authentication failed")}finally{d(null)}}},te=async()=>{r(null),ue(!0),d("local");try{const t=await Ne();if(!t.ok){const n=await t.json().catch(()=>null);r(n?.error_description??"Could not sign in to your local install.");return}window.location.href=N()}catch(t){r(t instanceof Error?t.message:"Could not sign in to your local install.")}finally{d(null)}};i.useEffect(()=>{T&&s&&!u&&!J&&te()},[T,s,u,J]);const fe=async()=>{if(!a){r("Enter your email address first to reset your password.");return}d("reset-password-request"),r(null);try{const t=`${window.location.origin}/auth/reset-password`,n=await Ee(`${Le}/api/auth/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:a,redirectTo:t})});if(!n.ok)throw await Ue(n);V(!0)}catch(t){r(t instanceof Error?t.message:"Failed to send password reset email")}finally{d(null)}},he=async t=>{if(t.preventDefault(),!!v){d("phone"),r(null);try{await se.sendOtp({phoneNumber:v}),H(!0)}catch(n){r(n instanceof Error?n.message:"Failed to send verification code")}finally{d(null)}}},xe=async t=>{if(t.preventDefault(),!(!v||!U)){d("verify"),r(null);try{await se.verify({phoneNumber:v,code:U})}catch(n){r(n instanceof Error?n.message:"Invalid verification code"),d(null)}}};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx("h1",{className:"text-2xl font-bold",children:q?`Sign in to join ${q}`:f&&c==="sign-up"?"Set up your local install":f?"Welcome back":c==="sign-up"?"Create your account":"Sign in"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:q?"Sign in with the email your invitation was sent to.":f&&c==="sign-up"?"This account stays on this machine. Email is just an identifier — pick anything you’ll remember.":f?"Sign in to your local install.":Y?"Sign in to connect the browser extension":c==="sign-up"?"Choose a sign-up method":"Choose your preferred sign-in method"}),f&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-muted text-muted-foreground rounded-full text-xs",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Local install · nothing sent to lobu.ai"]}),Y&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-primary/10 text-primary rounded-full text-sm",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Browser Extension"]})]}),e.jsx(Pe,{children:e.jsx(Me,{children:T?e.jsx("div",{className:"space-y-4",children:F?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:F}),e.jsx("button",{type:"button",disabled:l!==null,onClick:te,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:"Try again"})]}):e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(h,{size:"lg"}),e.jsx("span",{children:"Signing you into your local install…"})]})}):e.jsxs(e.Fragment,{children:[E&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(h,{size:"lg"}),e.jsx("span",{children:"Loading sign-in options…"})]}),!E&&W&&e.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load sign-in options. ",W]}),!E&&!W&&j.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"No sign-in methods are configured. Contact support for access."}),p&&e.jsxs("div",{className:"mb-4 flex rounded-lg border p-1",children:[e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-in"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>L("sign-in"),children:"Sign In"}),e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-up"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>L("sign-up"),children:"Sign Up"})]}),me.length>1&&e.jsxs("div",{className:"mb-6 flex rounded-lg border p-1",children:[p&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="email-password"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("email-password"),children:"Email + Password"}),P&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="social"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("social"),children:"Social"}),!p&&k&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="magic-link"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("magic-link"),children:"Magic Link"}),M&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="whatsapp"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("whatsapp"),children:"WhatsApp"})]}),O&&e.jsx("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"We found an existing account for this identity. To protect the account, verify with a magic link before linking social sign-in."}),K&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:K}),F&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:F}),(p||b==="social")&&P&&e.jsxs("div",{className:"space-y-3",children:[Object.entries(s?.social??{}).filter(([,t])=>t).map(([t])=>{const n=Fe.find(be=>be.provider===t),g=n?.icon,I=n?.name??t.charAt(0).toUpperCase()+t.slice(1);return e.jsxs("button",{type:"button",onClick:()=>Z(t),disabled:l!==null,className:"w-full flex items-center justify-center gap-3 h-10 px-4 border border-input rounded-lg bg-background hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-50",children:[l===t?e.jsx(h,{size:"lg"}):g?e.jsx(g,{className:"w-4 h-4"}):e.jsx(ke,{className:"w-4 h-4"}),"Continue with ",I]},t)}),p&&e.jsxs("div",{className:"relative my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]})]}),p&&e.jsxs("form",{onSubmit:pe,className:"space-y-4",children:[c==="sign-up"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"full-name",className:"block text-sm font-medium",children:"Full name"}),e.jsx("input",{id:"full-name",type:"text",value:$,onChange:t=>ie(t.target.value),placeholder:"Jane Doe",className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email-password-email",type:"email",value:a,onChange:t=>{B(t.target.value),V(!1)},placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-password",className:"block text-sm font-medium",children:"Password"}),e.jsx("input",{id:"email-password-password",type:"password",value:w,onChange:t=>ae(t.target.value),placeholder:"Enter a password",required:!0,minLength:8,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!a||!w,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="email-password"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:c==="sign-up"?"Creating account...":"Signing in..."})]}):c==="sign-up"?f?"Create local account":"Create Account":"Sign In"}),c==="sign-in"&&Q&&e.jsx("button",{type:"button",disabled:l!==null,onClick:async()=>{r(null),d("passkey");try{const t=await z.passkey();if(t?.error){const n=t.error.message??"Passkey sign-in failed.";r(S(n)??n);return}window.location.href=N()}catch(t){const n=t instanceof Error?t.message:String(t);r(S(n)??n)}finally{d(null)}},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="passkey"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Waiting for passkey…"})]}):"Sign in with passkey"}),c==="sign-in"&&k&&e.jsx("button",{type:"button",disabled:l!==null||!a,onClick:async()=>{await ee()&&y("magic-link")},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending magic link..."})]}):"Send me a magic link instead"}),c==="sign-in"&&e.jsx("button",{type:"button",disabled:l!==null||!a,onClick:fe,className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="reset-password-request"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending reset email..."})]}):"Forgot password?"}),c==="sign-in"&&de&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this email exists, we sent a password reset link."})]}),b==="magic-link"&&k&&(ce?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("svg",{className:"h-12 w-12 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-lg font-medium",children:"Check your email"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["We sent a magic link to ",e.jsx("strong",{children:a}),".",e.jsx("br",{}),"Click the link in the email to sign in."]}),e.jsx("button",{type:"button",className:"mt-4 text-sm text-primary hover:underline",onClick:()=>_(!1),children:"Use a different email"})]}):e.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email",type:"email",value:a,onChange:t=>B(t.target.value),placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!a,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Magic Link"})]})),b==="whatsapp"&&M&&(le?e.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Enter the 6-digit code sent to ",e.jsx("strong",{children:v})]}),e.jsx("div",{children:e.jsx("input",{type:"text",value:U,onChange:t=>D(t.target.value),placeholder:"000000",maxLength:6,pattern:"[0-9]{6}",required:!0,className:"block h-12 w-full rounded-md border border-input bg-background px-3 py-2 text-center text-xl tracking-widest placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),e.jsx("button",{type:"submit",disabled:l!==null||U.length!==6,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="verify"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Verifying..."})]}):"Verify & Sign In"}),e.jsx("button",{type:"button",className:"w-full text-sm text-primary hover:underline",onClick:()=>{H(!1),D("")},children:"Use a different number"})]}):e.jsxs("form",{onSubmit:he,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium",children:"WhatsApp Number"}),e.jsx("input",{id:"phone",type:"tel",value:v,onChange:t=>oe(t.target.value),placeholder:"+1234567890",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Include country code (e.g., +1 for US)"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!v,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="phone"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Code via WhatsApp"})]}))]})})})]})})}export{Re as component};
@@ -1 +1 @@
1
- import{r as n,ap as o,j as e}from"./index-C2YGEKPo.js";function s(){return n.useEffect(()=>{o().catch(t=>console.error("Sign out failed:",t)).finally(()=>{window.location.href="/"})},[]),e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Signing out..."})})}export{s as component};
1
+ import{r as n,ap as o,j as e}from"./index-BKZMzuMS.js";function s(){return n.useEffect(()=>{o().catch(t=>console.error("Sign out failed:",t)).finally(()=>{window.location.href="/"})},[]),e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Signing out..."})})}export{s as component};
@@ -1 +1 @@
1
- import{j as e,S as o,Y as c,bM as u,bm as b,e2 as d,B as h,L as p,a5 as g}from"./index-C2YGEKPo.js";function x({rows:s=5}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading members",children:Array.from({length:s}).map((r,t)=>e.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(o,{className:"h-8 w-8 shrink-0 rounded-full"}),e.jsx(o,{className:"h-4 w-40"})]},t))})}function j(s){const r=new URLSearchParams({type:"$member"});return`/${s}/memory?${r.toString()}`}function m({title:s,body:r,ctaLabel:t,showCta:n,callbackUrl:a}){return e.jsx(b,{icon:d,title:s,description:r,children:t&&n?e.jsx(h,{asChild:!0,className:"mt-4",children:e.jsx(p,{to:"/auth/login",search:g({callbackUrl:a,intent:"sign-in"}),children:t})}):null})}function y({ownerSlug:s,children:r}){const{isAuthenticated:t,isReady:n}=c(),{isMember:a,isLoading:l}=u(),i=j(s);return!n||l?e.jsx(x,{}):t?a?e.jsx(e.Fragment,{children:r}):e.jsx(m,{title:"Join to see members",body:"Emails and member details are only visible to members of this workspace. Use the banner above to join.",callbackUrl:i}):e.jsx(m,{title:"Sign in to see members",body:"The members of this workspace are only visible to people who have signed in.",ctaLabel:"Sign in",showCta:!0,callbackUrl:i})}export{y as M};
1
+ import{j as e,S as o,Y as c,bM as u,bm as b,e2 as d,B as h,L as p,a5 as g}from"./index-BKZMzuMS.js";function x({rows:s=5}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading members",children:Array.from({length:s}).map((r,t)=>e.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(o,{className:"h-8 w-8 shrink-0 rounded-full"}),e.jsx(o,{className:"h-4 w-40"})]},t))})}function j(s){const r=new URLSearchParams({type:"$member"});return`/${s}/memory?${r.toString()}`}function m({title:s,body:r,ctaLabel:t,showCta:n,callbackUrl:a}){return e.jsx(b,{icon:d,title:s,description:r,children:t&&n?e.jsx(h,{asChild:!0,className:"mt-4",children:e.jsx(p,{to:"/auth/login",search:g({callbackUrl:a,intent:"sign-in"}),children:t})}):null})}function y({ownerSlug:s,children:r}){const{isAuthenticated:t,isReady:n}=c(),{isMember:a,isLoading:l}=u(),i=j(s);return!n||l?e.jsx(x,{}):t?a?e.jsx(e.Fragment,{children:r}):e.jsx(m,{title:"Join to see members",body:"Emails and member details are only visible to members of this workspace. Use the banner above to join.",callbackUrl:i}):e.jsx(m,{title:"Sign in to see members",body:"The members of this workspace are only visible to people who have signed in.",ctaLabel:"Sign in",showCta:!0,callbackUrl:i})}export{y as M};