decocms 2.317.0 → 2.318.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/dist/client/assets/{AlertCircle-DBGfLjQw.js → AlertCircle-D7In04VZ.js} +1 -1
  2. package/dist/client/assets/{Archive-BKT9Dg_O.js → Archive-DaxWSUle.js} +1 -1
  3. package/dist/client/assets/{ArrowNarrowLeft-CukpweKs.js → ArrowNarrowLeft-I0Rr4fru.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-D9dARFlG.js → ArrowUpRight-Cl4DoJ1w.js} +1 -1
  5. package/dist/client/assets/{Check-BXg4TGxE.js → Check-nv67ec3-.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Bo4QB9pu.js → CheckCircle-ByasFo1p.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DEP8rKZT.js → ChevronDown-Brvsr3Fl.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CXiW90Fz.js → ChevronRight-PLlU1t0W.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BhNdg10c.js → ChevronUp-VDqvRLBN.js} +1 -1
  10. package/dist/client/assets/{Container-CxQrLgnS.js → Container-DTioRpeZ.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-Caoo-NuL.js → DotsVertical-DSgmYETN.js} +1 -1
  12. package/dist/client/assets/{LayoutLeft-Br6mPXCN.js → LayoutLeft-CG8cspKX.js} +1 -1
  13. package/dist/client/assets/{LinkExternal01-FDsQXojs.js → LinkExternal01-FKIQuNsM.js} +1 -1
  14. package/dist/client/assets/{Lock01-CjoGpFGs.js → Lock01-XwPtPsiy.js} +1 -1
  15. package/dist/client/assets/{Palette-C1Yvme6Z.js → Palette-DGf3gs0h.js} +1 -1
  16. package/dist/client/assets/{Play-BFNsKgtb.js → Play-BUgAN2i6.js} +1 -1
  17. package/dist/client/assets/{Plus-BPcc_-zf.js → Plus-Bk1OvOXE.js} +1 -1
  18. package/dist/client/assets/{RefreshCcw01-DebjkWfq.js → RefreshCcw01-CeTSzQsT.js} +1 -1
  19. package/dist/client/assets/{SearchMd-CePuFGwO.js → SearchMd-Bo6RzH5Q.js} +1 -1
  20. package/dist/client/assets/{Settings02-B5jIAnK4.js → Settings02-uL3uu5-7.js} +1 -1
  21. package/dist/client/assets/{Shield01-CKYDfpKE.js → Shield01-OH6-JWjw.js} +1 -1
  22. package/dist/client/assets/{Star01-CxJjtPnY.js → Star01-_us4XpQn.js} +1 -1
  23. package/dist/client/assets/{Sun-CBmGK6wu.js → Sun-Zv-PWUwn.js} +1 -1
  24. package/dist/client/assets/{Tool01-YKVy1yNP.js → Tool01-DUGZCBMz.js} +1 -1
  25. package/dist/client/assets/{Trash01--KbsY2dn.js → Trash01-AR9qKMZU.js} +1 -1
  26. package/dist/client/assets/{User01-BLvWkS9e.js → User01-3xBsy6wV.js} +1 -1
  27. package/dist/client/assets/{Users03-C4su_vOM.js → Users03-B0r4bSLn.js} +1 -1
  28. package/dist/client/assets/{X-CNAnrf0f.js → X-DDQYEU6o.js} +1 -1
  29. package/dist/client/assets/{XCircle-QSJN9xhv.js → XCircle-B14ynTvz.js} +1 -1
  30. package/dist/client/assets/{XClose-CPKu5cnb.js → XClose-DwaprZxL.js} +1 -1
  31. package/dist/client/assets/{Zap-B4MS-NKo.js → Zap-EburzyyI.js} +1 -1
  32. package/dist/client/assets/{ZapSquare-D07uWeTi.js → ZapSquare-DgAVTy7i.js} +1 -1
  33. package/dist/client/assets/{accordion-DK_H38Gy.js → accordion-CNGIXlRh.js} +1 -1
  34. package/dist/client/assets/{agent-icon-ChigV_SM.js → agent-icon-CDOpQPVP.js} +1 -1
  35. package/dist/client/assets/{agents-list-CQyCCUIN.js → agents-list-Bie-B6KO.js} +1 -1
  36. package/dist/client/assets/{ai-providers-D8YlgZiZ.js → ai-providers-sx9fCpX9.js} +1 -1
  37. package/dist/client/assets/{alert-dialog-B-CFL8EO.js → alert-dialog-DzUiFLm5.js} +1 -1
  38. package/dist/client/assets/{auth-catchall-CI1pA1WK.js → auth-catchall-Db6wnMxY.js} +1 -1
  39. package/dist/client/assets/{automation-list-row-exexu0fc.js → automation-list-row-DA67TUpG.js} +1 -1
  40. package/dist/client/assets/{automations-Ch8DHfAX.js → automations-D5gbOL8y.js} +1 -1
  41. package/dist/client/assets/{avatar-DLcW-A0B.js → avatar-JFkuXk7Y.js} +1 -1
  42. package/dist/client/assets/{badge-Bovdptse.js → badge-D0TDvkU5.js} +1 -1
  43. package/dist/client/assets/{brand-context-BEky_t3d.js → brand-context-VXYVmQXI.js} +1 -1
  44. package/dist/client/assets/{card-Bij24Dhu.js → card-NxdWcP2Y.js} +1 -1
  45. package/dist/client/assets/{chat-context-C_XiURbM.js → chat-context-BpeMEIll.js} +1 -1
  46. package/dist/client/assets/{checkbox-DepLdWR1.js → checkbox-q_vRqr9W.js} +1 -1
  47. package/dist/client/assets/{collection-detail-CWWkHJjz.js → collection-detail-C0n6W9bV.js} +1 -1
  48. package/dist/client/assets/{collection-display-button-U6oQljTt.js → collection-display-button-BDkguG0j.js} +1 -1
  49. package/dist/client/assets/{collection-search-BCf7pr5A.js → collection-search-B_PTLHi8.js} +1 -1
  50. package/dist/client/assets/{collection-search-oUHE77Ko.js → collection-search-CMNBGaQC.js} +1 -1
  51. package/dist/client/assets/{collection-table-wrapper-CIXt2Qna.js → collection-table-wrapper-CCajoTAy.js} +1 -1
  52. package/dist/client/assets/{collection-tabs-CHoGEXEE.js → collection-tabs-CAm-q3uz.js} +1 -1
  53. package/dist/client/assets/{collections-DbmVPIqC.js → collections-CreMYLs8.js} +1 -1
  54. package/dist/client/assets/{command-BJXJqdxz.js → command-B9OPYg11.js} +1 -1
  55. package/dist/client/assets/{connection-card-DvWQmocE.js → connection-card-C06IRcu3.js} +1 -1
  56. package/dist/client/assets/{connection-detail-DMePaT7A.js → connection-detail-z9x5FbvM.js} +1 -1
  57. package/dist/client/assets/{connection-form-helpers-z7ekyahw.js → connection-form-helpers-n0-EInK6.js} +1 -1
  58. package/dist/client/assets/{connections-C2W6I3Kx.js → connections-CH6W6L6i.js} +1 -1
  59. package/dist/client/assets/{constants-D2ruRIzu.js → constants-B0L3jJTH.js} +1 -1
  60. package/dist/client/assets/{constants-CrCZOO5F.js → constants-fVwC9Czh.js} +1 -1
  61. package/dist/client/assets/{dialog-zxbh5ng1.js → dialog-qtKrSwKA.js} +1 -1
  62. package/dist/client/assets/{domain-settings-CG6GaRrK.js → domain-settings-P92TIE-X.js} +1 -1
  63. package/dist/client/assets/{drawer-DNDd7AZJ.js → drawer-B0OHUPPF.js} +1 -1
  64. package/dist/client/assets/{dropdown-menu-BHUBCwIp.js → dropdown-menu-BnaZE7Qd.js} +1 -1
  65. package/dist/client/assets/{dynamic-plugin-layout-DuN_fdev.js → dynamic-plugin-layout-BLT1-t7U.js} +1 -1
  66. package/dist/client/assets/{empty-state-9cIH1OSj.js → empty-state-BCr9v4T1.js} +1 -1
  67. package/dist/client/assets/{empty-state-16qSOU0O.js → empty-state-Bd4cGUaH.js} +1 -1
  68. package/dist/client/assets/{extract-connection-data-CA-1nswb.js → extract-connection-data-D7Vkjtul.js} +1 -1
  69. package/dist/client/assets/{features-CemeaDAi.js → features-BMjb9wKO.js} +1 -1
  70. package/dist/client/assets/{form-DK_rcfC8.js → form-dz7U0CZK.js} +1 -1
  71. package/dist/client/assets/{general-C8mtE7AK.js → general-jiXD2EYY.js} +1 -1
  72. package/dist/client/assets/{index-D8oXDizB.js → index-B1sAFND8.js} +1 -1
  73. package/dist/client/assets/{index-By1GUFmc.js → index-BK7vZkwz.js} +1 -1
  74. package/dist/client/assets/{index-C-NbBgOF.js → index-BMBxMDI7.js} +1 -1
  75. package/dist/client/assets/{index-BSzZmTb_.js → index-BOaGE1aK.js} +1 -1
  76. package/dist/client/assets/{index-B19uc8uS.js → index-BTxYkYBr.js} +1 -1
  77. package/dist/client/assets/{index-nTgL534f.js → index-CB6J7z90.js} +1 -1
  78. package/dist/client/assets/{index-CMD-gSoU.js → index-CHYuwbgr.js} +1 -1
  79. package/dist/client/assets/{index-CCt7tyZ0.js → index-CtMy8ETw.js} +1 -1
  80. package/dist/client/assets/{index-CLwT6SqX.js → index-DTLkaJxe.js} +1 -1
  81. package/dist/client/assets/{index-77yxUsUU.js → index-DrMvBZMW.js} +1 -1
  82. package/dist/client/assets/{index-BOMQKZYe.js → index-KBbmKsy_.js} +1 -1
  83. package/dist/client/assets/{index-7mIMVlht.js → index-OK75u_aS.js} +3 -3
  84. package/dist/client/assets/{index-CzOMQ7ME.js → index-dmkCn37I.js} +2 -2
  85. package/dist/client/assets/{index-CVz9D9gf.js → index-jo98Roqy.js} +1 -1
  86. package/dist/client/assets/{index-DHNiGAXq.js → index-xstkyz4B.js} +1 -1
  87. package/dist/client/assets/{index-CEKdquZV.js → index-y8RdJ-mt.js} +1 -1
  88. package/dist/client/assets/{infiniteQueryObserver-C3rVl4tZ.js → infiniteQueryObserver-BGrXNOzy.js} +1 -1
  89. package/dist/client/assets/{input-B0c-2DIW.js → input-C0h7cNmt.js} +1 -1
  90. package/dist/client/assets/{integration-icon-BaScZvO6.js → integration-icon-PH7vkQ9v.js} +1 -1
  91. package/dist/client/assets/{label-gqBY6uyz.js → label-C5ENUwLS.js} +1 -1
  92. package/dist/client/assets/{layout-CYKmcI2j.js → layout-BamLP3Zj.js} +1 -1
  93. package/dist/client/assets/{lean-canvas-recruit-modal-CHTxHUjM.js → lean-canvas-recruit-modal-CZMvychF.js} +1 -1
  94. package/dist/client/assets/{login-DClTL_nN.js → login-uG1nFl44.js} +1 -1
  95. package/dist/client/assets/{members-DhsQ9190.js → members-fSWoT1uJ.js} +1 -1
  96. package/dist/client/assets/{monaco-editor-BBalufRy.js → monaco-editor-eJWlN-2G.js} +1 -1
  97. package/dist/client/assets/{monitoring-stats-row-Dv-X2RbZ.js → monitoring-stats-row-CYIwSwNt.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-B-3DKhKg.js → oauth-callback-DIrOvKws.js} +1 -1
  99. package/dist/client/assets/{oauth-callback-ai-provider-Bkh9HG7z.js → oauth-callback-ai-provider-CNRYQgK6.js} +1 -1
  100. package/dist/client/assets/{onboarding-D7bymWNF.js → onboarding-BBHY-5YM.js} +1 -1
  101. package/dist/client/assets/{org-layout-CYfpIgy5.js → org-layout-D7UrUDGp.js} +1 -1
  102. package/dist/client/assets/{org-plugin-layout-C8RFioa3.js → org-plugin-layout-DqfPxjfL.js} +1 -1
  103. package/dist/client/assets/{pair-Bg3A59Mm.js → pair-BJSIhyuY.js} +1 -1
  104. package/dist/client/assets/{plugin-empty-state-BrALBpmq.js → plugin-empty-state-BP62tfBa.js} +1 -1
  105. package/dist/client/assets/{plugin-header-ClLf_cJL.js → plugin-header-BPz_4aBZ.js} +1 -1
  106. package/dist/client/assets/{plugin-layout-C1cPizmH.js → plugin-layout-BvUSBgIT.js} +1 -1
  107. package/dist/client/assets/{popover-DVDtU_6G.js → popover-9waMMdOC.js} +1 -1
  108. package/dist/client/assets/{profile-OTfGZyjY.js → profile-BW02PQou.js} +1 -1
  109. package/dist/client/assets/{project-app-view-C5TQg2cG.js → project-app-view-kQIX2VaC.js} +1 -1
  110. package/dist/client/assets/registry-BohcIySS.js +2 -0
  111. package/dist/client/assets/{registry-layout-CmjO7_QP.js → registry-layout-C0qSEWQT.js} +1 -1
  112. package/dist/client/assets/{required-auth-layout-BRR_6ANi.js → required-auth-layout-BVmXc_2r.js} +1 -1
  113. package/dist/client/assets/{reset-password-BIYV3F1f.js → reset-password-B1_rk5lV.js} +1 -1
  114. package/dist/client/assets/{roles-DjfHoeEL.js → roles-D5G81cT_.js} +1 -1
  115. package/dist/client/assets/{scroll-area-9lFTzWCb.js → scroll-area-xE7hc-8l.js} +1 -1
  116. package/dist/client/assets/{search-input-BWH3fQpv.js → search-input-C1skYPKA.js} +1 -1
  117. package/dist/client/assets/{select-Ilj6kxB7.js → select-BjC54T39.js} +1 -1
  118. package/dist/client/assets/{select-model-Ca5uLyFK.js → select-model-CLZn_-xL.js} +1 -1
  119. package/dist/client/assets/{settings-layout-DGVGgKqW.js → settings-layout-BhnclKCP.js} +1 -1
  120. package/dist/client/assets/{settings-section-DfJOrTB5.js → settings-section-CijJZPn7.js} +1 -1
  121. package/dist/client/assets/{shell-layout-DbyGG6Wz.js → shell-layout-DU81GX4X.js} +1 -1
  122. package/dist/client/assets/{sidebar-CHkSPfi1.js → sidebar-sY4KII-w.js} +1 -1
  123. package/dist/client/assets/{skeleton-BhYsT5bA.js → skeleton-De5l7OL1.js} +1 -1
  124. package/dist/client/assets/{spinner-DRDdaYJh.js → spinner-CsMegR0e.js} +1 -1
  125. package/dist/client/assets/{sso-BWvJitB4.js → sso-CrRO0aCM.js} +1 -1
  126. package/dist/client/assets/{store-CRnNdTmg.js → store-CJkx6fS3.js} +1 -1
  127. package/dist/client/assets/store-registry-DoOjurxP.js +2 -0
  128. package/dist/client/assets/{switch-MdXM9LTQ.js → switch-Dg8MplKB.js} +1 -1
  129. package/dist/client/assets/{table-DqMsTisq.js → table-CcD56_bf.js} +1 -1
  130. package/dist/client/assets/{tabs-BOCdrF2i.js → tabs-Bun7zdDt.js} +1 -1
  131. package/dist/client/assets/{task-status-BMDGQef8.js → task-status-n57TCkuM.js} +1 -1
  132. package/dist/client/assets/{textarea-BqfIjmtd.js → textarea-Da3AWsK6.js} +1 -1
  133. package/dist/client/assets/{toggle-group-i_HO-0bV.js → toggle-group-DDewxrST.js} +1 -1
  134. package/dist/client/assets/{tools-list-BdLDYsTK.js → tools-list-ufT0EENN.js} +1 -1
  135. package/dist/client/assets/{tooltip-Dk-x7ks3.js → tooltip-DHpEGVi8.js} +1 -1
  136. package/dist/client/assets/{types-G67jsjMK.js → types-BrFLFb5i.js} +1 -1
  137. package/dist/client/assets/{use-ai-providers-Bo9kqLtW.js → use-ai-providers-Cf9shvYI.js} +1 -1
  138. package/dist/client/assets/{use-collections-DaGR-TK3.js → use-collections-XDqst4E_.js} +1 -1
  139. package/dist/client/assets/{use-connection-Bw3IdOYX.js → use-connection-BCPpnVMX.js} +1 -1
  140. package/dist/client/assets/{use-copy-B-uFxHk6.js → use-copy-BNSIRmV_.js} +1 -1
  141. package/dist/client/assets/{use-create-virtual-mcp-CCKFB_a7.js → use-create-virtual-mcp-DdlYO5qT.js} +1 -1
  142. package/dist/client/assets/{use-debounced-autosave-T0GvbwUO.js → use-debounced-autosave-BnUZVD_o.js} +1 -1
  143. package/dist/client/assets/{use-decopilot-events-Co1GYuP2.js → use-decopilot-events-DTwuBO8M.js} +1 -1
  144. package/dist/client/assets/{use-delete-connection-kRigiWM3.js → use-delete-connection-B1f9N3vg.js} +1 -1
  145. package/dist/client/assets/{use-infinite-scroll-BNHelzzC.js → use-infinite-scroll-ByL07kWP.js} +1 -1
  146. package/dist/client/assets/{use-list-state-DUJmWeK2.js → use-list-state-D1Op5rZf.js} +1 -1
  147. package/dist/client/assets/{use-mcp-tools-DVY8KcMA.js → use-mcp-tools-a-ZvbrGo.js} +1 -1
  148. package/dist/client/assets/{use-members-BgQ7Ica2.js → use-members-BGu0mh45.js} +1 -1
  149. package/dist/client/assets/{use-navigate-to-agent-BQ5qza3f.js → use-navigate-to-agent-DjWaqrlh.js} +1 -1
  150. package/dist/client/assets/{use-org-auth-client-CJlh_N8L.js → use-org-auth-client-B7YA_80Y.js} +1 -1
  151. package/dist/client/assets/{use-org-sso-B3swYyz4.js → use-org-sso-CWD9kAdD.js} +1 -1
  152. package/dist/client/assets/{use-organization-roles-BIsWMlMh.js → use-organization-roles-BQMmdy5c.js} +1 -1
  153. package/dist/client/assets/{use-organization-settings-BMveAMB5.js → use-organization-settings-C2ni1vuh.js} +1 -1
  154. package/dist/client/assets/{use-registry-connections-Cld8pkRO.js → use-registry-connections-DeY5Qm5r.js} +1 -1
  155. package/dist/client/assets/{use-status-sounds-DsCr5ian.js → use-status-sounds-CBWZKYGa.js} +1 -1
  156. package/dist/client/assets/{use-tasks-ChwW8r_K.js → use-tasks-DZibCf5w.js} +1 -1
  157. package/dist/client/assets/{use-view-mode-MWDbD9TW.js → use-view-mode-C21WimLS.js} +1 -1
  158. package/dist/client/assets/{use-virtual-mcp-lxX8wI4d.js → use-virtual-mcp-BVVlTr3L.js} +1 -1
  159. package/dist/client/assets/useInfiniteQuery-B4rOzvqQ.js +1 -0
  160. package/dist/client/assets/useSuspenseInfiniteQuery-DVCwsKmm.js +1 -0
  161. package/dist/client/assets/{user-BesiartC.js → user-B1UpgZbT.js} +1 -1
  162. package/dist/client/assets/{view-mode-toggle-Dn0_DV4a.js → view-mode-toggle-CY3mqueQ.js} +1 -1
  163. package/dist/client/assets/{workflow-8tifDY_U.js → workflow-D4BXnu1J.js} +1 -1
  164. package/dist/client/assets/workflow-detail-CCg_qRjv.js +1 -0
  165. package/dist/client/index.html +1 -1
  166. package/dist/server/cli.js +1 -1
  167. package/dist/server/node_modules/{postgres-date/license → pg/LICENSE} +6 -6
  168. package/dist/server/node_modules/pg/README.md +95 -0
  169. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  170. package/dist/server/node_modules/pg/lib/client.js +743 -0
  171. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  172. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  173. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  174. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  175. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  176. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  177. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  178. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  179. package/dist/server/node_modules/pg/lib/index.js +73 -0
  180. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  181. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  182. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  183. package/dist/server/node_modules/pg/lib/query.js +252 -0
  184. package/dist/server/node_modules/pg/lib/result.js +109 -0
  185. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  186. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  187. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  188. package/dist/server/node_modules/pg/package.json +76 -0
  189. package/dist/server/node_modules/slice-ansi/index.d.ts +19 -0
  190. package/dist/server/node_modules/slice-ansi/index.js +260 -0
  191. package/dist/server/node_modules/{ansi-regex → slice-ansi}/license +1 -0
  192. package/dist/server/node_modules/slice-ansi/package.json +59 -0
  193. package/dist/server/node_modules/slice-ansi/readme.md +54 -0
  194. package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +752 -0
  195. package/package.json +1 -1
  196. package/dist/client/assets/registry-CXDPGCG2.js +0 -2
  197. package/dist/client/assets/store-registry-6e--RkKu.js +0 -2
  198. package/dist/client/assets/useInfiniteQuery-ImrWnFFo.js +0 -1
  199. package/dist/client/assets/useSuspenseInfiniteQuery-CpJJnQ6p.js +0 -1
  200. package/dist/client/assets/workflow-detail-8AQCTpUe.js +0 -1
  201. package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
  202. package/dist/server/node_modules/ansi-regex/index.js +0 -14
  203. package/dist/server/node_modules/ansi-regex/package.json +0 -61
  204. package/dist/server/node_modules/ansi-regex/readme.md +0 -66
  205. package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  206. package/dist/server/node_modules/emoji-regex/README.md +0 -107
  207. package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
  208. package/dist/server/node_modules/emoji-regex/index.js +0 -4
  209. package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
  210. package/dist/server/node_modules/emoji-regex/package.json +0 -45
  211. package/dist/server/node_modules/environment/index.d.ts +0 -74
  212. package/dist/server/node_modules/environment/index.js +0 -47
  213. package/dist/server/node_modules/environment/license +0 -9
  214. package/dist/server/node_modules/environment/package.json +0 -74
  215. package/dist/server/node_modules/environment/readme.md +0 -94
  216. package/dist/server/node_modules/escape-string-regexp/index.d.ts +0 -18
  217. package/dist/server/node_modules/escape-string-regexp/index.js +0 -11
  218. package/dist/server/node_modules/escape-string-regexp/license +0 -9
  219. package/dist/server/node_modules/escape-string-regexp/package.json +0 -43
  220. package/dist/server/node_modules/escape-string-regexp/readme.md +0 -29
  221. package/dist/server/node_modules/is-unicode-supported/index.d.ts +0 -12
  222. package/dist/server/node_modules/is-unicode-supported/index.js +0 -21
  223. package/dist/server/node_modules/is-unicode-supported/license +0 -9
  224. package/dist/server/node_modules/is-unicode-supported/package.json +0 -47
  225. package/dist/server/node_modules/is-unicode-supported/readme.md +0 -35
  226. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  227. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  228. package/dist/server/node_modules/mimic-fn/license +0 -9
  229. package/dist/server/node_modules/mimic-fn/package.json +0 -42
  230. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  231. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  232. package/dist/server/node_modules/pg-int8/README.md +0 -16
  233. package/dist/server/node_modules/pg-int8/index.js +0 -100
  234. package/dist/server/node_modules/pg-int8/package.json +0 -24
  235. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  236. package/dist/server/node_modules/postgres-array/index.js +0 -97
  237. package/dist/server/node_modules/postgres-array/license +0 -21
  238. package/dist/server/node_modules/postgres-array/package.json +0 -35
  239. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  240. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  241. package/dist/server/node_modules/postgres-bytea/license +0 -21
  242. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  243. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  244. package/dist/server/node_modules/postgres-date/index.js +0 -116
  245. package/dist/server/node_modules/postgres-date/package.json +0 -33
  246. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  247. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  248. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  249. package/dist/server/node_modules/postgres-interval/license +0 -21
  250. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  251. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  252. package/dist/server/node_modules/restore-cursor/index.d.ts +0 -11
  253. package/dist/server/node_modules/restore-cursor/index.js +0 -11
  254. package/dist/server/node_modules/restore-cursor/license +0 -9
  255. package/dist/server/node_modules/restore-cursor/package.json +0 -55
  256. package/dist/server/node_modules/restore-cursor/readme.md +0 -31
  257. package/dist/server/node_modules/split2/LICENSE +0 -13
  258. package/dist/server/node_modules/split2/README.md +0 -85
  259. package/dist/server/node_modules/split2/bench.js +0 -27
  260. package/dist/server/node_modules/split2/index.js +0 -141
  261. package/dist/server/node_modules/split2/package.json +0 -39
  262. package/dist/server/node_modules/split2/test.js +0 -409
  263. package/dist/server/node_modules/string-width/index.d.ts +0 -39
  264. package/dist/server/node_modules/string-width/index.js +0 -82
  265. package/dist/server/node_modules/string-width/license +0 -9
  266. package/dist/server/node_modules/string-width/package.json +0 -64
  267. package/dist/server/node_modules/string-width/readme.md +0 -66
@@ -1 +1 @@
1
- import{e as R,s as he,f as Se,U as St,g as et,d as Ct,W as xs,X as ps,Y as hs,j as s,Z as gs,c as J,t as se,r as S,$ as Nt,a0 as kt,H as bs,J as js,D as vs,z as _s,a as ys,B as Qe,b as _e,a1 as Ss,P as wt,x as be,a2 as Cs,a3 as Ns,o as Be,a4 as ks,a5 as ws,a6 as Is,a7 as Ms,a8 as Oe,a9 as As,aa as $s,ab as Os,ac as zs,ad as It,ae as Ps,af as Ts,ag as Rs,ah as Es,ai as Ds,aj as Ls,ak as Fs,al as Us,am as Gs,an as Bs,ao as Hs,L as Vs,E as tt,K as Mt}from"./index-CzOMQ7ME.js";import{p as Ks,g as Ws,C as qs,D as lt,E as rt,F as Qs,G as at,H as Ys,A as $e,j as Xs,I as Js,J as Zs}from"./agent-icon-ChigV_SM.js";import{i as en}from"./LayoutLeft-Br6mPXCN.js";import{u as At,r as tn}from"./shell-layout-DbyGG6Wz.js";import{f as sn,g as nn}from"./pair-Bg3A59Mm.js";import{f as Pe,g as Te,h as pe,u as He,i as xe,j as le,k as $t,l as Ot,m as on,n as zt,o as Pt}from"./sidebar-CHkSPfi1.js";import{S as Ue}from"./skeleton-BhYsT5bA.js";import{b as st,P as nt,a as ot}from"./popover-DVDtU_6G.js";import{b as Tt,a as Rt,D as Et}from"./drawer-DNDd7AZJ.js";import{A as ct}from"./avatar-DLcW-A0B.js";import{u as Dt,T as Ye,a as Xe,c as dt,b as Je}from"./tooltip-Dk-x7ks3.js";import{i as Lt}from"./Check-BXg4TGxE.js";import{c as ut,a as ln,e as rn}from"./XCircle-QSJN9xhv.js";import{i as an,b as cn}from"./ZapSquare-D07uWeTi.js";import{n as dn,a as un,i as mn}from"./Sun-CBmGK6wu.js";import{s as Ge}from"./Plus-BPcc_-zf.js";import{a as Ve}from"./Settings02-B5jIAnK4.js";import{i as fn}from"./Shield01-CKYDfpKE.js";import{a as Ft}from"./Users03-C4su_vOM.js";import{f as xn,a as pn,b as hn,c as gn,d as bn,e as jn,A as vn}from"./alert-dialog-B-CFL8EO.js";import{F as _n,a as yn,b as Sn,c as Cn,d as Nn,e as kn,f as wn}from"./form-DK_rcfC8.js";import{I as In}from"./input-B0c-2DIW.js";import{S as Mn}from"./spinner-DRDdaYJh.js";import"./index-CVz9D9gf.js";import{s as An}from"./XClose-CPKu5cnb.js";import{S as Ut,u as Gt,W as ze,i as $n,b as On}from"./constants-CrCZOO5F.js";import{u as zn}from"./use-mcp-tools-DVY8KcMA.js";import{u as Pn}from"./use-ai-providers-Bo9kqLtW.js";import{A as Tn,h as Rn,i as En,j as Dn,k as Ln,C as Fn}from"./index-DHNiGAXq.js";import{u as Un,a as mt,K as Gn,P as Bn,S as Hn,v as Vn,D as Kn,c as Wn,s as qn,b as Qn,d as Yn,C as Xn,e as Jn}from"./collection-search-BCf7pr5A.js";import{i as ft}from"./X-CNAnrf0f.js";import{b as Bt,u as Ht}from"./use-virtual-mcp-lxX8wI4d.js";import{u as Vt,a as Zn}from"./use-navigate-to-agent-BQ5qza3f.js";import{u as eo}from"./use-create-virtual-mcp-CCKFB_a7.js";import{I as to,a as so,S as no,L as oo,b as io,G as lo}from"./lean-canvas-recruit-modal-CHTxHUjM.js";import{u as ro}from"./use-tasks-ChwW8r_K.js";import{E as ao}from"./empty-state-9cIH1OSj.js";import{e as xt,f as co}from"./chat-context-C_XiURbM.js";import{u as uo}from"./use-decopilot-events-Co1GYuP2.js";import{g as Kt,a as pt,b as ht,h as gt,D as bt}from"./dropdown-menu-BHUBCwIp.js";import{i as mo}from"./Archive-BKT9Dg_O.js";import{i as fo}from"./Zap-B4MS-NKo.js";import{g as xo}from"./task-status-BMDGQef8.js";function Wt(){const t=R.c(77),{org:e}=he(),n=Se(),o=St(),{setTasksOpen:i,openTab:l}=At(),r=e.slug,a=he().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=et(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=Ct(d),x=o.location.pathname;let f;t[2]!==a.enabledPlugins?(f=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=f):f=t[3];const p=f;let C;t[4]!==a.ui?(C=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=C):C=t[5];const $=C;let g,N,h,y;if(t[6]!==a.id||t[7]!==p||t[8]!==n||t[9]!==r||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let _;t[17]!==p?(_=X=>p.includes(X.pluginId),t[17]=p,t[18]=_):_=t[18];const K=xs.filter(_),W=m.virtualmcpid??a.id;N=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==n||t[23]!==r||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();n({to:"/$org/$taskId/$pluginId",params:{org:r,taskId:oe,pluginId:X},search:re=>({...re,virtualmcpid:W})})},t[21]=G,t[22]=n,t[23]=r,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],y=K.map(ne),t[6]=a.id,t[7]=p,t[8]=n,t[9]=r,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=N,t[15]=h,t[16]=y}else g=t[13],N=t[14],h=t[15],y=t[16];const j=y;let b;if(t[29]!==p||t[30]!==g||t[31]!==h){let _;t[33]!==p?(_=G=>p.includes(G.pluginId),t[33]=p,t[34]=_):_=t[34];const K=ps.filter(_);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],b=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=b}else b=t[32];const v=b;let I;if(t[38]!==l||t[39]!==$){let _;t[41]!==l?(_=K=>{const W=Ks(K.icon),G=W.type==="icon"?Ws(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?s.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?s.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):s.jsx(en,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>l(sn(K.connectionId,K.toolName))}},t[41]=l,t[42]=_):_=t[42],I=$.map(_),t[38]=l,t[39]=$,t[40]=I}else I=t[40];const F=I;let O;t[43]!==F?(O=F.length>0?{type:"group",group:{id:"apps",label:"Apps",items:F,defaultExpanded:!0}}:null,t[43]=F,t[44]=O):O=t[44];const z=O;let E;t[45]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(qs,{className:"size-4!"}),t[45]=E):E=t[45];const P=x===`/${r}`||x===`/${r}/`;let k;t[46]!==n||t[47]!==r||t[48]!==i?(k=()=>{i(!1),n({to:"/$org",params:{org:r}})},t[46]=n,t[47]=r,t[48]=i,t[49]=k):k=t[49];let w;t[50]!==k||t[51]!==P?(w={key:"home",label:"Home",icon:E,isActive:P,onClick:k},t[50]=k,t[51]=P,t[52]=w):w=t[52];const M=w;let D;t[53]!==p?(D=p.includes(hs),t[53]=p,t[54]=D):D=t[54];const A=D;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(gs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==r||t[57]!==x?(U=x.startsWith(`/${r}/settings/workflows`),t[56]=r,t[57]=x,t[58]=U):U=t[58];let L;t[59]!==n||t[60]!==r?(L=()=>n({to:"/$org/settings/workflows",params:{org:r}}),t[59]=n,t[60]=r,t[61]=L):L=t[61];let H;t[62]!==U||t[63]!==L?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:L},t[62]=U,t[63]=L,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==M||t[66]!==N||t[67]!==A||t[68]!==V){const _=[M];N&&A&&_.push(V),q={type:"items",items:_},t[65]=M,t[66]=N,t[67]=A,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==z||t[71]!==v||t[72]!==j||t[73]!==q){if(Q=[q],j.length>0){let _;t[75]!==j?(_={type:"items",items:j},t[75]=j,t[76]=_):_=t[76],Q.push(_)}v.length>0&&Q.push(...v),z&&Q.push(z),t[70]=z,t[71]=v,t[72]=j,t[73]=q,t[74]=Q}else Q=t[74];return Q}function qt(t){const e=R.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs(Pe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Te,{children:s.jsx(pe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function po(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function Qt(t){const e=R.c(15),{item:n}=t,{isMobile:o,setOpenMobile:i}=He();let l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{se("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&i(!1)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];const r=l,a=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==r||e[7]!==n.icon||e[8]!==n.isActive||e[9]!==n.label?(d=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:n.icon}),e[6]=r,e[7]=n.icon,e[8]=n.isActive,e[9]=n.label,e[10]=d):d=e[10];let m;return e[11]!==n.key||e[12]!==u||e[13]!==d?(m=s.jsx(le,{className:u,children:d},a),e[11]=n.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function ho(t){const e=R.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx($t,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(bo),e[2]=n.group.items,e[3]=l):l=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(r=s.jsx(qt,{label:o,defaultExpanded:i,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=r):r=e[7],r}case"items":{let o;e[8]!==n.items?(o=n.items.map(go),e[8]=n.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}}}function go(t){return s.jsx(Qt,{item:t},t.key)}function bo(t){return s.jsx(Qt,{item:t},t.key)}function jo(t){const e=R.c(14),{sections:n,header:o,footer:i,additionalContent:l,variant:r,contentClassName:a}=t,c=r===void 0?"sidebar":r;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(po,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==n?(m=n.map(vo),e[3]=n,e[4]=m):m=e[4];let x;e[5]!==l||e[6]!==d||e[7]!==m?(x=s.jsxs(Ot,{className:d,children:[m,l]}),e[5]=l,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==i||e[10]!==o||e[11]!==x||e[12]!==c?(f=s.jsxs(on,{variant:c,children:[u,o,x,i]}),e[9]=i,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function vo(t,e){return s.jsx(ho,{section:t},e)}function Yt(t){const e=R.c(2);let n;return e[0]!==t?(n=s.jsx(jo,{...t}),e[0]=t,e[1]=n):n=e[1],n}Yt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ue,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function _o(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function jt(t){const e=R.c(15),{item:n,onClose:o}=t,i=n.isActive&&"z-10";let l;e[0]!==i?(l=J(i),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==o?(r=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-8",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.isActive||e[8]!==n.label||e[9]!==r||e[10]!==a?(c=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:a}),e[7]=n.isActive,e[8]=n.label,e[9]=r,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==l||e[13]!==c?(u=s.jsx(le,{className:l,children:c}),e[12]=l,e[13]=c,e[14]=u):u=e[14],u}function yo(t){const e=R.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($t,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,l=n.group.defaultExpanded;let r;if(e[2]!==o||e[3]!==n.group.items){let c;e[5]!==o?(c=u=>s.jsx(jt,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],r=n.group.items.map(c),e[2]=o,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(qt,{label:i,defaultExpanded:l,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==o||e[12]!==n.items){let r;e[14]!==o?(r=a=>s.jsx(jt,{item:a,onClose:o},a.key),e[14]=o,e[15]=r):r=e[15],i=n.items.map(r),e[11]=o,e[12]=n.items,e[13]=i}else i=e[13];let l;return e[16]!==i?(l=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=l):l=e[17],l}}}function So(t){const e=R.c(12),{sections:n,onClose:o,footer:i,additionalContent:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(_o,{})}),e[0]=r):r=e[0];let a;if(e[1]!==o||e[2]!==n){let d;e[4]!==o?(d=(m,x)=>s.jsx(yo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=n.map(d),e[1]=o,e[2]=n,e[3]=a}else a=e[3];let c;e[6]!==l||e[7]!==a?(c=s.jsxs(Ot,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,l]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==i||e[10]!==c?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[r,c,i]}),e[9]=i,e[10]=c,e[11]=u):u=e[11],u}function Xt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Co=bs({name:js().min(2,"Organization name is required")});function No(t){const e=R.c(41),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:vs(Co),defaultValues:{name:""}},e[0]=i):i=e[0];const l=_s(i);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={mutationFn:wo,onSuccess:ko},e[1]=r):r=e[1];const a=ys(r),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(hn,{children:[s.jsx(gn,{children:"Create a new organization"}),s.jsx(bn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==l){let v;e[6]!==a?(v=I=>a.mutateAsync(I),e[6]=a,e[7]=v):v=e[7],d=l.handleSubmit(v),e[3]=a,e[4]=l,e[5]=d}else d=e[5];let m;e[8]!==l.formState.isSubmitting?(m=v=>{const{field:I}=v;return s.jsxs(Sn,{children:[s.jsx(Cn,{children:"Organization Name"}),s.jsx(Nn,{children:s.jsx(In,{...I,placeholder:"Acme Inc.",disabled:l.formState.isSubmitting})}),s.jsx(kn,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Xt(I.value)]})]}),s.jsx(wn,{})]})},e[8]=l.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==l.control||e[11]!==m?(x=s.jsx(_n,{control:l.control,name:"name",render:m}),e[10]=l.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a.reset(),l.reset()},e[15]=a,e[16]=l,e[17]=p):p=e[17];let C;e[18]!==l.formState.isSubmitting||e[19]!==p?(C=s.jsx(xn,{disabled:l.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=l.formState.isSubmitting,e[19]=p,e[20]=C):C=e[20];const $=!l.formState.isValid||l.formState.isSubmitting;let g;e[21]!==l.formState.isSubmitting?(g=l.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Mn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=l.formState.isSubmitting,e[22]=g):g=e[22];let N;e[23]!==$||e[24]!==g?(N=s.jsx(Qe,{type:"submit",variant:"default",disabled:$,children:g}),e[23]=$,e[24]=g,e[25]=N):N=e[25];let h;e[26]!==N||e[27]!==C?(h=s.jsxs(jn,{children:[C,N]}),e[26]=N,e[27]=C,e[28]=h):h=e[28];let y;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[x,f,h]}),e[29]=h,e[30]=d,e[31]=x,e[32]=f,e[33]=y):y=e[33];let j;e[34]!==l||e[35]!==y?(j=s.jsxs(pn,{children:[u,s.jsx(yn,{...l,children:y})]}),e[34]=l,e[35]=y,e[36]=j):j=e[36];let b;return e[37]!==o||e[38]!==n||e[39]!==j?(b=s.jsx(vn,{open:n,onOpenChange:o,children:j}),e[37]=o,e[38]=n,e[39]=j,e[40]=b):b=e[40],b}function ko(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function wo(t){const e=Xt(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await _e.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const o=n?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function Ze(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Io(t){const e=R.c(13),{org:n,size:o}=t,i=o===void 0?"sm":o,l=i==="xs"?"size-5":"size-6",r=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==l?(a=J(l,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ze(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==r?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:J("font-semibold leading-none",r),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=r,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Le(t){const e=R.c(22),{item:n,onClose:o}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let x;return e[4]!==n.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=s.jsxs("a",{href:n.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:o,children:[d,m]}),e[4]=n.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let i;e[11]!==n||e[12]!==o?(i=()=>{n.onClick?.(),o()},e[11]=n,e[12]=o,e[13]=i):i=e[13];let l;e[14]!==n.icon?(l=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=l):l=e[15];let r;e[16]!==n.label?(r=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=r):r=e[17];let a;return e[18]!==i||e[19]!==l||e[20]!==r?(a=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[l,r]}),e[18]=i,e[19]=l,e[20]=r,e[21]=a):a=e[21],a}function vt(t){const e=R.c(16),{sortedOrgs:n,orgParam:o,onSelectOrg:i,onCreateOrg:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=r):r=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ge,{size:16}),e[1]=a):a=e[1];let c;e[2]!==l?(c=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[r,s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=l,e[3]=c):c=e[3];let u;if(e[4]!==i||e[5]!==o||e[6]!==n){let x;e[8]!==i||e[9]!==o?(x=f=>s.jsxs("button",{type:"button",onClick:()=>i(f.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",f.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Io,{org:f,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&s.jsx(Lt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=i,e[9]=o,e[10]=x):x=e[10],u=n.map(x),e[4]=i,e[5]=o,e[6]=n,e[7]=u}else u=e[7];let d;e[11]!==u?(d=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=s.jsxs(s.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function _t(t){const e=R.c(142),{user:n,userImage:o,menuItems:i,signOutItem:l,themeOptions:r,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=n?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=s.jsx(ct,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=n?.name??"User";let Z;e[3]!==ee?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=n?.email;let X;e[5]!==ne?(X=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Oo)},e[10]=n,e[11]=re):re=e[11];let ye;e[12]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(ut,{size:14}),e[12]=ye):ye=e[12];let ae;e[13]!==re?(ae=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ye})}),e[13]=re,e[14]=ae):ae=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let ve;e[16]!==ae?(ve=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[ae,je]})}),e[16]=ae,e[17]=ve):ve=e[17];let ie;e[18]!==ve||e[19]!==Y||e[20]!==oe?(ie=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,ve]}),e[18]=ve,e[19]=Y,e[20]=oe,e[21]=ie):ie=e[21];let ce;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(ce=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=ce):ce=e[26];let de;if(e[27]!==f||e[28]!==i){let ge;e[30]!==f?(ge=De=>s.jsx(Le,{item:De,onClose:f},De.key),e[30]=f,e[31]=ge):ge=e[31],de=i.map(ge),e[27]=f,e[28]=i,e[29]=de}else de=e[29];let ue;e[32]!==f||e[33]!==l?(ue=s.jsx(Le,{item:l,onClose:f}),e[32]=f,e[33]=l,e[34]=ue):ue=e[34];let me;e[35]!==de||e[36]!==ue?(me=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[de,ue]}),e[35]=de,e[36]=ue,e[37]=me):me=e[37];let fe;e[38]!==ce||e[39]!==me?(fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ce,me]}),e[38]=ce,e[39]=me,e[40]=fe):fe=e[40];let T;if(e[41]!==a.theme||e[42]!==c||e[43]!==r){let ge;e[45]!==a.theme||e[46]!==c?(ge=De=>{const{value:qe,icon:us,label:ms}=De;return s.jsx("button",{type:"button","aria-label":ms,onClick:()=>c(fs=>({...fs,theme:qe})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:us},qe)},e[45]=a.theme,e[46]=c,e[47]=ge):ge=e[47],T=r.map(ge),e[41]=a.theme,e[42]=c,e[43]=r,e[44]=T}else T=e[44];let Ce;e[48]!==T?(Ce=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[48]=T,e[49]=Ce):Ce=e[49];const Ke=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[50]!==c?(Ne=()=>c($o),e[50]=c,e[51]=Ne):Ne=e[51];const We=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ke;e[52]!==We?(ke=J("size-8 rounded-md flex items-center justify-center transition-colors",We),e[52]=We,e[53]=ke):ke=e[53];let we;e[54]!==a.enableSounds?(we=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[54]=a.enableSounds,e[55]=we):we=e[55];let Ie;e[56]!==Ke||e[57]!==Ne||e[58]!==ke||e[59]!==we?(Ie=s.jsx("button",{type:"button","aria-label":Ke,onClick:Ne,className:ke,children:we}),e[56]=Ke,e[57]=Ne,e[58]=ke,e[59]=we,e[60]=Ie):Ie=e[60];let Re;e[61]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.317.0"]}),e[61]=Re):Re=e[61];let Me;e[62]!==Ie?(Me=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Re]}),e[62]=Ie,e[63]=Me):Me=e[63];let Ae;e[64]!==Ce||e[65]!==Me?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ce,Me]}),e[64]=Ce,e[65]=Me,e[66]=Ae):Ae=e[66];let Ee;return e[67]!==ie||e[68]!==fe||e[69]!==Ae?(Ee=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ie,fe,Ae]}),e[67]=ie,e[68]=fe,e[69]=Ae,e[70]=Ee):Ee=e[70],Ee}const C=n?.name??"U";let $;e[71]!==C||e[72]!==o?($=s.jsx(ct,{url:o,fallback:C,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=C,e[72]=o,e[73]=$):$=e[73];const g=n?.name??"User";let N;e[74]!==g?(N=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=N):N=e[75];const h=n?.email;let y;e[76]!==h?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=y):y=e[77];let j;e[78]!==N||e[79]!==y?(j=s.jsxs("div",{className:"flex-1 min-w-0",children:[N,y]}),e[78]=N,e[79]=y,e[80]=j):j=e[80];let b;e[81]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ao)},e[81]=n,e[82]=b):b=e[82];let v;e[83]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:14}),e[83]=v):v=e[83];let I;e[84]!==b?(I=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[84]=b,e[85]=I):I=e[85];let F;e[86]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=F):F=e[86];let O;e[87]!==I?(O=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[I,F]})}),e[87]=I,e[88]=O):O=e[88];let z;e[89]!==O||e[90]!==$||e[91]!==j?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[$,j,O]}),e[89]=O,e[90]=$,e[91]=j,e[92]=z):z=e[92];let E;if(e[93]!==f||e[94]!==i){let G;e[96]!==f?(G=Y=>s.jsx(Le,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],E=i.map(G),e[93]=f,e[94]=i,e[95]=E}else E=e[95];let P;e[98]!==f||e[99]!==l?(P=s.jsx(Le,{item:l,onClose:f}),e[98]=f,e[99]=l,e[100]=P):P=e[100];let k;e[101]!==E||e[102]!==P?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[E,P]}),e[101]=E,e[102]=P,e[103]=k):k=e[103];let w;if(e[104]!==a.theme||e[105]!==c||e[106]!==r){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],w=r.map(G),e[104]=a.theme,e[105]=c,e[106]=r,e[107]=w}else w=e[107];let M;e[111]!==w?(M=s.jsx("div",{className:"flex items-center gap-0.5",children:w}),e[111]=w,e[112]=M):M=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let A;e[113]!==c?(A=()=>c(Mo),e[113]=c,e[114]=A):A=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let L;e[117]!==a.enableSounds?(L=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[117]=a.enableSounds,e[118]=L):L=e[118];let H;e[119]!==D||e[120]!==A||e[121]!==U||e[122]!==L?(H=s.jsx("button",{type:"button","aria-label":D,onClick:A,className:U,children:L}),e[119]=D,e[120]=A,e[121]=U,e[122]=L,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.317.0"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=s.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==M||e[128]!==q?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[M,q]}),e[127]=M,e[128]=q,e[129]=Q):Q=e[129];let _;e[130]!==z||e[131]!==k||e[132]!==Q?(_=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,k,Q]}),e[130]=z,e[131]=k,e[132]=Q,e[133]=_):_=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[134]=x,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==_||e[140]!==K?(W=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[_,K]}),e[139]=_,e[140]=K,e[141]=W):W=e[141],W}function Mo(t){return{...t,enableSounds:!t.enableSounds}}function Ao(){be.success("User ID copied")}function $o(t){return{...t,enableSounds:!t.enableSounds}}function Oo(){be.success("User ID copied")}function Jt(){const t=R.c(50),{data:e}=_e.useSession(),{data:n}=_e.useListOrganizations(),o=Se();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const r=Ss(i)?.params.org,[a,c]=wt(),u=Dt(),[d,m]=S.useState(!1),[x,f]=S.useState(!1),p=e?.user,C=p?.image;let $;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==r||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==C){const h=n?.find(W=>W.slug===r);let y;if(t[11]!==r||t[12]!==n){let W;t[14]!==r?(W=(G,Y)=>G.slug===r?-1:Y.slug===r?1:G.name.localeCompare(Y.name),t[14]=r,t[15]=W):W=t[15],y=[...n??[]].sort(W),t[11]=r,t[12]=n,t[13]=y}else y=t[13];const j=y;let b;t[16]!==o?(b=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=b):b=t[17];const v=b;let I;t[18]===Symbol.for("react.memo_cache_sentinel")?(I=()=>m(!1),t[18]=I):I=t[18];const F=I;let O;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ve,{size:16}),t[19]=O):O=t[19];let z;t[20]!==o||t[21]!==r?(z={key:"preferences",label:"Preferences",icon:O,onClick:()=>{o({to:"/$org/settings/profile",params:{org:r??""}})}},t[20]=o,t[21]=r,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E={key:"terms",label:"Terms of Use",icon:s.jsx(Qs,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=E):E=t[23];let P;t[24]===Symbol.for("react.memo_cache_sentinel")?(P={key:"privacy",label:"Privacy Policy",icon:s.jsx(fn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=P):P=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k={key:"github",label:"decocms/studio",icon:s.jsx(Cs,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=k):k=t[25];let w;t[26]===Symbol.for("react.memo_cache_sentinel")?(w={key:"community",label:"Community",icon:s.jsx(Ft,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=w):w=t[26];let M;t[27]===Symbol.for("react.memo_cache_sentinel")?(M={key:"homepage",label:"Homepage",icon:s.jsx(ln,{size:16}),href:"https://decocms.com",external:!0},t[27]=M):M=t[27];let D;t[28]!==z?(D=[z,E,P,k,w,M],t[28]=z,t[29]=D):D=t[29];const A=D;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:s.jsx(an,{size:16}),onClick:Po},t[30]=B):B=t[30];const U=B;let L;t[31]===Symbol.for("react.memo_cache_sentinel")?(L={value:"light",icon:s.jsx(dn,{size:14}),label:"Light theme"},t[31]=L):L=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:s.jsx(un,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[L,H,{value:"system",icon:s.jsx(mn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),f(!0)},t[34]=Q):Q=t[34];let _;t[35]!==v||t[36]!==u||t[37]!==A||t[38]!==r||t[39]!==a||t[40]!==c||t[41]!==j||t[42]!==p||t[43]!==C?(_={user:p,userImage:C,menuItems:A,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:j,orgParam:r,onSelectOrg:v,onCreateOrg:Q,close:F,isMobile:u},t[35]=v,t[36]=u,t[37]=A,t[38]=r,t[39]=a,t[40]=c,t[41]=j,t[42]=p,t[43]=C,t[44]=_):_=t[44];const K=_;$=u?s.jsxs(Tt,{open:d,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(Rt,{className:"h-[80dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Account"}),s.jsx(_t,{...K})]})]}):s.jsxs(st,{open:d,onOpenChange:m,children:[s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:h?.name??"Account",className:"rounded-md",children:s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),s.jsx(ot,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:zo,children:s.jsx(_t,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=r,t[5]=n,t[6]=a,t[7]=c,t[8]=p,t[9]=C,t[10]=$}else $=t[10];let g;t[45]!==x?(g=s.jsx(No,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let N;return t[47]!==$||t[48]!==g?(N=s.jsxs(s.Fragment,{children:[$,g]}),t[47]=$,t[48]=g,t[49]=N):N=t[49],N}function zo(t){return t.preventDefault()}function Po(){se("signed_out",{source:"account_popover"}),_e.signOut()}function To({invitation:t}){const[e,n]=S.useState(!1),[o,i]=S.useState(!1),l=Be(),r=async()=>{n(!0);try{const c=await _e.organization.acceptInvitation({invitationId:t.id});if(c.error)be.error(c.error.message),n(!1);else{const u=await _e.organization.getFullOrganization({query:{organizationId:t.organizationId}});be.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{be.error("Failed to accept invitation"),n(!1)}},a=async()=>{i(!0);try{const c=await _e.organization.rejectInvitation({invitationId:t.id});c.error?(be.error(c.error.message),i(!1)):(be.success("Invitation declined"),l.invalidateQueries())}catch{be.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:r,disabled:e||o,"aria-label":"Accept invitation",children:s.jsx(Lt,{size:14})}),s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:s.jsx(An,{size:14})})]})]})}function Ro(){const t=S.useContext(Ns),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Eo extends S.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Do(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Lo(){const t=R.c(20),e=Se(),{org:n}=he();let o;t[0]!==n.id||t[1]!==n.slug?(o={connectionId:Ut,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=o):o=t[2];const i=Gt(o);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[3]=l):l=t[3];let r;t[4]!==i?(r={client:i,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:Fo},t[4]=i,t[5]=r):r=t[5];const{data:a,isPending:c,isError:u}=zn(r),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const x=m;let f;t[10]!==d?(f=J(d!=null&&Do(d)),t[10]=d,t[11]=f):f=t[11];let p;t[12]!==e||t[13]!==n.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=p):p=t[14];let C;t[15]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ys,{size:24}),t[15]=C):C=t[15];let $;return t[16]!==f||t[17]!==p||t[18]!==x?($=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:x,className:f,onClick:p,children:C})})}),t[16]=f,t[17]=p,t[18]=x,t[19]=$):$=t[19],$}function Fo(t){return t.structuredContent}function Uo(){const t=R.c(1);if(!Pn().some(Go))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Lo,{}),t[0]=o):o=t[0],o}function Go(t){return t.providerId==="deco"}function Bo(){const t=R.c(3),[e,n]=S.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(cn,{size:24})})})}),t[0]=o):o=t[0];let i;return t[1]!==e?(i=s.jsxs(s.Fragment,{children:[o,s.jsx(Tn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=i):i=t[2],i}function Ho(){const t=R.c(11),e=Ro();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(at,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e.length?(o=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let i;t[3]!==o?(i=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsxs(xe,{tooltip:"Inbox",className:"relative",children:[n,o]})})})}),t[3]=o,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=l):l=t[5];let r;t[6]!==e?(r=s.jsxs(ot,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[l,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(at,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Vo)})]}),t[6]=e,t[7]=r):r=t[7];let a;return t[8]!==i||t[9]!==r?(a=s.jsxs(st,{children:[i,r]}),t[8]=i,t[9]=r,t[10]=a):a=t[10],a}function Vo(t){return s.jsx(To,{invitation:t},t.id)}function Ko(){const t=R.c(6),e=Se(),{org:n}=he();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ve,{size:24}),t[3]=i):i=t[3];let l;return t[4]!==o?(l=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:o,children:i})})}),t[4]=o,t[5]=l):l=t[5],l}function Wo(){const t=R.c(5);let e,n,o,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Eo,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(Uo,{})})}),n=s.jsx(Bo,{}),o=s.jsx(Ho,{}),i=s.jsx(Ko,{}),t[0]=e,t[1]=n,t[2]=o,t[3]=i):(e=t[0],n=t[1],o=t[2],i=t[3]);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(Pt,{className:"px-2 pb-3 gap-1",children:[e,n,o,i,s.jsx(pe,{children:s.jsx(le,{children:s.jsx(Jt,{})})})]}),t[4]=l):l=t[4],l}function qo(){const t=R.c(10),e=Se(),{org:n}=he(),{setOpenMobile:o}=He();let i;t[0]!==e||t[1]!==n.slug||t[2]!==o?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),o(!1)},t[0]=e,t[1]=n.slug,t[2]=o,t[3]=i):i=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ve,{}),t[4]=l):l=t[4];let r;t[5]!==i?(r=s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:i,children:l})}),t[5]=i,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(le,{children:s.jsx(Jt,{})}),t[7]=a):a=t[7];let c;return t[8]!==r?(c=s.jsx(Pt,{children:s.jsxs(pe,{children:[r,a]})}),t[8]=r,t[9]=c):c=t[9],c}var it="ContextMenu",[Qo]=Ps(it,[It]),te=It(),[Yo,Zt]=Qo(it),es=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:o,dir:i,modal:l=!0}=t,[r,a]=S.useState(!1),c=te(e),u=ks(o),d=S.useCallback(m=>{a(m),u(m)},[u]);return s.jsx(Yo,{scope:e,open:r,onOpenChange:d,modal:l,children:s.jsx(ws,{...c,dir:i,open:r,onOpenChange:d,modal:l,children:n})})};es.displayName=it;var ts="ContextMenuTrigger",ss=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:o=!1,...i}=t,l=Zt(ts,n),r=te(n),a=S.useRef({x:0,y:0}),c=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=S.useRef(0),d=S.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},l.onOpenChange(!0)};return S.useEffect(()=>d,[d]),S.useEffect(()=>{o&&d()},[o,d]),s.jsxs(s.Fragment,{children:[s.jsx(Is,{...r,virtualRef:c}),s.jsx(Ms.span,{"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,x=>{d(),m(x),x.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,Fe(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,Fe(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,Fe(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,Fe(d))})]})});ss.displayName=ts;var Xo="ContextMenuPortal",ns=t=>{const{__scopeContextMenu:e,...n}=t,o=te(e);return s.jsx(As,{...o,...n})};ns.displayName=Xo;var os="ContextMenuContent",is=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=Zt(os,n),l=te(n),r=S.useRef(!1);return s.jsx($s,{...l,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&r.current&&a.preventDefault(),r.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!i.modal&&(r.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});is.displayName=os;var Jo="ContextMenuGroup",Zo=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ts,{...i,...o,ref:e})});Zo.displayName=Jo;var ei="ContextMenuLabel",ti=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Rs,{...i,...o,ref:e})});ti.displayName=ei;var si="ContextMenuItem",ls=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Os,{...i,...o,ref:e})});ls.displayName=si;var ni="ContextMenuCheckboxItem",oi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Es,{...i,...o,ref:e})});oi.displayName=ni;var ii="ContextMenuRadioGroup",li=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ds,{...i,...o,ref:e})});li.displayName=ii;var ri="ContextMenuRadioItem",ai=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ls,{...i,...o,ref:e})});ai.displayName=ri;var ci="ContextMenuItemIndicator",di=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Fs,{...i,...o,ref:e})});di.displayName=ci;var ui="ContextMenuSeparator",rs=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(zs,{...i,...o,ref:e})});rs.displayName=ui;var mi="ContextMenuArrow",fi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Us,{...i,...o,ref:e})});fi.displayName=mi;var xi="ContextMenuSubTrigger",pi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Gs,{...i,...o,ref:e})});pi.displayName=xi;var hi="ContextMenuSubContent",gi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Bs,{...i,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gi.displayName=hi;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var bi=es,ji=ss,vi=ns,_i=is,yi=ls,Si=rs;function Ci(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(bi,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ni(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(ji,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function ki(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(vi,{children:s.jsx(_i,{"data-slot":"context-menu-content",className:i,...o})}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function yt(t){const e=R.c(12);let n,o,i,l;e[0]!==t?({className:n,inset:o,variant:l,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=i,e[4]=l):(n=e[1],o=e[2],i=e[3],l=e[4]);const r=l===void 0?"default":l;let a;e[5]!==n?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==i||e[9]!==a||e[10]!==r?(c=s.jsx(yi,{"data-slot":"context-menu-item","data-inset":o,"data-variant":r,className:a,...i}),e[7]=o,e[8]=i,e[9]=a,e[10]=r,e[11]=c):c=e[11],c}function wi(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(Si,{"data-slot":"context-menu-separator",className:i,...o}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function Ii(t){const e=Se(),n=Be(),o=ro(),{locator:i}=he(),l=et({strict:!1}),r=Ct({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===r.virtualmcpid?tn(n,i,l.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Mi({agent:t,org:e,onUnpin:n,isDragging:o}){const i=Se(),{isMobile:l,setOpenMobile:r}=He(),a=Rn(e),u=St({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=S.useState(null),x=S.useRef(null),f=S.useRef(null),p=S.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const C=h=>{if(p.current)return;const y=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(y)},550)},$=h=>{f.current&&(clearTimeout(f.current),f.current=null),!(x.current&&h.relatedTarget instanceof Node&&x.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,N=d?d.width+g:0;return s.jsx(Ci,{children:s.jsxs(le,{className:J(d&&"z-[55]"),children:[s.jsx(Ni,{asChild:!0,children:s.jsx(xe,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{l&&r(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:C,onMouseLeave:$,children:s.jsx($e,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),s.jsxs(ki,{children:[s.jsxs(yt,{onClick:()=>{const h=crypto.randomUUID();i({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[s.jsx(Ve,{size:14}),"Settings"]}),s.jsx(wi,{}),s.jsxs(yt,{onClick:()=>{n(),u&&i({to:"/$org",params:{org:e}})},className:"",children:[s.jsx(ft,{size:14}),"Unpin"]})]}),d&&Hs.createPortal(s.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),n(),i({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:N,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:s.jsx(ft,{size:14})}),document.body)]})})}function Ai(t){const e=R.c(18);let n;e[0]!==t.agent.id?(n={id:t.agent.id},e[0]=t.agent.id,e[1]=n):n=e[1];const{attributes:o,listeners:i,setNodeRef:l,transform:r,transition:a,isDragging:c}=Yn(n);let u;e[2]!==r?(u=Xn.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let x;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(x={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=x):x=e[8];const f=x;let p;e[9]!==c||e[10]!==t?(p=s.jsx(Mi,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let C;return e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==f||e[16]!==p?(C=s.jsx("div",{ref:l,style:f,...o,...i,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=i,e[14]=l,e[15]=f,e[16]=p,e[17]=C):C=e[17],C}function $i(t){const e=R.c(9),{agent:n,onClick:o}=t;let i;e[0]!==n.icon||e[1]!==n.title?(i=s.jsx($e,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==i||e[7]!==l?(r=s.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[i,l]}),e[5]=o,e[6]=i,e[7]=l,e[8]=r):r=e[8],r}function Oi(t){const e=R.c(80),{onClose:n,onOpenImportDeco:o,onOpenGithubImport:i,onOpenSelfHealing:l,onOpenDiagnosticsModal:r,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=S.useState(""),f=Bt(),{org:p}=he();let C;e[0]!==f?(C=f.filter(Fi).map(Li),e[0]=f,e[1]=C):C=e[1];const $=C,{pin:g,isPinned:N}=Vt(p.id,$);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:y,isCreating:j}=eo(h),[b]=wt(),v=Ii(p.slug),I=Zn();let F,O,z,E,P,k,w,M;if(e[3]!==f||e[4]!==y||e[5]!==j||e[6]!==N||e[7]!==I||e[8]!==v||e[9]!==n||e[10]!==u||e[11]!==d||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==c||e[18]!==g||e[19]!==b.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();M=f.filter(Di).filter(T=>!m||T.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Ei),e[29]=f,e[30]=q):q=e[30];const Q=q;F=ze.filter(T=>(!m||T.title.toLowerCase().includes(V))&&!(T.id==="studio-pack"&&Q)&&!(T.id==="self-healing-storefront"&&!b.experimental_vibecode));let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=ze.find(Ri),e[31]=_):_=e[31];const K=_,W=K?f.find(T=>T.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Ti),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(T=>T.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Pi),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(T=>T.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(zi),e[34]=oe):oe=e[34];const re=oe,ye=re?f.find(T=>T.metadata?.type===re.id):void 0;let ae;e[35]!==N||e[36]!==v||e[37]!==n||e[38]!==g?(ae=T=>{N(T.id)||g(T.id),n(),x(""),v(T.id)},e[35]=N,e[36]=v,e[37]=n,e[38]=g,e[39]=ae):ae=e[39];const je=ae,ve=T=>{n(),x(""),T==="self-healing-storefront"?l():T==="site-editor"?o():T==="site-diagnostics"?W?I(W.id):r():T==="lean-canvas"?ee?I(ee.id):a():T==="ai-image"?X?I(X.id):u():T==="ai-research"?ye?I(ye.id):d():T==="studio-pack"?c():v(T)};k="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(w=s.jsx(Jn,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=w):w=e[41],O="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=z):z=e[42];let ie;e[43]!==y||e[44]!==n?(ie=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await y(),n()},e[43]=y,e[44]=n,e[45]=ie):ie=e[45];let ce,de;e[46]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ge,{size:16,className:"text-muted-foreground"})}),de=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=ce,e[47]=de):(ce=e[46],de=e[47]);let ue;e[48]!==j||e[49]!==ie?(ue=s.jsxs("button",{type:"button",disabled:j,onClick:ie,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[ce,de]}),e[48]=j,e[49]=ie,e[50]=ue):ue=e[50];let me;e[51]!==n||e[52]!==i||e[53]!==b.experimental_vibecode?(me=b.experimental_vibecode&&s.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),i(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(lo,{className:"size-5 text-muted-foreground"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=n,e[52]=i,e[53]=b.experimental_vibecode,e[54]=me):me=e[54];let fe;e[55]!==je?(fe=T=>s.jsx($i,{agent:T,onClick:()=>je(T)},T.id),e[55]=je,e[56]=fe):fe=e[56],E=s.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[ue,me,M.map(fe)]}),P=F.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-1 pt-4 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),s.jsx("div",{className:"grid grid-cols-3 gap-1",children:F.map(T=>s.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:T.id,template_title:T.title}),ve(T.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx($e,{icon:T.icon,name:T.title,size:"md",className:"transition-transform group-hover:scale-105"}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:T.title})]},T.id))})]}),e[3]=f,e[4]=y,e[5]=j,e[6]=N,e[7]=I,e[8]=v,e[9]=n,e[10]=u,e[11]=d,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=l,e[17]=c,e[18]=g,e[19]=b.experimental_vibecode,e[20]=m,e[21]=F,e[22]=O,e[23]=z,e[24]=E,e[25]=P,e[26]=k,e[27]=w,e[28]=M}else F=e[21],O=e[22],z=e[23],E=e[24],P=e[25],k=e[26],w=e[27],M=e[28];let D;e[57]!==F||e[58]!==j||e[59]!==m||e[60]!==M.length?(D=M.length===0&&F.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=F,e[58]=j,e[59]=m,e[60]=M.length,e[61]=D):D=e[61];let A;e[62]!==O||e[63]!==z||e[64]!==E||e[65]!==P||e[66]!==D?(A=s.jsxs("div",{className:O,children:[z,E,P,D]}),e[62]=O,e[63]=z,e[64]=E,e[65]=P,e[66]=D,e[67]=A):A=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==n?(U=()=>n(),e[70]=n,e[71]=U):U=e[71];let L;e[72]!==B||e[73]!==U?(L=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Vs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=L):L=e[74];let H;return e[75]!==A||e[76]!==L||e[77]!==k||e[78]!==w?(H=s.jsxs("div",{className:k,children:[w,A,L]}),e[75]=A,e[76]=L,e[77]=k,e[78]=w,e[79]=H):H=e[79],H}function zi(t){return t.id==="ai-research"}function Pi(t){return t.id==="ai-image"}function Ti(t){return t.id==="lean-canvas"}function Ri(t){return t.id==="site-diagnostics"}function Ei(t){return On(t.id)}function Di(t){return!$n(t.id)}function Li(t){return t.id}function Fi(t){return t.pinned}function Ui(){const t=R.c(36),[e,n]=S.useState(!1),[o,i]=S.useState(!1),[l,r]=S.useState(!1),[a,c]=S.useState(!1),[u,d]=S.useState(!1),[m,x]=S.useState(!1),[f,p]=S.useState(!1),[C,$]=S.useState(!1),[g,N]=S.useState(!1),h=Dt(),{setOpenMobile:y}=He();let j;t[0]!==h||t[1]!==y?(j=()=>{n(!1),h&&y(!1)},t[0]=h,t[1]=y,t[2]=j):j=t[2];const b=j;let v;t[3]!==b||t[4]!==e?(v=e&&s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ue,{className:"h-4 w-24"})}),children:s.jsx(Oi,{onClose:b,onOpenImportDeco:()=>i(!0),onOpenGithubImport:()=>{r(!0),b()},onOpenSelfHealing:()=>{c(!0),b()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>$(!0),onOpenAiResearchModal:()=>N(!0)})}),t[3]=b,t[4]=e,t[5]=v):v=t[5];const I=v;let F;t[6]!==h||t[7]!==e||t[8]!==I?(F=h?s.jsxs(s.Fragment,{children:[s.jsx(le,{children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},children:s.jsx(Ge,{className:"!opacity-100"})})}),s.jsx(Tt,{open:e,onOpenChange:n,direction:"bottom",children:s.jsxs(Rt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Browse agents"}),I]})})]}):s.jsxs(st,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),n(B)},children:[s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:s.jsx(Ge,{className:"!opacity-100"})})})}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:I})]}),t[6]=h,t[7]=e,t[8]=I,t[9]=F):F=t[9];let O;t[10]!==o?(O=s.jsx(to,{open:o,onOpenChange:i}),t[10]=o,t[11]=O):O=t[11];let z;t[12]!==l?(z=s.jsx(so,{open:l,onOpenChange:r}),t[12]=l,t[13]=z):z=t[13];let E;t[14]!==a?(E=s.jsx(En,{open:a,onOpenChange:c}),t[14]=a,t[15]=E):E=t[15];let P;t[16]!==u?(P=s.jsx(no,{open:u,onOpenChange:d}),t[16]=u,t[17]=P):P=t[17];let k;t[18]!==m?(k=s.jsx(oo,{open:m,onOpenChange:x}),t[18]=m,t[19]=k):k=t[19];let w;t[20]!==f?(w=s.jsx(io,{open:f,onOpenChange:p}),t[20]=f,t[21]=w):w=t[21];let M;t[22]!==C?(M=s.jsx(Dn,{open:C,onOpenChange:$}),t[22]=C,t[23]=M):M=t[23];let D;t[24]!==g?(D=s.jsx(Ln,{open:g,onOpenChange:N}),t[24]=g,t[25]=D):D=t[25];let A;return t[26]!==D||t[27]!==F||t[28]!==O||t[29]!==z||t[30]!==E||t[31]!==P||t[32]!==k||t[33]!==w||t[34]!==M?(A=s.jsxs(s.Fragment,{children:[F,O,z,E,P,k,w,M,D]}),t[26]=D,t[27]=F,t[28]=O,t[29]=z,t[30]=E,t[31]=P,t[32]=k,t[33]=w,t[34]=M,t[35]=A):A=t[35],A}function Gi(){const t=R.c(34),e=Bt(),{org:n}=he();let o;t[0]!==e?(o=e.filter(Ki).map(Vi),t[0]=e,t[1]=o):o=t[1];const i=o,{pinnedIds:l,unpin:r,reorder:a}=Vt(n.id,i),c=new Map(e.map(Hi)),u=l.map(A=>c.get(A)).filter(Bi);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:qn},t[3]=m):m=t[3];const x=Un(mt(Bn,d),mt(Gn,m));let f;t[4]!==l||t[5]!==a?(f=A=>{const{active:B,over:U}=A;if(!U||B.id===U.id)return;const L=l.indexOf(B.id),H=l.indexOf(U.id);L===-1||H===-1||a(Qn([...l],L,H))},t[4]=l,t[5]=a,t[6]=f):f=t[6];const p=f,C=Pe,$="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const N=Te,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",y=pe,j="gap-2";let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ui,{}),t[8]=b):b=t[8];const v=Kn,I=Wn,F=Hn,O=Vn;let z;t[9]!==n.slug||t[10]!==r?(z=A=>s.jsx(Ai,{agent:A,org:n.slug,onUnpin:()=>r(A.id)},A.id),t[9]=n.slug,t[10]=r,t[11]=z):z=t[11];const E=u.map(z);let P;t[12]!==F||t[13]!==l||t[14]!==O||t[15]!==E?(P=s.jsx(F,{items:l,strategy:O,children:E}),t[12]=F,t[13]=l,t[14]=O,t[15]=E,t[16]=P):P=t[16];let k;t[17]!==v||t[18]!==p||t[19]!==x||t[20]!==P||t[21]!==I?(k=s.jsx(v,{sensors:x,collisionDetection:I,onDragEnd:p,children:P}),t[17]=v,t[18]=p,t[19]=x,t[20]=P,t[21]=I,t[22]=k):k=t[22];let w;t[23]!==y||t[24]!==k||t[25]!==b?(w=s.jsxs(y,{className:j,children:[b,k]}),t[23]=y,t[24]=k,t[25]=b,t[26]=w):w=t[26];let M;t[27]!==N||t[28]!==w?(M=s.jsx(N,{className:h,children:w}),t[27]=N,t[28]=w,t[29]=M):M=t[29];let D;return t[30]!==C||t[31]!==M||t[32]!==g?(D=s.jsxs(C,{className:$,children:[g,M]}),t[30]=C,t[31]=M,t[32]=g,t[33]=D):D=t[33],D}function Bi(t){return!!t}function Hi(t){return[t.id,t]}function Vi(t){return t.id}function Ki(t){return t.pinned}function as(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(S.Suspense,{fallback:s.jsx(Pe,{className:"py-0 px-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-2",children:s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Ue,{className:"h-4 w-4 rounded"}),s.jsx(Ue,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Gi,{})}),t[0]=e):e=t[0],e}function Xl(){const t=R.c(4),e=Wt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Wo,{}),t[0]=n):n=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),t[1]=o):o=t[1];let i;return t[2]!==e?(i=s.jsx(Yt,{sections:e,footer:n,additionalContent:o}),t[2]=e,t[3]=i):i=t[3],i}function Jl(t){const e=R.c(5),{onClose:n}=t,o=Wt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qo,{}),e[0]=i):i=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),e[1]=l):l=e[1];let r;return e[2]!==n||e[3]!==o?(r=s.jsx(So,{sections:o,onClose:n,footer:i,additionalContent:l}),e[2]=n,e[3]=o,e[4]=r):r=e[4],r}function Wi(){const t=R.c(6),{org:e,locator:n}=he(),o=Be();let i;t[0]!==n||t[1]!==o?(i=()=>{o.invalidateQueries({queryKey:Mt.tasksPrefix(n)})},t[0]=n,t[1]=o,t[2]=i):i=t[2];let l;t[3]!==e.slug||t[4]!==i?(l={orgSlug:e.slug,onTaskStatus:i},t[3]=e.slug,t[4]=i,t[5]=l):l=t[5],uo(l)}function qi(t){const e=R.c(8),{virtualMcpId:n,size:o,showAutomationBadge:i}=t,l=o===void 0?"sm":o;let r;e[0]!==l||e[1]!==n?(r=n?s.jsx(Qi,{virtualMcpId:n,size:l}):s.jsx($e,{icon:null,name:"?",size:l}),e[0]=l,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(fo,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[r,a]}),e[5]=r,e[6]=a,e[7]=c):c=e[7],c}function Qi(t){const e=R.c(6),{virtualMcpId:n,size:o}=t,i=Ht(n);if(!i){let a;return e[0]!==o?(a=s.jsx($e,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const l=i.icon??null;let r;return e[2]!==i.title||e[3]!==o||e[4]!==l?(r=s.jsx($e,{icon:l,name:i.title,size:o}),e[2]=i.title,e[3]=o,e[4]=l,e[5]=r):r=e[5],r}function Yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function Xi(t){const e=R.c(47),{task:n,isActive:o,onClick:i,onArchive:l,showAutomationBadge:r}=t,a=xo(n.status),c=a.icon,u=Ht(n.virtual_mcp_id);let d;e[0]!==u?(d=Yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=S.useRef(null);let f;e[2]!==o?(f=()=>{if(!o)return;const V=x.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o||e[5]!==n.id?(p=[o,n.id],e[4]=o,e[5]=n.id,e[6]=p):p=e[6],S.useEffect(f,p);const C="button",$=0;let g;e[7]!==i?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),i())},e[7]=i,e[8]=g):g=e[8];const N=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==N?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[9]=N,e[10]=h):h=e[10];let y;e[11]!==r||e[12]!==n.virtual_mcp_id?(y=s.jsx(qi,{virtualMcpId:n.virtual_mcp_id,size:"xs",showAutomationBadge:r}),e[11]=r,e[12]=n.virtual_mcp_id,e[13]=y):y=e[13];const j=n.title||"Untitled task";let b;e[14]!==j?(b=s.jsx("div",{className:"text-sm text-foreground truncate",children:j}),e[14]=j,e[15]=b):b=e[15];let v;e[16]!==m||e[17]!==n.branch||e[18]!==n.updated_at?(v=n.updated_at&&s.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[n.branch?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):m?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:nn(new Date(n.updated_at))})]}),e[16]=m,e[17]=n.branch,e[18]=n.updated_at,e[19]=v):v=e[19];let I;e[20]!==b||e[21]!==v?(I=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,v]}),e[20]=b,e[21]=v,e[22]=I):I=e[22];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",z=a.label,E=14,P=J(a.iconClassName,n.status==="in_progress"&&"animate-spin");let k;e[23]!==c||e[24]!==P?(k=s.jsx(c,{size:E,className:P}),e[23]=c,e[24]=P,e[25]=k):k=e[25];let w;e[26]!==a||e[27]!==k?(w=s.jsx("span",{className:O,"aria-label":z,children:k}),e[26]=a,e[27]=k,e[28]=w):w=e[28];let M;e[29]!==l?(M=V=>{V.stopPropagation(),l()},e[29]=l,e[30]=M):M=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(mo,{size:14}),e[31]=D):D=e[31];let A;e[32]!==M?(A=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:M,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:D})}),e[32]=M,e[33]=A):A=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Xe,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==A?(U=s.jsxs(Je,{children:[A,B]}),e[35]=A,e[36]=U):U=e[36];let L;e[37]!==w||e[38]!==U?(L=s.jsxs("div",{className:F,children:[w,U]}),e[37]=w,e[38]=U,e[39]=L):L=e[39];let H;return e[40]!==i||e[41]!==I||e[42]!==L||e[43]!==g||e[44]!==h||e[45]!==y?(H=s.jsxs("div",{ref:x,role:C,tabIndex:$,onClick:i,onKeyDown:g,className:h,children:[y,I,L]}),e[40]=i,e[41]=I,e[42]=L,e[43]=g,e[44]=h,e[45]=y,e[46]=H):H=e[46],H}const cs={all:"All tasks",manual:"Chats",automation:"Automation"},ds={all:"All members",mine:"Mine only"};function Ji(t){const e=R.c(59),{title:n,tasks:o,activeTaskId:i,onSelect:l,onArchive:r,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=S.useState("all"),[p,C]=S.useState("mine");let $;e[0]!==m||e[1]!==p||e[2]!==o?($=p==="mine"&&m?o.filter(_=>_.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=$):$=e[3];const g=$;let N;e[4]!==x||e[5]!==g?(N=x==="automation"?g.filter(sl):x==="manual"?g.filter(tl):g,e[4]=x,e[5]=g,e[6]=N):N=e[6];const h=N;let y;e[7]!==n?(y=s.jsx("span",{children:n}),e[7]=n,e[8]=y):y=e[8];let j;e[9]!==p?(j=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?s.jsx(Js,{size:16}):s.jsx(Ft,{size:16})})}),e[9]=p,e[10]=j):j=e[10];let b;e[11]!==p?(b=_=>{const K=_;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),C(K)},e[11]=p,e[12]=b):b=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=Object.keys(ds),e[13]=v):v=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=v.map(el),e[14]=I):I=e[14];let F;e[15]!==p||e[16]!==b?(F=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:p,onValueChange:b,children:I})}),e[15]=p,e[16]=b,e[17]=F):F=e[17];let O;e[18]!==j||e[19]!==F?(O=s.jsxs(bt,{children:[j,F]}),e[18]=j,e[19]=F,e[20]=O):O=e[20];const z=x!=="all"&&"text-purple-500";let E;e[21]!==z?(E=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",z),e[21]=z,e[22]=E):E=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(rn,{size:16}),e[23]=P):P=e[23];let k;e[24]!==E?(k=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter tasks",className:E,children:P})}),e[24]=E,e[25]=k):k=e[25];let w;e[26]!==x?(w=_=>{const K=_;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=w):w=e[27];let M;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=Object.keys(cs),e[28]=M):M=e[28];let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=M.map(Zi),e[29]=D):D=e[29];let A;e[30]!==x||e[31]!==w?(A=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:x,onValueChange:w,children:D})}),e[30]=x,e[31]=w,e[32]=A):A=e[32];let B;e[33]!==k||e[34]!==A?(B=s.jsxs(bt,{children:[k,A]}),e[33]=k,e[34]=A,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==n?(U=c&&a&&s.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${n.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:s.jsx(Xs,{size:16})}),e[36]=a,e[37]=c,e[38]=n,e[39]=U):U=e[39];let L;e[40]!==B||e[41]!==U||e[42]!==O?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,B,U]}),e[40]=B,e[41]=U,e[42]=O,e[43]=L):L=e[43];let H;e[44]!==L||e[45]!==y?(H=s.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[y,L]}),e[44]=L,e[45]=y,e[46]=H):H=e[46];let V;e[47]!==i||e[48]!==d||e[49]!==r||e[50]!==l||e[51]!==u||e[52]!==h?(V=h.length===0&&d?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(_=>s.jsx(Xi,{task:_,isActive:i===_.id,onClick:()=>{i!==_.id&&se("tasks_panel_task_clicked",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null,from_automation:!!_.fromAutomation}),l(_)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null}),r(_)},showAutomationBadge:u||_.fromAutomation},_.id)),e[47]=i,e[48]=d,e[49]=r,e[50]=l,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=s.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Zi(t){return s.jsx(Kt,{value:t,children:cs[t]},t)}function el(t){return s.jsx(Kt,{value:t,children:ds[t]},t)}function tl(t){return!t.fromAutomation}function sl(t){return t.fromAutomation}function nl(){const t=R.c(23);Wi();const{data:e}=_e.useSession(),n=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:i}=xt(o);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open",hasTrigger:!0},t[1]=l):l=t[1];const{tasks:r}=xt(l),{setTaskId:a,createNewTask:c}=At();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=et(u),{locator:m,org:x}=he(),f=Be();let p;t[3]!==x.id||t[4]!==x.slug?(p={connectionId:Ut,orgId:x.id,orgSlug:x.slug},t[3]=x.id,t[4]=x.slug,t[5]=p):p=t[5];const C=Gt(p),$=d.taskId??null;let g;t[6]!==r||t[7]!==i?(g=[...i,...r.map(il)].sort(ol),t[6]=r,t[7]=i,t[8]=g):g=t[8];const N=g;let h;t[9]!==C||t[10]!==m||t[11]!==f?(h=async v=>{try{await co(C,v.id,{hidden:!0}),f.invalidateQueries({queryKey:Mt.tasksPrefix(m)})}catch(I){const O=I;be.error(`Failed to archive task: ${O.message}`)}},t[9]=C,t[10]=m,t[11]=f,t[12]=h):h=t[12];const y=h;if(N.length===0){let v;return t[13]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"h-full flex items-center justify-center p-4",children:s.jsx(ao,{image:s.jsx(Zs,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[13]=v):v=t[13],v}let j;t[14]!==a?(j=v=>a(v.id,v.virtual_mcp_id),t[14]=a,t[15]=j):j=t[15];let b;return t[16]!==$||t[17]!==N||t[18]!==c||t[19]!==n||t[20]!==y||t[21]!==j?(b=s.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:s.jsx(Ji,{title:"Tasks",tasks:N,activeTaskId:$,onSelect:j,onArchive:y,onNew:c,showNewButton:!0,currentUserId:n})}),t[16]=$,t[17]=N,t[18]=c,t[19]=n,t[20]=y,t[21]=j,t[22]=b):b=t[22],b}function ol(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function il(t){return{...t,fromAutomation:!0}}function ll(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(rl)}),t[0]=e):e=t[0],e}function rl(t,e){return s.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Zl(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fn.Skeleton,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(tt,{fallback:e,children:s.jsx(S.Suspense,{fallback:s.jsx(ll,{}),children:s.jsx(nl,{})})}),t[1]=n):n=t[1],n}export{Xl as S,Zl as T,Jl as a,Yi as g};
1
+ import{e as R,s as he,f as Se,U as St,g as et,d as Ct,W as xs,X as ps,Y as hs,j as s,Z as gs,c as J,t as se,r as S,$ as Nt,a0 as kt,H as bs,J as js,D as vs,z as _s,a as ys,B as Qe,b as _e,a1 as Ss,P as wt,x as be,a2 as Cs,a3 as Ns,o as Be,a4 as ks,a5 as ws,a6 as Is,a7 as Ms,a8 as Oe,a9 as As,aa as $s,ab as Os,ac as zs,ad as It,ae as Ps,af as Ts,ag as Rs,ah as Es,ai as Ds,aj as Ls,ak as Fs,al as Us,am as Gs,an as Bs,ao as Hs,L as Vs,E as tt,K as Mt}from"./index-dmkCn37I.js";import{p as Ks,g as Ws,C as qs,D as lt,E as rt,F as Qs,G as at,H as Ys,A as $e,j as Xs,I as Js,J as Zs}from"./agent-icon-CDOpQPVP.js";import{i as en}from"./LayoutLeft-CG8cspKX.js";import{u as At,r as tn}from"./shell-layout-DU81GX4X.js";import{f as sn,g as nn}from"./pair-BJSIhyuY.js";import{f as Pe,g as Te,h as pe,u as He,i as xe,j as le,k as $t,l as Ot,m as on,n as zt,o as Pt}from"./sidebar-sY4KII-w.js";import{S as Ue}from"./skeleton-De5l7OL1.js";import{b as st,P as nt,a as ot}from"./popover-9waMMdOC.js";import{b as Tt,a as Rt,D as Et}from"./drawer-B0OHUPPF.js";import{A as ct}from"./avatar-JFkuXk7Y.js";import{u as Dt,T as Ye,a as Xe,c as dt,b as Je}from"./tooltip-DHpEGVi8.js";import{i as Lt}from"./Check-nv67ec3-.js";import{c as ut,a as ln,e as rn}from"./XCircle-B14ynTvz.js";import{i as an,b as cn}from"./ZapSquare-DgAVTy7i.js";import{n as dn,a as un,i as mn}from"./Sun-Zv-PWUwn.js";import{s as Ge}from"./Plus-Bk1OvOXE.js";import{a as Ve}from"./Settings02-uL3uu5-7.js";import{i as fn}from"./Shield01-OH6-JWjw.js";import{a as Ft}from"./Users03-B0r4bSLn.js";import{f as xn,a as pn,b as hn,c as gn,d as bn,e as jn,A as vn}from"./alert-dialog-DzUiFLm5.js";import{F as _n,a as yn,b as Sn,c as Cn,d as Nn,e as kn,f as wn}from"./form-dz7U0CZK.js";import{I as In}from"./input-C0h7cNmt.js";import{S as Mn}from"./spinner-CsMegR0e.js";import"./index-jo98Roqy.js";import{s as An}from"./XClose-DwaprZxL.js";import{S as Ut,u as Gt,W as ze,i as $n,b as On}from"./constants-fVwC9Czh.js";import{u as zn}from"./use-mcp-tools-a-ZvbrGo.js";import{u as Pn}from"./use-ai-providers-Cf9shvYI.js";import{A as Tn,h as Rn,i as En,j as Dn,k as Ln,C as Fn}from"./index-xstkyz4B.js";import{u as Un,a as mt,K as Gn,P as Bn,S as Hn,v as Vn,D as Kn,c as Wn,s as qn,b as Qn,d as Yn,C as Xn,e as Jn}from"./collection-search-B_PTLHi8.js";import{i as ft}from"./X-DDQYEU6o.js";import{b as Bt,u as Ht}from"./use-virtual-mcp-BVVlTr3L.js";import{u as Vt,a as Zn}from"./use-navigate-to-agent-DjWaqrlh.js";import{u as eo}from"./use-create-virtual-mcp-DdlYO5qT.js";import{I as to,a as so,S as no,L as oo,b as io,G as lo}from"./lean-canvas-recruit-modal-CZMvychF.js";import{u as ro}from"./use-tasks-DZibCf5w.js";import{E as ao}from"./empty-state-BCr9v4T1.js";import{e as xt,f as co}from"./chat-context-BpeMEIll.js";import{u as uo}from"./use-decopilot-events-DTwuBO8M.js";import{g as Kt,a as pt,b as ht,h as gt,D as bt}from"./dropdown-menu-BnaZE7Qd.js";import{i as mo}from"./Archive-DaxWSUle.js";import{i as fo}from"./Zap-EburzyyI.js";import{g as xo}from"./task-status-n57TCkuM.js";function Wt(){const t=R.c(77),{org:e}=he(),n=Se(),o=St(),{setTasksOpen:i,openTab:l}=At(),r=e.slug,a=he().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=et(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=Ct(d),x=o.location.pathname;let f;t[2]!==a.enabledPlugins?(f=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=f):f=t[3];const p=f;let C;t[4]!==a.ui?(C=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=C):C=t[5];const $=C;let g,N,h,y;if(t[6]!==a.id||t[7]!==p||t[8]!==n||t[9]!==r||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let _;t[17]!==p?(_=X=>p.includes(X.pluginId),t[17]=p,t[18]=_):_=t[18];const K=xs.filter(_),W=m.virtualmcpid??a.id;N=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==n||t[23]!==r||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();n({to:"/$org/$taskId/$pluginId",params:{org:r,taskId:oe,pluginId:X},search:re=>({...re,virtualmcpid:W})})},t[21]=G,t[22]=n,t[23]=r,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],y=K.map(ne),t[6]=a.id,t[7]=p,t[8]=n,t[9]=r,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=N,t[15]=h,t[16]=y}else g=t[13],N=t[14],h=t[15],y=t[16];const j=y;let b;if(t[29]!==p||t[30]!==g||t[31]!==h){let _;t[33]!==p?(_=G=>p.includes(G.pluginId),t[33]=p,t[34]=_):_=t[34];const K=ps.filter(_);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],b=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=b}else b=t[32];const v=b;let I;if(t[38]!==l||t[39]!==$){let _;t[41]!==l?(_=K=>{const W=Ks(K.icon),G=W.type==="icon"?Ws(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?s.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?s.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):s.jsx(en,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>l(sn(K.connectionId,K.toolName))}},t[41]=l,t[42]=_):_=t[42],I=$.map(_),t[38]=l,t[39]=$,t[40]=I}else I=t[40];const F=I;let O;t[43]!==F?(O=F.length>0?{type:"group",group:{id:"apps",label:"Apps",items:F,defaultExpanded:!0}}:null,t[43]=F,t[44]=O):O=t[44];const z=O;let E;t[45]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(qs,{className:"size-4!"}),t[45]=E):E=t[45];const P=x===`/${r}`||x===`/${r}/`;let k;t[46]!==n||t[47]!==r||t[48]!==i?(k=()=>{i(!1),n({to:"/$org",params:{org:r}})},t[46]=n,t[47]=r,t[48]=i,t[49]=k):k=t[49];let w;t[50]!==k||t[51]!==P?(w={key:"home",label:"Home",icon:E,isActive:P,onClick:k},t[50]=k,t[51]=P,t[52]=w):w=t[52];const M=w;let D;t[53]!==p?(D=p.includes(hs),t[53]=p,t[54]=D):D=t[54];const A=D;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(gs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==r||t[57]!==x?(U=x.startsWith(`/${r}/settings/workflows`),t[56]=r,t[57]=x,t[58]=U):U=t[58];let L;t[59]!==n||t[60]!==r?(L=()=>n({to:"/$org/settings/workflows",params:{org:r}}),t[59]=n,t[60]=r,t[61]=L):L=t[61];let H;t[62]!==U||t[63]!==L?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:L},t[62]=U,t[63]=L,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==M||t[66]!==N||t[67]!==A||t[68]!==V){const _=[M];N&&A&&_.push(V),q={type:"items",items:_},t[65]=M,t[66]=N,t[67]=A,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==z||t[71]!==v||t[72]!==j||t[73]!==q){if(Q=[q],j.length>0){let _;t[75]!==j?(_={type:"items",items:j},t[75]=j,t[76]=_):_=t[76],Q.push(_)}v.length>0&&Q.push(...v),z&&Q.push(z),t[70]=z,t[71]=v,t[72]=j,t[73]=q,t[74]=Q}else Q=t[74];return Q}function qt(t){const e=R.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs(Pe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Te,{children:s.jsx(pe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function po(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function Qt(t){const e=R.c(15),{item:n}=t,{isMobile:o,setOpenMobile:i}=He();let l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{se("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&i(!1)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];const r=l,a=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==r||e[7]!==n.icon||e[8]!==n.isActive||e[9]!==n.label?(d=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:n.icon}),e[6]=r,e[7]=n.icon,e[8]=n.isActive,e[9]=n.label,e[10]=d):d=e[10];let m;return e[11]!==n.key||e[12]!==u||e[13]!==d?(m=s.jsx(le,{className:u,children:d},a),e[11]=n.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function ho(t){const e=R.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx($t,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(bo),e[2]=n.group.items,e[3]=l):l=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(r=s.jsx(qt,{label:o,defaultExpanded:i,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=r):r=e[7],r}case"items":{let o;e[8]!==n.items?(o=n.items.map(go),e[8]=n.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}}}function go(t){return s.jsx(Qt,{item:t},t.key)}function bo(t){return s.jsx(Qt,{item:t},t.key)}function jo(t){const e=R.c(14),{sections:n,header:o,footer:i,additionalContent:l,variant:r,contentClassName:a}=t,c=r===void 0?"sidebar":r;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(po,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==n?(m=n.map(vo),e[3]=n,e[4]=m):m=e[4];let x;e[5]!==l||e[6]!==d||e[7]!==m?(x=s.jsxs(Ot,{className:d,children:[m,l]}),e[5]=l,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==i||e[10]!==o||e[11]!==x||e[12]!==c?(f=s.jsxs(on,{variant:c,children:[u,o,x,i]}),e[9]=i,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function vo(t,e){return s.jsx(ho,{section:t},e)}function Yt(t){const e=R.c(2);let n;return e[0]!==t?(n=s.jsx(jo,{...t}),e[0]=t,e[1]=n):n=e[1],n}Yt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ue,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function _o(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function jt(t){const e=R.c(15),{item:n,onClose:o}=t,i=n.isActive&&"z-10";let l;e[0]!==i?(l=J(i),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==o?(r=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-8",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.isActive||e[8]!==n.label||e[9]!==r||e[10]!==a?(c=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:a}),e[7]=n.isActive,e[8]=n.label,e[9]=r,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==l||e[13]!==c?(u=s.jsx(le,{className:l,children:c}),e[12]=l,e[13]=c,e[14]=u):u=e[14],u}function yo(t){const e=R.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($t,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,l=n.group.defaultExpanded;let r;if(e[2]!==o||e[3]!==n.group.items){let c;e[5]!==o?(c=u=>s.jsx(jt,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],r=n.group.items.map(c),e[2]=o,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(qt,{label:i,defaultExpanded:l,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==o||e[12]!==n.items){let r;e[14]!==o?(r=a=>s.jsx(jt,{item:a,onClose:o},a.key),e[14]=o,e[15]=r):r=e[15],i=n.items.map(r),e[11]=o,e[12]=n.items,e[13]=i}else i=e[13];let l;return e[16]!==i?(l=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=l):l=e[17],l}}}function So(t){const e=R.c(12),{sections:n,onClose:o,footer:i,additionalContent:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(_o,{})}),e[0]=r):r=e[0];let a;if(e[1]!==o||e[2]!==n){let d;e[4]!==o?(d=(m,x)=>s.jsx(yo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=n.map(d),e[1]=o,e[2]=n,e[3]=a}else a=e[3];let c;e[6]!==l||e[7]!==a?(c=s.jsxs(Ot,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,l]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==i||e[10]!==c?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[r,c,i]}),e[9]=i,e[10]=c,e[11]=u):u=e[11],u}function Xt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Co=bs({name:js().min(2,"Organization name is required")});function No(t){const e=R.c(41),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:vs(Co),defaultValues:{name:""}},e[0]=i):i=e[0];const l=_s(i);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={mutationFn:wo,onSuccess:ko},e[1]=r):r=e[1];const a=ys(r),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(hn,{children:[s.jsx(gn,{children:"Create a new organization"}),s.jsx(bn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==l){let v;e[6]!==a?(v=I=>a.mutateAsync(I),e[6]=a,e[7]=v):v=e[7],d=l.handleSubmit(v),e[3]=a,e[4]=l,e[5]=d}else d=e[5];let m;e[8]!==l.formState.isSubmitting?(m=v=>{const{field:I}=v;return s.jsxs(Sn,{children:[s.jsx(Cn,{children:"Organization Name"}),s.jsx(Nn,{children:s.jsx(In,{...I,placeholder:"Acme Inc.",disabled:l.formState.isSubmitting})}),s.jsx(kn,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Xt(I.value)]})]}),s.jsx(wn,{})]})},e[8]=l.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==l.control||e[11]!==m?(x=s.jsx(_n,{control:l.control,name:"name",render:m}),e[10]=l.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a.reset(),l.reset()},e[15]=a,e[16]=l,e[17]=p):p=e[17];let C;e[18]!==l.formState.isSubmitting||e[19]!==p?(C=s.jsx(xn,{disabled:l.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=l.formState.isSubmitting,e[19]=p,e[20]=C):C=e[20];const $=!l.formState.isValid||l.formState.isSubmitting;let g;e[21]!==l.formState.isSubmitting?(g=l.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Mn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=l.formState.isSubmitting,e[22]=g):g=e[22];let N;e[23]!==$||e[24]!==g?(N=s.jsx(Qe,{type:"submit",variant:"default",disabled:$,children:g}),e[23]=$,e[24]=g,e[25]=N):N=e[25];let h;e[26]!==N||e[27]!==C?(h=s.jsxs(jn,{children:[C,N]}),e[26]=N,e[27]=C,e[28]=h):h=e[28];let y;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[x,f,h]}),e[29]=h,e[30]=d,e[31]=x,e[32]=f,e[33]=y):y=e[33];let j;e[34]!==l||e[35]!==y?(j=s.jsxs(pn,{children:[u,s.jsx(yn,{...l,children:y})]}),e[34]=l,e[35]=y,e[36]=j):j=e[36];let b;return e[37]!==o||e[38]!==n||e[39]!==j?(b=s.jsx(vn,{open:n,onOpenChange:o,children:j}),e[37]=o,e[38]=n,e[39]=j,e[40]=b):b=e[40],b}function ko(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function wo(t){const e=Xt(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await _e.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const o=n?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function Ze(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Io(t){const e=R.c(13),{org:n,size:o}=t,i=o===void 0?"sm":o,l=i==="xs"?"size-5":"size-6",r=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==l?(a=J(l,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ze(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==r?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:J("font-semibold leading-none",r),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=r,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Le(t){const e=R.c(22),{item:n,onClose:o}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let x;return e[4]!==n.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=s.jsxs("a",{href:n.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:o,children:[d,m]}),e[4]=n.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let i;e[11]!==n||e[12]!==o?(i=()=>{n.onClick?.(),o()},e[11]=n,e[12]=o,e[13]=i):i=e[13];let l;e[14]!==n.icon?(l=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=l):l=e[15];let r;e[16]!==n.label?(r=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=r):r=e[17];let a;return e[18]!==i||e[19]!==l||e[20]!==r?(a=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[l,r]}),e[18]=i,e[19]=l,e[20]=r,e[21]=a):a=e[21],a}function vt(t){const e=R.c(16),{sortedOrgs:n,orgParam:o,onSelectOrg:i,onCreateOrg:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=r):r=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ge,{size:16}),e[1]=a):a=e[1];let c;e[2]!==l?(c=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[r,s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=l,e[3]=c):c=e[3];let u;if(e[4]!==i||e[5]!==o||e[6]!==n){let x;e[8]!==i||e[9]!==o?(x=f=>s.jsxs("button",{type:"button",onClick:()=>i(f.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",f.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Io,{org:f,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&s.jsx(Lt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=i,e[9]=o,e[10]=x):x=e[10],u=n.map(x),e[4]=i,e[5]=o,e[6]=n,e[7]=u}else u=e[7];let d;e[11]!==u?(d=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=s.jsxs(s.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function _t(t){const e=R.c(142),{user:n,userImage:o,menuItems:i,signOutItem:l,themeOptions:r,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=n?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=s.jsx(ct,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=n?.name??"User";let Z;e[3]!==ee?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=n?.email;let X;e[5]!==ne?(X=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Oo)},e[10]=n,e[11]=re):re=e[11];let ye;e[12]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(ut,{size:14}),e[12]=ye):ye=e[12];let ae;e[13]!==re?(ae=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ye})}),e[13]=re,e[14]=ae):ae=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let ve;e[16]!==ae?(ve=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[ae,je]})}),e[16]=ae,e[17]=ve):ve=e[17];let ie;e[18]!==ve||e[19]!==Y||e[20]!==oe?(ie=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,ve]}),e[18]=ve,e[19]=Y,e[20]=oe,e[21]=ie):ie=e[21];let ce;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(ce=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=ce):ce=e[26];let de;if(e[27]!==f||e[28]!==i){let ge;e[30]!==f?(ge=De=>s.jsx(Le,{item:De,onClose:f},De.key),e[30]=f,e[31]=ge):ge=e[31],de=i.map(ge),e[27]=f,e[28]=i,e[29]=de}else de=e[29];let ue;e[32]!==f||e[33]!==l?(ue=s.jsx(Le,{item:l,onClose:f}),e[32]=f,e[33]=l,e[34]=ue):ue=e[34];let me;e[35]!==de||e[36]!==ue?(me=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[de,ue]}),e[35]=de,e[36]=ue,e[37]=me):me=e[37];let fe;e[38]!==ce||e[39]!==me?(fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ce,me]}),e[38]=ce,e[39]=me,e[40]=fe):fe=e[40];let T;if(e[41]!==a.theme||e[42]!==c||e[43]!==r){let ge;e[45]!==a.theme||e[46]!==c?(ge=De=>{const{value:qe,icon:us,label:ms}=De;return s.jsx("button",{type:"button","aria-label":ms,onClick:()=>c(fs=>({...fs,theme:qe})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:us},qe)},e[45]=a.theme,e[46]=c,e[47]=ge):ge=e[47],T=r.map(ge),e[41]=a.theme,e[42]=c,e[43]=r,e[44]=T}else T=e[44];let Ce;e[48]!==T?(Ce=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[48]=T,e[49]=Ce):Ce=e[49];const Ke=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[50]!==c?(Ne=()=>c($o),e[50]=c,e[51]=Ne):Ne=e[51];const We=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ke;e[52]!==We?(ke=J("size-8 rounded-md flex items-center justify-center transition-colors",We),e[52]=We,e[53]=ke):ke=e[53];let we;e[54]!==a.enableSounds?(we=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[54]=a.enableSounds,e[55]=we):we=e[55];let Ie;e[56]!==Ke||e[57]!==Ne||e[58]!==ke||e[59]!==we?(Ie=s.jsx("button",{type:"button","aria-label":Ke,onClick:Ne,className:ke,children:we}),e[56]=Ke,e[57]=Ne,e[58]=ke,e[59]=we,e[60]=Ie):Ie=e[60];let Re;e[61]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.318.0"]}),e[61]=Re):Re=e[61];let Me;e[62]!==Ie?(Me=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Re]}),e[62]=Ie,e[63]=Me):Me=e[63];let Ae;e[64]!==Ce||e[65]!==Me?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ce,Me]}),e[64]=Ce,e[65]=Me,e[66]=Ae):Ae=e[66];let Ee;return e[67]!==ie||e[68]!==fe||e[69]!==Ae?(Ee=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ie,fe,Ae]}),e[67]=ie,e[68]=fe,e[69]=Ae,e[70]=Ee):Ee=e[70],Ee}const C=n?.name??"U";let $;e[71]!==C||e[72]!==o?($=s.jsx(ct,{url:o,fallback:C,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=C,e[72]=o,e[73]=$):$=e[73];const g=n?.name??"User";let N;e[74]!==g?(N=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=N):N=e[75];const h=n?.email;let y;e[76]!==h?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=y):y=e[77];let j;e[78]!==N||e[79]!==y?(j=s.jsxs("div",{className:"flex-1 min-w-0",children:[N,y]}),e[78]=N,e[79]=y,e[80]=j):j=e[80];let b;e[81]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ao)},e[81]=n,e[82]=b):b=e[82];let v;e[83]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:14}),e[83]=v):v=e[83];let I;e[84]!==b?(I=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[84]=b,e[85]=I):I=e[85];let F;e[86]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=F):F=e[86];let O;e[87]!==I?(O=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[I,F]})}),e[87]=I,e[88]=O):O=e[88];let z;e[89]!==O||e[90]!==$||e[91]!==j?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[$,j,O]}),e[89]=O,e[90]=$,e[91]=j,e[92]=z):z=e[92];let E;if(e[93]!==f||e[94]!==i){let G;e[96]!==f?(G=Y=>s.jsx(Le,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],E=i.map(G),e[93]=f,e[94]=i,e[95]=E}else E=e[95];let P;e[98]!==f||e[99]!==l?(P=s.jsx(Le,{item:l,onClose:f}),e[98]=f,e[99]=l,e[100]=P):P=e[100];let k;e[101]!==E||e[102]!==P?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[E,P]}),e[101]=E,e[102]=P,e[103]=k):k=e[103];let w;if(e[104]!==a.theme||e[105]!==c||e[106]!==r){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],w=r.map(G),e[104]=a.theme,e[105]=c,e[106]=r,e[107]=w}else w=e[107];let M;e[111]!==w?(M=s.jsx("div",{className:"flex items-center gap-0.5",children:w}),e[111]=w,e[112]=M):M=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let A;e[113]!==c?(A=()=>c(Mo),e[113]=c,e[114]=A):A=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let L;e[117]!==a.enableSounds?(L=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[117]=a.enableSounds,e[118]=L):L=e[118];let H;e[119]!==D||e[120]!==A||e[121]!==U||e[122]!==L?(H=s.jsx("button",{type:"button","aria-label":D,onClick:A,className:U,children:L}),e[119]=D,e[120]=A,e[121]=U,e[122]=L,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.318.0"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=s.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==M||e[128]!==q?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[M,q]}),e[127]=M,e[128]=q,e[129]=Q):Q=e[129];let _;e[130]!==z||e[131]!==k||e[132]!==Q?(_=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,k,Q]}),e[130]=z,e[131]=k,e[132]=Q,e[133]=_):_=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[134]=x,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==_||e[140]!==K?(W=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[_,K]}),e[139]=_,e[140]=K,e[141]=W):W=e[141],W}function Mo(t){return{...t,enableSounds:!t.enableSounds}}function Ao(){be.success("User ID copied")}function $o(t){return{...t,enableSounds:!t.enableSounds}}function Oo(){be.success("User ID copied")}function Jt(){const t=R.c(50),{data:e}=_e.useSession(),{data:n}=_e.useListOrganizations(),o=Se();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const r=Ss(i)?.params.org,[a,c]=wt(),u=Dt(),[d,m]=S.useState(!1),[x,f]=S.useState(!1),p=e?.user,C=p?.image;let $;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==r||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==C){const h=n?.find(W=>W.slug===r);let y;if(t[11]!==r||t[12]!==n){let W;t[14]!==r?(W=(G,Y)=>G.slug===r?-1:Y.slug===r?1:G.name.localeCompare(Y.name),t[14]=r,t[15]=W):W=t[15],y=[...n??[]].sort(W),t[11]=r,t[12]=n,t[13]=y}else y=t[13];const j=y;let b;t[16]!==o?(b=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=b):b=t[17];const v=b;let I;t[18]===Symbol.for("react.memo_cache_sentinel")?(I=()=>m(!1),t[18]=I):I=t[18];const F=I;let O;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ve,{size:16}),t[19]=O):O=t[19];let z;t[20]!==o||t[21]!==r?(z={key:"preferences",label:"Preferences",icon:O,onClick:()=>{o({to:"/$org/settings/profile",params:{org:r??""}})}},t[20]=o,t[21]=r,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E={key:"terms",label:"Terms of Use",icon:s.jsx(Qs,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=E):E=t[23];let P;t[24]===Symbol.for("react.memo_cache_sentinel")?(P={key:"privacy",label:"Privacy Policy",icon:s.jsx(fn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=P):P=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k={key:"github",label:"decocms/studio",icon:s.jsx(Cs,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=k):k=t[25];let w;t[26]===Symbol.for("react.memo_cache_sentinel")?(w={key:"community",label:"Community",icon:s.jsx(Ft,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=w):w=t[26];let M;t[27]===Symbol.for("react.memo_cache_sentinel")?(M={key:"homepage",label:"Homepage",icon:s.jsx(ln,{size:16}),href:"https://decocms.com",external:!0},t[27]=M):M=t[27];let D;t[28]!==z?(D=[z,E,P,k,w,M],t[28]=z,t[29]=D):D=t[29];const A=D;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:s.jsx(an,{size:16}),onClick:Po},t[30]=B):B=t[30];const U=B;let L;t[31]===Symbol.for("react.memo_cache_sentinel")?(L={value:"light",icon:s.jsx(dn,{size:14}),label:"Light theme"},t[31]=L):L=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:s.jsx(un,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[L,H,{value:"system",icon:s.jsx(mn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),f(!0)},t[34]=Q):Q=t[34];let _;t[35]!==v||t[36]!==u||t[37]!==A||t[38]!==r||t[39]!==a||t[40]!==c||t[41]!==j||t[42]!==p||t[43]!==C?(_={user:p,userImage:C,menuItems:A,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:j,orgParam:r,onSelectOrg:v,onCreateOrg:Q,close:F,isMobile:u},t[35]=v,t[36]=u,t[37]=A,t[38]=r,t[39]=a,t[40]=c,t[41]=j,t[42]=p,t[43]=C,t[44]=_):_=t[44];const K=_;$=u?s.jsxs(Tt,{open:d,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(Rt,{className:"h-[80dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Account"}),s.jsx(_t,{...K})]})]}):s.jsxs(st,{open:d,onOpenChange:m,children:[s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:h?.name??"Account",className:"rounded-md",children:s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),s.jsx(ot,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:zo,children:s.jsx(_t,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=r,t[5]=n,t[6]=a,t[7]=c,t[8]=p,t[9]=C,t[10]=$}else $=t[10];let g;t[45]!==x?(g=s.jsx(No,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let N;return t[47]!==$||t[48]!==g?(N=s.jsxs(s.Fragment,{children:[$,g]}),t[47]=$,t[48]=g,t[49]=N):N=t[49],N}function zo(t){return t.preventDefault()}function Po(){se("signed_out",{source:"account_popover"}),_e.signOut()}function To({invitation:t}){const[e,n]=S.useState(!1),[o,i]=S.useState(!1),l=Be(),r=async()=>{n(!0);try{const c=await _e.organization.acceptInvitation({invitationId:t.id});if(c.error)be.error(c.error.message),n(!1);else{const u=await _e.organization.getFullOrganization({query:{organizationId:t.organizationId}});be.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{be.error("Failed to accept invitation"),n(!1)}},a=async()=>{i(!0);try{const c=await _e.organization.rejectInvitation({invitationId:t.id});c.error?(be.error(c.error.message),i(!1)):(be.success("Invitation declined"),l.invalidateQueries())}catch{be.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:r,disabled:e||o,"aria-label":"Accept invitation",children:s.jsx(Lt,{size:14})}),s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:s.jsx(An,{size:14})})]})]})}function Ro(){const t=S.useContext(Ns),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Eo extends S.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Do(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Lo(){const t=R.c(20),e=Se(),{org:n}=he();let o;t[0]!==n.id||t[1]!==n.slug?(o={connectionId:Ut,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=o):o=t[2];const i=Gt(o);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[3]=l):l=t[3];let r;t[4]!==i?(r={client:i,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:Fo},t[4]=i,t[5]=r):r=t[5];const{data:a,isPending:c,isError:u}=zn(r),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const x=m;let f;t[10]!==d?(f=J(d!=null&&Do(d)),t[10]=d,t[11]=f):f=t[11];let p;t[12]!==e||t[13]!==n.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=p):p=t[14];let C;t[15]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ys,{size:24}),t[15]=C):C=t[15];let $;return t[16]!==f||t[17]!==p||t[18]!==x?($=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:x,className:f,onClick:p,children:C})})}),t[16]=f,t[17]=p,t[18]=x,t[19]=$):$=t[19],$}function Fo(t){return t.structuredContent}function Uo(){const t=R.c(1);if(!Pn().some(Go))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Lo,{}),t[0]=o):o=t[0],o}function Go(t){return t.providerId==="deco"}function Bo(){const t=R.c(3),[e,n]=S.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(cn,{size:24})})})}),t[0]=o):o=t[0];let i;return t[1]!==e?(i=s.jsxs(s.Fragment,{children:[o,s.jsx(Tn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=i):i=t[2],i}function Ho(){const t=R.c(11),e=Ro();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(at,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e.length?(o=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let i;t[3]!==o?(i=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsxs(xe,{tooltip:"Inbox",className:"relative",children:[n,o]})})})}),t[3]=o,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=l):l=t[5];let r;t[6]!==e?(r=s.jsxs(ot,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[l,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(at,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Vo)})]}),t[6]=e,t[7]=r):r=t[7];let a;return t[8]!==i||t[9]!==r?(a=s.jsxs(st,{children:[i,r]}),t[8]=i,t[9]=r,t[10]=a):a=t[10],a}function Vo(t){return s.jsx(To,{invitation:t},t.id)}function Ko(){const t=R.c(6),e=Se(),{org:n}=he();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ve,{size:24}),t[3]=i):i=t[3];let l;return t[4]!==o?(l=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:o,children:i})})}),t[4]=o,t[5]=l):l=t[5],l}function Wo(){const t=R.c(5);let e,n,o,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Eo,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(Uo,{})})}),n=s.jsx(Bo,{}),o=s.jsx(Ho,{}),i=s.jsx(Ko,{}),t[0]=e,t[1]=n,t[2]=o,t[3]=i):(e=t[0],n=t[1],o=t[2],i=t[3]);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(Pt,{className:"px-2 pb-3 gap-1",children:[e,n,o,i,s.jsx(pe,{children:s.jsx(le,{children:s.jsx(Jt,{})})})]}),t[4]=l):l=t[4],l}function qo(){const t=R.c(10),e=Se(),{org:n}=he(),{setOpenMobile:o}=He();let i;t[0]!==e||t[1]!==n.slug||t[2]!==o?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),o(!1)},t[0]=e,t[1]=n.slug,t[2]=o,t[3]=i):i=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ve,{}),t[4]=l):l=t[4];let r;t[5]!==i?(r=s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:i,children:l})}),t[5]=i,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(le,{children:s.jsx(Jt,{})}),t[7]=a):a=t[7];let c;return t[8]!==r?(c=s.jsx(Pt,{children:s.jsxs(pe,{children:[r,a]})}),t[8]=r,t[9]=c):c=t[9],c}var it="ContextMenu",[Qo]=Ps(it,[It]),te=It(),[Yo,Zt]=Qo(it),es=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:o,dir:i,modal:l=!0}=t,[r,a]=S.useState(!1),c=te(e),u=ks(o),d=S.useCallback(m=>{a(m),u(m)},[u]);return s.jsx(Yo,{scope:e,open:r,onOpenChange:d,modal:l,children:s.jsx(ws,{...c,dir:i,open:r,onOpenChange:d,modal:l,children:n})})};es.displayName=it;var ts="ContextMenuTrigger",ss=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:o=!1,...i}=t,l=Zt(ts,n),r=te(n),a=S.useRef({x:0,y:0}),c=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=S.useRef(0),d=S.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},l.onOpenChange(!0)};return S.useEffect(()=>d,[d]),S.useEffect(()=>{o&&d()},[o,d]),s.jsxs(s.Fragment,{children:[s.jsx(Is,{...r,virtualRef:c}),s.jsx(Ms.span,{"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,x=>{d(),m(x),x.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,Fe(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,Fe(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,Fe(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,Fe(d))})]})});ss.displayName=ts;var Xo="ContextMenuPortal",ns=t=>{const{__scopeContextMenu:e,...n}=t,o=te(e);return s.jsx(As,{...o,...n})};ns.displayName=Xo;var os="ContextMenuContent",is=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=Zt(os,n),l=te(n),r=S.useRef(!1);return s.jsx($s,{...l,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&r.current&&a.preventDefault(),r.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!i.modal&&(r.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});is.displayName=os;var Jo="ContextMenuGroup",Zo=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ts,{...i,...o,ref:e})});Zo.displayName=Jo;var ei="ContextMenuLabel",ti=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Rs,{...i,...o,ref:e})});ti.displayName=ei;var si="ContextMenuItem",ls=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Os,{...i,...o,ref:e})});ls.displayName=si;var ni="ContextMenuCheckboxItem",oi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Es,{...i,...o,ref:e})});oi.displayName=ni;var ii="ContextMenuRadioGroup",li=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ds,{...i,...o,ref:e})});li.displayName=ii;var ri="ContextMenuRadioItem",ai=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ls,{...i,...o,ref:e})});ai.displayName=ri;var ci="ContextMenuItemIndicator",di=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Fs,{...i,...o,ref:e})});di.displayName=ci;var ui="ContextMenuSeparator",rs=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(zs,{...i,...o,ref:e})});rs.displayName=ui;var mi="ContextMenuArrow",fi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Us,{...i,...o,ref:e})});fi.displayName=mi;var xi="ContextMenuSubTrigger",pi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Gs,{...i,...o,ref:e})});pi.displayName=xi;var hi="ContextMenuSubContent",gi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Bs,{...i,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gi.displayName=hi;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var bi=es,ji=ss,vi=ns,_i=is,yi=ls,Si=rs;function Ci(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(bi,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ni(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(ji,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function ki(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(vi,{children:s.jsx(_i,{"data-slot":"context-menu-content",className:i,...o})}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function yt(t){const e=R.c(12);let n,o,i,l;e[0]!==t?({className:n,inset:o,variant:l,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=i,e[4]=l):(n=e[1],o=e[2],i=e[3],l=e[4]);const r=l===void 0?"default":l;let a;e[5]!==n?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==i||e[9]!==a||e[10]!==r?(c=s.jsx(yi,{"data-slot":"context-menu-item","data-inset":o,"data-variant":r,className:a,...i}),e[7]=o,e[8]=i,e[9]=a,e[10]=r,e[11]=c):c=e[11],c}function wi(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(Si,{"data-slot":"context-menu-separator",className:i,...o}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function Ii(t){const e=Se(),n=Be(),o=ro(),{locator:i}=he(),l=et({strict:!1}),r=Ct({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===r.virtualmcpid?tn(n,i,l.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Mi({agent:t,org:e,onUnpin:n,isDragging:o}){const i=Se(),{isMobile:l,setOpenMobile:r}=He(),a=Rn(e),u=St({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=S.useState(null),x=S.useRef(null),f=S.useRef(null),p=S.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const C=h=>{if(p.current)return;const y=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(y)},550)},$=h=>{f.current&&(clearTimeout(f.current),f.current=null),!(x.current&&h.relatedTarget instanceof Node&&x.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,N=d?d.width+g:0;return s.jsx(Ci,{children:s.jsxs(le,{className:J(d&&"z-[55]"),children:[s.jsx(Ni,{asChild:!0,children:s.jsx(xe,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{l&&r(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:C,onMouseLeave:$,children:s.jsx($e,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),s.jsxs(ki,{children:[s.jsxs(yt,{onClick:()=>{const h=crypto.randomUUID();i({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[s.jsx(Ve,{size:14}),"Settings"]}),s.jsx(wi,{}),s.jsxs(yt,{onClick:()=>{n(),u&&i({to:"/$org",params:{org:e}})},className:"",children:[s.jsx(ft,{size:14}),"Unpin"]})]}),d&&Hs.createPortal(s.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),n(),i({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:N,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:s.jsx(ft,{size:14})}),document.body)]})})}function Ai(t){const e=R.c(18);let n;e[0]!==t.agent.id?(n={id:t.agent.id},e[0]=t.agent.id,e[1]=n):n=e[1];const{attributes:o,listeners:i,setNodeRef:l,transform:r,transition:a,isDragging:c}=Yn(n);let u;e[2]!==r?(u=Xn.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let x;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(x={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=x):x=e[8];const f=x;let p;e[9]!==c||e[10]!==t?(p=s.jsx(Mi,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let C;return e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==f||e[16]!==p?(C=s.jsx("div",{ref:l,style:f,...o,...i,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=i,e[14]=l,e[15]=f,e[16]=p,e[17]=C):C=e[17],C}function $i(t){const e=R.c(9),{agent:n,onClick:o}=t;let i;e[0]!==n.icon||e[1]!==n.title?(i=s.jsx($e,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==i||e[7]!==l?(r=s.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[i,l]}),e[5]=o,e[6]=i,e[7]=l,e[8]=r):r=e[8],r}function Oi(t){const e=R.c(80),{onClose:n,onOpenImportDeco:o,onOpenGithubImport:i,onOpenSelfHealing:l,onOpenDiagnosticsModal:r,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=S.useState(""),f=Bt(),{org:p}=he();let C;e[0]!==f?(C=f.filter(Fi).map(Li),e[0]=f,e[1]=C):C=e[1];const $=C,{pin:g,isPinned:N}=Vt(p.id,$);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:y,isCreating:j}=eo(h),[b]=wt(),v=Ii(p.slug),I=Zn();let F,O,z,E,P,k,w,M;if(e[3]!==f||e[4]!==y||e[5]!==j||e[6]!==N||e[7]!==I||e[8]!==v||e[9]!==n||e[10]!==u||e[11]!==d||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==c||e[18]!==g||e[19]!==b.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();M=f.filter(Di).filter(T=>!m||T.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Ei),e[29]=f,e[30]=q):q=e[30];const Q=q;F=ze.filter(T=>(!m||T.title.toLowerCase().includes(V))&&!(T.id==="studio-pack"&&Q)&&!(T.id==="self-healing-storefront"&&!b.experimental_vibecode));let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=ze.find(Ri),e[31]=_):_=e[31];const K=_,W=K?f.find(T=>T.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Ti),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(T=>T.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Pi),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(T=>T.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(zi),e[34]=oe):oe=e[34];const re=oe,ye=re?f.find(T=>T.metadata?.type===re.id):void 0;let ae;e[35]!==N||e[36]!==v||e[37]!==n||e[38]!==g?(ae=T=>{N(T.id)||g(T.id),n(),x(""),v(T.id)},e[35]=N,e[36]=v,e[37]=n,e[38]=g,e[39]=ae):ae=e[39];const je=ae,ve=T=>{n(),x(""),T==="self-healing-storefront"?l():T==="site-editor"?o():T==="site-diagnostics"?W?I(W.id):r():T==="lean-canvas"?ee?I(ee.id):a():T==="ai-image"?X?I(X.id):u():T==="ai-research"?ye?I(ye.id):d():T==="studio-pack"?c():v(T)};k="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(w=s.jsx(Jn,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=w):w=e[41],O="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=z):z=e[42];let ie;e[43]!==y||e[44]!==n?(ie=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await y(),n()},e[43]=y,e[44]=n,e[45]=ie):ie=e[45];let ce,de;e[46]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ge,{size:16,className:"text-muted-foreground"})}),de=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=ce,e[47]=de):(ce=e[46],de=e[47]);let ue;e[48]!==j||e[49]!==ie?(ue=s.jsxs("button",{type:"button",disabled:j,onClick:ie,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[ce,de]}),e[48]=j,e[49]=ie,e[50]=ue):ue=e[50];let me;e[51]!==n||e[52]!==i||e[53]!==b.experimental_vibecode?(me=b.experimental_vibecode&&s.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),i(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(lo,{className:"size-5 text-muted-foreground"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=n,e[52]=i,e[53]=b.experimental_vibecode,e[54]=me):me=e[54];let fe;e[55]!==je?(fe=T=>s.jsx($i,{agent:T,onClick:()=>je(T)},T.id),e[55]=je,e[56]=fe):fe=e[56],E=s.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[ue,me,M.map(fe)]}),P=F.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-1 pt-4 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),s.jsx("div",{className:"grid grid-cols-3 gap-1",children:F.map(T=>s.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:T.id,template_title:T.title}),ve(T.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx($e,{icon:T.icon,name:T.title,size:"md",className:"transition-transform group-hover:scale-105"}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:T.title})]},T.id))})]}),e[3]=f,e[4]=y,e[5]=j,e[6]=N,e[7]=I,e[8]=v,e[9]=n,e[10]=u,e[11]=d,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=l,e[17]=c,e[18]=g,e[19]=b.experimental_vibecode,e[20]=m,e[21]=F,e[22]=O,e[23]=z,e[24]=E,e[25]=P,e[26]=k,e[27]=w,e[28]=M}else F=e[21],O=e[22],z=e[23],E=e[24],P=e[25],k=e[26],w=e[27],M=e[28];let D;e[57]!==F||e[58]!==j||e[59]!==m||e[60]!==M.length?(D=M.length===0&&F.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=F,e[58]=j,e[59]=m,e[60]=M.length,e[61]=D):D=e[61];let A;e[62]!==O||e[63]!==z||e[64]!==E||e[65]!==P||e[66]!==D?(A=s.jsxs("div",{className:O,children:[z,E,P,D]}),e[62]=O,e[63]=z,e[64]=E,e[65]=P,e[66]=D,e[67]=A):A=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==n?(U=()=>n(),e[70]=n,e[71]=U):U=e[71];let L;e[72]!==B||e[73]!==U?(L=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Vs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=L):L=e[74];let H;return e[75]!==A||e[76]!==L||e[77]!==k||e[78]!==w?(H=s.jsxs("div",{className:k,children:[w,A,L]}),e[75]=A,e[76]=L,e[77]=k,e[78]=w,e[79]=H):H=e[79],H}function zi(t){return t.id==="ai-research"}function Pi(t){return t.id==="ai-image"}function Ti(t){return t.id==="lean-canvas"}function Ri(t){return t.id==="site-diagnostics"}function Ei(t){return On(t.id)}function Di(t){return!$n(t.id)}function Li(t){return t.id}function Fi(t){return t.pinned}function Ui(){const t=R.c(36),[e,n]=S.useState(!1),[o,i]=S.useState(!1),[l,r]=S.useState(!1),[a,c]=S.useState(!1),[u,d]=S.useState(!1),[m,x]=S.useState(!1),[f,p]=S.useState(!1),[C,$]=S.useState(!1),[g,N]=S.useState(!1),h=Dt(),{setOpenMobile:y}=He();let j;t[0]!==h||t[1]!==y?(j=()=>{n(!1),h&&y(!1)},t[0]=h,t[1]=y,t[2]=j):j=t[2];const b=j;let v;t[3]!==b||t[4]!==e?(v=e&&s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ue,{className:"h-4 w-24"})}),children:s.jsx(Oi,{onClose:b,onOpenImportDeco:()=>i(!0),onOpenGithubImport:()=>{r(!0),b()},onOpenSelfHealing:()=>{c(!0),b()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>$(!0),onOpenAiResearchModal:()=>N(!0)})}),t[3]=b,t[4]=e,t[5]=v):v=t[5];const I=v;let F;t[6]!==h||t[7]!==e||t[8]!==I?(F=h?s.jsxs(s.Fragment,{children:[s.jsx(le,{children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},children:s.jsx(Ge,{className:"!opacity-100"})})}),s.jsx(Tt,{open:e,onOpenChange:n,direction:"bottom",children:s.jsxs(Rt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Browse agents"}),I]})})]}):s.jsxs(st,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),n(B)},children:[s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:s.jsx(Ge,{className:"!opacity-100"})})})}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:I})]}),t[6]=h,t[7]=e,t[8]=I,t[9]=F):F=t[9];let O;t[10]!==o?(O=s.jsx(to,{open:o,onOpenChange:i}),t[10]=o,t[11]=O):O=t[11];let z;t[12]!==l?(z=s.jsx(so,{open:l,onOpenChange:r}),t[12]=l,t[13]=z):z=t[13];let E;t[14]!==a?(E=s.jsx(En,{open:a,onOpenChange:c}),t[14]=a,t[15]=E):E=t[15];let P;t[16]!==u?(P=s.jsx(no,{open:u,onOpenChange:d}),t[16]=u,t[17]=P):P=t[17];let k;t[18]!==m?(k=s.jsx(oo,{open:m,onOpenChange:x}),t[18]=m,t[19]=k):k=t[19];let w;t[20]!==f?(w=s.jsx(io,{open:f,onOpenChange:p}),t[20]=f,t[21]=w):w=t[21];let M;t[22]!==C?(M=s.jsx(Dn,{open:C,onOpenChange:$}),t[22]=C,t[23]=M):M=t[23];let D;t[24]!==g?(D=s.jsx(Ln,{open:g,onOpenChange:N}),t[24]=g,t[25]=D):D=t[25];let A;return t[26]!==D||t[27]!==F||t[28]!==O||t[29]!==z||t[30]!==E||t[31]!==P||t[32]!==k||t[33]!==w||t[34]!==M?(A=s.jsxs(s.Fragment,{children:[F,O,z,E,P,k,w,M,D]}),t[26]=D,t[27]=F,t[28]=O,t[29]=z,t[30]=E,t[31]=P,t[32]=k,t[33]=w,t[34]=M,t[35]=A):A=t[35],A}function Gi(){const t=R.c(34),e=Bt(),{org:n}=he();let o;t[0]!==e?(o=e.filter(Ki).map(Vi),t[0]=e,t[1]=o):o=t[1];const i=o,{pinnedIds:l,unpin:r,reorder:a}=Vt(n.id,i),c=new Map(e.map(Hi)),u=l.map(A=>c.get(A)).filter(Bi);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:qn},t[3]=m):m=t[3];const x=Un(mt(Bn,d),mt(Gn,m));let f;t[4]!==l||t[5]!==a?(f=A=>{const{active:B,over:U}=A;if(!U||B.id===U.id)return;const L=l.indexOf(B.id),H=l.indexOf(U.id);L===-1||H===-1||a(Qn([...l],L,H))},t[4]=l,t[5]=a,t[6]=f):f=t[6];const p=f,C=Pe,$="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const N=Te,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",y=pe,j="gap-2";let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ui,{}),t[8]=b):b=t[8];const v=Kn,I=Wn,F=Hn,O=Vn;let z;t[9]!==n.slug||t[10]!==r?(z=A=>s.jsx(Ai,{agent:A,org:n.slug,onUnpin:()=>r(A.id)},A.id),t[9]=n.slug,t[10]=r,t[11]=z):z=t[11];const E=u.map(z);let P;t[12]!==F||t[13]!==l||t[14]!==O||t[15]!==E?(P=s.jsx(F,{items:l,strategy:O,children:E}),t[12]=F,t[13]=l,t[14]=O,t[15]=E,t[16]=P):P=t[16];let k;t[17]!==v||t[18]!==p||t[19]!==x||t[20]!==P||t[21]!==I?(k=s.jsx(v,{sensors:x,collisionDetection:I,onDragEnd:p,children:P}),t[17]=v,t[18]=p,t[19]=x,t[20]=P,t[21]=I,t[22]=k):k=t[22];let w;t[23]!==y||t[24]!==k||t[25]!==b?(w=s.jsxs(y,{className:j,children:[b,k]}),t[23]=y,t[24]=k,t[25]=b,t[26]=w):w=t[26];let M;t[27]!==N||t[28]!==w?(M=s.jsx(N,{className:h,children:w}),t[27]=N,t[28]=w,t[29]=M):M=t[29];let D;return t[30]!==C||t[31]!==M||t[32]!==g?(D=s.jsxs(C,{className:$,children:[g,M]}),t[30]=C,t[31]=M,t[32]=g,t[33]=D):D=t[33],D}function Bi(t){return!!t}function Hi(t){return[t.id,t]}function Vi(t){return t.id}function Ki(t){return t.pinned}function as(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(S.Suspense,{fallback:s.jsx(Pe,{className:"py-0 px-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-2",children:s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Ue,{className:"h-4 w-4 rounded"}),s.jsx(Ue,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Gi,{})}),t[0]=e):e=t[0],e}function Xl(){const t=R.c(4),e=Wt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Wo,{}),t[0]=n):n=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),t[1]=o):o=t[1];let i;return t[2]!==e?(i=s.jsx(Yt,{sections:e,footer:n,additionalContent:o}),t[2]=e,t[3]=i):i=t[3],i}function Jl(t){const e=R.c(5),{onClose:n}=t,o=Wt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qo,{}),e[0]=i):i=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),e[1]=l):l=e[1];let r;return e[2]!==n||e[3]!==o?(r=s.jsx(So,{sections:o,onClose:n,footer:i,additionalContent:l}),e[2]=n,e[3]=o,e[4]=r):r=e[4],r}function Wi(){const t=R.c(6),{org:e,locator:n}=he(),o=Be();let i;t[0]!==n||t[1]!==o?(i=()=>{o.invalidateQueries({queryKey:Mt.tasksPrefix(n)})},t[0]=n,t[1]=o,t[2]=i):i=t[2];let l;t[3]!==e.slug||t[4]!==i?(l={orgSlug:e.slug,onTaskStatus:i},t[3]=e.slug,t[4]=i,t[5]=l):l=t[5],uo(l)}function qi(t){const e=R.c(8),{virtualMcpId:n,size:o,showAutomationBadge:i}=t,l=o===void 0?"sm":o;let r;e[0]!==l||e[1]!==n?(r=n?s.jsx(Qi,{virtualMcpId:n,size:l}):s.jsx($e,{icon:null,name:"?",size:l}),e[0]=l,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(fo,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[r,a]}),e[5]=r,e[6]=a,e[7]=c):c=e[7],c}function Qi(t){const e=R.c(6),{virtualMcpId:n,size:o}=t,i=Ht(n);if(!i){let a;return e[0]!==o?(a=s.jsx($e,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const l=i.icon??null;let r;return e[2]!==i.title||e[3]!==o||e[4]!==l?(r=s.jsx($e,{icon:l,name:i.title,size:o}),e[2]=i.title,e[3]=o,e[4]=l,e[5]=r):r=e[5],r}function Yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function Xi(t){const e=R.c(47),{task:n,isActive:o,onClick:i,onArchive:l,showAutomationBadge:r}=t,a=xo(n.status),c=a.icon,u=Ht(n.virtual_mcp_id);let d;e[0]!==u?(d=Yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=S.useRef(null);let f;e[2]!==o?(f=()=>{if(!o)return;const V=x.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o||e[5]!==n.id?(p=[o,n.id],e[4]=o,e[5]=n.id,e[6]=p):p=e[6],S.useEffect(f,p);const C="button",$=0;let g;e[7]!==i?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),i())},e[7]=i,e[8]=g):g=e[8];const N=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==N?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[9]=N,e[10]=h):h=e[10];let y;e[11]!==r||e[12]!==n.virtual_mcp_id?(y=s.jsx(qi,{virtualMcpId:n.virtual_mcp_id,size:"xs",showAutomationBadge:r}),e[11]=r,e[12]=n.virtual_mcp_id,e[13]=y):y=e[13];const j=n.title||"Untitled task";let b;e[14]!==j?(b=s.jsx("div",{className:"text-sm text-foreground truncate",children:j}),e[14]=j,e[15]=b):b=e[15];let v;e[16]!==m||e[17]!==n.branch||e[18]!==n.updated_at?(v=n.updated_at&&s.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[n.branch?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):m?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:nn(new Date(n.updated_at))})]}),e[16]=m,e[17]=n.branch,e[18]=n.updated_at,e[19]=v):v=e[19];let I;e[20]!==b||e[21]!==v?(I=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,v]}),e[20]=b,e[21]=v,e[22]=I):I=e[22];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",z=a.label,E=14,P=J(a.iconClassName,n.status==="in_progress"&&"animate-spin");let k;e[23]!==c||e[24]!==P?(k=s.jsx(c,{size:E,className:P}),e[23]=c,e[24]=P,e[25]=k):k=e[25];let w;e[26]!==a||e[27]!==k?(w=s.jsx("span",{className:O,"aria-label":z,children:k}),e[26]=a,e[27]=k,e[28]=w):w=e[28];let M;e[29]!==l?(M=V=>{V.stopPropagation(),l()},e[29]=l,e[30]=M):M=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(mo,{size:14}),e[31]=D):D=e[31];let A;e[32]!==M?(A=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:M,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:D})}),e[32]=M,e[33]=A):A=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Xe,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==A?(U=s.jsxs(Je,{children:[A,B]}),e[35]=A,e[36]=U):U=e[36];let L;e[37]!==w||e[38]!==U?(L=s.jsxs("div",{className:F,children:[w,U]}),e[37]=w,e[38]=U,e[39]=L):L=e[39];let H;return e[40]!==i||e[41]!==I||e[42]!==L||e[43]!==g||e[44]!==h||e[45]!==y?(H=s.jsxs("div",{ref:x,role:C,tabIndex:$,onClick:i,onKeyDown:g,className:h,children:[y,I,L]}),e[40]=i,e[41]=I,e[42]=L,e[43]=g,e[44]=h,e[45]=y,e[46]=H):H=e[46],H}const cs={all:"All tasks",manual:"Chats",automation:"Automation"},ds={all:"All members",mine:"Mine only"};function Ji(t){const e=R.c(59),{title:n,tasks:o,activeTaskId:i,onSelect:l,onArchive:r,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=S.useState("all"),[p,C]=S.useState("mine");let $;e[0]!==m||e[1]!==p||e[2]!==o?($=p==="mine"&&m?o.filter(_=>_.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=$):$=e[3];const g=$;let N;e[4]!==x||e[5]!==g?(N=x==="automation"?g.filter(sl):x==="manual"?g.filter(tl):g,e[4]=x,e[5]=g,e[6]=N):N=e[6];const h=N;let y;e[7]!==n?(y=s.jsx("span",{children:n}),e[7]=n,e[8]=y):y=e[8];let j;e[9]!==p?(j=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?s.jsx(Js,{size:16}):s.jsx(Ft,{size:16})})}),e[9]=p,e[10]=j):j=e[10];let b;e[11]!==p?(b=_=>{const K=_;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),C(K)},e[11]=p,e[12]=b):b=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=Object.keys(ds),e[13]=v):v=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=v.map(el),e[14]=I):I=e[14];let F;e[15]!==p||e[16]!==b?(F=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:p,onValueChange:b,children:I})}),e[15]=p,e[16]=b,e[17]=F):F=e[17];let O;e[18]!==j||e[19]!==F?(O=s.jsxs(bt,{children:[j,F]}),e[18]=j,e[19]=F,e[20]=O):O=e[20];const z=x!=="all"&&"text-purple-500";let E;e[21]!==z?(E=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",z),e[21]=z,e[22]=E):E=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(rn,{size:16}),e[23]=P):P=e[23];let k;e[24]!==E?(k=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter tasks",className:E,children:P})}),e[24]=E,e[25]=k):k=e[25];let w;e[26]!==x?(w=_=>{const K=_;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=w):w=e[27];let M;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=Object.keys(cs),e[28]=M):M=e[28];let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=M.map(Zi),e[29]=D):D=e[29];let A;e[30]!==x||e[31]!==w?(A=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:x,onValueChange:w,children:D})}),e[30]=x,e[31]=w,e[32]=A):A=e[32];let B;e[33]!==k||e[34]!==A?(B=s.jsxs(bt,{children:[k,A]}),e[33]=k,e[34]=A,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==n?(U=c&&a&&s.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${n.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:s.jsx(Xs,{size:16})}),e[36]=a,e[37]=c,e[38]=n,e[39]=U):U=e[39];let L;e[40]!==B||e[41]!==U||e[42]!==O?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,B,U]}),e[40]=B,e[41]=U,e[42]=O,e[43]=L):L=e[43];let H;e[44]!==L||e[45]!==y?(H=s.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[y,L]}),e[44]=L,e[45]=y,e[46]=H):H=e[46];let V;e[47]!==i||e[48]!==d||e[49]!==r||e[50]!==l||e[51]!==u||e[52]!==h?(V=h.length===0&&d?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(_=>s.jsx(Xi,{task:_,isActive:i===_.id,onClick:()=>{i!==_.id&&se("tasks_panel_task_clicked",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null,from_automation:!!_.fromAutomation}),l(_)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null}),r(_)},showAutomationBadge:u||_.fromAutomation},_.id)),e[47]=i,e[48]=d,e[49]=r,e[50]=l,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=s.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Zi(t){return s.jsx(Kt,{value:t,children:cs[t]},t)}function el(t){return s.jsx(Kt,{value:t,children:ds[t]},t)}function tl(t){return!t.fromAutomation}function sl(t){return t.fromAutomation}function nl(){const t=R.c(23);Wi();const{data:e}=_e.useSession(),n=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:i}=xt(o);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open",hasTrigger:!0},t[1]=l):l=t[1];const{tasks:r}=xt(l),{setTaskId:a,createNewTask:c}=At();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=et(u),{locator:m,org:x}=he(),f=Be();let p;t[3]!==x.id||t[4]!==x.slug?(p={connectionId:Ut,orgId:x.id,orgSlug:x.slug},t[3]=x.id,t[4]=x.slug,t[5]=p):p=t[5];const C=Gt(p),$=d.taskId??null;let g;t[6]!==r||t[7]!==i?(g=[...i,...r.map(il)].sort(ol),t[6]=r,t[7]=i,t[8]=g):g=t[8];const N=g;let h;t[9]!==C||t[10]!==m||t[11]!==f?(h=async v=>{try{await co(C,v.id,{hidden:!0}),f.invalidateQueries({queryKey:Mt.tasksPrefix(m)})}catch(I){const O=I;be.error(`Failed to archive task: ${O.message}`)}},t[9]=C,t[10]=m,t[11]=f,t[12]=h):h=t[12];const y=h;if(N.length===0){let v;return t[13]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"h-full flex items-center justify-center p-4",children:s.jsx(ao,{image:s.jsx(Zs,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[13]=v):v=t[13],v}let j;t[14]!==a?(j=v=>a(v.id,v.virtual_mcp_id),t[14]=a,t[15]=j):j=t[15];let b;return t[16]!==$||t[17]!==N||t[18]!==c||t[19]!==n||t[20]!==y||t[21]!==j?(b=s.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:s.jsx(Ji,{title:"Tasks",tasks:N,activeTaskId:$,onSelect:j,onArchive:y,onNew:c,showNewButton:!0,currentUserId:n})}),t[16]=$,t[17]=N,t[18]=c,t[19]=n,t[20]=y,t[21]=j,t[22]=b):b=t[22],b}function ol(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function il(t){return{...t,fromAutomation:!0}}function ll(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(rl)}),t[0]=e):e=t[0],e}function rl(t,e){return s.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Zl(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fn.Skeleton,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(tt,{fallback:e,children:s.jsx(S.Suspense,{fallback:s.jsx(ll,{}),children:s.jsx(nl,{})})}),t[1]=n):n=t[1],n}export{Xl as S,Zl as T,Jl as a,Yi as g};
@@ -1,4 +1,4 @@
1
- import{ci as ne,e as _,j as o,B as te,l as ln,bb as ze,cj as ms,r as T,s as oe,c as O,g as ps,o as cn,c4 as xs,a7 as hs,a8 as fe,aV as an,c5 as gs,aS as bs,c3 as Ss,c6 as un,b5 as js,cc as ys,cd as vs,ae as ws,ce as Ns,ck as $t,cl as dn,x as ks,y as _s,cm as Cs,cn as Is}from"./index-CzOMQ7ME.js";import{D as Ts,F as Es,B as $s}from"./index-By1GUFmc.js";import{e as Fe,i as Os,u as ae}from"./constants-CrCZOO5F.js";import{b as fn}from"./use-virtual-mcp-lxX8wI4d.js";import{M as Re}from"./monaco-editor-BBalufRy.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-DK_H38Gy.js";import{B as le}from"./badge-Bovdptse.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-Ilj6kxB7.js";import{S as st}from"./spinner-DRDdaYJh.js";import{V as Ws}from"./view-mode-toggle-Dn0_DV4a.js";import{a8 as Ds,a9 as Fs,i as Hs,a0 as mn,aa as Vs,P as Us,u as qs,ab as pn,X as Ks,T as xn,ac as Bs,ad as Xs,R as bt,ae as Js}from"./agent-icon-ChigV_SM.js";import{i as hn}from"./Play-BFNsKgtb.js";import{b as Gs,a as Qs,V as Qe}from"./layout-CYKmcI2j.js";import{c as gn,b as bn,T as Sn,a as jn}from"./tooltip-Dk-x7ks3.js";import{u as Ys,a as Zs}from"./use-connection-Bw3IdOYX.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-DVY8KcMA.js";import{c as eo,d as to,e as no,D as so,a as oo,b as ro}from"./dialog-zxbh5ng1.js";import"./index-CLwT6SqX.js";import{N as io,h as lo,j as co,m as Be,P as ao,i as uo,R as fo,c as mo,k as po,e as qt,d as xo}from"./index-nTgL534f.js";import{S as ho}from"./index-BOMQKZYe.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BHUBCwIp.js";import{s as go}from"./Plus-BPcc_-zf.js";import{b as kn}from"./Tool01-YKVy1yNP.js";import{i as He}from"./Check-BXg4TGxE.js";import{s as Mt}from"./XClose-CPKu5cnb.js";import{I as Lt}from"./integration-icon-BaScZvO6.js";import{a as bo,S as So}from"./scroll-area-9lFTzWCb.js";import"./index-CVz9D9gf.js";import{i as _n}from"./X-CNAnrf0f.js";import{u as Cn,a as jo}from"./use-collections-DaGR-TK3.js";import{E as In}from"./empty-state-16qSOU0O.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-B0c-2DIW.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Ds,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Fs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{ci as ne,e as _,j as o,B as te,l as ln,bb as ze,cj as ms,r as T,s as oe,c as O,g as ps,o as cn,c4 as xs,a7 as hs,a8 as fe,aV as an,c5 as gs,aS as bs,c3 as Ss,c6 as un,b5 as js,cc as ys,cd as vs,ae as ws,ce as Ns,ck as $t,cl as dn,x as ks,y as _s,cm as Cs,cn as Is}from"./index-dmkCn37I.js";import{D as Ts,F as Es,B as $s}from"./index-BK7vZkwz.js";import{e as Fe,i as Os,u as ae}from"./constants-fVwC9Czh.js";import{b as fn}from"./use-virtual-mcp-BVVlTr3L.js";import{M as Re}from"./monaco-editor-eJWlN-2G.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-CNGIXlRh.js";import{B as le}from"./badge-D0TDvkU5.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-BjC54T39.js";import{S as st}from"./spinner-CsMegR0e.js";import{V as Ws}from"./view-mode-toggle-CY3mqueQ.js";import{a8 as Ds,a9 as Fs,i as Hs,a0 as mn,aa as Vs,P as Us,u as qs,ab as pn,X as Ks,T as xn,ac as Bs,ad as Xs,R as bt,ae as Js}from"./agent-icon-CDOpQPVP.js";import{i as hn}from"./Play-BUgAN2i6.js";import{b as Gs,a as Qs,V as Qe}from"./layout-BamLP3Zj.js";import{c as gn,b as bn,T as Sn,a as jn}from"./tooltip-DHpEGVi8.js";import{u as Ys,a as Zs}from"./use-connection-BCPpnVMX.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-a-ZvbrGo.js";import{c as eo,d as to,e as no,D as so,a as oo,b as ro}from"./dialog-qtKrSwKA.js";import"./index-DTLkaJxe.js";import{N as io,h as lo,j as co,m as Be,P as ao,i as uo,R as fo,c as mo,k as po,e as qt,d as xo}from"./index-CB6J7z90.js";import{S as ho}from"./index-KBbmKsy_.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BnaZE7Qd.js";import{s as go}from"./Plus-Bk1OvOXE.js";import{b as kn}from"./Tool01-DUGZCBMz.js";import{i as He}from"./Check-nv67ec3-.js";import{s as Mt}from"./XClose-DwaprZxL.js";import{I as Lt}from"./integration-icon-PH7vkQ9v.js";import{a as bo,S as So}from"./scroll-area-xE7hc-8l.js";import"./index-jo98Roqy.js";import{i as _n}from"./X-DDQYEU6o.js";import{u as Cn,a as jo}from"./use-collections-XDqst4E_.js";import{E as In}from"./empty-state-Bd4cGUaH.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-C0h7cNmt.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Ds,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Fs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}