decocms 3.76.1 → 3.77.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 (251) hide show
  1. package/dist/client/assets/{AlertCircle-CU38QLy6.js → AlertCircle-BYmwGQCf.js} +1 -1
  2. package/dist/client/assets/{ArrowRight-DxveGWk4.js → ArrowRight-CvF16wpP.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-ie9OiC1L.js → ArrowUpRight-DpeEXraR.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-JqmGicRO.js → CheckCircle-Bf3Z61R3.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-0fINXUkk.js → ChevronDown-DbkPHjH7.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DOYNMC-e.js → ChevronLeft-7WikNK_I.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-B6XUFwET.js → ChevronRight-CUrrZIqG.js} +1 -1
  8. package/dist/client/assets/ChevronUp-BT7nyl6k.js +1 -0
  9. package/dist/client/assets/{DotsVertical-CWryBHtG.js → DotsVertical-BpkGXLrP.js} +1 -1
  10. package/dist/client/assets/{Eye-BxG-oJAF.js → Eye-D3915Vo9.js} +1 -1
  11. package/dist/client/assets/{FilterLines-C43ER7Pr.js → FilterLines-BDTdg3RE.js} +1 -1
  12. package/dist/client/assets/{Globe01-C0lWcJBb.js → Globe01-BxZmquSL.js} +1 -1
  13. package/dist/client/assets/{Globe04-CFiBZJOT.js → Globe04-CkBzX8xL.js} +1 -1
  14. package/dist/client/assets/{HardDrive-Ce7Xq_sJ.js → HardDrive-Cko4CWL8.js} +1 -1
  15. package/dist/client/assets/{Key01-CWpW_-Pr.js → Key01-CAY-Xxyp.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DqymKk5q.js → LayoutLeft-CJuGELXN.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BC9HiQgY.js → LinkExternal01-DluIM9mv.js} +1 -1
  18. package/dist/client/assets/{Monitor01-pVUVKdPN.js → Monitor01-bbyGUKmR.js} +1 -1
  19. package/dist/client/assets/{Palette-BwK1Ghgx.js → Palette-DLCudjOT.js} +1 -1
  20. package/dist/client/assets/{Play-LsXMa_ja.js → Play-I5x_JKdj.js} +1 -1
  21. package/dist/client/assets/{Plus-BqBWPPKf.js → Plus-DOSjIlBe.js} +1 -1
  22. package/dist/client/assets/{SearchMd-CUFv_rgs.js → SearchMd-q-mL98uP.js} +1 -1
  23. package/dist/client/assets/{Settings02-BFRtrqB4.js → Settings02-C0s-saqA.js} +1 -1
  24. package/dist/client/assets/{Shield01-Bd_FXtHh.js → Shield01-DA5SmW0P.js} +1 -1
  25. package/dist/client/assets/{Star01-ewA9GGVc.js → Star01-1ZF9aI5Y.js} +1 -1
  26. package/dist/client/assets/{Stars01-KZUmRNKW.js → Stars01-CWQtskKI.js} +1 -1
  27. package/dist/client/assets/{Stars02-DYAjCaf7.js → Stars02-DMdFpBOz.js} +1 -1
  28. package/dist/client/assets/{Sun-YkcktInM.js → Sun-CVp19c6p.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-JVBtN5EN.js → SwitchHorizontal01-BMk8DM55.js} +1 -1
  30. package/dist/client/assets/{Tool01-B-ZIzcOP.js → Tool01-CHEQOI-w.js} +1 -1
  31. package/dist/client/assets/{Trash01-CDCJsikI.js → Trash01-jgpaQcTh.js} +1 -1
  32. package/dist/client/assets/{Upload01-BvNX7dwC.js → Upload01-DmPHnKxK.js} +1 -1
  33. package/dist/client/assets/{User01-DWxhvxAm.js → User01-CQqeHCY8.js} +1 -1
  34. package/dist/client/assets/{Users01-CcfwVwMB.js → Users01-3CAb_L9A.js} +1 -1
  35. package/dist/client/assets/{Users03-Bnzjqkr7.js → Users03-BtWBA-oP.js} +1 -1
  36. package/dist/client/assets/{X-Bmi_qRN4.js → X-BTPYHIvY.js} +1 -1
  37. package/dist/client/assets/{XCircle-DPmDQ715.js → XCircle-BODgW7sH.js} +1 -1
  38. package/dist/client/assets/{XClose-thceHO6y.js → XClose-qC8Lq_ms.js} +1 -1
  39. package/dist/client/assets/{Zap-BiorjSWt.js → Zap-CVq2f6J2.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-BUu_lfxg.js → ZapSquare-C3NGLDu-.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-DvgFp2BT.js → ZoomOut-CjZnoT-b.js} +1 -1
  42. package/dist/client/assets/{access-gate-WjXD0-_B.js → access-gate-CBINLd7U.js} +1 -1
  43. package/dist/client/assets/add-section-modal-A1TEpk88.js +1 -0
  44. package/dist/client/assets/agent-icon-s6bX_I9L.js +1 -0
  45. package/dist/client/assets/agents-list-yRMR0cF5.js +1 -0
  46. package/dist/client/assets/ai-providers-47bmrarJ.js +1 -0
  47. package/dist/client/assets/{alert-CveeSpYR.js → alert-CHc3FYZF.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-BaufekhR.js → alert-dialog-D2GL5qBd.js} +1 -1
  49. package/dist/client/assets/app-editor-DjZhxnMe.js +1 -0
  50. package/dist/client/assets/{auth-BXPdjuWF.js → auth-BX6flE6a.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-BPIlgrZN.js → auth-catchall-BpjOaSW9.js} +1 -1
  52. package/dist/client/assets/{auth-entry-C6zOnMW5.js → auth-entry-DfGml_TH.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-D86JKDEn.js → auth-split-layout-HWtMmGAh.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-aHfkNvIG.js → automation-list-row-CAkQUGBC.js} +1 -1
  55. package/dist/client/assets/{automation-runs-CJg4mnNP.js → automation-runs-BO1vGgx9.js} +1 -1
  56. package/dist/client/assets/automations-DQeUsmtv.js +1 -0
  57. package/dist/client/assets/{avatar-CSuVLmod.js → avatar-BS-jv_DR.js} +1 -1
  58. package/dist/client/assets/{badge-BS7vcv5t.js → badge-BcU0uhl8.js} +1 -1
  59. package/dist/client/assets/{block-document-BQOe9ocy.js → block-document-CF604YR_.js} +1 -1
  60. package/dist/client/assets/{brand-context-DcuFxecd.js → brand-context-2XxEjOnF.js} +1 -1
  61. package/dist/client/assets/buckets-DVC4Kohh.js +1 -0
  62. package/dist/client/assets/{calendar-DOU5eOAx.js → calendar-CbxSTdbI.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-DMLAXOWw.js → capability-load-error-D-aRp7QN.js} +1 -1
  64. package/dist/client/assets/{card-Dlbea5c8.js → card-BIfVO_jW.js} +1 -1
  65. package/dist/client/assets/category-editor-BfrojdBX.js +1 -0
  66. package/dist/client/assets/{chat-context-CBpDhIU2.js → chat-context-EpSQJI2R.js} +1 -1
  67. package/dist/client/assets/checkbox-B76UlBUd.js +1 -0
  68. package/dist/client/assets/{cli-auth-success-BgUCdALe.js → cli-auth-success-BZa-itTp.js} +1 -1
  69. package/dist/client/assets/collection-detail-BNS2Iwl7.js +1 -0
  70. package/dist/client/assets/collection-display-button-BP4c4hrD.js +1 -0
  71. package/dist/client/assets/{collection-search-ZnbN2Oka.js → collection-search-DYVCc599.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CI7K_OKd.js → collection-tabs-C0YJH8OQ.js} +1 -1
  73. package/dist/client/assets/{command-FVnvTkmT.js → command-Cx31xkYn.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-Bx2cQDUo.js +1 -0
  75. package/dist/client/assets/connect-desktop-dialog-C3zpTl9v.js +1 -0
  76. package/dist/client/assets/{connection-card-DuX9wPmQ.js → connection-card-C3_U3j25.js} +1 -1
  77. package/dist/client/assets/connection-detail-DttTci9g.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BAad4_Oz.js → connection-form-helpers-QpFovVZo.js} +1 -1
  79. package/dist/client/assets/connections-4YYDTDW3.js +1 -0
  80. package/dist/client/assets/{context-menu-LUxIfqx1.js → context-menu-DX4dPYJO.js} +1 -1
  81. package/dist/client/assets/{decopilot-D0ubcUmg.js → decopilot-DaDKMLey.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-ByFi2-lw.js → decopilot-sse-pool-CcKrM-Xv.js} +1 -1
  83. package/dist/client/assets/{dialog-CLq1SghM.js → dialog-DGhL6eBy.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BJdz6sAq.js → domain-settings-C1EU9nuj.js} +1 -1
  85. package/dist/client/assets/{drawer-C1zwk63J.js → drawer-B9Cs5iI_.js} +1 -1
  86. package/dist/client/assets/dropdown-menu-CiC9tTdb.js +1 -0
  87. package/dist/client/assets/{empty-state-QuiqZdc3.js → empty-state-yOW3dSH7.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-Dg9BZZhS.js → extract-connection-data-Cmd1hHZE.js} +1 -1
  89. package/dist/client/assets/file-explorer-CRI6MNvr.js +2 -0
  90. package/dist/client/assets/{file-type-icon-BUdJI6sA.js → file-type-icon-C0VVPUpN.js} +1 -1
  91. package/dist/client/assets/{files-feT_4u5f.js → files-BJZQ0FpY.js} +1 -1
  92. package/dist/client/assets/{form-BiL7tBo8.js → form-CaHcodeJ.js} +1 -1
  93. package/dist/client/assets/general-DvXPbO2X.js +1 -0
  94. package/dist/client/assets/{github-repo-picker-Bkke5mPs.js → github-repo-picker-CtfOBr8M.js} +1 -1
  95. package/dist/client/assets/{hooks-DuQsd6Bm.js → hooks-DX86YvO8.js} +1 -1
  96. package/dist/client/assets/image-field-D_fZia_E.js +1 -0
  97. package/dist/client/assets/{import-from-deco-dialog-BJTdqbDe.js → import-from-deco-dialog-Dn6_-blC.js} +1 -1
  98. package/dist/client/assets/{index-D2an7Gp7.js → index-BbdyUut8.js} +1 -1
  99. package/dist/client/assets/{index-0PKQPYj-.js → index-BdFUyuzp.js} +1 -1
  100. package/dist/client/assets/{index-BwwMI_z3.js → index-BiSv4wgs.js} +3 -3
  101. package/dist/client/assets/{index-Dx8Lr08E.js → index-Bzfd3S0P.js} +3 -3
  102. package/dist/client/assets/index-CAejfhLf.js +1 -0
  103. package/dist/client/assets/{index-CaI094MV.js → index-CQF6lVUo.js} +1 -1
  104. package/dist/client/assets/{index-BMvE__1e.js → index-CS96E1bw.js} +2 -2
  105. package/dist/client/assets/{index-BxhIMeWM.js → index-Cyq8kOmo.js} +1 -1
  106. package/dist/client/assets/{index-CKyFmB_U.js → index-D-jSeUPY.js} +1 -1
  107. package/dist/client/assets/{index-QeN7VcKq.js → index-DAfY2rvi.js} +4 -4
  108. package/dist/client/assets/{index-Dxv0Qdk7.js → index-DLBSEic_.js} +1 -1
  109. package/dist/client/assets/index-IC_7I4E3.js +1 -0
  110. package/dist/client/assets/{index-BlldpIQL.js → index-lWXyO72r.js} +1 -1
  111. package/dist/client/assets/{index-CNc7ZujZ.js → index-m_lmKMTo.js} +1 -1
  112. package/dist/client/assets/{index-redirect-D34lI4w0.js → index-redirect--cQpprvo.js} +1 -1
  113. package/dist/client/assets/{input-9-kTRwAW.js → input-Ta_Y1lvO.js} +1 -1
  114. package/dist/client/assets/{integration-icon-EI90wRK8.js → integration-icon-DDugmSqH.js} +1 -1
  115. package/dist/client/assets/{label-DQDXb8Iy.js → label-C8gqICzJ.js} +1 -1
  116. package/dist/client/assets/{login-_ioU-7z7.js → login-15LhOBnr.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-d5uIP20j.js → mcp-oauth-D0PDq8qp.js} +1 -1
  118. package/dist/client/assets/{members-B4-o1sPI.js → members-BCHlqZ_l.js} +2 -2
  119. package/dist/client/assets/{monaco-editor-CSc3_nGj.js → monaco-editor-B83AZ8GN.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-bB_yDQ1d.js → monitoring-stats-row-CH_Ju-wa.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-M2VH_xNw.js → oauth-callback-ai-provider-BB5BJd2l.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-BsRC3N8-.js → oauth-callback-ix708N30.js} +1 -1
  123. package/dist/client/assets/{onboarding-C7eKdLoo.js → onboarding-CMCNAluc.js} +1 -1
  124. package/dist/client/assets/{org-install-_P6DeAjW.js → org-install-DrK1M64X.js} +1 -1
  125. package/dist/client/assets/{org-layout-DCm7IxEI.js → org-layout-C6zhzHkR.js} +1 -1
  126. package/dist/client/assets/{organization-choice-RrOgT99H.js → organization-choice-B6-OJzO9.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BQFbKmQP.js → page-seo-form-BzBYlYXK.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-BI1e3r-Y.js +1 -0
  129. package/dist/client/assets/{popover-C48maDID.js → popover-BlGotCa-.js} +1 -1
  130. package/dist/client/assets/post-editor-DayUNdZ0.js +1 -0
  131. package/dist/client/assets/preview-dialog-BTdQ1TvF.js +5 -0
  132. package/dist/client/assets/{primitives-BBY0CFqU.js → primitives-CKYU8UlB.js} +1 -1
  133. package/dist/client/assets/profile-B5aimk1S.js +1 -0
  134. package/dist/client/assets/project-app-view-Dnb_LmK_.js +1 -0
  135. package/dist/client/assets/record-editor-BY0yu0r9.js +1 -0
  136. package/dist/client/assets/registry-CcuEWwCn.js +2 -0
  137. package/dist/client/assets/{registry-layout-DCbpe-7M.js → registry-layout-DsXkT4KV.js} +2 -2
  138. package/dist/client/assets/{require-capability-DSFyWoVw.js → require-capability-XP_1zPNl.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-WiM3pjQr.js → required-auth-layout-qIDzSGtQ.js} +1 -1
  140. package/dist/client/assets/{reset-password-CyW_D8JQ.js → reset-password-RZU_bfNW.js} +1 -1
  141. package/dist/client/assets/roles-CT6FH28_.js +1 -0
  142. package/dist/client/assets/save-referenced-block-CMl5gaJM.js +1 -0
  143. package/dist/client/assets/save-status-Bwyidu0s.js +1 -0
  144. package/dist/client/assets/{schema-form-DsQqx-T1.js → schema-form-CTQz2kTF.js} +1 -1
  145. package/dist/client/assets/{scroll-area-DMoYJ3k8.js → scroll-area-iBbwLoaH.js} +1 -1
  146. package/dist/client/assets/{search-input-DnOeAwxM.js → search-input-CHOe8stk.js} +1 -1
  147. package/dist/client/assets/secrets-DqovOx3Q.js +1 -0
  148. package/dist/client/assets/{sections-editor-Cy3vokJh.js → sections-editor-PK5zsI1T.js} +2 -2
  149. package/dist/client/assets/select-D9WchHFw.js +1 -0
  150. package/dist/client/assets/{select-model-CP3J5XcK.js → select-model-D4uK7qW2.js} +1 -1
  151. package/dist/client/assets/seo-editor-Dwigxdky.js +1 -0
  152. package/dist/client/assets/{settings-layout-B1_sKCgZ.js → settings-layout-CtPsdD9d.js} +1 -1
  153. package/dist/client/assets/{settings-section-D9jClssB.js → settings-section-XLADU1Ft.js} +1 -1
  154. package/dist/client/assets/{sheet-augXQ0K7.js → sheet-DcscOrN-.js} +1 -1
  155. package/dist/client/assets/{shell-controls-B_MLdfQN.js → shell-controls-DCNtyoPf.js} +1 -1
  156. package/dist/client/assets/{shell-layout-BT2b3cNK.js → shell-layout-78V1nK9o.js} +1 -1
  157. package/dist/client/assets/{shell-route-loading-BS9UjtiE.js → shell-route-loading-Drp-Ml9n.js} +1 -1
  158. package/dist/client/assets/{sidebar-DXPYC1Hg.js → sidebar-BHU7Y-eK.js} +1 -1
  159. package/dist/client/assets/{skeleton-onJaQqBb.js → skeleton-DYsLWJ4s.js} +1 -1
  160. package/dist/client/assets/{sortable.esm-CaciG6GE.js → sortable.esm-DYnQaz_O.js} +1 -1
  161. package/dist/client/assets/sso-CUKcu8bh.js +1 -0
  162. package/dist/client/assets/{store-BToWUgCq.js → store-D0RG8VnF.js} +1 -1
  163. package/dist/client/assets/store-registry-l1zQEo3-.js +2 -0
  164. package/dist/client/assets/{studio-tools-B8VUUU-T.js → studio-tools-B6e1wIqk.js} +1 -1
  165. package/dist/client/assets/{switch-BPQwwUV8.js → switch-B0g5vIO8.js} +1 -1
  166. package/dist/client/assets/{table-CRHHLqz7.js → table-CuanbdKo.js} +1 -1
  167. package/dist/client/assets/{tabs-CdvhBRm_.js → tabs-DfpltS-P.js} +1 -1
  168. package/dist/client/assets/{task-status-UVFK-kXi.js → task-status-B9Z3_U-A.js} +1 -1
  169. package/dist/client/assets/{textarea-CWkbF3jO.js → textarea-ji5jId4g.js} +1 -1
  170. package/dist/client/assets/{toggle-group-BsdLNJ12.js → toggle-group-B5UDI72A.js} +1 -1
  171. package/dist/client/assets/{toolbar-BJeFrmdV.js → toolbar-BMWZipjQ.js} +1 -1
  172. package/dist/client/assets/{tooltip-CyNlJ2D3.js → tooltip-BIAup3vg.js} +1 -1
  173. package/dist/client/assets/{types-BAop8rwy.js → types-DmsJ1dgA.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-BYdj6_Kv.js → use-ai-providers-CSwg9ID-.js} +1 -1
  175. package/dist/client/assets/{use-automations-C40bqyM5.js → use-automations-Cm2EUHDJ.js} +1 -1
  176. package/dist/client/assets/{use-capability-BC9VFiK3.js → use-capability-jAHdTjWn.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-BwGvIB24.js → use-clock-tick-BH2ii9Ri.js} +1 -1
  178. package/dist/client/assets/{use-collections-yr9dnEMw.js → use-collections-DYVhZ6LZ.js} +1 -1
  179. package/dist/client/assets/{use-connection-DTZL15F4.js → use-connection-CYq4sTpp.js} +1 -1
  180. package/dist/client/assets/{use-copy-DFo7-jB5.js → use-copy-BL1Gi5Ma.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-CL5yn8nP.js → use-create-virtual-mcp-BbTDDIhz.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-BXUwU_2r.js → use-debounced-autosave-BWXIh3Xt.js} +1 -1
  183. package/dist/client/assets/use-deco-credits-CjVry_TJ.js +1 -0
  184. package/dist/client/assets/{use-delete-connection-YPzOIAD8.js → use-delete-connection-BP0n__7X.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-DqSldcFs.js → use-file-configs-3VHkoOl7.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-CuBVIy0d.js → use-infinite-scroll-CsW5GqEa.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-CSb3cFHt.js → use-join-requests-BtpSJ5cA.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-DvAPKq6Y.js → use-mcp-client-BcfXwx2l.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-C08ra20t.js → use-mcp-prompts-h_GWEUu_.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-BvNLlDVP.js → use-mcp-tools-DhZgsJaJ.js} +1 -1
  191. package/dist/client/assets/{use-members-CDiFYafh.js → use-members-K1wagpAk.js} +1 -1
  192. package/dist/client/assets/{use-navigate-to-agent--cfMzNid.js → use-navigate-to-agent-GOxU3Hpn.js} +1 -1
  193. package/dist/client/assets/{use-org-auth-client-POkuFZw3.js → use-org-auth-client-CMUSTibk.js} +1 -1
  194. package/dist/client/assets/{use-org-sso-D0AtHZwW.js → use-org-sso-BJNpFjMG.js} +1 -1
  195. package/dist/client/assets/{use-organization-roles-B9r7gSrc.js → use-organization-roles-CnWjq4nf.js} +1 -1
  196. package/dist/client/assets/{use-organization-settings-C6tDwGjc.js → use-organization-settings-CbMA9tyx.js} +1 -1
  197. package/dist/client/assets/{use-registry-connections-DSa_I7y4.js → use-registry-connections-CQIqYcvJ.js} +1 -1
  198. package/dist/client/assets/{use-secrets-DcZ7AQsJ.js → use-secrets-B69dGKd4.js} +1 -1
  199. package/dist/client/assets/{use-status-sounds-D1GhbJRz.js → use-status-sounds-B38RTJiB.js} +1 -1
  200. package/dist/client/assets/{use-view-mode-Jelm-Bs5.js → use-view-mode-DyryORIA.js} +1 -1
  201. package/dist/client/assets/{use-virtual-mcp-CoIXtDgU.js → use-virtual-mcp-B9JwuB8w.js} +1 -1
  202. package/dist/client/assets/useInfiniteQuery-nR5oOHHR.js +1 -0
  203. package/dist/client/assets/useSuspenseInfiniteQuery-mFFPqXZc.js +1 -0
  204. package/dist/client/assets/variant-calendar-CisCsFL5.js +1 -0
  205. package/dist/client/assets/{view-mode-toggle-DpYW1yVt.js → view-mode-toggle-Bt_jVM0U.js} +1 -1
  206. package/dist/client/index.html +1 -1
  207. package/dist/server/cli.js +344 -344
  208. package/dist/server/server.js +235 -235
  209. package/package.json +1 -1
  210. package/dist/client/assets/Check-BLeNHxJZ.js +0 -1
  211. package/dist/client/assets/ChevronUp-uM-ozZ5J.js +0 -1
  212. package/dist/client/assets/add-section-modal-D39KPQ1s.js +0 -1
  213. package/dist/client/assets/agent-icon-DBLutUdr.js +0 -1
  214. package/dist/client/assets/agents-list-BDmLqytH.js +0 -1
  215. package/dist/client/assets/ai-providers-CJDUqvc6.js +0 -1
  216. package/dist/client/assets/app-editor-CoUliEgJ.js +0 -1
  217. package/dist/client/assets/automations-zENxbilR.js +0 -1
  218. package/dist/client/assets/buckets-CgxhDoZh.js +0 -1
  219. package/dist/client/assets/category-editor-DNfPaYT5.js +0 -1
  220. package/dist/client/assets/checkbox-wpAqS3ku.js +0 -1
  221. package/dist/client/assets/collection-detail-B34YWmjR.js +0 -1
  222. package/dist/client/assets/collection-display-button-CSZsuDEp.js +0 -1
  223. package/dist/client/assets/commerce-onboarding-DMq1bIwD.js +0 -1
  224. package/dist/client/assets/connect-desktop-dialog-DJmqWrPH.js +0 -1
  225. package/dist/client/assets/connection-detail-CTpLzjcs.js +0 -1
  226. package/dist/client/assets/connections-BTl6It2w.js +0 -1
  227. package/dist/client/assets/dropdown-menu-EYUmANSx.js +0 -1
  228. package/dist/client/assets/file-explorer-DilO5CaV.js +0 -2
  229. package/dist/client/assets/general-t_xGh-0k.js +0 -1
  230. package/dist/client/assets/image-field-BPXDAjk4.js +0 -1
  231. package/dist/client/assets/index-B-GX2s0h.js +0 -1
  232. package/dist/client/assets/index-DpLRFWMx.js +0 -1
  233. package/dist/client/assets/page-seo-sheet-B1SXxpsG.js +0 -1
  234. package/dist/client/assets/post-editor-DSEtrqlM.js +0 -1
  235. package/dist/client/assets/preview-dialog-DL68uWz9.js +0 -5
  236. package/dist/client/assets/profile-BfQ-nwRV.js +0 -1
  237. package/dist/client/assets/project-app-view-B-fBz6xo.js +0 -1
  238. package/dist/client/assets/record-editor-Bu9CNLzK.js +0 -1
  239. package/dist/client/assets/registry-DEBhPfPr.js +0 -2
  240. package/dist/client/assets/roles-BYfXD5x1.js +0 -1
  241. package/dist/client/assets/save-referenced-block-yb-G98jf.js +0 -1
  242. package/dist/client/assets/save-status-Bsha5t5q.js +0 -1
  243. package/dist/client/assets/secrets-ByyoykgA.js +0 -1
  244. package/dist/client/assets/select-C_iDf6oN.js +0 -1
  245. package/dist/client/assets/seo-editor-Cw0s2Jen.js +0 -1
  246. package/dist/client/assets/sso-_zVzfqX4.js +0 -1
  247. package/dist/client/assets/store-registry-eaRlD2cI.js +0 -2
  248. package/dist/client/assets/use-deco-credits-C-w7pZL9.js +0 -1
  249. package/dist/client/assets/useInfiniteQuery-D5rCytza.js +0 -1
  250. package/dist/client/assets/useSuspenseInfiniteQuery-p_uY5FHN.js +0 -1
  251. package/dist/client/assets/variant-calendar-BlDoEgmA.js +0 -1
@@ -1 +0,0 @@
1
- import{c as N,j as s,q as ls,r as z,l as Q,i as Bs,p as te,s as pe,a as Ie,v as Us,K as as,k as cs,b as Ge,e as qs,u as Jn,w as Zn,R as er,D as tr,x as sr,y as nr,z as rr,C as or,d as ir,B as ft,E as lr,F as ar,t as Oe,G as cr,H as dr,m as ur,I as mr,n as fr,J as pr,M as xr,P as hr,Q as Pe,T as Ws,U as gr,V as Ks,W as br,X as jr,Y as vr,Z as yr,_ as Sr,$ as _r,a0 as Nr,a1 as Cr,a2 as Vs,O as wr}from"./index-BwwMI_z3.js";import{u as Ve,S as he,a as Te,b as Lt,c as Ht,d as De,e as Ys,f as Xs,g as kr,h as Ir,i as ts,j as Tr,k as $r,l as Ar}from"./sidebar-DXPYC1Hg.js";import{u as ds,T as Me,a as Re,b as Ee,c as vs}from"./tooltip-CyNlJ2D3.js";import{u as zr,S as ys,M as Or}from"./shell-controls-B_MLdfQN.js";import{i as Pr,a as Dr,b as Mr}from"./ZoomOut-DvgFp2BT.js";import{T as ge,a as ce}from"./toolbar-BJeFrmdV.js";import{S as we}from"./skeleton-onJaQqBb.js";import{P as Bt,a as pt,b as Ut}from"./popover-C48maDID.js";import{D as Qs,a as Js,b as Zs}from"./drawer-C1zwk63J.js";import{i as en}from"./SearchMd-CUFv_rgs.js";import{s as Rr}from"./Star01-ewA9GGVc.js";import{s as ke}from"./Plus-BqBWPPKf.js";import{i as Er,a as Fr}from"./use-mcp-client-DvAPKq6Y.js";import{u as tn,a as vt,b as Gr}from"./use-virtual-mcp-CoIXtDgU.js";import{u as Lr}from"./use-create-virtual-mcp-CL5yn8nP.js";import{I as Hr,u as Br,W as Ur,H as qr,S as Wr}from"./import-from-deco-dialog-BJTdqbDe.js";import{A as Fe,a as Ss,i as _s,b as sn,c as Kr,d as Vr,e as Yr,f as Xr}from"./agent-icon-DBLutUdr.js";import{G as Qr,a as Jr}from"./github-repo-picker-Bkke5mPs.js";import{u as nn,a as Zr,b as rn,T as eo}from"./hooks-DuQsd6Bm.js";import{r as to,u as so,R as no,a as ro,b as on}from"./shell-layout-BT2b3cNK.js";import{u as oo,g as ln,a as io,b as lo,s as ao,c as co,r as uo,d as mo,e as fo,f as po,p as xo,T as an,h as ho,i as go,j as bo,k as jo,l as vo,m as yo,n as So,o as _o,q as No,S as Ns,t as cn}from"./use-navigate-to-agent--cfMzNid.js";import{g as Co,u as dn,A as un,a as wo,b as ko}from"./use-deco-credits-C-w7pZL9.js";import{i as Io}from"./LayoutLeft-DqymKk5q.js";import{i as mn}from"./Monitor01-pVUVKdPN.js";import{u as To,v as $o,C as Ao}from"./connect-desktop-dialog-DJmqWrPH.js";import{A as ss}from"./avatar-CSuVLmod.js";import{i as us}from"./Check-BLeNHxJZ.js";import{a as Cs}from"./Eye-BxG-oJAF.js";import{n as zo,i as Oo}from"./Globe01-C0lWcJBb.js";import{i as Po,a as fn}from"./ZapSquare-BUu_lfxg.js";import{n as Do,a as Mo}from"./Sun-YkcktInM.js";import{a as yt,i as Ro,b as Eo}from"./Settings02-BFRtrqB4.js";import{i as Fo}from"./Shield01-Bd_FXtHh.js";import{a as Go}from"./Users03-Bnzjqkr7.js";import{s as ms}from"./XClose-thceHO6y.js";import{A as Lo,a as Ho,b as Bo,c as Uo,d as qo,e as Wo,f as Ko}from"./alert-dialog-BaufekhR.js";import{F as Vo,a as Yo,b as Xo,c as Qo,d as Jo,e as Zo,f as ei}from"./form-BiL7tBo8.js";import{I as ti}from"./input-9-kTRwAW.js";import{S as si,C as ni}from"./chat-context-CBpDhIU2.js";import"./index-CNc7ZujZ.js";import{n as fs}from"./Stars02-DYAjCaf7.js";import{u as ri,a as oi}from"./use-join-requests-CSb3cFHt.js";import{i as ps}from"./ChevronRight-B6XUFwET.js";import{i as ii}from"./FilterLines-C43ER7Pr.js";import{t as li}from"./Users01-CcfwVwMB.js";import{S as ws,a as pn,b as ks,c as Is,d as Ts}from"./select-C_iDf6oN.js";import{D as ai,a as ci,b as di,c as ui,d as mi}from"./dialog-CLq1SghM.js";import{C as fi,a as pi,b as xi,c as hi,d as gi}from"./command-FVnvTkmT.js";import{u as xn}from"./studio-tools-B8VUUU-T.js";import{i as hn}from"./Zap-BiorjSWt.js";import{u as bi}from"./use-org-auth-client-POkuFZw3.js";import{C as Ot,a as $s,b as gn,c as bn,d as jn}from"./context-menu-LUxIfqx1.js";import{g as ji,S as vi}from"./task-status-UVFK-kXi.js";import{u as yi,f as Si}from"./use-clock-tick-BwGvIB24.js";import{u as _i,a as As,K as Ni,P as Ci,s as wi,S as ki,v as Ii,D as Ti,c as $i,b as Ai,C as zi}from"./sortable.esm-CaciG6GE.js";import{t as vn}from"./ChevronDown-0fINXUkk.js";import{S as Oi}from"./shell-route-loading-BS9UjtiE.js";import"./sheet-augXQ0K7.js";import"./X-Bmi_qRN4.js";import"./ChevronLeft-DOYNMC-e.js";import"./auth-BXPdjuWF.js";import"./use-collections-yr9dnEMw.js";import"./use-connection-DTZL15F4.js";import"./collection-search-ZnbN2Oka.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./XCircle-DPmDQ715.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./CheckCircle-JqmGicRO.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LinkExternal01-BC9HiQgY.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Stars01-KZUmRNKW.js";import"./Trash01-CDCJsikI.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./checkbox-wpAqS3ku.js";import"./mcp-oauth-d5uIP20j.js";import"./use-mcp-tools-BvNLlDVP.js";import"./extract-connection-data-Dg9BZZhS.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-WiM3pjQr.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-C6tDwGjc.js";import"./use-org-sso-D0AtHZwW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DuX9wPmQ.js";import"./use-registry-connections-DSa_I7y4.js";import"./useInfiniteQuery-D5rCytza.js";import"./use-infinite-scroll-CuBVIy0d.js";import"./card-Dlbea5c8.js";import"./integration-icon-EI90wRK8.js";import"./collection-tabs-CI7K_OKd.js";import"./badge-BS7vcv5t.js";import"./textarea-CWkbF3jO.js";import"./connection-form-helpers-BAad4_Oz.js";import"./useSuspenseInfiniteQuery-p_uY5FHN.js";import"./use-ai-providers-BYdj6_Kv.js";import"./label-DQDXb8Iy.js";import"./use-capability-BC9VFiK3.js";import"./index-Dxv0Qdk7.js";import"./differenceInSeconds-NQ4PDo0z.js";function Pi(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Ve();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const xs=240,Di=400,Mi="sidebar.width";function jt(t){return Math.max(xs,Math.min(Di,t))}function Ri(){const t=N.c(11),[e,n]=ls(Mi,Ei),r=z.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=jt(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const x=b=>{const j=jt(f+(b.clientX-m));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=jt(f+(b.clientX-m));n(j);for(const y of p)y.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(xs)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=jt(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function Ei(t){return typeof t=="number"?jt(t):xs}function Fi(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=Q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Bs,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(en,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==x?(g=s.jsxs("label",{className:f,children:[h,x]}),e[14]=f,e[15]=h,e[16]=x,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const Gi="Select an existing agent";function Li(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Me,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Re,{side:"right",sideOffset:8,children:Gi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ee,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function Hi(){const t=N.c(5),{enableDecoImport:e}=Us(),{data:n}=Ie.useSession();let r;t[0]!==n?.user?.email?(r=as.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:Bi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=cs(i);return l?.isDecoUser??!1}async function Bi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Ui(t){const e=Ge(),{create:n}=nn(),{locator:r}=pe(),o=qs({strict:!1}),i=Jn({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?to(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function qi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Fe,{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]=o):o=e[2];let i;e[3]!==n.title?(i=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]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function Wi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=z.useState(""),a=tn(),c=a??[],{org:d}=pe(),{data:u}=Ie.useSession(),m=u?.user?.id??"anon",f=ln(a),h=io();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={navigateOnCreate:!0},e[0]=p):p=e[0];const{createVirtualMCP:x,isCreating:g}=Lr(p),{createFromTemplate:b,isCreating:j}=Br(),y=Hi(),v=Ui(d.slug),_=Co(a),w=i.toLowerCase(),S=c.filter(Ki).filter(Z=>!_.has(Z.id)).filter(Z=>!i||Z.title.toLowerCase().includes(w)),I=Z=>{lo({orgId:d.id,userId:m},Z.id,f),h(),n(),l(""),v(Z.id)},T="flex flex-col max-h-[min(640px,80dvh)]";let $;e[1]!==i?($=s.jsx(Fi,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=$):$=e[2];const O="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=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[3]=A):A=e[3];const C="grid grid-cols-3 gap-1";let M;e[4]!==x||e[5]!==n?(M=async()=>{te("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=M):M=e[6];let K,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(K=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(ke,{size:16,className:"text-muted-foreground"})}),U=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=K,e[8]=U):(K=e[7],U=e[8]);let E;e[9]!==g||e[10]!==M?(E=s.jsxs("button",{type:"button",disabled:g,onClick:M,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:[K,U]}),e[9]=g,e[10]=M,e[11]=E):E=e[11];let L;e[12]!==b||e[13]!==n?(L=async()=>{te("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(Ur),n()},e[12]=b,e[13]=n,e[14]=L):L=e[14];let R,H;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=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(Rr,{className:"size-5 text-muted-foreground"})}),H=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=R,e[16]=H):(R=e[15],H=e[16]);let P;e[17]!==j||e[18]!==L?(P=s.jsxs("button",{type:"button",disabled:j,onClick:L,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:[R,H]}),e[17]=j,e[18]=L,e[19]=P):P=e[19];let G;e[20]!==b||e[21]!==n?(G=async()=>{te("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await b(qr),n()},e[20]=b,e[21]=n,e[22]=G):G=e[22];let D,B;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=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("img",{src:Wr,alt:"",className:"size-5 object-contain"})}),B=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=D,e[24]=B):(D=e[23],B=e[24]);let F;e[25]!==j||e[26]!==G?(F=s.jsxs("button",{type:"button",disabled:j,onClick:G,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:[D,B]}),e[25]=j,e[26]=G,e[27]=F):F=e[27];let Y;e[28]!==n||e[29]!==o?(Y=()=>{te("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=Y):Y=e[30];let ee,V;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=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(Jr,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=ee,e[32]=V):(ee=e[31],V=e[32]);let J;e[33]!==Y?(J=s.jsxs("button",{type:"button",onClick:Y,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[ee,V]}),e[33]=Y,e[34]=J):J=e[34];let X;e[35]!==y||e[36]!==n||e[37]!==r?(X=y&&s.jsxs("button",{type:"button",onClick:()=>{te("agent_import_clicked",{source:"deco"}),r(),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("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=y,e[36]=n,e[37]=r,e[38]=X):X=e[38];const W=S.map(Z=>s.jsx(qi,{agent:Z,onClick:()=>I(Z)},Z.id));let re;e[39]!==E||e[40]!==P||e[41]!==F||e[42]!==J||e[43]!==X||e[44]!==W?(re=s.jsxs("div",{className:C,children:[E,P,F,J,X,W]}),e[39]=E,e[40]=P,e[41]=F,e[42]=J,e[43]=X,e[44]=W,e[45]=re):re=e[45];let ie;e[46]!==g||e[47]!==i||e[48]!==S.length?(ie=S.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=g,e[47]=i,e[48]=S.length,e[49]=ie):ie=e[49];let ue;e[50]!==re||e[51]!==ie||e[52]!==A?(ue=s.jsxs("div",{className:O,children:[A,re,ie]}),e[50]=re,e[51]=ie,e[52]=A,e[53]=ue):ue=e[53];let ne;e[54]!==d.slug?(ne={org:d.slug},e[54]=d.slug,e[55]=ne):ne=e[55];let oe;e[56]!==n?(oe=()=>n(),e[56]=n,e[57]=oe):oe=e[57];let le;e[58]!==ne||e[59]!==oe?(le=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Zn,{to:"/$org/settings/agents",params:ne,onClick:oe,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ne,e[59]=oe,e[60]=le):le=e[60];let xe;return e[61]!==ue||e[62]!==$||e[63]!==le?(xe=s.jsxs("div",{className:T,children:[$,ue,le]}),e[61]=ue,e[62]=$,e[63]=le,e[64]=xe):xe=e[64],xe}function Ki(t){return!Er(t.id)}function yn(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=z.useState(!1),[a,c]=z.useState(!1),[d,u]=z.useState(!1),m=ds(),{setOpenMobile:f}=Ve(),h=oo(),p=h?"border border-border":void 0;let x;e[2]!==h?(x=T=>h?s.jsx(Li,{children:T}):T,e[2]=h,e[3]=x):x=e[3];const g=x;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(we,{className:"h-4 w-24"})}),children:s.jsx(Wi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const v=y;let _;e[10]!==o||e[11]!==p||e[12]!==h||e[13]!==m||e[14]!==i||e[15]!==v||e[16]!==g?(_=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),onClick:()=>{te("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(ke,{className:"size-4"})})):s.jsx(he,{children:g(s.jsxs(Te,{tooltip:h?void 0:"Browse agents",className:Q(p),onClick:()=>{te("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(ke,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Qs,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(Js,{className:"max-h-[85dvh] p-0",children:[s.jsx(Zs,{className:"sr-only",children:"Browse agents"}),v]})})]}):s.jsxs(Bt,{open:i,onOpenChange:T=>{T&&!i&&te("agent_browser_opened",{surface:"desktop_popover"}),l(T)},children:[o?g(s.jsx(pt,{asChild:!0,children:s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),children:s.jsx(ke,{className:"size-4"})})})):s.jsx(he,{children:g(s.jsx(pt,{asChild:!0,children:s.jsxs(Te,{tooltip:h?void 0:"Browse agents",className:Q(p),children:[s.jsx(ke,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ut,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:v})]}),e[10]=o,e[11]=p,e[12]=h,e[13]=m,e[14]=i,e[15]=v,e[16]=g,e[17]=_):_=e[17];let w;e[18]!==a?(w=s.jsx(Hr,{open:a,onOpenChange:c}),e[18]=a,e[19]=w):w=e[19];let S;e[20]!==d?(S=s.jsx(Qr,{open:d,onOpenChange:u}),e[20]=d,e[21]=S):S=e[21];let I;return e[22]!==_||e[23]!==w||e[24]!==S?(I=s.jsxs(s.Fragment,{children:[_,w,S]}),e[22]=_,e[23]=w,e[24]=S,e[25]=I):I=e[25],I}function Sn(){const t=N.c(24),{org:e}=pe(),n=Ge(),o=zr().location.pathname,i=e.slug,{state:l,isMobile:a}=Ve(),c=!a&&l==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Pr,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const h=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Dr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let g;t[11]!==n||t[12]!==i?(g=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=g):g=t[13];let b;t[14]!==x||t[15]!==g?(b={key:"files",label:"Library",icon:p,isActive:x,onClick:g},t[14]=x,t[15]=g,t[16]=b):b=t[16];const j=b;let y;t[17]!==j||t[18]!==h?(y={type:"items",items:[h,j]},t[17]=j,t[18]=h,t[19]=y):y=t[19];let v;if(t[20]!==c||t[21]!==y){if(v=[y],c){let _;t[23]===Symbol.for("react.memo_cache_sentinel")?(_={type:"custom",key:"new-task",content:s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(De,{className:"gap-1.5",children:s.jsx(yn,{})})})})},t[23]=_):_=t[23],v.push(_)}t[20]=c,t[21]=y,t[22]=v}else v=t[22];return v}function Rt(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(d=s.jsx(er,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function _n(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=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]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(Lt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Ht,{children:s.jsx(De,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Nn(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Ve();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{te("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=Q(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(Te,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(he,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Vi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ys,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Xi),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(_n,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(Yi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(De,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Yi(t){return s.jsx(Nn,{item:t},t.key)}function Xi(t){return s.jsx(Nn,{item:t},t.key)}function Qi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=Q("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Ji),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(Xs,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(kr,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function Ji(t,e){return s.jsx(Vi,{section:t},e)}function Cn(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Qi,{...t}),e[0]=t,e[1]=n):n=e[1],n}Cn.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(we,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ns(){const t=N.c(22),e=To(),[n,r]=z.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=$o(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:x.length>0?`Available: ${x.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(mn,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Me,{asChild:!0,children:s.jsxs(ge,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(Re,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Ee,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(Ao,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let p;return t[19]!==f||t[20]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=p):p=t[21],p}function Zi(t){const e=N.c(17),{onToggle:n,className:r}=t,i=Us().logo??tr,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=Q("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Io,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ge,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ns,{}),e[12]=p):p=e[12];let x;return e[13]!==c||e[14]!==m||e[15]!==h?(x=s.jsxs(Ir,{className:c,children:[m,h,p]}),e[13]=c,e[14]=m,e[15]=h,e[16]=x):x=e[16],x}function zs(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=Q(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(Te,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(he,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function el(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ys,{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;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(zs,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(_n,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(zs,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(De,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function tl(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(z.Suspense,{fallback:l,children:s.jsx(Zi,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,p)=>s.jsx(el,{section:h,onClose:r},p),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(Xs,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function wn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sl=sr({name:nr().min(2,"Organization name is required")});function nl(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:rr(sl),defaultValues:{name:""}},e[0]=o):o=e[0];const i=or(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:ol,onSuccess:rl},e[1]=l):l=e[1];const a=ir(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(Bo,{children:[s.jsx(Uo,{children:"Create a new organization"}),s.jsx(qo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=I=>a.mutateAsync(I),e[6]=a,e[7]=S):S=e[7],u=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=S=>{const{field:I}=S;return s.jsxs(Xo,{children:[s.jsx(Qo,{children:"Organization Name"}),s.jsx(Jo,{children:s.jsx(ti,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Zo,{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:"","/",wn(I.value)]})]}),s.jsx(ei,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(Vo,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(Lo,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(si,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(ft,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(Wo,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=h,e[33]=v):v=e[33];let _;e[34]!==i||e[35]!==v?(_=s.jsxs(Ho,{children:[d,s.jsx(Yo,{...i,children:v})]}),e[34]=i,e[35]=v,e[36]=_):_=e[36];let w;return e[37]!==r||e[38]!==n||e[39]!==_?(w=s.jsx(Ko,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=w):w=e[40],w}function rl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ol(t){const e=wn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ie.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function rs(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function il(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=Q(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:rs(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:Q("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function Pt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=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 f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,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:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,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:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Os(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=ur();let l;e[0]!==n?(l=(C,M)=>C.slug===n?-1:M.slug===n?1:C.name.localeCompare(M.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=z.useState(!1),[u,m]=z.useState(""),f=u.toLowerCase(),h=f?a.filter(C=>C.name.toLowerCase().includes(f)||C.slug.toLowerCase().includes(f)):a;let p;e[2]!==c?(p=function(){c&&m(""),d(ll)},e[2]=c,e[3]=p):p=e[3];const x=p;let g;e[4]!==u||e[5]!==c||e[6]!==x?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:C=>m(C.target.value),onKeyDown:C=>C.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(ms,{size:16}):s.jsx(en,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ke,{size:16}),e[13]=y):y=e[13];let v;e[14]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=v):v=e[15];let _;e[16]!==j||e[17]!==v?(_=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,v]}),e[16]=j,e[17]=v,e[18]=_):_=e[18];let w;e[19]!==g||e[20]!==_?(w=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,_]}),e[19]=g,e[20]=_,e[21]=w):w=e[21];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let T;e[22]!==r||e[23]!==n?(T=C=>s.jsxs("button",{type:"button",onClick:()=>r(C.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",C.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(il,{org:C,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:C.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.slug})]}),C.slug===n&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},C.id),e[22]=r,e[23]=n,e[24]=T):T=e[24];const $=h.map(T);let O;e[25]!==I||e[26]!==$?(O=s.jsxs("div",{className:S,children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==w?(A=s.jsxs(s.Fragment,{children:[w,O]}),e[28]=O,e[29]=w,e[30]=A):A=e[30],A}function ll(t){return!t}function Ps(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:h,open:p}=t;if(h){const X=n?.name??"U";let W;e[0]!==X||e[1]!==r?(W=s.jsx(ss,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=W):W=e[2];const re=n?.name??"User";let ie;e[3]!==re?(ie=s.jsx("p",{className:"text-sm font-medium truncate",children:re}),e[3]=re,e[4]=ie):ie=e[4];const ue=n?.email;let ne;e[5]!==ue?(ne=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ue}),e[5]=ue,e[6]=ne):ne=e[6];let oe;e[7]!==ie||e[8]!==ne?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[ie,ne]}),e[7]=ie,e[8]=ne,e[9]=oe):oe=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ul)},e[10]=n,e[11]=le):le=e[11];let xe;e[12]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(Cs,{size:14}),e[12]=xe):xe=e[12];let Z;e[13]!==le?(Z=s.jsx(Me,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:xe})}),e[13]=le,e[14]=Z):Z=e[14];let $e;e[15]===Symbol.for("react.memo_cache_sentinel")?($e=s.jsx(Re,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=$e):$e=e[15];let me;e[16]!==Z?(me=s.jsx(vs,{delayDuration:300,children:s.jsxs(Ee,{children:[Z,$e]})}),e[16]=Z,e[17]=me):me=e[17];let be;e[18]!==me||e[19]!==W||e[20]!==oe?(be=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,oe,me]}),e[18]=me,e[19]=W,e[20]=oe,e[21]=be):be=e[21];const je=String(p);let Ae;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==je?(Ae=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(Os,{orgParam:d,onSelectOrg:u,onCreateOrg:m},je)}),e[22]=m,e[23]=u,e[24]=d,e[25]=je,e[26]=Ae):Ae=e[26];let ve;if(e[27]!==f||e[28]!==o){let ae;e[30]!==f?(ae=ze=>s.jsx(Pt,{item:ze,onClose:f},ze.key),e[30]=f,e[31]=ae):ae=e[31],ve=o.map(ae),e[27]=f,e[28]=o,e[29]=ve}else ve=e[29];let Le;e[32]!==f||e[33]!==i?(Le=s.jsx(Pt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Le):Le=e[34];let _e;e[35]!==ve||e[36]!==Le?(_e=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ve,Le]}),e[35]=ve,e[36]=Le,e[37]=_e):_e=e[37];let ye;e[38]!==Ae||e[39]!==_e?(ye=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Ae,_e]}),e[38]=Ae,e[39]=_e,e[40]=ye):ye=e[40];let He;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ae;e[45]!==a.theme||e[46]!==c?(ae=ze=>{const{value:Ce,icon:gt,label:Xe}=ze;return s.jsx("button",{type:"button","aria-label":Xe,onClick:()=>c(bt=>({...bt,theme:Ce})),className:Q("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ce?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:gt},Ce)},e[45]=a.theme,e[46]=c,e[47]=ae):ae=e[47],He=l.map(ae),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=He}else He=e[44];let Be;e[48]!==He?(Be=s.jsx("div",{className:"flex items-center gap-0.5",children:He}),e[48]=He,e[49]=Be):Be=e[49];const xt=a.enableSounds?"Disable sounds":"Enable sounds";let Ue;e[50]!==c?(Ue=()=>c(dl),e[50]=c,e[51]=Ue):Ue=e[51];const Ye=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let de;e[52]!==Ye?(de=Q("size-8 rounded-md flex items-center justify-center transition-colors",Ye),e[52]=Ye,e[53]=de):de=e[53];let qe;e[54]!==a.enableSounds?(qe=a.enableSounds?s.jsx(Ss,{size:14}):s.jsx(_s,{size:14}),e[54]=a.enableSounds,e[55]=qe):qe=e[55];let We;e[56]!==xt||e[57]!==Ue||e[58]!==de||e[59]!==qe?(We=s.jsx("button",{type:"button","aria-label":xt,onClick:Ue,className:de,children:qe}),e[56]=xt,e[57]=Ue,e[58]=de,e[59]=qe,e[60]=We):We=e[60];let ht;e[61]===Symbol.for("react.memo_cache_sentinel")?(ht=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.76.1"]}),e[61]=ht):ht=e[61];let Ke;e[62]!==We?(Ke=s.jsxs("div",{className:"flex items-center gap-2",children:[We,ht]}),e[62]=We,e[63]=Ke):Ke=e[63];let Ne;e[64]!==Be||e[65]!==Ke?(Ne=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Be,Ke]}),e[64]=Be,e[65]=Ke,e[66]=Ne):Ne=e[66];let Se;return e[67]!==be||e[68]!==ye||e[69]!==Ne?(Se=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[be,ye,Ne]}),e[67]=be,e[68]=ye,e[69]=Ne,e[70]=Se):Se=e[70],Se}const x=n?.name??"U";let g;e[71]!==x||e[72]!==r?(g=s.jsx(ss,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const y=n?.email;let v;e[76]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=v):v=e[77];let _;e[78]!==j||e[79]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[78]=j,e[79]=v,e[80]=_):_=e[80];let w;e[81]!==n?(w=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(cl)},e[81]=n,e[82]=w):w=e[82];let S;e[83]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Cs,{size:14}),e[83]=S):S=e[83];let I;e[84]!==w?(I=s.jsx(Me,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:w,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[84]=w,e[85]=I):I=e[85];let T;e[86]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Re,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=T):T=e[86];let $;e[87]!==I?($=s.jsx(vs,{delayDuration:300,children:s.jsxs(Ee,{children:[I,T]})}),e[87]=I,e[88]=$):$=e[88];let O;e[89]!==$||e[90]!==g||e[91]!==_?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,_,$]}),e[89]=$,e[90]=g,e[91]=_,e[92]=O):O=e[92];let A;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=W=>s.jsx(Pt,{item:W,onClose:f},W.key),e[96]=f,e[97]=X):X=e[97],A=o.map(X),e[93]=f,e[94]=o,e[95]=A}else A=e[95];let C;e[98]!==f||e[99]!==i?(C=s.jsx(Pt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=C):C=e[100];let M;e[101]!==A||e[102]!==C?(M=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[A,C]}),e[101]=A,e[102]=C,e[103]=M):M=e[103];let K;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=W=>{const{value:re,icon:ie,label:ue}=W;return s.jsx("button",{type:"button","aria-label":ue,onClick:()=>c(ne=>({...ne,theme:re})),className:Q("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===re?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ie},re)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],K=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=K}else K=e[107];let U;e[111]!==K?(U=s.jsx("div",{className:"flex items-center gap-0.5",children:K}),e[111]=K,e[112]=U):U=e[112];const E=a.enableSounds?"Disable sounds":"Enable sounds";let L;e[113]!==c?(L=()=>c(al),e[113]=c,e[114]=L):L=e[114];const R=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let H;e[115]!==R?(H=Q("size-7 rounded-md flex items-center justify-center transition-colors",R),e[115]=R,e[116]=H):H=e[116];let P;e[117]!==a.enableSounds?(P=a.enableSounds?s.jsx(Ss,{size:14}):s.jsx(_s,{size:14}),e[117]=a.enableSounds,e[118]=P):P=e[118];let G;e[119]!==E||e[120]!==L||e[121]!==H||e[122]!==P?(G=s.jsx("button",{type:"button","aria-label":E,onClick:L,className:H,children:P}),e[119]=E,e[120]=L,e[121]=H,e[122]=P,e[123]=G):G=e[123];let D;e[124]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.76.1"]}),e[124]=D):D=e[124];let B;e[125]!==G?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[G,D]}),e[125]=G,e[126]=B):B=e[126];let F;e[127]!==U||e[128]!==B?(F=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[U,B]}),e[127]=U,e[128]=B,e[129]=F):F=e[129];let Y;e[130]!==O||e[131]!==M||e[132]!==F?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,M,F]}),e[130]=O,e[131]=M,e[132]=F,e[133]=Y):Y=e[133];const ee=String(p);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==ee?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(Os,{orgParam:d,onSelectOrg:u,onCreateOrg:m},ee)}),e[134]=m,e[135]=u,e[136]=d,e[137]=ee,e[138]=V):V=e[138];let J;return e[139]!==Y||e[140]!==V?(J=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,V]}),e[139]=Y,e[140]=V,e[141]=J):J=e[141],J}function al(t){return{...t,enableSounds:!t.enableSounds}}function cl(){Oe.success("User ID copied")}function dl(t){return{...t,enableSounds:!t.enableSounds}}function ul(){Oe.success("User ID copied")}function os(){const t=N.c(44),{data:e}=Ie.useSession(),{org:n}=pe(),r=Ge();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=lr(o)?.params.org,[a,c]=ar(),d=ds(),[u,m]=z.useState(!1),[f,h]=z.useState(!1),p=e?.user,x=p?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(yt,{size:16}),t[4]=v):v=t[4];let _;t[5]!==r||t[6]!==l?(_={key:"preferences",label:"Preferences",icon:v,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=_):_=t[7];let w;t[8]!==n||t[9]!==r?(w=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(zo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=w):w=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Mr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=S):S=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(Fo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={key:"github",label:"decocms/studio",icon:s.jsx(cr,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=T):T=t[13];let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={key:"community",label:"Community",icon:s.jsx(Go,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=$):$=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(Oo,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let A;t[16]!==_||t[17]!==w?(A=[_,...w,S,I,T,$,O],t[16]=_,t[17]=w,t[18]=A):A=t[18];const C=A;let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M={key:"logout",label:"Sign out",icon:s.jsx(Po,{size:16}),onClick:fl},t[19]=M):M=t[19];const K=M;let U;t[20]===Symbol.for("react.memo_cache_sentinel")?(U={value:"light",icon:s.jsx(Do,{size:14}),label:"Light theme"},t[20]=U):U=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(Mo,{size:14}),label:"Dark theme"},t[21]=E):E=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=[U,E,{value:"system",icon:s.jsx(mn,{size:14}),label:"System theme"}],t[22]=L):L=t[22];const R=L;let H;t[23]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{m(!1),h(!0)},t[23]=H):H=t[23];let P;t[24]!==b||t[25]!==d||t[26]!==C||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==p||t[32]!==x?(P={user:p,userImage:x,menuItems:C,signOutItem:K,themeOptions:R,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:H,close:y,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=C,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=p,t[32]=x,t[33]=P):P=t[33];const G=P;let D;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==G?(D=d?s.jsxs(Qs,{open:u,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:n?.logo?void 0:rs(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(Js,{className:"h-[80dvh] p-0",children:[s.jsx(Zs,{className:"sr-only",children:"Account"}),s.jsx(Ps,{...G})]})]}):s.jsxs(Bt,{open:u,onOpenChange:m,children:[s.jsx(pt,{asChild:!0,children:s.jsxs(Te,{tooltip:n?.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:n?.logo?void 0:rs(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Ut,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:ml,children:s.jsx(Ps,{...G})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=G,t[38]=D):D=t[38];let B;t[39]!==f?(B=s.jsx(nl,{open:f,onOpenChange:h}),t[39]=f,t[40]=B):B=t[40];let F;return t[41]!==D||t[42]!==B?(F=s.jsxs(s.Fragment,{children:[D,B]}),t[41]=D,t[42]=B,t[43]=F):F=t[43],F}function ml(t){return t.preventDefault()}function fl(){te("signed_out",{source:"account_popover"}),dr(),Ie.signOut()}function pl({invitation:t}){const[e,n]=z.useState(!1),[r,o]=z.useState(!1),i=mr(),l=async()=>{n(!0);try{const d=await Ie.organization.acceptInvitation({invitationId:t.id});if(d.error){Oe.error(d.error.message),n(!1);return}}catch{Oe.error("Failed to accept invitation"),n(!1);return}Oe.success("Invitation accepted!"),fr();let c;try{c=(await Ie.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Ie.organization.rejectInvitation({invitationId:t.id});c.error?(Oe.error(c.error.message),o(!1)):(Oe.success("Invitation declined"),i.invalidateQueries())}catch{Oe.error("Failed to decline invitation"),o(!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(ft,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(us,{size:14})}),s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(ms,{size:14})})]})]})}function xl(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=ri(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(ss,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(us,{size:14}),e[11]=h):h=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:h}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==o||e[16]!==n.id?(x=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ms,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==x?(b=s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=x,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let y;return e[25]!==j||e[26]!==d||e[27]!==m?(y=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:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=y):y=e[28],y}function hl(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ps,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function gl(){const t=z.useContext(pr),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function kn(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=so(),o=gl(),i=oi();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Sl).map(yl),u=[...o].sort(vl).map(jl);let m;t[4]!==e?(m=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...no].sort(bl).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function bl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function jl(t){return{type:"invitation",invitation:t}}function vl(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function yl(t){return{type:"join-request",request:t}}function Sl(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class In extends z.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 Tn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function _l(){const t=N.c(17),e=Ge(),{org:n}=pe(),{hasDecoKey:r,balanceDollars:o}=dn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=Q(o!=null&&Tn(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(sn,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(De,{children:s.jsx(he,{children:s.jsxs(Te,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function Nl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(In,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(_l,{})})}),t[0]=e):e=t[0],e}function Cl(){const t=N.c(17),e=Ge(),{org:n}=pe(),{hasDecoKey:r,balanceDollars:o}=dn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=Q(o!=null&&Tn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(sn,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Me,{asChild:!0,children:s.jsx(ge,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(Re,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ee,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function wl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(In,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(Cl,{})})}),t[0]=e):e=t[0],e}function $n(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=kn(),[i,l]=z.useState(null);let a;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{l(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||l(null)},e[7]=f):f=e[7];let h;e[8]!==m||e[9]!==r||e[10]!==d?(h=s.jsx(Ut,{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:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ft,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Ro,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(ro,{release:d})})]}):s.jsxs(s.Fragment,{children:[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"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(fs,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="join-request"?s.jsx(xl,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(pl,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(hl,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Bt,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function An(){const{redDotCount:t}=kn();return t>0}function kl(){const t=N.c(6),e=An();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(fs,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx($n,{children:s.jsx(pt,{asChild:!0,children:s.jsxs(Te,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Il(){const t=N.c(8),e=An();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(fs,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(pt,{asChild:!0,children:s.jsx(Me,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Re,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx($n,{children:s.jsxs(Ee,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Tl(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Te,{tooltip:"Connections",onClick:()=>{te("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(fn,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(un,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function $l(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ee,{delayDuration:300,children:[s.jsx(Me,{asChild:!0,children:s.jsx(ge,{"aria-label":"Connections",onClick:()=>{te("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(fn,{className:"size-4"})})}),s.jsx(Re,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(un,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Al(){const t=N.c(7),e=Ge(),{org:n}=pe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(yt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(Te,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function zl(){const t=N.c(9),e=Ge(),{org:n}=pe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(yt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Me,{asChild:!0,children:s.jsx(ge,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Re,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Ee,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Ol(){const t=N.c(6),{state:e}=Ve();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Nl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Tl,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(kl,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Al,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ts,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(De,{children:[i,l,a,s.jsx(he,{children:s.jsx(os,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ts,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(De,{children:s.jsx(he,{children:s.jsx(os,{})})})}),s.jsx(zl,{}),s.jsx(Il,{}),s.jsx($l,{}),s.jsx(wl,{})]})}),t[5]=r):r=t[5],r}function Pl(){const t=N.c(8),e=Ge(),{org:n}=pe(),{setOpenMobile:r}=Ve();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(De,{children:s.jsx(he,{children:s.jsx(os,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(yt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(ts,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ge,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function Dl(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(Ml,{virtualMcpId:n,size:i}):s.jsx(Fe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&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(hn,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function Ml(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=vt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Fe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Fe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function Rl(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=z.useState(""),{org:l}=pe(),{setTaskId:a}=on(),c=xn();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=cs,d=as.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let h;e[5]!==c||e[6]!==m?(h=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=h):h=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==h?(p={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=p):p=e[11];const{data:x,isFetching:g}=u(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==r?(y=C=>{C||i(""),r(C)},e[14]=r,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=C=>{v(!1),a(C.id,C.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const w=_;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(ai,{className:"sr-only",children:[s.jsx(ci,{children:"Search"}),s.jsx(di,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let I;e[20]!==o?(I=s.jsx(xi,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let T;e[22]!==w||e[23]!==g||e[24]!==j||e[25]!==m?(T=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(fi,{children:"No results."}):j.map(C=>C.type==="thread"?s.jsxs(pi,{value:`thread:${C.id}:${C.title}`,onSelect:()=>w(C),className:"gap-2.5",children:[s.jsx(Dl,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=w,e[23]=g,e[24]=j,e[25]=m,e[26]=T):T=e[26];let $;e[27]!==T?($=s.jsx(hi,{children:T}),e[27]=T,e[28]=$):$=e[28];let O;e[29]!==I||e[30]!==$?(O=s.jsxs(ui,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(gi,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,$]})]}),e[29]=I,e[30]=$,e[31]=O):O=e[31];let A;return e[32]!==v||e[33]!==n||e[34]!==O?(A=s.jsx(mi,{open:n,onOpenChange:v,children:O}),e[32]=v,e[33]=n,e[34]=O,e[35]=A):A=e[35],A}function El(t){return t==="owner"||t==="admin"}function Fl(){const t=N.c(11),{locator:e}=pe(),n=bi(),{data:r}=Ie.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=as.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=cs(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(h=>h.userId===o)?.role;u=El(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Zt,qt="HoverCard",[zn]=gr(qt,[Ws]),Wt=Ws(),[Gl,Kt]=zn(qt),On=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=Wt(e),d=z.useRef(0),u=z.useRef(0),m=z.useRef(!1),f=z.useRef(!1),[h,p]=_r({prop:r,defaultProp:o??!1,onChange:i,caller:qt}),x=z.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=z.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),a))},[a,p]),b=z.useCallback(()=>p(!1),[p]);return z.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(Gl,{scope:e,open:h,onOpenChange:p,onOpen:x,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(Nr,{...c,children:n})})};On.displayName=qt;var Pn="HoverCardTrigger",Dn=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Kt(Pn,n),i=Wt(n);return s.jsx(xr,{asChild:!0,...i,children:s.jsx(hr.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:Pe(t.onPointerEnter,Ft(o.onOpen)),onPointerLeave:Pe(t.onPointerLeave,Ft(o.onClose)),onFocus:Pe(t.onFocus,o.onOpen),onBlur:Pe(t.onBlur,o.onClose),onTouchStart:Pe(t.onTouchStart,l=>l.preventDefault())})})});Dn.displayName=Pn;var hs="HoverCardPortal",[Ll,Hl]=zn(hs,{forceMount:void 0}),Mn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=Kt(hs,e);return s.jsx(Ll,{scope:e,forceMount:n,children:s.jsx(Ks,{present:n||i.open,children:s.jsx(Sr,{asChild:!0,container:o,children:r})})})};Mn.displayName=hs;var Et="HoverCardContent",Rn=z.forwardRef((t,e)=>{const n=Hl(Et,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=Kt(Et,t.__scopeHoverCard);return s.jsx(Ks,{present:r||i.open,children:s.jsx(Bl,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Pe(t.onPointerEnter,Ft(i.onOpen)),onPointerLeave:Pe(t.onPointerLeave,Ft(i.onClose)),ref:e})})});Rn.displayName=Et;var Bl=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=Kt(Et,n),d=Wt(n),u=z.useRef(null),m=br(e,u),[f,h]=z.useState(!1);return z.useEffect(()=>{if(f){const p=document.body;return Zt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Zt,p.style.webkitUserSelect=Zt}}},[f]),z.useEffect(()=>{if(u.current){const p=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),z.useEffect(()=>{u.current&&Wl(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),s.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Pe(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(vr,{...d,...a,onPointerDown:Pe(a.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Ul="HoverCardArrow",ql=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Wt(n);return s.jsx(yr,{...o,...r,ref:e})});ql.displayName=Ul;function Ft(t){return e=>e.pointerType==="touch"?void 0:t()}function Wl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Kl=On,Vl=Dn,Yl=Mn,Xl=Rn;function Ql(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Kl,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function Jl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Vl,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Zl(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=Q("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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(Yl,{"data-slot":"hover-card-portal",children:s.jsx(Xl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function En(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ke,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(Ot,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(yt,{size:14,className:"mr-2"}),e[9]=h):h=e[9];let p;e[10]!==f?(p=s.jsxs(Ot,{onSelect:f,children:[h,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx($s,{}),s.jsxs(Ot,{onSelect:()=>a(n,!r),children:[s.jsx(Kr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx($s,{}),s.jsxs(Ot,{onSelect:()=>c(n),children:[s.jsx(Eo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,p,x,g]}),e[21]=m,e[22]=p,e[23]=x,e[24]=g,e[25]=b):b=e[25],b}function ea(t){return t==="ephemeral"||t.startsWith("thread:")}function Vt(t){const e=N.c(46),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c,indented:d}=t,u=ji(n.status),m=u.icon,f=n.metadata?.kind==="tool_call_run",h=vt(f?void 0:n.virtual_mcp_id);let p;e[0]!==h?(p=wo(h),e[0]=h,e[1]=p):p=e[1];const x=p;yi(6e4);const g=l||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==o?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const _=d?"-ml-4 pl-6":"pl-2",w=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_||e[5]!==w?(S=Q("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",_,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",w),e[4]=_,e[5]=w,e[6]=S):S=e[6];let I;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(I=a&&!f&&s.jsx(Fe,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=I):I=e[11];let T;e[12]!==g?(T=g&&s.jsx(hn,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=g,e[13]=T):T=e[13];const $=n.title||"Untitled task";let O;e[14]!==$?(O=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[14]=$,e[15]=O):O=e[15];let A;e[16]!==T||e[17]!==O?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[T,O]}),e[16]=T,e[17]=O,e[18]=A):A=e[18];let C;e[19]!==x||e[20]!==r||e[21]!==n.branch||e[22]!==n.updated_at?(C=n.updated_at&&s.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!ea(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Si(new Date(n.updated_at))})]}),e[19]=x,e[20]=r,e[21]=n.branch,e[22]=n.updated_at,e[23]=C):C=e[23];let M;e[24]!==A||e[25]!==C?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,C]}),e[24]=A,e[25]=C,e[26]=M):M=e[26];const K="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(m,{size:14,className:Q(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let E;e[27]!==i?(E=B=>{B.stopPropagation(),i()},e[27]=i,e[28]=E):E=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Cr,{size:14}),e[29]=L):L=e[29];let R;e[30]!==E?(R=s.jsx(Me,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:E,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:L})}),e[30]=E,e[31]=R):R=e[31];let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Re,{side:"right",children:"Archive"}),e[32]=H):H=e[32];let P;e[33]!==R?(P=s.jsxs(Ee,{children:[R,H]}),e[33]=R,e[34]=P):P=e[34];let G;e[35]!==U||e[36]!==P?(G=s.jsxs("div",{className:K,children:[U,P]}),e[35]=U,e[36]=P,e[37]=G):G=e[37];let D;return e[38]!==o||e[39]!==M||e[40]!==G||e[41]!==v||e[42]!==S||e[43]!==I||e[44]!==n.id?(D=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:o,onKeyDown:v,className:S,children:[I,M,G]}),e[38]=o,e[39]=M,e[40]=G,e[41]=v,e[42]=S,e[43]=I,e[44]=n.id,e[45]=D):D=e[45],D}function gs(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(Bs,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function ta(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function sa(t){return t.member==="mine"&&!t.currentUserId}const Fn=4;let Mt=0;const is=[];function na(){for(;Mt<Fn&&is.length>0;){const t=is.shift();t&&t()}}function Gn(t){return new Promise((e,n)=>{const r=()=>{Mt++,t().then(e,n).finally(()=>{Mt--,na()})};Mt<Fn?r():is.push(r)})}const Yt=10;function Ds(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function ra(t,e,n,r){let o=0;for(const i of t)bs(i,e,n,r)&&o++;return o}function es(t,e,n,r){return ra(t,e,n,r)}function oa(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&bs(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function ia(t,e){return!!(t>=Yt||t===0&&e)}function Ms(t,e){return t<e}function la(t,e){return e===!1?!1:e===!0?!0:t}function bs(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Gt=new Map,Dt=new Map;function aa(t,e){return e?t>=Yt?!0:null:!1}function Rs(t){return Gt.get(t)}function ca(t,e){Gt.set(t,e)}function da(t,e,n){const r=Gt.get(t);if(r!==void 0){n(r);return}let o=Dt.get(t);o||(o=Gn(e).then(i=>(Gt.set(t,i),Dt.delete(t),i)).catch(()=>(Dt.delete(t),Promise.reject(new Error("group probe failed")))),Dt.set(t,o)),o.then(n,()=>n(!1))}function Es(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Yt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ua(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||bs(l,n,r,o)&&i++;return i}function js(t,e,n,r){const o=N.c(8),{org:i}=pe(),l=ta(i.id,t,e,n);let a;o[0]!==n?(a=sa(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=Zr(),{threads:f,hasMore:h}=rn(),p=r??es(f,t,e,n),x=ia(p,h),g=aa(p,h),b=xn();if(d.identity===l&&d.serverHasMore===null){const S=g??Rs(l);S!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:S})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&Rs(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(S=>S.identity===l?{...S,isProbing:!0,probeSubscribedIdentity:l}:S),da(l,async()=>{const S=Ds(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:T}=Es(I),$=es(m.threads.get(),t,e,n);return T===void 0?!1:Ms($,T)},S=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:S})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(T=>T.identity===I?{...T,isFetching:!0}:T);try{const T=es(f,t,e,n),$=Ds(t,e,T,n,Yt),O=await Gn(()=>b.call("COLLECTION_THREADS_LIST",$)),{items:A,hasMore:C,totalCount:M}=Es(O),K=new Set(f.map(ma)),U=ua(A,K,t,e,n),E=T;m.mergeThreads(A),u(L=>{if(L.identity!==I)return L;let R;return M!==void 0?R=Ms(E+U,M):R=A.length===0||U===0?!1:C,ca(I,R),{...L,isFetching:!1,serverHasMore:R}})}catch(T){const $=T,O=$ instanceof Error?$.message:String($);Oe.error(`Could not load more tasks: ${O}`),u(A=>A.identity===I?{...A,isFetching:!1}:A)}},v=d.isFetching||d.isProbing,_=!c&&!v&&la(x,d.serverHasMore);let w;return o[2]!==v||o[3]!==y||o[4]!==_||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(w={hasMore:_,isFetching:v,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=v,o[3]=y,o[4]=_,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=w):w=o[7],w}function ma(t){return t.id}function Ln(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:h,sortable:p,groupVisibleCount:x}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=vt(n),y=r[0];let v;e[0]!==y||e[1]!==c||e[2]!==l||e[3]!==n?(v=()=>{y?l(y):c(n)},e[0]=y,e[1]=c,e[2]=l,e[3]=n,e[4]=v):v=e[4];const _=v,w=p?.isDragging?!1:void 0;let S;e[5]!==p?.isDragging||e[6]!==n?(S=X=>{p?.isDragging||X&&te("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=S):S=e[7];const I=!!(y&&o&&y.id===o),T=p?"Drag to reorder":void 0;let $;e[8]!==p?($=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=$):$=e[9];const O=p&&"cursor-pointer active:cursor-grabbing touch-none",A=p?.isDragging&&"cursor-grabbing";let C;e[10]!==A||e[11]!==O?(C=Q("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",O,A),e[10]=A,e[11]=O,e[12]=C):C=e[12];const M=j?.icon??null,K=j?.title??"?";let U;e[13]!==M||e[14]!==K?(U=s.jsx(Fe,{icon:M,name:K,size:"sm+",className:"rounded-lg"}),e[13]=M,e[14]=K,e[15]=U):U=e[15];let E;e[16]!==_||e[17]!==C||e[18]!==U||e[19]!==I||e[20]!==T||e[21]!==$?(E=s.jsx(he,{children:s.jsx(gn,{asChild:!0,children:s.jsx(Jl,{asChild:!0,children:s.jsx(Te,{onClick:_,isActive:I,title:T,...$,className:C,children:U})})})}),e[16]=_,e[17]=C,e[18]=U,e[19]=I,e[20]=T,e[21]=$,e[22]=E):E=e[22];const L=h??fa;let R;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==L||e[29]!==n?(R=s.jsx(bn,{className:"w-56",children:s.jsx(En,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:L,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=L,e[29]=n,e[30]=R):R=e[30];let H;e[31]!==E||e[32]!==R?(H=s.jsxs(jn,{children:[E,R]}),e[31]=E,e[32]=R,e[33]=H):H=e[33];const P=j?.title??"Agent";let G;e[34]!==P?(G=s.jsx("span",{className:"truncate",children:P}),e[34]=P,e[35]=G):G=e[35];let D;e[36]!==c||e[37]!==n?(D=()=>c(n),e[36]=c,e[37]=n,e[38]=D):D=e[38];let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(ke,{size:14}),e[39]=B):B=e[39];let F;e[40]!==D?(F=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:D,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:B}),e[40]=D,e[41]=F):F=e[41];let Y;e[42]!==G||e[43]!==F?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[G,F]}),e[42]=G,e[43]=F,e[44]=Y):Y=e[44];let ee;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(ee=s.jsx(pa,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=x,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=ee):ee=e[52];let V;e[53]!==Y||e[54]!==ee?(V=s.jsxs(Zl,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,ee]}),e[53]=Y,e[54]=ee,e[55]=V):V=e[55];let J;return e[56]!==H||e[57]!==V||e[58]!==w||e[59]!==S?(J=s.jsxs(Ql,{open:w,openDelay:120,closeDelay:150,onOpenChange:S,children:[H,V]}),e[56]=H,e[57]=V,e[58]=w,e[59]=S,e[60]=J):J=e[60],J}function fa(){}function pa(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=js("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Vt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(gs,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function xa(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:wi},a[1]=u):u=a[1];const m=_i(As(Ci,d),As(Ni,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=ao(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const h=f;let p;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==h||a[12]!==c?(p=b=>{const{active:j,over:y}=b;if(!y||j.id===y.id)return;const v=String(j.id),_=String(y.id);if(!co(v,_,o))return;const w=uo(h,v,_),S=mo(e,n,o,w);e==="org"?fo(n.orgId,S):po(n,S),te("sidebar_group_reordered",{virtual_mcp_id:v,over_virtual_mcp_id:_,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=h,a[12]=c,a[13]=p):p=a[13];const x=p;let g;return a[14]!==x||a[15]!==m||a[16]!==h?(g={sensors:m,sortableIds:h,handleDragEnd:x},a[14]=x,a[15]=m,a[16]=h,a[17]=g):g=a[17],g}function ha(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function ga(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Ai(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const h={transform:zi.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:h,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function Fs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:h,handleDragEnd:p}=xa(r,n,o,i,l,a,c);if(r.length===0)return null;const x=h;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==h){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==h?(y=v=>{const _=d(v);return h.includes(v.virtualMcpId)?s.jsx(ga,{id:v.virtualMcpId,children:w=>{const{setNodeRef:S,style:I,isDragging:T,attributes:$,listeners:O}=w;return s.jsx("div",{ref:S,style:I,className:Q(T&&"opacity-50"),children:u(_,{attributes:$,listeners:O,isDragging:T})})}},v.virtualMcpId):s.jsx("div",{children:m(_)},v.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=h,e[10]=y):y=e[10],g=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=h,e[5]=g}else g=e[5];let b;e[11]!==x||e[12]!==g?(b=s.jsx(ki,{items:x,strategy:Ii,children:g}),e[11]=x,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==b?(j=s.jsx(Ti,{sensors:f,collisionDetection:$i,onDragEnd:p,children:b}),e[14]=p,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function Hn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:h,orgPinned:p,user:x,toolCallRuns:g}=xo(n,o,i),b=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const y=j;let v;e[20]!==c||e[21]!==b?(v=b&&s.jsx(ha,{collapsed:c}),e[20]=c,e[21]=b,e[22]=v):v=e[22],f=s.jsxs(s.Fragment,{children:[h&&m(d(h)),s.jsx(Fs,{section:"org",groups:p,...y}),v,s.jsx(Fs,{section:"user",groups:x,...y}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function ba(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(Hn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:va,renderSortable:ja}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ja(t,e){return s.jsx(Ln,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function va(t){return s.jsx(Ln,{...t},t.virtualMcpId)}const ya="sidebar.group.expanded.";function Bn(t,e){const n=N.c(3),[r,o]=ls(`${ya}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Un(t){const e=N.c(70),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:h,groupVisibleCount:p,devPartnerId:x,devGroupVisibleCount:g,sortable:b}=t,j=u===void 0?!1:u,y=m===void 0?!1:m,v=x===void 0?null:x,[_,w]=Bn(n,!1),S=n===an,I=b?.isDragging??!1;let T;e[0]!==v||e[1]!==r?(T=v?r.filter(W=>W.virtual_mcp_id===v):[],e[0]=v,e[1]=r,e[2]=T):T=e[2];const $=T;let O;e[3]!==v||e[4]!==r?(O=v?r.filter(W=>W.virtual_mcp_id!==v):r,e[3]=v,e[4]=r,e[5]=O):O=e[5];const A=O,C=!!v&&($.length>0||(g??0)>0);let M;e[6]!==_||e[7]!==w?(M=function(){w(!_)},e[6]=_,e[7]=w,e[8]=M):M=e[8];const K=M;let U;e[9]!==S||e[10]!==b?(U=b&&!S?{...b.attributes,...b.listeners}:{},e[9]=S,e[10]=b,e[11]=U):U=e[11];let E;e[12]!==K?(E=W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),K())},e[12]=K,e[13]=E):E=e[13];const L=b&&!S&&"touch-none active:cursor-grabbing",R=I&&"shadow-md bg-accent/40 cursor-grabbing";let H;e[14]!==R||e[15]!==L?(H=Q("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",L,R),e[14]=R,e[15]=L,e[16]=H):H=e[16];let P;e[17]!==S||e[18]!==n?(P=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(_a,{virtualMcpId:n,isToolCallRuns:S})}),e[17]=S,e[18]=n,e[19]=P):P=e[19];let G;e[20]!==_?(G=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:_?s.jsx(vn,{size:14}):s.jsx(ps,{size:14})}),e[20]=_,e[21]=G):G=e[21];let D;e[22]!==P||e[23]!==G?(D=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[P,G]}),e[22]=P,e[23]=G,e[24]=D):D=e[24];let B;e[25]!==S||e[26]!==n?(B=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(Ca,{virtualMcpId:n,isToolCallRuns:S})}),e[25]=S,e[26]=n,e[27]=B):B=e[27];let F;e[28]!==S||e[29]!==a||e[30]!==n?(F=!S&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:W=>{W.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ke,{size:14})}),e[28]=S,e[29]=a,e[30]=n,e[31]=F):F=e[31];let Y;e[32]!==_||e[33]!==K||e[34]!==H||e[35]!==D||e[36]!==B||e[37]!==F||e[38]!==U||e[39]!==E?(Y=s.jsxs("div",{...U,role:"button",tabIndex:0,"aria-expanded":_,onClick:K,onKeyDown:E,className:H,children:[D,B,F]}),e[32]=_,e[33]=K,e[34]=H,e[35]=D,e[36]=B,e[37]=F,e[38]=U,e[39]=E,e[40]=Y):Y=e[40];const ee=Y;let V;e[41]!==y||e[42]!==ee||e[43]!==j||e[44]!==S||e[45]!==d||e[46]!==a||e[47]!==c||e[48]!==f||e[49]!==n?(V=S?ee:s.jsxs(jn,{children:[s.jsx(gn,{asChild:!0,children:ee}),s.jsx(bn,{className:"w-56",children:s.jsx(En,{virtualMcpId:n,isOrgPinned:j,canManageOrgPin:y,onNewTaskInGroup:a,onShowSettings:c,onToggleOrgPin:f??Sa,onHideGroup:d})})]}),e[41]=y,e[42]=ee,e[43]=j,e[44]=S,e[45]=d,e[46]=a,e[47]=c,e[48]=f,e[49]=n,e[50]=V):V=e[50];let J;e[51]!==o||e[52]!==g||e[53]!==v||e[54]!==$||e[55]!==_||e[56]!==h||e[57]!==p||e[58]!==S||e[59]!==A||e[60]!==l||e[61]!==a||e[62]!==i||e[63]!==C||e[64]!==r||e[65]!==n?(J=_&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:S?r.map(W=>s.jsx(Vt,{task:W,isActive:o===W.id,onClick:()=>i(W),onArchive:()=>l(W),showAutomationBadge:!!W.trigger_id,indented:!0},W.id)):s.jsxs(s.Fragment,{children:[s.jsx(Gs,{virtualMcpId:n,threads:A,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:p}),C&&v&&s.jsxs("div",{className:"flex flex-col gap-0.5 mt-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2 pb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/80",children:[s.jsx(Vr,{size:11}),"Develop"]}),s.jsx(Gs,{virtualMcpId:v,threads:$,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:g})]})]})}),e[51]=o,e[52]=g,e[53]=v,e[54]=$,e[55]=_,e[56]=h,e[57]=p,e[58]=S,e[59]=A,e[60]=l,e[61]=a,e[62]=i,e[63]=C,e[64]=r,e[65]=n,e[66]=J):J=e[66];let X;return e[67]!==V||e[68]!==J?(X=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[V,J]}),e[67]=V,e[68]=J,e[69]=X):X=e[69],X}function Sa(){}function _a(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Fe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Na,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Na(t){const e=N.c(4),{virtualMcpId:n}=t,r=vt(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Fe,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Fe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function Ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(wa,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function wa(t){const e=N.c(2),{virtualMcpId:n}=t,o=vt(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function Gs(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:c,groupVisibleCount:d}=t,u=js("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:h,serverHasMore:p}=u,[x,g]=z.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(g(!0),queueMicrotask(()=>{h()}));const{hasMore:b}=u;let j;return e[0]!==o||e[1]!==b||e[2]!==m||e[3]!==h||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(n),className:"flex items-center gap-2 -ml-4 pl-6 pr-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(ke,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,indented:!0},y.id)),(b||m)&&s.jsx(gs,{onClick:()=>{h()},isFetching:m,indented:!0})]})}),e[0]=o,e[1]=b,e[2]=m,e[3]=h,e[4]=l,e[5]=a,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function ka(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=js("status",n,a),[h,p]=z.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==l||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==l||e[7]!==i?(j=y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[5]=o,e[6]=l,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=l,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let g;e[9]!==m||e[10]!==c||e[11]!==u?(g=(m||c)&&s.jsx(gs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[9]=m,e[10]=c,e[11]=u,e[12]=g):g=e[12];let b;return e[13]!==x||e[14]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[13]=x,e[14]=g,e[15]=b):b=e[15],b}function Ia(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=vi[n],d=c.icon,[u,m]=Bn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(vn,{size:14}):s.jsx(ps,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==x||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[10]=x,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,y]}),e[17]=u,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=y,e[23]=v):v=e[23];let _;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(_=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(ka,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=_):_=e[31];let w;return e[32]!==v||e[33]!==_?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,_]}),e[32]=v,e[33]=_,e[34]=w):w=e[34],w}function Ta(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(Hn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Aa,renderSortable:$a}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function $a(t,e){return s.jsx(Un,{...t,sortable:e},t.virtualMcpId)}function Aa(t){return s.jsx(Un,{...t},t.virtualMcpId)}function za(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Oa(t,e,n,r,o){const i=N.c(5),l=za(t,e,r,o),[a,c]=z.useState("");a!==l&&(ho(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=go(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const qn={all:"All tasks",manual:"Chats",automation:"Automation"},Wn={all:"All members",mine:"Mine only"},Ls={agent:"Agent",status:"Status"};function Kn(t){const e=N.c(98);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:r}=n,{data:o}=Ie.useSession(),i=o?.user?.id,l=i??"anon",{org:a}=pe(),c=Fr(a.id).id,d=tn(),{liveToDev:u,devToLive:m}=ko(d),f=ln(d),h=Fl(),p=Gr();let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x={},e[2]=x):x=e[2];const[g,b]=z.useState(x),j=new Set(f),y={},v=[];let _;e[3]!==g?(_=Object.entries(g),e[3]=g,e[4]=_):_=e[4];for(const[k,q]of _)j.has(k)!==q?y[k]=q:v.push(k);v.length>0&&b(k=>{const q={...k};for(const se of v)delete q[se];return q});const w=new Set(f);for(const[k,q]of Object.entries(y))q?w.add(k):w.delete(k);const S=[...w],I=new Set(S),{threads:T}=rn(),$=T.filter(Ha),{hide:O}=nn(),A=Ge(),{setTaskId:C,createNewTask:M}=on();let K;e[5]===Symbol.for("react.memo_cache_sentinel")?(K={strict:!1},e[5]=K):K=e[5];const E=qs(K).taskId??null;let L;e[6]!==r?(L=()=>{r?.()},e[6]=r,e[7]=L):L=e[7];const R=L,H=[...$].sort(La),[P,G]=z.useState("all"),[D,B]=z.useState("mine"),[F,Y]=z.useState("agent"),[ee,V]=z.useState(!1),[J,X]=z.useState(!1),[W,re]=z.useState(0),ie=bo(),ue=W+ie;let ne;e[8]!==a.id||e[9]!==l?(ne={orgId:a.id,userId:l},e[8]=a.id,e[9]=l,e[10]=ne):ne=e[10];const oe=ne,le={type:P,member:D,currentUserId:i??null},xe=oa(H,"agent",le),Z=Oa(oe,jo(vo(H,c),m),c,S,ue);let $e;e[11]!==i||e[12]!==D?($e=k=>D==="mine"&&i?k.filter(q=>q.created_by===i):k,e[11]=i,e[12]=D,e[13]=$e):$e=e[13];const me=$e;let be;e[14]!==P?(be=k=>P==="automation"?k.filter(Ga):P==="manual"?k.filter(Fa):k,e[14]=P,e[15]=be):be=e[15];const je=be,Ae=k=>{const q=k.id===E;if(O(k.id),!q)return;const se=H.find(fe=>fe.id!==k.id&&fe.virtual_mcp_id===k.virtual_mcp_id&&fe.created_by===i);R(),se?C(se.id,se.virtual_mcp_id):A({to:"/$org",params:{org:a.slug}})};let ve;e[16]!==R||e[17]!==M?(ve=k=>{te("sidebar_group_new_clicked",{virtual_mcp_id:k}),R(),M(k)},e[16]=R,e[17]=M,e[18]=ve):ve=e[18];const Le=ve,_e=yo();let ye;e[19]!==R||e[20]!==_e?(ye=k=>{te("sidebar_group_settings_clicked",{virtual_mcp_id:k}),R(),_e(k,{search:{main:"instructions"}})},e[19]=R,e[20]=_e,e[21]=ye):ye=e[21];const He=ye,Be=k=>{if(I.has(k))return;te("sidebar_group_hide_clicked",{virtual_mcp_id:k});const q=Z.find(se=>se.virtualMcpId===k);if(q)for(const se of q.threads)O(se.id);_o(oe,k,S),re(Ea)},xt=async(k,q)=>{if(h&&y[k]===void 0){te("sidebar_group_org_pin_toggled",{virtual_mcp_id:k,pinned:q}),b(se=>({...se,[k]:q}));try{await p.update.mutateAsync({id:k,data:{pinned:q}})}catch{No(oe,k,!q),b(se=>{const fe={...se};return delete fe[k],fe})}}},Ue=k=>{const q=k===c||k===an;return{isOrgPinned:q||I.has(k),canManageOrgPin:q?!1:h,onToggleOrgPin:q?void 0:xt}},Ye=k=>{const q=je(me(k.threads)),se=u.get(k.virtualMcpId)??null;return{virtualMcpId:k.virtualMcpId,threads:q,devPartnerId:se,devGroupVisibleCount:se?xe.get(se)??0:0,activeTaskId:E,filters:le,groupVisibleCount:xe.get(k.virtualMcpId)??0,onSelectTask:fe=>{R(),C(fe.id,fe.virtual_mcp_id)},onArchiveTask:Ae,onNewTaskInGroup:Le,onShowSettings:He,onHideGroup:Be,...Ue(k.virtualMcpId)}},de=P!=="all"||D!=="mine",{state:qe,isMobile:We}=Ve();if(qe==="collapsed"&&!We){let k;if(e[22]!==de||e[23]!==Z||e[24]!==me||e[25]!==je){let mt;e[27]!==de||e[28]!==me||e[29]!==je?(mt=Xn=>{const Qn=je(me(Xn.threads));return!(de&&Qn.length===0)},e[27]=de,e[28]=me,e[29]=je,e[30]=mt):mt=e[30],k=Z.filter(mt),e[22]=de,e[23]=Z,e[24]=me,e[25]=je,e[26]=k}else k=e[26];const q=k,se=F==="agent"&&Z.length===0;let fe;e[31]!==se?(fe=s.jsx(Ns,{value:se}),e[31]=se,e[32]=fe):fe=e[32];let zt;return e[33]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>re(Ra),e[33]=zt):zt=e[33],s.jsxs(s.Fragment,{children:[fe,s.jsx(De,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ba,{groups:q,orderScope:oe,decopilotId:c,orgPinnedIds:S,onReorder:zt,renderGroup:mt=>Ye(mt)})})]})}const Ke="flex flex-col h-full min-h-0",Ne=F==="agent"&&Z.length===0;let Se;e[34]!==Ne?(Se=s.jsx(Ns,{value:Ne}),e[34]=Ne,e[35]=Se):Se=e[35];let ae;e[36]!==V?(ae=()=>{te("tasks_panel_search_opened"),X(!0),V(!0)},e[36]=V,e[37]=ae):ae=e[37];let ze;e[38]===Symbol.for("react.memo_cache_sentinel")?(ze=s.jsx(Yr,{size:16}),e[38]=ze):ze=e[38];let Ce;e[39]!==ae?(Ce=s.jsx(ge,{"aria-label":"Search threads",onClick:ae,children:ze}),e[39]=ae,e[40]=Ce):Ce=e[40];const gt=Ls[F==="agent"?"status":"agent"];let Xe;e[41]!==gt?(Xe=gt.toLowerCase(),e[41]=gt,e[42]=Xe):Xe=e[42];const bt=`Group by ${Xe}`,Xt=Ls[F];let St;e[43]!==Xt?(St=Xt.toLowerCase(),e[43]=Xt,e[44]=St):St=e[44];const Qt=`Grouped by ${St}`;let Qe,Je;e[45]!==F?(Qe=()=>{const k=F==="agent"?"status":"agent";te("tasks_panel_group_by_changed",{to_value:k}),Y(k)},Je=F==="agent"?s.jsx(li,{size:16}):s.jsx(Xr,{size:16}),e[45]=F,e[46]=Qe,e[47]=Je):(Qe=e[46],Je=e[47]);let Ze;e[48]!==bt||e[49]!==Qt||e[50]!==Qe||e[51]!==Je?(Ze=s.jsx(ge,{"aria-label":bt,title:Qt,onClick:Qe,children:Je}),e[48]=bt,e[49]=Qt,e[50]=Qe,e[51]=Je,e[52]=Ze):Ze=e[52];let _t;e[53]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(ii,{size:16}),e[53]=_t):_t=e[53];let et;e[54]!==de?(et=de&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),e[54]=de,e[55]=et):et=e[55];let tt;e[56]!==et?(tt=s.jsx(pt,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Filter tasks",children:[_t,et]})}),e[56]=et,e[57]=tt):tt=e[57];let st;e[58]!==D?(st=k=>{const q=k;q!==D&&te("tasks_panel_member_filter_changed",{to_value:q}),B(q)},e[58]=D,e[59]=st):st=e[59];let Nt;e[60]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(ks,{size:"sm",className:"w-full",children:s.jsx(Is,{})}),e[60]=Nt):Nt=e[60];let Ct;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ct=Object.keys(Wn),e[61]=Ct):Ct=e[61];let wt;e[62]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(ws,{children:Ct.map(Ma)}),e[62]=wt):wt=e[62];let nt;e[63]!==D||e[64]!==st?(nt=s.jsx(Hs,{label:"Members",children:s.jsxs(Ts,{value:D,onValueChange:st,children:[Nt,wt]})}),e[63]=D,e[64]=st,e[65]=nt):nt=e[65];let rt;e[66]!==P?(rt=k=>{const q=k;q!==P&&te("tasks_panel_filter_changed",{to_value:q}),G(q)},e[66]=P,e[67]=rt):rt=e[67];let kt;e[68]===Symbol.for("react.memo_cache_sentinel")?(kt=s.jsx(ks,{size:"sm",className:"w-full",children:s.jsx(Is,{})}),e[68]=kt):kt=e[68];let It;e[69]===Symbol.for("react.memo_cache_sentinel")?(It=Object.keys(qn),e[69]=It):It=e[69];let Tt;e[70]===Symbol.for("react.memo_cache_sentinel")?(Tt=s.jsx(ws,{children:It.map(Da)}),e[70]=Tt):Tt=e[70];let ot;e[71]!==rt||e[72]!==P?(ot=s.jsx(Hs,{label:"Type",children:s.jsxs(Ts,{value:P,onValueChange:rt,children:[kt,Tt]})}),e[71]=rt,e[72]=P,e[73]=ot):ot=e[73];let it;e[74]!==nt||e[75]!==ot?(it=s.jsx(Ut,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[nt,ot]})}),e[74]=nt,e[75]=ot,e[76]=it):it=e[76];let lt;e[77]!==tt||e[78]!==it?(lt=s.jsxs(Bt,{children:[tt,it]}),e[77]=tt,e[78]=it,e[79]=lt):lt=e[79];let at;e[80]!==Ce||e[81]!==Ze||e[82]!==lt?(at=s.jsxs("div",{className:"flex items-center gap-0.5",children:[Ce,Ze,lt]}),e[80]=Ce,e[81]=Ze,e[82]=lt,e[83]=at):at=e[83];let $t;e[84]===Symbol.for("react.memo_cache_sentinel")?($t=s.jsx(yn,{compact:!0}),e[84]=$t):$t=e[84];let ct;e[85]!==at?(ct=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[at,$t]}),e[85]=at,e[86]=ct):ct=e[86];const Yn="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Jt=F==="status"?s.jsx(s.Fragment,{children:So(je(me(H))).map(k=>s.jsx(Ia,{status:k.status,threads:k.threads,activeTaskId:E,onSelectTask:q=>{R(),C(q.id,q.virtual_mcp_id)},onArchiveTask:Ae,filters:le},k.status))}):s.jsx(Ta,{groups:Z,orderScope:oe,decopilotId:c,orgPinnedIds:S,onReorder:()=>re(Pa),renderGroup:k=>({...Ye(k)})});let dt;e[87]!==Jt?(dt=s.jsx("div",{className:Yn,children:Jt}),e[87]=Jt,e[88]=dt):dt=e[88];let ut;e[89]!==J||e[90]!==ee||e[91]!==V?(ut=J&&s.jsx(Rl,{open:ee,onOpenChange:V}),e[89]=J,e[90]=ee,e[91]=V,e[92]=ut):ut=e[92];let At;return e[93]!==Se||e[94]!==ct||e[95]!==dt||e[96]!==ut?(At=s.jsxs("div",{className:Ke,children:[Se,ct,dt,ut]}),e[93]=Se,e[94]=ct,e[95]=dt,e[96]=ut,e[97]=At):At=e[97],At}function Pa(t){return t+1}function Da(t){return s.jsx(pn,{value:t,children:qn[t]},t)}function Ma(t){return s.jsx(pn,{value:t,children:Wn[t]},t)}function Ra(t){return t+1}function Ea(t){return t+1}function Fa(t){return!t.trigger_id}function Ga(t){return!!t.trigger_id}function La(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ha(t){return!t.hidden}function Hs(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Ba=5,Ua=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Vn(){const t=N.c(3),{state:e}=Ve();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ba}).map(Ka)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(we,{className:"size-6 rounded-md"}),s.jsx(we,{className:"size-6 rounded-md"}),s.jsx(we,{className:"size-6 rounded-md"})]}),s.jsx(we,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Ua.map(qa)})]}),t[2]=r):r=t[2],r}function qa(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(we,{className:"size-5 rounded-full shrink-0"}),s.jsx(we,{className:Q("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Wa)})]},e)}function Wa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(we,{className:"h-3 flex-1 rounded-sm"})},e)}function Ka(t,e){return s.jsx(we,{className:"size-10 rounded-lg mx-auto"},e)}function Va(){const t=N.c(4),e=Sn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ol,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Vs,{children:s.jsxs(z.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Vn,{})]}),children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Kn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(cn,{children:s.jsx(Cn,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Ya(t){const e=N.c(9),{onClose:n}=t,r=Sn();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Pl,{}),e[0]=o):o=e[0];let i,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Vn,{})]}),l=s.jsx(Rt,{className:"mb-2"}),e[1]=i,e[2]=l):(i=e[1],l=e[2]);let a;e[3]!==n?(a=s.jsx(Vs,{children:s.jsxs(z.Suspense,{fallback:i,children:[l,s.jsx(Kn,{onNavigate:n})]})}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==r||e[7]!==a?(c=s.jsx(cn,{children:s.jsx(tl,{sections:r,onClose:n,footer:o,additionalContent:a})}),e[5]=n,e[6]=r,e[7]=a,e[8]=c):c=e[8],c}const Xa="sidebar.open";function Qa(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Oi,{}),t[0]=e):e=t[0],e}function su(){const t=N.c(24),e=ds(),[n,r]=ls(Xa,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=Ri();let c;t[0]!==e?(c=e?s.jsxs(ce.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(ce.LogoLink,{}),s.jsx(ys,{}),s.jsx(ns,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ce.TogglesSlot,{}),s.jsx(ce.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ce.CenterSlot,{}),s.jsx(ce.RightSlot,{})]}):s.jsxs(ce.Header,{children:[s.jsxs(ce.LeftColumn,{children:[s.jsx(ce.LogoLink,{}),s.jsx(ys,{}),s.jsx("span",{className:"hidden md:contents",children:s.jsx(ce.Nav,{})}),s.jsx(ce.TogglesSlot,{}),s.jsx(ns,{})]}),s.jsx(ce.CenterSlot,{}),s.jsxs(ce.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(ce.TabsSlot,{})}),s.jsx(ce.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Va,{}),s.jsx(Pi,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Tr,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(z.Suspense,{fallback:s.jsx(Qa,{}),children:s.jsx(wr,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==m||t[11]!==f||t[12]!==i?(x=s.jsxs($r,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,p]}),t[10]=m,t[11]=f,t[12]=i,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Or,{renderSidebar:Ja}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(ni,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,g]})}),t[16]=c,t[17]=x,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(eo,{children:s.jsx(ce.Provider,{children:s.jsx(Ar,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function Ja(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Ya,{onClose:e})})})}export{su as default};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-BwwMI_z3.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-augXQ0K7.js";import{S as nt}from"./scroll-area-DMoYJ3k8.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-BQFbKmQP.js";import{m as xt}from"./index-QeN7VcKq.js";import"./X-Bmi_qRN4.js";import"./agent-icon-DBLutUdr.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./Settings02-BFRtrqB4.js";import"./XCircle-DPmDQ715.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./Users03-Bnzjqkr7.js";import"./CheckCircle-JqmGicRO.js";import"./Check-BLeNHxJZ.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronRight-B6XUFwET.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Stars02-DYAjCaf7.js";import"./Eye-BxG-oJAF.js";import"./ZoomOut-DvgFp2BT.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Star01-ewA9GGVc.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LayoutLeft-DqymKk5q.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Plus-BqBWPPKf.js";import"./SearchMd-CUFv_rgs.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Trash01-CDCJsikI.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./Zap-BiorjSWt.js";import"./use-clock-tick-BwGvIB24.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DFo7-jB5.js";import"./tooltip-CyNlJ2D3.js";import"./file-type-icon-BUdJI6sA.js";import"./dialog-CLq1SghM.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BAop8rwy.js";import"./use-mcp-client-DvAPKq6Y.js";import"./auth-BXPdjuWF.js";import"./chat-context-CBpDhIU2.js";import"./hooks-DuQsd6Bm.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CoIXtDgU.js";import"./use-collections-yr9dnEMw.js";import"./use-ai-providers-BYdj6_Kv.js";import"./studio-tools-B8VUUU-T.js";import"./use-organization-settings-C6tDwGjc.js";import"./shell-layout-BT2b3cNK.js";import"./avatar-CSuVLmod.js";import"./required-auth-layout-WiM3pjQr.js";import"./use-org-sso-D0AtHZwW.js";import"./integration-icon-EI90wRK8.js";import"./use-navigate-to-agent--cfMzNid.js";import"./use-connection-DTZL15F4.js";import"./use-mcp-prompts-C08ra20t.js";import"./form-BiL7tBo8.js";import"./label-DQDXb8Iy.js";import"./input-9-kTRwAW.js";import"./select-C_iDf6oN.js";import"./switch-BPQwwUV8.js";import"./schema-form-DsQqx-T1.js";import"./calendar-DOU5eOAx.js";import"./popover-C48maDID.js";import"./textarea-CWkbF3jO.js";import"./sortable.esm-CaciG6GE.js";import"./dropdown-menu-EYUmANSx.js";import"./image-field-BPXDAjk4.js";import"./skeleton-onJaQqBb.js";import"./tabs-CdvhBRm_.js";import"./use-file-configs-DqSldcFs.js";import"./useInfiniteQuery-D5rCytza.js";import"./use-infinite-scroll-CuBVIy0d.js";import"./command-FVnvTkmT.js";import"./index-Dxv0Qdk7.js";import"./index-BlldpIQL.js";import"./drawer-C1zwk63J.js";import"./collection-search-ZnbN2Oka.js";import"./toggle-group-BsdLNJ12.js";import"./use-deco-credits-C-w7pZL9.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DuX9wPmQ.js";import"./use-registry-connections-DSa_I7y4.js";import"./extract-connection-data-Dg9BZZhS.js";import"./card-Dlbea5c8.js";import"./collection-tabs-CI7K_OKd.js";import"./badge-BS7vcv5t.js";import"./connection-form-helpers-BAad4_Oz.js";import"./useSuspenseInfiniteQuery-p_uY5FHN.js";import"./mcp-oauth-d5uIP20j.js";import"./connect-desktop-dialog-DJmqWrPH.js";import"./decopilot-D0ubcUmg.js";import"./checkbox-wpAqS3ku.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D9jClssB.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1GhbJRz.js";import"./empty-state-QuiqZdc3.js";import"./toolbar-BJeFrmdV.js";import"./preview-dialog-DL68uWz9.js";import"./index-D2an7Gp7.js";import"./use-mcp-tools-BvNLlDVP.js";import"./use-capability-BC9VFiK3.js";import"./shell-route-loading-BS9UjtiE.js";import"./index-BxhIMeWM.js";import"./alert-dialog-BaufekhR.js";import"./use-debounced-autosave-BXUwU_2r.js";import"./index-CKyFmB_U.js";import"./sidebar-DXPYC1Hg.js";import"./search-input-DnOeAwxM.js";import"./github-repo-picker-Bkke5mPs.js";import"./use-secrets-DcZ7AQsJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DpYW1yVt.js";import"./select-model-CP3J5XcK.js";import"./use-automations-C40bqyM5.js";import"./monaco-editor-CSc3_nGj.js";import"./automation-runs-CJg4mnNP.js";import"./table-CRHHLqz7.js";import"./use-members-CDiFYafh.js";import"./use-org-auth-client-POkuFZw3.js";import"./task-status-UVFK-kXi.js";import"./automation-list-row-aHfkNvIG.js";function mi(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{mi as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as Q,j as r,B as W,r as X,l as Z}from"./index-BwwMI_z3.js";import{t as ee}from"./ChevronDown-0fINXUkk.js";import{n as te}from"./LinkExternal01-BC9HiQgY.js";import{Q as oe}from"./agent-icon-DBLutUdr.js";import{e as re,f as ie,d as le}from"./scroll-area-DMoYJ3k8.js";import{I as Y}from"./input-9-kTRwAW.js";import{L as K}from"./label-DQDXb8Iy.js";import{M as se}from"./automation-runs-CJg4mnNP.js";import{T as ae}from"./textarea-CWkbF3jO.js";import{I as ne}from"./image-field-BPXDAjk4.js";import{g as me}from"./schema-form-DsQqx-T1.js";import{ak as pe,al as ce,am as fe,an as ue}from"./index-QeN7VcKq.js";import{u as de,s as U,I as ge,R as xe,A as he}from"./primitives-BBY0CFqU.js";import{S as ye}from"./save-status-Bsha5t5q.js";import{a as ve,B as je,b as be}from"./block-document-BQOe9ocy.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./Settings02-BFRtrqB4.js";import"./XCircle-DPmDQ715.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./Users03-Bnzjqkr7.js";import"./CheckCircle-JqmGicRO.js";import"./Check-BLeNHxJZ.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronRight-B6XUFwET.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Stars02-DYAjCaf7.js";import"./Eye-BxG-oJAF.js";import"./ZoomOut-DvgFp2BT.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Star01-ewA9GGVc.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LayoutLeft-DqymKk5q.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Plus-BqBWPPKf.js";import"./SearchMd-CUFv_rgs.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Trash01-CDCJsikI.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./X-Bmi_qRN4.js";import"./Zap-BiorjSWt.js";import"./use-clock-tick-BwGvIB24.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DFo7-jB5.js";import"./tooltip-CyNlJ2D3.js";import"./file-type-icon-BUdJI6sA.js";import"./dialog-CLq1SghM.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BAop8rwy.js";import"./use-mcp-client-DvAPKq6Y.js";import"./auth-BXPdjuWF.js";import"./chat-context-CBpDhIU2.js";import"./hooks-DuQsd6Bm.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CoIXtDgU.js";import"./use-collections-yr9dnEMw.js";import"./use-ai-providers-BYdj6_Kv.js";import"./studio-tools-B8VUUU-T.js";import"./use-organization-settings-C6tDwGjc.js";import"./shell-layout-BT2b3cNK.js";import"./avatar-CSuVLmod.js";import"./required-auth-layout-WiM3pjQr.js";import"./use-org-sso-D0AtHZwW.js";import"./sheet-augXQ0K7.js";import"./integration-icon-EI90wRK8.js";import"./use-navigate-to-agent--cfMzNid.js";import"./use-connection-DTZL15F4.js";import"./use-mcp-prompts-C08ra20t.js";import"./form-BiL7tBo8.js";import"./select-C_iDf6oN.js";import"./useInfiniteQuery-D5rCytza.js";import"./use-infinite-scroll-CuBVIy0d.js";import"./card-Dlbea5c8.js";import"./table-CRHHLqz7.js";import"./empty-state-QuiqZdc3.js";import"./use-members-CDiFYafh.js";import"./use-org-auth-client-POkuFZw3.js";import"./task-status-UVFK-kXi.js";import"./use-automations-C40bqyM5.js";import"./useSuspenseInfiniteQuery-p_uY5FHN.js";import"./badge-BS7vcv5t.js";import"./checkbox-wpAqS3ku.js";import"./command-FVnvTkmT.js";import"./index-Dxv0Qdk7.js";import"./popover-C48maDID.js";import"./dropdown-menu-EYUmANSx.js";import"./skeleton-onJaQqBb.js";import"./tabs-CdvhBRm_.js";import"./use-file-configs-DqSldcFs.js";import"./calendar-DOU5eOAx.js";import"./switch-BPQwwUV8.js";import"./sortable.esm-CaciG6GE.js";import"./index-BlldpIQL.js";import"./drawer-C1zwk63J.js";import"./collection-search-ZnbN2Oka.js";import"./toggle-group-BsdLNJ12.js";import"./use-deco-credits-C-w7pZL9.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DuX9wPmQ.js";import"./use-registry-connections-DSa_I7y4.js";import"./extract-connection-data-Dg9BZZhS.js";import"./collection-tabs-CI7K_OKd.js";import"./connection-form-helpers-BAad4_Oz.js";import"./mcp-oauth-d5uIP20j.js";import"./connect-desktop-dialog-DJmqWrPH.js";import"./decopilot-D0ubcUmg.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D9jClssB.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1GhbJRz.js";import"./toolbar-BJeFrmdV.js";import"./preview-dialog-DL68uWz9.js";import"./index-D2an7Gp7.js";import"./use-mcp-tools-BvNLlDVP.js";import"./use-capability-BC9VFiK3.js";import"./shell-route-loading-BS9UjtiE.js";import"./index-BxhIMeWM.js";import"./alert-dialog-BaufekhR.js";import"./use-debounced-autosave-BXUwU_2r.js";import"./index-CKyFmB_U.js";import"./sidebar-DXPYC1Hg.js";import"./search-input-DnOeAwxM.js";import"./github-repo-picker-Bkke5mPs.js";import"./use-secrets-DcZ7AQsJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DpYW1yVt.js";import"./select-model-CP3J5XcK.js";import"./monaco-editor-CSc3_nGj.js";import"./automation-list-row-aHfkNvIG.js";const q=f=>typeof f=="string"?f:"",Ce=/\/blog\.tsx?$/;function Se(f){for(const[e,t]of Object.entries(f)){if(e.includes("/")||!t||typeof t!="object"||Array.isArray(t))continue;const i=t;if(typeof i.__resolveType!="string"||!Ce.test(i.__resolveType))continue;const o=q(i.pageSlug);if(o)return o}return null}function _e(f){const e=f.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return q(t?.slug)}function ke(f,e){let t=f;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}function Ne({decofile:f,post:e,previewBaseUrl:t}){if(!t)return null;const i=Se(f);if(!i)return null;const o=ke(i,{category:_e(e),slug:q(e.slug)});if(!o)return null;try{return new URL(o,t).href}catch{return null}}function Pe(f){return Array.isArray(f)?f.map(e=>({key:U(e?.key),value:U(e?.value)})):[]}function gr(f){const e=Q.c(68),{orgSlug:t,virtualMcpId:i,branch:o,blockKey:s,block:S,decofile:m,meta:v,previewBaseUrl:x}=f;let j;e[0]!==o||e[1]!==t||e[2]!==i?(j={orgSlug:t,virtualMcpId:i,branch:o},e[0]=o,e[1]=t,e[2]=i,e[3]=j):j=e[3];const l=pe(j);let u;e[4]!==S?(u=ce(S,"posts"),e[4]=S,e[5]=u):u=e[5];const d=u;let b;e[6]!==s||e[7]!==l?(b=M=>{l.mutate({blockKey:s,data:fe(s,"posts",M)})},e[6]=s,e[7]=l,e[8]=b):b=e[8];const[a,R]=de(d,b);let _;e[9]!==a||e[10]!==R?(_=(M,J)=>R({...a,[M]:J}),e[9]=a,e[10]=R,e[11]=_):_=e[11];const p=_;let k;e[12]!==m||e[13]!==a||e[14]!==x?(k=Ne({decofile:m,post:a,previewBaseUrl:x}),e[12]=m,e[13]=a,e[14]=x,e[15]=k):k=e[15];const h=k;let n;e[16]!==a.title?(n=U(a.title)||"Untitled post",e[16]=a.title,e[17]=n):n=e[17];let c;e[18]!==n?(c=r.jsx("span",{className:"truncate text-sm font-medium",children:n}),e[18]=n,e[19]=c):c=e[19];let g;e[20]!==l.isError||e[21]!==l.isPending?(g=r.jsx(ye,{isPending:l.isPending,isError:l.isError}),e[20]=l.isError,e[21]=l.isPending,e[22]=g):g=e[22];const C=!h,z=h?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==h?(N=()=>{h&&window.open(h,"_blank","noopener,noreferrer")},e[23]=h,e[24]=N):N=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=r.jsx(te,{size:14}),e[25]=I):I=e[25];let L;e[26]!==z||e[27]!==N||e[28]!==C?(L=r.jsxs(W,{type:"button",variant:"outline",size:"sm",disabled:C,title:z,onClick:N,children:[I,"See preview"]}),e[26]=z,e[27]=N,e[28]=C,e[29]=L):L=e[29];let P;e[30]!==L||e[31]!==g?(P=r.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,L]}),e[30]=L,e[31]=g,e[32]=P):P=e[32];let B;e[33]!==P||e[34]!==c?(B=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,P]}),e[33]=P,e[34]=c,e[35]=B):B=e[35];let T;e[36]!==a.title?(T=U(a.title),e[36]=a.title,e[37]=T):T=e[37];let w;e[38]!==p?(w=M=>p("title",M),e[38]=p,e[39]=w):w=e[39];let A;e[40]!==T||e[41]!==w?(A=r.jsx(ge,{value:T,onChange:w,placeholder:"Post title",className:"py-1 text-3xl font-bold text-foreground"}),e[40]=T,e[41]=w,e[42]=A):A=e[42];let E;e[43]!==m||e[44]!==a||e[45]!==p?(E=r.jsx(Be,{post:a,decofile:m,onChange:p}),e[43]=m,e[44]=a,e[45]=p,e[46]=E):E=e[46];let $;e[47]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx("div",{className:"mt-6 border-t"}),e[47]=$):$=e[47];let F;e[48]!==a.sections?(F=ve(a.sections),e[48]=a.sections,e[49]=F):F=e[49];let O;e[50]!==p?(O=M=>p("sections",M),e[50]=p,e[51]=O):O=e[51];let y;e[52]!==v||e[53]!==F||e[54]!==O?(y=r.jsx(je,{value:F,onChange:O,meta:v,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."}),e[52]=v,e[53]=F,e[54]=O,e[55]=y):y=e[55];let D;e[56]!==A||e[57]!==E||e[58]!==y?(D=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsxs("div",{className:"mx-auto max-w-3xl px-8 py-8",children:[A,E,$,y]})}),e[56]=A,e[57]=E,e[58]=y,e[59]=D):D=e[59];let V;e[60]!==B||e[61]!==D?(V=r.jsxs("div",{className:"flex h-full flex-col",children:[B,D]}),e[60]=B,e[61]=D,e[62]=V):V=e[62];let G;return e[63]!==o||e[64]!==t||e[65]!==V||e[66]!==i?(G=r.jsx(be,{orgSlug:t,virtualMcpId:i,branch:o,children:V}),e[63]=o,e[64]=t,e[65]=V,e[66]=i,e[67]=G):G=e[67],G}function Be(f){const e=Q.c(69),{post:t,decofile:i,onChange:o}=f,[s,S]=X.useState(!1);let m,v;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(oe,{size:15}),v=r.jsx("span",{className:"flex-1 text-left",children:"Post settings"}),e[0]=m,e[1]=v):(m=e[0],v=e[1]);const x=s&&"rotate-180";let j;e[2]!==x?(j=Z("transition-transform",x),e[2]=x,e[3]=j):j=e[3];let l;e[4]!==j?(l=r.jsx(re,{asChild:!0,children:r.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[m,v,r.jsx(ee,{size:15,className:j})]})}),e[4]=j,e[5]=l):l=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx(K,{htmlFor:"post-excerpt",children:"Excerpt"}),e[6]=u):u=e[6];let d;e[7]!==t.excerpt?(d=U(t.excerpt),e[7]=t.excerpt,e[8]=d):d=e[8];let b;e[9]!==o?(b=y=>o("excerpt",y.target.value),e[9]=o,e[10]=b):b=e[10];let a;e[11]!==d||e[12]!==b?(a=r.jsxs("div",{className:"space-y-2",children:[u,r.jsx(ae,{id:"post-excerpt",value:d,onChange:b,rows:2})]}),e[11]=d,e[12]=b,e[13]=a):a=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(K,{htmlFor:"post-slug",children:"Slug"}),e[14]=R):R=e[14];let _;e[15]!==t.slug?(_=U(t.slug),e[15]=t.slug,e[16]=_):_=e[16];let p;e[17]!==o?(p=y=>o("slug",y.target.value),e[17]=o,e[18]=p):p=e[18];let k;e[19]!==_||e[20]!==p?(k=r.jsxs("div",{className:"space-y-2",children:[R,r.jsx(Y,{id:"post-slug",value:_,onChange:p,placeholder:"my-post",className:"h-10"})]}),e[19]=_,e[20]=p,e[21]=k):k=e[21];let h;e[22]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"date",title:"Date"},e[22]=h):h=e[22];let n;e[23]!==t.date?(n=U(t.date),e[23]=t.date,e[24]=n):n=e[24];let c;e[25]!==o?(c=y=>o("date",y),e[25]=o,e[26]=c):c=e[26];let g;e[27]!==n||e[28]!==c?(g=r.jsx(me,{schema:h,value:n,onChange:c,path:"post-date",label:"Date"}),e[27]=n,e[28]=c,e[29]=g):g=e[29];let C;e[30]!==k||e[31]!==g?(C=r.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[k,g]}),e[30]=k,e[31]=g,e[32]=C):C=e[32];let z;e[33]===Symbol.for("react.memo_cache_sentinel")?(z={type:"string",format:"image-uri",title:"Cover image"},e[33]=z):z=e[33];let N;e[34]!==o?(N=y=>o("image",y),e[34]=o,e[35]=N):N=e[35];let I;e[36]!==t.image||e[37]!==N?(I=r.jsx(ne,{schema:z,value:t.image,onChange:N,path:"post-image",label:"Cover image"}),e[36]=t.image,e[37]=N,e[38]=I):I=e[38];let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=["email"],e[39]=L):L=e[39];let P;e[40]!==o?(P=y=>o("authors",y),e[40]=o,e[41]=P):P=e[41];let B;e[42]!==i||e[43]!==t.authors||e[44]!==P?(B=r.jsx(H,{label:"Authors",decofile:i,kind:"authors",valueField:"email",extraFields:L,selected:t.authors,onChange:P}),e[42]=i,e[43]=t.authors,e[44]=P,e[45]=B):B=e[45];let T;e[46]===Symbol.for("react.memo_cache_sentinel")?(T=["slug"],e[46]=T):T=e[46];let w;e[47]!==o?(w=y=>o("categories",y),e[47]=o,e[48]=w):w=e[48];let A;e[49]!==i||e[50]!==t.categories||e[51]!==w?(A=r.jsx(H,{label:"Categories",decofile:i,kind:"categories",valueField:"slug",extraFields:T,selected:t.categories,onChange:w}),e[49]=i,e[50]=t.categories,e[51]=w,e[52]=A):A=e[52];let E;e[53]!==o?(E=y=>o("extraProps",y),e[53]=o,e[54]=E):E=e[54];let $;e[55]!==t.extraProps||e[56]!==E?($=r.jsx(we,{value:t.extraProps,onChange:E}),e[55]=t.extraProps,e[56]=E,e[57]=$):$=e[57];let F;e[58]!==C||e[59]!==I||e[60]!==B||e[61]!==A||e[62]!==$||e[63]!==a?(F=r.jsxs(ie,{className:"space-y-5 px-2 pt-4",children:[a,C,I,B,A,$]}),e[58]=C,e[59]=I,e[60]=B,e[61]=A,e[62]=$,e[63]=a,e[64]=F):F=e[64];let O;return e[65]!==s||e[66]!==F||e[67]!==l?(O=r.jsxs(le,{open:s,onOpenChange:S,className:"mt-4",children:[l,F]}),e[65]=s,e[66]=F,e[67]=l,e[68]=O):O=e[68],O}function we(f){const e=Q.c(15),{value:t,onChange:i}=f;let o,s,S,m;if(e[0]!==i||e[1]!==t){o=Pe(t);const j=(l,u)=>i(o.map((d,b)=>b===l?{...d,...u}:d));s="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(K,{children:"Extra props"}),e[6]=S):S=e[6],m=o.length>0&&r.jsx("ul",{className:"space-y-2",children:o.map((l,u)=>r.jsxs("li",{className:"group/item flex items-center gap-2",children:[r.jsx(Y,{value:l.key,onChange:d=>j(u,{key:d.target.value}),placeholder:"key",className:"h-9 flex-1"}),r.jsx(Y,{value:l.value,onChange:d=>j(u,{value:d.target.value}),placeholder:"value",className:"h-9 flex-1"}),r.jsx(xe,{label:"Remove prop",onClick:()=>i(o.filter((d,b)=>b!==u))})]},u))}),e[0]=i,e[1]=t,e[2]=o,e[3]=s,e[4]=S,e[5]=m}else o=e[2],s=e[3],S=e[4],m=e[5];let v;e[7]!==o||e[8]!==i?(v=r.jsx(he,{label:"Add prop",onClick:()=>i([...o,{key:"",value:""}])}),e[7]=o,e[8]=i,e[9]=v):v=e[9];let x;return e[10]!==s||e[11]!==S||e[12]!==m||e[13]!==v?(x=r.jsxs("div",{className:s,children:[S,m,v]}),e[10]=s,e[11]=S,e[12]=m,e[13]=v,e[14]=x):x=e[14],x}function H(f){const e=Q.c(31),{label:t,decofile:i,kind:o,valueField:s,extraFields:S,selected:m,onChange:v}=f;let x,j,l;if(e[0]!==i||e[1]!==o||e[2]!==s){x=ue(i,o);let h;e[6]!==s?(h=(c,g)=>U(c[s])||g,e[6]=s,e[7]=h):h=e[7],l=h;let n;e[8]!==l?(n=c=>{const{key:g,payload:C}=c;return{value:l(C,g),label:U(C.name)||l(C,g)}},e[8]=l,e[9]=n):n=e[9],j=x.map(n),e[0]=i,e[1]=o,e[2]=s,e[3]=x,e[4]=j,e[5]=l}else x=e[3],j=e[4],l=e[5];const u=j;let d;if(e[10]!==m||e[11]!==s){const h=Array.isArray(m)?m:[];let n;e[13]!==s?(n=c=>U(c[s]),e[13]=s,e[14]=n):n=e[14],d=h.map(n).filter(Boolean),e[10]=m,e[11]=s,e[12]=d}else d=e[12];const b=d;let a;e[15]!==S||e[16]!==v||e[17]!==x||e[18]!==s||e[19]!==l?(a=h=>{v(h.map(n=>{const c=x.find(C=>{const{key:z,payload:N}=C;return l(N,z)===n});if(!c)return{name:n,[s]:n};const g={name:U(c.payload.name)};for(const C of S)g[C]=c.payload[C]??n;return g}))},e[15]=S,e[16]=v,e[17]=x,e[18]=s,e[19]=l,e[20]=a):a=e[20];const R=a;let _;e[21]!==t?(_=r.jsx(K,{children:t}),e[21]=t,e[22]=_):_=e[22];let p;e[23]!==b||e[24]!==R||e[25]!==t||e[26]!==u?(p=u.length===0?r.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",t.toLowerCase()," yet — create some in the"," ",t.toLowerCase()," collection."]}):r.jsx(se,{options:u,defaultValue:b,onValueChange:R,placeholder:`Select ${t.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=R,e[25]=t,e[26]=u,e[27]=p):p=e[27];let k;return e[28]!==_||e[29]!==p?(k=r.jsxs("div",{className:"space-y-2",children:[_,p]}),e[28]=_,e[29]=p,e[30]=k):k=e[30],k}export{gr as PostEditor};
@@ -1,5 +0,0 @@
1
- import{r as g,aK as ln,c as A,l as ve,j as c,s as se,I as st,d as Ie,K as Y,k as be,a$ as an,F as cn,i as un,B as ee,ac as dn,t as Me,ae as fn,w as pn,e as mn}from"./index-BwwMI_z3.js";import{c as hn,f as xn,g as gn,b as yn,d as wn,a as vn,h as bn}from"./ZoomOut-DvgFp2BT.js";import{D as Sn,a as Ze,c as kt,d as Pt}from"./dialog-CLq1SghM.js";import{b as ue,T as de,a as fe}from"./tooltip-CyNlJ2D3.js";import{n as Fe,i as Ct}from"./Globe01-C0lWcJBb.js";import{n as $t}from"./LinkExternal01-BC9HiQgY.js";import{s as zn}from"./XClose-thceHO6y.js";import{S as _e}from"./skeleton-onJaQqBb.js";import{l as jn,F as kn}from"./index-D2an7Gp7.js";import{F as et,M as Pn}from"./file-type-icon-BUdJI6sA.js";import{D as Cn,a as $n,b as En,c as dt}from"./dropdown-menu-EYUmANSx.js";import{i as Nn}from"./LayoutLeft-DqymKk5q.js";import{I as In}from"./input-9-kTRwAW.js";import{a as Mn,P as Rn,b as Dn}from"./popover-C48maDID.js";import{i as Ln}from"./Check-BLeNHxJZ.js";import{a as _n}from"./Eye-BxG-oJAF.js";import{i as An}from"./Key01-CWpW_-Pr.js";const We=g.createContext(null);We.displayName="PanelGroupContext";const V={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},rt=10,ye=g.useLayoutEffect,ft=ln.useId,Tn=typeof ft=="function"?ft:()=>null;let Fn=0;function it(n=null){const e=Tn(),t=g.useRef(n||e||null);return t.current===null&&(t.current=""+Fn++),n??t.current}function Et({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:o,maxSize:l,minSize:a,onCollapse:u,onExpand:p,onResize:d,order:f,style:x,tagName:m="div",...z}){const v=g.useContext(We);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:P,getPanelSize:M,getPanelStyle:k,groupId:W,isPanelCollapsed:N,reevaluatePanelConstraints:w,registerPanel:K,resizePanel:q,unregisterPanel:U}=v,T=it(o),D=g.useRef({callbacks:{onCollapse:u,onExpand:p,onResize:d},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:l,minSize:a},id:T,idIsFromProps:o!==void 0,order:f});g.useRef({didLogMissingDefaultSizeWarning:!1}),ye(()=>{const{callbacks:_,constraints:L}=D.current,F={...L};D.current.id=T,D.current.idIsFromProps=o!==void 0,D.current.order=f,_.onCollapse=u,_.onExpand=p,_.onResize=d,L.collapsedSize=t,L.collapsible=s,L.defaultSize=r,L.maxSize=l,L.minSize=a,(F.collapsedSize!==L.collapsedSize||F.collapsible!==L.collapsible||F.maxSize!==L.maxSize||F.minSize!==L.minSize)&&w(D.current,F)}),ye(()=>{const _=D.current;return K(_),()=>{U(_)}},[f,T,K,U]),g.useImperativeHandle(i,()=>({collapse:()=>{y(D.current)},expand:_=>{P(D.current,_)},getId(){return T},getSize(){return M(D.current)},isCollapsed(){return N(D.current)},isExpanded(){return!N(D.current)},resize:_=>{q(D.current,_)}}),[y,P,M,N,T,q]);const X=k(D.current,r);return g.createElement(m,{...z,children:n,className:e,id:T,style:{...X,...x},[V.groupId]:W,[V.panel]:"",[V.panelCollapsible]:s||void 0,[V.panelId]:T,[V.panelSize]:parseFloat(""+X.flexGrow).toFixed(1)})}const Nt=g.forwardRef((n,e)=>g.createElement(Et,{...n,forwardedRef:e}));Et.displayName="Panel";Nt.displayName="forwardRef(Panel)";let tt=null,Te=-1,he=null;function Hn(n,e){if(e){const t=(e&Lt)!==0,s=(e&_t)!==0,r=(e&At)!==0,i=(e&Tt)!==0;if(t)return r?"se-resize":i?"ne-resize":"e-resize";if(s)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Un(){he!==null&&(document.head.removeChild(he),tt=null,he=null,Te=-1)}function Ve(n,e){var t,s;const r=Hn(n,e);if(tt!==r){if(tt=r,he===null&&(he=document.createElement("style"),document.head.appendChild(he)),Te>=0){var i;(i=he.sheet)===null||i===void 0||i.removeRule(Te)}Te=(t=(s=he.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function It(n){return n.type==="keydown"}function Mt(n){return n.type.startsWith("pointer")}function Rt(n){return n.type.startsWith("mouse")}function qe(n){if(Mt(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Rt(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function On(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Wn(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function qn(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:ht(n),b:ht(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;E(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:mt(pt(t.a)),b:mt(pt(t.b))};if(r.a===r.b){const i=s.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let l=i.length;for(;l--;){const a=i[l];if(a===o.a)return 1;if(a===o.b)return-1}}return Math.sign(r.a-r.b)}const Bn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Kn(n){var e;const t=getComputedStyle((e=Dt(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Gn(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Kn(n))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Bn.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function pt(n){let e=n.length;for(;e--;){const t=n[e];if(E(t,"Missing node"),Gn(t))return t}return null}function mt(n){return n&&Number(getComputedStyle(n).zIndex)||0}function ht(n){const e=[];for(;n;)e.push(n),n=Dt(n);return e}function Dt(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Lt=1,_t=2,At=4,Tt=8,Vn=On()==="coarse";let ie=[],Pe=!1,ge=new Map,Be=new Map;const Re=new Set;function Xn(n,e,t,s,r){var i;const{ownerDocument:o}=e,l={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},a=(i=ge.get(o))!==null&&i!==void 0?i:0;return ge.set(o,a+1),Re.add(l),He(),function(){var p;Be.delete(n),Re.delete(l);const d=(p=ge.get(o))!==null&&p!==void 0?p:1;if(ge.set(o,d-1),He(),d===1&&ge.delete(o),ie.includes(l)){const f=ie.indexOf(l);f>=0&&ie.splice(f,1),lt(),r("up",!0,null)}}}function Qn(n){const{target:e}=n,{x:t,y:s}=qe(n);Pe=!0,ot({target:e,x:t,y:s}),He(),ie.length>0&&(Ue("down",n),n.preventDefault(),Ft(e)||n.stopImmediatePropagation())}function Xe(n){const{x:e,y:t}=qe(n);if(Pe&&n.buttons===0&&(Pe=!1,Ue("up",n)),!Pe){const{target:s}=n;ot({target:s,x:e,y:t})}Ue("move",n),lt(),ie.length>0&&n.preventDefault()}function Qe(n){const{target:e}=n,{x:t,y:s}=qe(n);Be.clear(),Pe=!1,ie.length>0&&(n.preventDefault(),Ft(e)||n.stopImmediatePropagation()),Ue("up",n),ot({target:e,x:t,y:s}),lt(),He()}function Ft(n){let e=n;for(;e;){if(e.hasAttribute(V.resizeHandle))return!0;e=e.parentElement}return!1}function ot({target:n,x:e,y:t}){ie.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Re.forEach(r=>{const{element:i,hitAreaMargins:o}=r,l=i.getBoundingClientRect(),{bottom:a,left:u,right:p,top:d}=l,f=Vn?o.coarse:o.fine;if(e>=u-f&&e<=p+f&&t>=d-f&&t<=a+f){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&qn(s,i)>0){let m=s,z=!1;for(;m&&!m.contains(i);){if(Wn(m.getBoundingClientRect(),l)){z=!0;break}m=m.parentElement}if(z)return}ie.push(r)}})}function Je(n,e){Be.set(n,e)}function lt(){let n=!1,e=!1;ie.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;Be.forEach(s=>{t|=s}),n&&e?Ve("intersection",t):n?Ve("horizontal",t):e?Ve("vertical",t):Un()}let Ye=new AbortController;function He(){Ye.abort(),Ye=new AbortController;const n={capture:!0,signal:Ye.signal};Re.size&&(Pe?(ie.length>0&&ge.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",Qe,n),s.addEventListener("pointerleave",Xe,n),s.addEventListener("pointermove",Xe,n))}),window.addEventListener("pointerup",Qe,n),window.addEventListener("pointercancel",Qe,n)):ge.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Qn,n),s.addEventListener("pointermove",Xe,n))}))}function Ue(n,e){Re.forEach(t=>{const{setResizeHandlerState:s}=t,r=ie.includes(t);s(n,r,e)})}function Jn(){const[n,e]=g.useState(0);return g.useCallback(()=>e(t=>t+1),[])}function E(n,e){if(!n)throw console.error(e),Error(e)}function we(n,e,t=rt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function pe(n,e,t=rt){return we(n,e,t)===0}function te(n,e,t){return we(n,e,t)===0}function Yn(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const r=n[s],i=e[s];if(!te(r,i,t))return!1}return!0}function ke({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];E(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:l=0}=s;if(we(t,l)<0)if(i){const a=(r+l)/2;we(t,a)<0?t=r:t=l}else t=l;return t=Math.min(o,t),t=parseFloat(t.toFixed(rt)),t}function Ee({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(te(n,0))return e;const o=[...e],[l,a]=s;E(l!=null,"Invalid first pivot index"),E(a!=null,"Invalid second pivot index");let u=0;if(i==="keyboard"){{const d=n<0?a:l,f=t[d];E(f,`Panel constraints not found for index ${d}`);const{collapsedSize:x=0,collapsible:m,minSize:z=0}=f;if(m){const v=e[d];if(E(v!=null,`Previous layout not found for panel index ${d}`),te(v,x)){const y=z-v;we(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}{const d=n<0?l:a,f=t[d];E(f,`No panel constraints found for index ${d}`);const{collapsedSize:x=0,collapsible:m,minSize:z=0}=f;if(m){const v=e[d];if(E(v!=null,`Previous layout not found for panel index ${d}`),te(v,z)){const y=v-x;we(y,Math.abs(n))>0&&(n=n<0?0-y:y)}}}}{const d=n<0?1:-1;let f=n<0?a:l,x=0;for(;;){const z=e[f];E(z!=null,`Previous layout not found for panel index ${f}`);const y=ke({panelConstraints:t,panelIndex:f,size:100})-z;if(x+=y,f+=d,f<0||f>=t.length)break}const m=Math.min(Math.abs(n),Math.abs(x));n=n<0?0-m:m}{let f=n<0?l:a;for(;f>=0&&f<t.length;){const x=Math.abs(n)-Math.abs(u),m=e[f];E(m!=null,`Previous layout not found for panel index ${f}`);const z=m-x,v=ke({panelConstraints:t,panelIndex:f,size:z});if(!te(m,v)&&(u+=m-v,o[f]=v,u.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?f--:f++}}if(Yn(r,o))return r;{const d=n<0?a:l,f=e[d];E(f!=null,`Previous layout not found for panel index ${d}`);const x=f+u,m=ke({panelConstraints:t,panelIndex:d,size:x});if(o[d]=m,!te(m,x)){let z=x-m,y=n<0?a:l;for(;y>=0&&y<t.length;){const P=o[y];E(P!=null,`Previous layout not found for panel index ${y}`);const M=P+z,k=ke({panelConstraints:t,panelIndex:y,size:M});if(te(P,k)||(z-=k-P,o[y]=k),te(z,0))break;n>0?y--:y++}}}const p=o.reduce((d,f)=>f+d,0);return te(p,100)?o:r}function Zn({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,o=0;const l=t[0];E(l!=null,"No pivot index found"),e.forEach((d,f)=>{const{constraints:x}=d,{maxSize:m=100,minSize:z=0}=x;f===l?(s=z,r=m):(i+=z,o+=m)});const a=Math.min(r,100-i),u=Math.max(s,100-o),p=n[l];return{valueMax:a,valueMin:u,valueNow:p}}function De(n,e=document){return Array.from(e.querySelectorAll(`[${V.resizeHandleId}][data-panel-group-id="${n}"]`))}function Ht(n,e,t=document){const r=De(n,t).findIndex(i=>i.getAttribute(V.resizeHandleId)===e);return r??null}function Ut(n,e,t){const s=Ht(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function Ot(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function Ke(n,e=document){const t=e.querySelector(`[${V.resizeHandleId}="${n}"]`);return t||null}function es(n,e,t,s=document){var r,i,o,l;const a=Ke(e,s),u=De(n,s),p=a?u.indexOf(a):-1,d=(r=(i=t[p])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(l=t[p+1])===null||l===void 0?void 0:l.id)!==null&&o!==void 0?o:null;return[d,f]}function ts({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:o}){g.useRef({didWarnAboutMissingResizeHandle:!1}),ye(()=>{if(!i)return;const l=De(t,i);for(let a=0;a<r.length-1;a++){const{valueMax:u,valueMin:p,valueNow:d}=Zn({layout:s,panelsArray:r,pivotIndices:[a,a+1]}),f=l[a];if(f!=null){const x=r[a];E(x,`No panel data found for index "${a}"`),f.setAttribute("aria-controls",x.id),f.setAttribute("aria-valuemax",""+Math.round(u)),f.setAttribute("aria-valuemin",""+Math.round(p)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{l.forEach((a,u)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,s,r,i]),g.useEffect(()=>{if(!i)return;const l=e.current;E(l,"Eager values not found");const{panelDataArray:a}=l,u=Ot(t,i);E(u!=null,`No group found for id "${t}"`);const p=De(t,i);E(p,`No resize handles found for group id "${t}"`);const d=p.map(f=>{const x=f.getAttribute(V.resizeHandleId);E(x,"Resize handle element has no handle id attribute");const[m,z]=es(t,x,a,i);if(m==null||z==null)return()=>{};const v=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const P=a.findIndex(M=>M.id===m);if(P>=0){const M=a[P];E(M,`No panel data found for index ${P}`);const k=s[P],{collapsedSize:W=0,collapsible:N,minSize:w=0}=M.constraints;if(k!=null&&N){const K=Ee({delta:te(k,W)?w-W:W-k,initialLayout:s,panelConstraints:a.map(q=>q.constraints),pivotIndices:Ut(t,x,i),prevLayout:s,trigger:"keyboard"});s!==K&&o(K)}}break}}};return f.addEventListener("keydown",v),()=>{f.removeEventListener("keydown",v)}});return()=>{d.forEach(f=>f())}},[i,n,e,t,s,r,o])}function xt(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Wt(n,e){const t=n==="horizontal",{x:s,y:r}=qe(e);return t?s:r}function ns(n,e,t,s,r){const i=t==="horizontal",o=Ke(e,r);E(o,`No resize handle element found for id "${e}"`);const l=o.getAttribute(V.groupId);E(l,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=s;const u=Wt(t,n),p=Ot(l,r);E(p,`No group element found for id "${l}"`);const d=p.getBoundingClientRect(),f=i?d.width:d.height;return(u-a)/f*100}function ss(n,e,t,s,r,i){if(It(n)){const o=t==="horizontal";let l=0;n.shiftKey?l=100:r!=null?l=r:l=10;let a=0;switch(n.key){case"ArrowDown":a=o?0:l;break;case"ArrowLeft":a=o?-l:0;break;case"ArrowRight":a=o?l:0;break;case"ArrowUp":a=o?0:-l;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return s==null?0:ns(n,e,t,s,i)}function rs({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,r=100;for(let i=0;i<n.length;i++){const o=t[i];E(o,`Panel constraints not found for index ${i}`);const{defaultSize:l}=o;l!=null&&(s++,e[i]=l,r-=l)}for(let i=0;i<n.length;i++){const o=t[i];E(o,`Panel constraints not found for index ${i}`);const{defaultSize:l}=o;if(l!=null)continue;const a=n.length-s,u=r/a;s++,e[i]=u,r-=u}return e}function Se(n,e,t){e.forEach((s,r)=>{const i=n[r];E(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:l,id:a}=i,{collapsedSize:u=0,collapsible:p}=l,d=t[a];if(d==null||s!==d){t[a]=s;const{onCollapse:f,onExpand:x,onResize:m}=o;m&&m(s,d),p&&(f||x)&&(x&&(d==null||pe(d,u))&&!pe(s,u)&&x(),f&&(d==null||!pe(d,u))&&pe(s,u)&&f())}})}function Ae(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function is({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const o=t[r];let l;return o==null?l=n!=null?n.toPrecision(i):"1":s.length===1?l="1":l=o.toPrecision(i),{flexBasis:0,flexGrow:l,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function os(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function gt(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function qt(n){return`react-resizable-panels:${n}`}function Bt(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:r,order:i}=e;return r?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function Kt(n,e){try{const t=qt(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function ls(n,e,t){var s,r;const i=(s=Kt(n,t))!==null&&s!==void 0?s:{},o=Bt(e);return(r=i[o])!==null&&r!==void 0?r:null}function as(n,e,t,s,r){var i;const o=qt(n),l=Bt(e),a=(i=Kt(n,r))!==null&&i!==void 0?i:{};a[l]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(o,JSON.stringify(a))}catch(u){console.error(u)}}function yt({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,o)=>i+o,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!te(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const o=t[i];E(o!=null,`No layout data found for index ${i}`);const l=100/s*o;t[i]=l}let r=0;for(let i=0;i<e.length;i++){const o=t[i];E(o!=null,`No layout data found for index ${i}`);const l=ke({panelConstraints:e,panelIndex:i,size:o});o!=l&&(r+=o-l,t[i]=l)}if(!te(r,0))for(let i=0;i<e.length;i++){const o=t[i];E(o!=null,`No layout data found for index ${i}`);const l=o+r,a=ke({panelConstraints:e,panelIndex:i,size:l});if(o!==a&&(r-=a-o,t[i]=a,te(r,0)))break}return t}const cs=100,Ne={getItem:n=>(gt(Ne),Ne.getItem(n)),setItem:(n,e)=>{gt(Ne),Ne.setItem(n,e)}},wt={};function Gt({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:l=null,storage:a=Ne,style:u,tagName:p="div",...d}){const f=it(i),x=g.useRef(null),[m,z]=g.useState(null),[v,y]=g.useState([]),P=Jn(),M=g.useRef({}),k=g.useRef(new Map),W=g.useRef(0),N=g.useRef({autoSaveId:n,direction:s,dragState:m,id:f,keyboardResizeBy:l,onLayout:o,storage:a}),w=g.useRef({layout:v,panelDataArray:[],panelDataArrayChanged:!1});g.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),g.useImperativeHandle(r,()=>({getId:()=>N.current.id,getLayout:()=>{const{layout:h}=w.current;return h},setLayout:h=>{const{onLayout:j}=N.current,{layout:I,panelDataArray:C}=w.current,b=yt({layout:h,panelConstraints:C.map($=>$.constraints)});xt(I,b)||(y(b),w.current.layout=b,j&&j(b),Se(C,b,M.current))}}),[]),ye(()=>{N.current.autoSaveId=n,N.current.direction=s,N.current.dragState=m,N.current.id=f,N.current.onLayout=o,N.current.storage=a}),ts({committedValuesRef:N,eagerValuesRef:w,groupId:f,layout:v,panelDataArray:w.current.panelDataArray,setLayout:y,panelGroupElement:x.current}),g.useEffect(()=>{const{panelDataArray:h}=w.current;if(n){if(v.length===0||v.length!==h.length)return;let j=wt[n];j==null&&(j=os(as,cs),wt[n]=j);const I=[...h],C=new Map(k.current);j(n,I,C,v,a)}},[n,v,a]),g.useEffect(()=>{});const K=g.useCallback(h=>{const{onLayout:j}=N.current,{layout:I,panelDataArray:C}=w.current;if(h.constraints.collapsible){const b=C.map(ae=>ae.constraints),{collapsedSize:$=0,panelSize:O,pivotIndices:Q}=xe(C,h,I);if(E(O!=null,`Panel size not found for panel "${h.id}"`),!pe(O,$)){k.current.set(h.id,O);const ce=ze(C,h)===C.length-1?O-$:$-O,G=Ee({delta:ce,initialLayout:I,panelConstraints:b,pivotIndices:Q,prevLayout:I,trigger:"imperative-api"});Ae(I,G)||(y(G),w.current.layout=G,j&&j(G),Se(C,G,M.current))}}},[]),q=g.useCallback((h,j)=>{const{onLayout:I}=N.current,{layout:C,panelDataArray:b}=w.current;if(h.constraints.collapsible){const $=b.map(re=>re.constraints),{collapsedSize:O=0,panelSize:Q=0,minSize:ae=0,pivotIndices:ce}=xe(b,h,C),G=j??ae;if(pe(Q,O)){const re=k.current.get(h.id),Ce=re!=null&&re>=G?re:G,Ge=ze(b,h)===b.length-1?Q-Ce:Ce-Q,Z=Ee({delta:Ge,initialLayout:C,panelConstraints:$,pivotIndices:ce,prevLayout:C,trigger:"imperative-api"});Ae(C,Z)||(y(Z),w.current.layout=Z,I&&I(Z),Se(b,Z,M.current))}}},[]),U=g.useCallback(h=>{const{layout:j,panelDataArray:I}=w.current,{panelSize:C}=xe(I,h,j);return E(C!=null,`Panel size not found for panel "${h.id}"`),C},[]),T=g.useCallback((h,j)=>{const{panelDataArray:I}=w.current,C=ze(I,h);return is({defaultSize:j,dragState:m,layout:v,panelData:I,panelIndex:C})},[m,v]),D=g.useCallback(h=>{const{layout:j,panelDataArray:I}=w.current,{collapsedSize:C=0,collapsible:b,panelSize:$}=xe(I,h,j);return E($!=null,`Panel size not found for panel "${h.id}"`),b===!0&&pe($,C)},[]),X=g.useCallback(h=>{const{layout:j,panelDataArray:I}=w.current,{collapsedSize:C=0,collapsible:b,panelSize:$}=xe(I,h,j);return E($!=null,`Panel size not found for panel "${h.id}"`),!b||we($,C)>0},[]),_=g.useCallback(h=>{const{panelDataArray:j}=w.current;j.push(h),j.sort((I,C)=>{const b=I.order,$=C.order;return b==null&&$==null?0:b==null?-1:$==null?1:b-$}),w.current.panelDataArrayChanged=!0,P()},[P]);ye(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:h,onLayout:j,storage:I}=N.current,{layout:C,panelDataArray:b}=w.current;let $=null;if(h){const Q=ls(h,b,I);Q&&(k.current=new Map(Object.entries(Q.expandToSizes)),$=Q.layout)}$==null&&($=rs({panelDataArray:b}));const O=yt({layout:$,panelConstraints:b.map(Q=>Q.constraints)});xt(C,O)||(y(O),w.current.layout=O,j&&j(O),Se(b,O,M.current))}}),ye(()=>{const h=w.current;return()=>{h.layout=[]}},[]);const L=g.useCallback(h=>{let j=!1;const I=x.current;return I&&window.getComputedStyle(I,null).getPropertyValue("direction")==="rtl"&&(j=!0),function(b){b.preventDefault();const $=x.current;if(!$)return()=>null;const{direction:O,dragState:Q,id:ae,keyboardResizeBy:ce,onLayout:G}=N.current,{layout:re,panelDataArray:Ce}=w.current,{initialLayout:Le}=Q??{},Ge=Ut(ae,h,$);let Z=ss(b,h,O,Q,ce,$);const ct=O==="horizontal";ct&&j&&(Z=-Z);const rn=Ce.map(on=>on.constraints),$e=Ee({delta:Z,initialLayout:Le??re,panelConstraints:rn,pivotIndices:Ge,prevLayout:re,trigger:It(b)?"keyboard":"mouse-or-touch"}),ut=!Ae(re,$e);(Mt(b)||Rt(b))&&W.current!=Z&&(W.current=Z,!ut&&Z!==0?ct?Je(h,Z<0?Lt:_t):Je(h,Z<0?At:Tt):Je(h,0)),ut&&(y($e),w.current.layout=$e,G&&G($e),Se(Ce,$e,M.current))}},[]),F=g.useCallback((h,j)=>{const{onLayout:I}=N.current,{layout:C,panelDataArray:b}=w.current,$=b.map(re=>re.constraints),{panelSize:O,pivotIndices:Q}=xe(b,h,C);E(O!=null,`Panel size not found for panel "${h.id}"`);const ce=ze(b,h)===b.length-1?O-j:j-O,G=Ee({delta:ce,initialLayout:C,panelConstraints:$,pivotIndices:Q,prevLayout:C,trigger:"imperative-api"});Ae(C,G)||(y(G),w.current.layout=G,I&&I(G),Se(b,G,M.current))},[]),H=g.useCallback((h,j)=>{const{layout:I,panelDataArray:C}=w.current,{collapsedSize:b=0,collapsible:$}=j,{collapsedSize:O=0,collapsible:Q,maxSize:ae=100,minSize:ce=0}=h.constraints,{panelSize:G}=xe(C,h,I);G!=null&&($&&Q&&pe(G,b)?pe(b,O)||F(h,O):G<ce?F(h,ce):G>ae&&F(h,ae))},[F]),J=g.useCallback((h,j)=>{const{direction:I}=N.current,{layout:C}=w.current;if(!x.current)return;const b=Ke(h,x.current);E(b,`Drag handle element not found for id "${h}"`);const $=Wt(I,j);z({dragHandleId:h,dragHandleRect:b.getBoundingClientRect(),initialCursorPosition:$,initialLayout:C})},[]),ne=g.useCallback(()=>{z(null)},[]),B=g.useCallback(h=>{const{panelDataArray:j}=w.current,I=ze(j,h);I>=0&&(j.splice(I,1),delete M.current[h.id],w.current.panelDataArrayChanged=!0,P())},[P]),S=g.useMemo(()=>({collapsePanel:K,direction:s,dragState:m,expandPanel:q,getPanelSize:U,getPanelStyle:T,groupId:f,isPanelCollapsed:D,isPanelExpanded:X,reevaluatePanelConstraints:H,registerPanel:_,registerResizeHandle:L,resizePanel:F,startDragging:J,stopDragging:ne,unregisterPanel:B,panelGroupElement:x.current}),[K,m,s,q,U,T,f,D,X,H,_,L,F,J,ne,B]),R={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return g.createElement(We.Provider,{value:S},g.createElement(p,{...d,children:e,className:t,id:i,ref:x,style:{...R,...u},[V.group]:"",[V.groupDirection]:s,[V.groupId]:f}))}const Vt=g.forwardRef((n,e)=>g.createElement(Gt,{...n,forwardedRef:e}));Gt.displayName="PanelGroup";Vt.displayName="forwardRef(PanelGroup)";function ze(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function xe(n,e,t){const s=ze(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],o=t[s];return{...e.constraints,panelSize:o,pivotIndices:i}}function us({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){g.useEffect(()=>{if(n||t==null||s==null)return;const r=Ke(e,s);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),t(o);break}case"F6":{o.preventDefault();const l=r.getAttribute(V.groupId);E(l,`No group element found for id "${l}"`);const a=De(l,s),u=Ht(l,e,s);E(u!==null,`No resize element found for id "${e}"`);const p=o.shiftKey?u>0?u-1:a.length-1:u+1<a.length?u+1:0;a[p].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[s,n,e,t])}function Xt({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:o,onDragging:l,onFocus:a,onPointerDown:u,onPointerUp:p,style:d={},tabIndex:f=0,tagName:x="div",...m}){var z,v;const y=g.useRef(null),P=g.useRef({onClick:o,onDragging:l,onPointerDown:u,onPointerUp:p});g.useEffect(()=>{P.current.onClick=o,P.current.onDragging=l,P.current.onPointerDown=u,P.current.onPointerUp=p});const M=g.useContext(We);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:k,groupId:W,registerResizeHandle:N,startDragging:w,stopDragging:K,panelGroupElement:q}=M,U=it(r),[T,D]=g.useState("inactive"),[X,_]=g.useState(!1),[L,F]=g.useState(null),H=g.useRef({state:T});ye(()=>{H.current.state=T}),g.useEffect(()=>{if(t)F(null);else{const S=N(U);F(()=>S)}},[t,U,N]);const J=(z=s?.coarse)!==null&&z!==void 0?z:15,ne=(v=s?.fine)!==null&&v!==void 0?v:5;g.useEffect(()=>{if(t||L==null)return;const S=y.current;E(S,"Element ref not attached");let R=!1;return Xn(U,S,k,{coarse:J,fine:ne},(j,I,C)=>{if(!I){D("inactive");return}switch(j){case"down":{D("drag"),R=!1,E(C,'Expected event to be defined for "down" action'),w(U,C);const{onDragging:b,onPointerDown:$}=P.current;b?.(!0),$?.();break}case"move":{const{state:b}=H.current;R=!0,b!=="drag"&&D("hover"),E(C,'Expected event to be defined for "move" action'),L(C);break}case"up":{D("hover"),K();const{onClick:b,onDragging:$,onPointerUp:O}=P.current;$?.(!1),O?.(),R||b?.();break}}})},[J,k,t,ne,N,U,L,w,K]),us({disabled:t,handleId:U,resizeHandler:L,panelGroupElement:q});const B={touchAction:"none",userSelect:"none"};return g.createElement(x,{...m,children:n,className:e,id:r,onBlur:()=>{_(!1),i?.()},onFocus:()=>{_(!0),a?.()},ref:y,role:"separator",style:{...B,...d},tabIndex:f,[V.groupDirection]:k,[V.groupId]:W,[V.resizeHandle]:"",[V.resizeHandleActive]:T==="drag"?"pointer":X?"keyboard":void 0,[V.resizeHandleEnabled]:!t,[V.resizeHandleId]:U,[V.resizeHandleState]:T})}Xt.displayName="PanelResizeHandle";function dr(n){const e=A.c(10);let t,s,r;e[0]!==n?({className:t,ref:r,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=ve("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let o;return e[6]!==s||e[7]!==r||e[8]!==i?(o=c.jsx(Vt,{ref:r,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=r,e[8]=i,e[9]=o):o=e[9],o}function fr(n){const e=A.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx(Nt,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function pr(n){const e=A.c(12);let t,s,r;e[0]!==n?({withHandle:r,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=ve("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),e[4]=t,e[5]=i):i=e[5];let o;e[6]!==r?(o=r&&c.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:c.jsx(hn,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let l;return e[8]!==s||e[9]!==i||e[10]!==o?(l=c.jsx(Xt,{"data-slot":"resizable-handle",className:i,...s,children:o}),e[8]=s,e[9]=i,e[10]=o,e[11]=l):l=e[11],l}function Qt(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function oe(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function le(n,e){const t=await fetch(n,e);if(!t.ok){let s="";try{s=(await t.json()).error??""}catch{}throw new Error(s||`HTTP ${t.status}`)}return t}function mr(n,e){const t=A.c(11),{org:s}=se();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=Y.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=r):r=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await le(oe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(ds),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let o;return t[8]!==r||t[9]!==i?(o={queryKey:r,placeholderData:an,queryFn:i},t[8]=r,t[9]=i,t[10]=o):o=t[10],be(o)}function ds(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function Jt(n,e,t){const s=A.c(15),{org:r}=se();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=Y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const o=n!==null;let l;s[4]!==t?(l=t?.refetchIntervalWhenAbsent?p=>p.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=l):l=s[5];let a;s[6]!==r.slug||s[7]!==e||s[8]!==n?(a=async()=>{const p=await fetch(oe(r.slug,n??"","stat",{path:e}));if(p.status===404)return null;if(!p.ok)throw new Error(`HTTP ${p.status}`);return(await p.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=a):a=s[9];let u;return s[10]!==i||s[11]!==o||s[12]!==l||s[13]!==a?(u={queryKey:i,enabled:o,refetchInterval:l,queryFn:a},s[10]=i,s[11]=o,s[12]=l,s[13]=a,s[14]=u):u=s[14],be(u)}function hr(n){const e=A.c(9),{org:t}=se();let s;e[0]!==t.id||e[1]!==n?(s=Y.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async()=>await(await le(oe(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,queryFn:r},e[6]=s,e[7]=r,e[8]=i):i=e[8],be(i)}function xr(n,e){const t=A.c(9),s=n===void 0?60:n,{org:r}=se();let i;t[0]!==r.id?(i=Y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const o=e?.enabled;let l;t[2]!==s||t[3]!==r.slug?(l=async()=>(await(await le(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=l):l=t[4];let a;return t[5]!==i||t[6]!==o||t[7]!==l?(a={queryKey:i,enabled:o,queryFn:l},t[5]=i,t[6]=o,t[7]=l,t[8]=a):a=t[8],be(a)}function gr(n){const e=A.c(8),{org:t}=se();let s;e[0]!==t.id?(s=Y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const l=await le(`/api/${encodeURIComponent(t.slug)}/fs/public-sets`),{sets:a}=await l.json(),u=["home",...a.map(ps)];return(await Promise.all(u.map(async d=>{const f=await le(oe(t.slug,d,"list",{path:""})),{entries:x}=await f.json();return x.filter(fs).map(m=>({volume:d,path:m.path}))}))).flat()},e[2]=t.slug,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==r||e[6]!==i?(o={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=o):o=e[7],be(o)}function fs(n){return n.kind==="dir"&&n.hasSkill}function ps(n){return`public-${n}`}function yr(){const n=A.c(7),{org:e}=se();let t;n[0]!==e.id?(t=Y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await le(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],be(r)}function ms(n){const e=A.c(3),{org:t}=se();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>oe(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function wr(){const n=A.c(2),{org:e}=se();let t;return n[0]!==e.slug?(t=(s,r)=>oe(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function hs(n){const e=A.c(3),{org:t}=se();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await le(oe(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],Ie(s)}function xs(n){const e=A.c(18),{org:t}=se(),s=st();let r;e[0]!==t||e[1]!==n?(r=async u=>(await(await le(oe(t.slug,n,"public",{path:u.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:u.mode,password:u.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async u=>{const p=Y.orgFsStat(t.id,n,u.path);await s.cancelQueries({queryKey:p});const d=s.getQueryData(p),f=u.mode!=="private";return s.setQueryData(p,x=>x&&{...x,readPublic:f,effectivePublic:f,shareMode:u.mode}),{key:p,previous:d}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let o;e[7]!==s?(o=(u,p,d)=>{d&&s.setQueryData(d.key,d.previous)},e[7]=s,e[8]=o):o=e[8];let l;e[9]!==t||e[10]!==s||e[11]!==n?(l=(u,p,d)=>{s.invalidateQueries({queryKey:Y.orgFsStat(t.id,n,d.path)}),s.invalidateQueries({queryKey:Y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Y.orgFsRecent(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=l):l=e[12];let a;return e[13]!==r||e[14]!==i||e[15]!==o||e[16]!==l?(a={mutationFn:r,onMutate:i,onError:o,onSettled:l},e[13]=r,e[14]=i,e[15]=o,e[16]=l,e[17]=a):a=e[17],Ie(a)}function vr(n){const e=A.c(26),{org:t}=se(),s=st();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:Y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Y.orgFsRecent(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let o;e[4]!==t||e[5]!==n?(o=async v=>{for(const y of v.files){const P=v.dir?`${v.dir}/${y.name}`:y.name;await le(oe(t.slug,n,"file",{path:P}),{method:"PUT",headers:{"content-type":y.type||"application/octet-stream"},body:y})}},e[4]=t,e[5]=n,e[6]=o):o=e[6];let l;e[7]!==i||e[8]!==o?(l={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=l):l=e[9];const a=Ie(l);let u;e[10]!==t||e[11]!==n?(u=async v=>{await le(oe(t.slug,n,"dir",{path:v}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=u):u=e[12];let p;e[13]!==i||e[14]!==u?(p={mutationFn:u,onSuccess:i},e[13]=i,e[14]=u,e[15]=p):p=e[15];const d=Ie(p);let f;e[16]!==t||e[17]!==n?(f=async v=>{await le(oe(t.slug,n,"file",{path:v}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=f):f=e[18];let x;e[19]!==i||e[20]!==f?(x={mutationFn:f,onSuccess:i},e[19]=i,e[20]=f,e[21]=x):x=e[21];const m=Ie(x);let z;return e[22]!==d||e[23]!==m||e[24]!==a?(z={upload:a,mkdir:d,remove:m},e[22]=d,e[23]=m,e[24]=a,e[25]=z):z=e[25],z}function gs(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function ys(n){if(gs(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function ws(n){try{return decodeURIComponent(n)}catch{return n}}function vs(n){return ys(n),encodeURIComponent(n)}function bs(n){return`.deco/blocks/${vs(n)}.json`}function br(n){return`/${bs(n)}`}const Sr=1e4,Ss=3;function nt(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function at(n){return n.startsWith("/")?n.slice(1):n}function Oe(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function zs(n){const e=Oe(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function zr(n,e){const t=e.replace(/^\/+|\/+$/g,"");return Oe(t?`${n==="/"?"":n}/${t}`:n)}function jr(n,e){return e==="directory"?n:zs(n)}function kr(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function js(n){const e=at(n);return e?e.split("/").filter(Boolean).length:0}function Pr(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Cr(n,e){return js(n)>=Ss&&!e.has(n)}function $r(n,e,t=[]){const s=at(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const r=`${s}/`;return e.some(i=>i.startsWith(r))||t.some(i=>i.startsWith(r))}function Er(n){const e=at(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return ws(s)}function ks(n){if(!n)return"plaintext";const e=n.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}function Nr(n){const e=nt(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function Ir(n,e=[]){const t={children:[]},s=i=>{const l=nt(i).split("/").filter(Boolean);let a=t,u="";for(const p of l){u+=`/${p}`;let d=a.children.find(f=>f.name===p);d?d.kind==="file"&&(d.kind="directory"):(d={name:p,path:u,kind:"directory",children:[]},a.children.push(d)),a=d}};for(const i of n){const l=nt(i).split("/").filter(Boolean);let a=t,u="";l.forEach((p,d)=>{u+=`/${p}`;const f=d===l.length-1;let x=a.children.find(m=>m.name===p);x||(x={name:p,path:u,kind:f?"file":"directory",children:[]},a.children.push(x)),a=x})}for(const i of e)s(Oe(i));const r=i=>{i.sort((o,l)=>o.kind!==l.kind?o.kind==="directory"?-1:1:o.name.localeCompare(l.name));for(const o of i)o.children.length>0&&r(o.children)};return r(t.children),t.children}function Ps(n,e,t=0){const s=[];for(const r of n)r.name!==".gitkeep"&&(s.push({node:r,depth:t}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&s.push(...Ps(r.children,e,t+1)));return s}function Mr(n){return n.split(`
2
- `).map(e=>{const t=e.match(/^\d+\t(.*)/);return t?t[1]:e}).join(`
3
- `)}jn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Cs(n){const e=A.c(11),{value:t,filename:s}=n,[r]=cn(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let o;e[0]!==s?(o=ks(s),e[0]=s,e[1]=o):o=e[1];const l=i?"vs-dark":"light";let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:c.jsx(un,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let u,p;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={enabled:!1},p={top:12,bottom:12},e[3]=u,e[4]=p):(u=e[3],p=e[4]);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:u,padding:p,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=d):d=e[5];let f;return e[6]!==s||e[7]!==o||e[8]!==l||e[9]!==t?(f=c.jsx(kn,{path:s,language:o,value:t,theme:l,loading:a,options:d},s),e[6]=s,e[7]=o,e[8]=l,e[9]=t,e[10]=f):f=e[10],f}function Yt(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const $s=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Es=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),vt=2*1024*1024;function Ns(n,e){const t=n.split(".").pop()?.toLowerCase()??"";return $s.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=vt?"markdown":"download":Es.has(t)&&e<=vt?"text":"download"}function Zt(){const n=A.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(_e,{className:"h-6 w-2/3"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:c.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx(_e,{className:"h-3 w-full"}),c.jsx(_e,{className:"h-3 w-5/6"}),c.jsx(_e,{className:"h-3 w-2/3"})]})]})}),n[1]=t):t=n[1],t}function en(n){const e=A.c(20),{file:t,note:s}=n;let r;e[0]!==t.filename?(r=c.jsx(et,{filename:t.filename,className:"h-12 w-10"}),e[0]=t.filename,e[1]=r):r=e[1];let i;e[2]!==t.filename?(i=c.jsx("span",{className:"text-sm font-medium text-foreground",children:t.filename}),e[2]=t.filename,e[3]=i):i=e[3];let o;e[4]!==t.size?(o=Yt(t.size),e[4]=t.size,e[5]=o):o=e[5];const l=s?` · ${s}`:"";let a;e[6]!==o||e[7]!==l?(a=c.jsxs("span",{className:"text-xs text-muted-foreground",children:[o,l]}),e[6]=o,e[7]=l,e[8]=a):a=e[8];let u;e[9]!==i||e[10]!==a?(u=c.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,a]}),e[9]=i,e[10]=a,e[11]=u):u=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(Fe,{size:14}),e[12]=p):p=e[12];let d;e[13]!==t.downloadUrl||e[14]!==t.filename?(d=c.jsx(ee,{asChild:!0,variant:"outline",size:"sm",children:c.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[p,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=d):d=e[15];let f;return e[16]!==r||e[17]!==u||e[18]!==d?(f=c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[r,u,d]})}),e[16]=r,e[17]=u,e[18]=d,e[19]=f):f=e[19],f}function bt(n){const e=A.c(16),{file:t,markdown:s}=n;let r;e[0]!==t.downloadUrl?(r=Y.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==t.downloadUrl?(i=async()=>{const d=await fetch(t.downloadUrl,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=t.downloadUrl,e[3]=i):i=e[3];let o;e[4]!==r||e[5]!==i?(o={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=o):o=e[6];const{data:l,isPending:a,isError:u}=be(o);if(a){let d;return e[7]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Zt,{}),e[7]=d):d=e[7],d}if(u||l===void 0){let d;return e[8]!==t?(d=c.jsx(en,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=d):d=e[9],d}if(s){const d=`file-preview-${t.key}`;let f;return e[10]!==l||e[11]!==d?(f=c.jsx("div",{className:"h-full overflow-y-auto",children:c.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:c.jsx(Pn,{id:d,text:l})})}),e[10]=l,e[11]=d,e[12]=f):f=e[12],f}let p;return e[13]!==l||e[14]!==t.filename?(p=c.jsx(Cs,{value:l,filename:t.filename}),e[13]=l,e[14]=t.filename,e[15]=p):p=e[15],p}function Is(n){const e=A.c(15),{file:t}=n;switch(Ns(t.filename,t.size)){case"image":{let r;return e[0]!==t.downloadUrl||e[1]!==t.filename?(r=c.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:c.jsx("img",{src:t.downloadUrl,alt:t.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=t.downloadUrl,e[1]=t.filename,e[2]=r):r=e[2],r}case"pdf":{let r;return e[3]!==t.downloadUrl||e[4]!==t.filename?(r=c.jsx("iframe",{src:t.downloadUrl,title:t.filename,className:"block h-full w-full bg-white"}),e[3]=t.downloadUrl,e[4]=t.filename,e[5]=r):r=e[5],r}case"html":{let r;return e[6]!==t.downloadUrl||e[7]!==t.filename?(r=c.jsx("iframe",{src:t.downloadUrl,title:t.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=t.downloadUrl,e[7]=t.filename,e[8]=r):r=e[8],r}case"markdown":{let r;return e[9]!==t?(r=c.jsx(bt,{file:t,markdown:!0}),e[9]=t,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==t?(r=c.jsx(bt,{file:t,markdown:!1}),e[11]=t,e[12]=r):r=e[12],r}default:{let r;return e[13]!==t?(r=c.jsx(en,{file:t}),e[13]=t,e[14]=r):r=e[14],r}}}function Ms(n){const e=A.c(40),{readUrl:t,editor:s,downloadName:r,trailing:i}=n;let o;e[0]!==t?(o=new URL(t,window.location.origin).toString(),e[0]=t,e[1]=o):o=e[1];const l=o;let a;e[2]!==s?(a=s.deckDetected&&c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:s.railOpen?"secondary":"ghost",size:"icon","aria-label":s.railOpen?"Hide slide list":"Show slide list",onClick:()=>s.setRailOpen(!s.railOpen),children:c.jsx(Nn,{size:14})})}),c.jsx(fe,{side:"bottom",children:s.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=s,e[3]=a):a=e[3];let u;e[4]!==l?(u=()=>window.open(l,"_blank","noopener"),e[4]=l,e[5]=u):u=e[5];let p;e[6]!==l?(p=c.jsx("span",{className:"truncate",children:l}),e[6]=l,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==u||e[10]!==p?(d=c.jsx("button",{type:"button",onClick:u,className:"flex min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:l,children:p}),e[8]=l,e[9]=u,e[10]=p,e[11]=d):d=e[11];let f;e[12]!==s.agentUpdated||e[13]!==s.reload?(f=s.agentUpdated&&c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsxs(ee,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:s.reload,children:[c.jsx(dn,{size:12}),"Agent updated — reload"]})}),c.jsx(fe,{side:"bottom",children:"The agent rewrote this deck while you were editing. Reloading discards unsaved differences."})]}),e[12]=s.agentUpdated,e[13]=s.reload,e[14]=f):f=e[14];let x;e[15]!==s.saving?(x=s.saving&&c.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=s.saving,e[16]=x):x=e[16];let m;e[17]!==s?(m=s.deckDetected&&s.writable&&c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:s.editMode?"secondary":"ghost",size:"icon","aria-label":s.editMode?"Done editing":"Edit inline",className:ve(s.editMode&&"text-primary"),onClick:()=>s.setEditMode(!s.editMode),children:c.jsx(xn,{size:14})})}),c.jsx(fe,{side:"bottom",children:s.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=s,e[18]=m):m=e[18];let z;e[19]!==l||e[20]!==r||e[21]!==s.deckDetected?(z=s.deckDetected?c.jsxs(Cn,{children:[c.jsx($n,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Download",children:c.jsx(Fe,{size:14})})}),c.jsxs(En,{align:"end",children:[c.jsxs(dt,{onClick:()=>window.open(`${l}#print`,"_blank","noopener"),children:[c.jsx(gn,{size:14}),"Export as PDF"]}),c.jsx(dt,{asChild:!0,children:c.jsxs("a",{href:l,download:r,children:[c.jsx(yn,{size:14}),"Download HTML"]})})]})]}):c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:c.jsx("a",{href:l,download:r,children:c.jsx(Fe,{size:14})})})}),c.jsx(fe,{side:"bottom",children:"Download"})]}),e[19]=l,e[20]=r,e[21]=s.deckDetected,e[22]=z):z=e[22];let v;e[23]!==l?(v=()=>window.open(l,"_blank","noopener"),e[23]=l,e[24]=v):v=e[24];let y;e[25]===Symbol.for("react.memo_cache_sentinel")?(y=c.jsx($t,{size:14}),e[25]=y):y=e[25];let P;e[26]!==v?(P=c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:v,children:y})}),e[26]=v,e[27]=P):P=e[27];let M;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=c.jsx(fe,{side:"bottom",children:"Open in new tab"}),e[28]=M):M=e[28];let k;e[29]!==P?(k=c.jsxs(ue,{children:[P,M]}),e[29]=P,e[30]=k):k=e[30];let W;return e[31]!==k||e[32]!==a||e[33]!==d||e[34]!==f||e[35]!==x||e[36]!==m||e[37]!==z||e[38]!==i?(W=c.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[a,d,f,x,m,z,k,i]}),e[31]=k,e[32]=a,e[33]=d,e[34]=f,e[35]=x,e[36]=m,e[37]=z,e[38]=i,e[39]=W):W=e[39],W}const je=1;function Rs(n){if(typeof n!="object"||n===null||n.v!==je||n.source!=="deck-viewer")return null;const e=n;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class me extends Error{constructor(e,t){super(e),this.code=t,this.name="DeckOpError"}code}function tn(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function Ds(n){const t=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return t?tn(t).length:null}function Ls(n,e){const t=new DOMParser().parseFromString(n,"text/html"),s=t.querySelector("deck-viewer");if(!s)throw new me("no <deck-viewer> element in source","no-viewer");const r=tn(s),i=e.kind==="move"?e.from:e.at,o=r[i];if(!o)throw new me(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new me("cannot remove the last slide","bad-op");o.remove();break}case"duplicate":{const a=o.cloneNode(!0);a.removeAttribute("id");for(const u of a.querySelectorAll("[id]"))u.removeAttribute("id");o.after(a);break}case"move":{if(e.to<0||e.to>=r.length)throw new me(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const a=e.to<e.from?r[e.to]:r[e.to].nextSibling;s.insertBefore(o,a)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new me(`invalid attribute name: ${e.name}`,"bad-op");o.setAttribute(e.name,e.value);break}case"remove-attr":{o.removeAttribute(e.name);break}case"replace":{const u=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!u)throw new me("replace html has no root element","bad-op");o.replaceWith(t.importNode(u,!0));break}default:throw new me(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
4
- `:""}${t.documentElement.outerHTML}
5
- `}const St="home",_s=400,As=800;function Ts(n){const e=n.savePath!==void 0,{org:t}=se(),s=st(),r=hs(St),[i,o]=g.useState(!1),[l,a]=g.useState(!1),[u,p]=g.useState(!1),[d,f]=g.useState(!1),[x,m]=g.useState(!1),[z,v]=g.useState(!1),[y,P]=g.useState(null),[M,k]=g.useState(null),[W,N]=g.useState(0),[w]=g.useState(()=>({iframe:null,source:null,queue:Promise.resolve(),saveTimer:null,selfMarkers:new Set})),K=i||z||x,q=()=>{n.savePath!==void 0&&(s.invalidateQueries({queryKey:Y.orgFsStat(t.id,St,n.savePath)}),s.invalidateQueries({queryKey:Y.orgFsRecent(t.id)}))},U=S=>{w.iframe?.contentWindow?.postMessage(S,"*")},T=()=>{w.source=null,f(!1),M&&P(M),N(S=>S+1),q()};n.statMarker!==M&&(k(n.statMarker),n.statMarker!==null&&(y===null?P(n.statMarker):w.selfMarkers.has(n.statMarker)||n.statMarker!==y&&(K?f(!0):(w.source=null,P(n.statMarker)))));const D=async()=>{w.saveTimer=null;const S=w.source;if(S===null){v(!1);return}m(!0);try{const R=await r.mutateAsync({path:n.savePath,body:S});w.selfMarkers.add(Qt(R)),q()}catch(R){console.error("[deck-editor] save failed",R),Me.error("Couldn't save deck edits — reloading the preview."),H.current.reload()}finally{m(!1),v(!1)}},X=S=>{v(!0),w.saveTimer&&clearTimeout(w.saveTimer),w.saveTimer=setTimeout(()=>{H.current.flushSave()},S)},_=(S,R,h)=>{U({v:je,type:"ack",opId:S,ok:R,error:h})},L=async S=>{if(!e){_(S.opId,!1,"read-only preview");return}try{if(w.source===null){const h=await fetch(n.readUrl,{credentials:"include"});if(!h.ok)throw new Error(`HTTP ${h.status}`);w.source=await h.text()}const R=Ds(w.source);if(R===null||R!==S.witness.childCount)throw new me(`slide count drifted (source ${R}, iframe ${S.witness.childCount})`,"stale-index");w.source=Ls(w.source,S.op),_(S.opId,!0),X(S.op.kind==="replace"?As:_s)}catch(R){console.error("[deck-editor] op failed",S.op,R),_(S.opId,!1,R instanceof Error?R.message:String(R)),Me.error("That edit couldn't be saved — reloading the preview."),H.current.reload()}},F=S=>{if(!w.iframe||S.source!==w.iframe.contentWindow)return;const R=Rs(S.data);if(R){if(R.type==="ready"){a(!0),H.current.editMode?U({v:je,type:"set-edit-mode",enabled:!0}):H.current.railOpen&&U({v:je,type:"set-rail",open:!0});return}R.type==="op"&&(w.queue=w.queue.then(()=>H.current.handleOp(R)).catch(()=>{}))}},H=g.useRef({onMessage:F,handleOp:L,flushSave:D,reload:T,editMode:i,railOpen:u});H.current={onMessage:F,handleOp:L,flushSave:D,reload:T,editMode:i,railOpen:u};const[J]=g.useState(()=>{let S=null;return R=>{if(R){w.iframe=R;const h=j=>H.current.onMessage(j);window.addEventListener("message",h),S=()=>window.removeEventListener("message",h)}else S?.(),S=null,w.iframe=null}}),ne=S=>{p(S),U({v:je,type:"set-rail",open:S})},B=S=>{o(S),U({v:je,type:"set-edit-mode",enabled:S}),S&&p(!0),!S&&d&&!z&&!x&&T()};return{iframeRef:J,deckDetected:l,writable:e,displayedMarker:y===null?null:`${y}.${W}`,editMode:i,setEditMode:B,railOpen:u,setRailOpen:ne,saving:x,agentUpdated:d,reload:T,postToIframe:U}}const Fs=300;function Hs({readUrl:n,marker:e,title:t,savePath:s,trailing:r}){const i=Ts({readUrl:n,statMarker:e,savePath:s}),[o,l]=g.useState(null);if(i.displayedMarker===null)return null;const a=n.includes("?")?"&":"?",u=`${n}${a}v=${encodeURIComponent(i.displayedMarker)}`,p=o===u;return c.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[c.jsx(Ms,{readUrl:n,editor:i,downloadName:t.split("/").pop()??t,trailing:r}),c.jsx("div",{className:"relative flex-1",children:c.jsx("iframe",{ref:i.iframeRef,src:u,onLoad:()=>l(u),sandbox:"allow-scripts",className:ve("absolute inset-0 block h-full w-full bg-white","transition-opacity ease-out",p?"opacity-100":"opacity-0"),style:{transitionDuration:`${Fs}ms`},title:t},u)})]})}const Us=[{mode:"private",label:"Org only",Icon:fn},{mode:"public",label:"Public",Icon:Ct},{mode:"password",label:"Password",Icon:An}];function nn(n){const e=A.c(38),{volume:t,path:s,kind:r,shareMode:i,effectivePublic:o,url:l}=n,a=xs(t),{data:u}=Jt(t,s),p=u?.shareMode??i,f=(u?.effectivePublic??o)&&p==="private",x=r==="dir",m=x?"folder":"file",[z,v]=g.useState(!1),[y,P]=g.useState(""),[M,k]=g.useState(!1);let W;e[0]!==s||e[1]!==a||e[2]!==m?(W=(B,S)=>{a.mutate({path:s,mode:B,password:S},{onSuccess:()=>{v(!1),P(""),Me.success(B==="private"?`This ${m} is now org-only`:B==="public"?`Anyone with the link can now view this ${m}`:`This ${m} is now password-protected`)},onError:Os})},e[0]=s,e[1]=a,e[2]=m,e[3]=W):W=e[3];const N=W;let w;e[4]!==N?(w=B=>{if(B==="password"){v(!0);return}v(!1),N(B)},e[4]=N,e[5]=w):w=e[5];const K=w,q=z?"password":p;let U;e[6]!==l?(U=async()=>{l&&(await navigator.clipboard.writeText(l),k(!0),Me.success("Link copied to clipboard"),setTimeout(()=>k(!1),2e3))},e[6]=l,e[7]=U):U=e[7];const T=U;let D;e[8]!==M||e[9]!==T||e[10]!==l?(D=l?c.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-input bg-muted/50 px-2 py-1.5",children:[c.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l}),c.jsx(ee,{variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:T,"aria-label":"Copy link",children:M?c.jsx(Ln,{size:12,className:"text-green-600"}):c.jsx(_n,{size:12})})]}):null,e[8]=M,e[9]=T,e[10]=l,e[11]=D):D=e[11];const X=D;if(f){let B;e[12]===Symbol.for("react.memo_cache_sentinel")?(B=c.jsx("div",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:c.jsx(Ct,{size:16})}),e[12]=B):B=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx("span",{className:"text-sm font-medium text-foreground",children:"Shared via a parent folder"}),e[13]=S):S=e[13];const R=x?"files in this folder":"this file";let h;e[14]!==R?(h=c.jsxs("div",{className:"flex items-start gap-3",children:[B,c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[S,c.jsxs("span",{className:"text-xs text-muted-foreground",children:["Anyone with the link can view"," ",R,". Manage sharing on the parent folder."]})]})]}),e[14]=R,e[15]=h):h=e[15];let j;return e[16]!==X||e[17]!==h?(j=c.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[h,X]}),e[16]=X,e[17]=h,e[18]=j):j=e[18],j}let _;e[19]!==q||e[20]!==K||e[21]!==a.isPending?(_=Us.map(B=>{const{mode:S,label:R,Icon:h}=B;return c.jsxs("button",{type:"button",disabled:a.isPending,onClick:()=>K(S),className:ve("flex flex-col items-center gap-1 rounded-md px-2 py-2 text-xs font-medium transition-colors disabled:opacity-60",q===S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[c.jsx(h,{size:15}),R]},S)}),e[19]=q,e[20]=K,e[21]=a.isPending,e[22]=_):_=e[22];let L;e[23]!==_?(L=c.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-muted p-1",children:_}),e[23]=_,e[24]=L):L=e[24];const F=q==="private"?`Only members of your organization can open ${x?"these files":"this link"}.`:q==="public"?x?"Anyone on the internet can view files in this folder via their link.":"Anyone on the internet with the link can view this file.":`Anyone with the link AND the password can view ${x?"files in this folder":"this file"}.`;let H;e[25]!==F?(H=c.jsx("p",{className:"text-xs text-muted-foreground",children:F}),e[25]=F,e[26]=H):H=e[26];let J;e[27]!==q||e[28]!==N||e[29]!==p||e[30]!==y||e[31]!==a.isPending?(J=q==="password"&&c.jsxs("form",{className:"flex items-center gap-2",onSubmit:B=>{B.preventDefault(),y&&N("password",y)},children:[c.jsx(In,{type:"password",value:y,onChange:B=>P(B.target.value),placeholder:p==="password"?"New password":"Password",autoComplete:"new-password",className:"h-8 text-xs"}),c.jsx(ee,{type:"submit",size:"sm",className:"shrink-0",disabled:!y||a.isPending,children:p==="password"?"Update":"Set"})]}),e[27]=q,e[28]=N,e[29]=p,e[30]=y,e[31]=a.isPending,e[32]=J):J=e[32];let ne;return e[33]!==X||e[34]!==L||e[35]!==H||e[36]!==J?(ne=c.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[L,H,J,X]}),e[33]=X,e[34]=L,e[35]=H,e[36]=J,e[37]=ne):ne=e[37],ne}function Os(n){return Me.error(n instanceof Error?n.message:"Failed to update sharing")}function zt(n){const e=A.c(7),{volume:t,path:s,shareMode:r,effectivePublic:i,url:o}=n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(Mn,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Share",children:c.jsx(wn,{size:14})})})}),c.jsx(fe,{side:"bottom",children:"Share"})]}),e[0]=l):l=e[0];let a;return e[1]!==i||e[2]!==s||e[3]!==r||e[4]!==o||e[5]!==t?(a=c.jsxs(Rn,{children:[l,c.jsx(Dn,{align:"end",className:"w-80 p-3",children:c.jsx(nn,{volume:t,path:s,kind:"file",shareMode:r,effectivePublic:i,url:o})})]}),e[1]=i,e[2]=s,e[3]=r,e[4]=o,e[5]=t,e[6]=a):a=e[6],a}function Rr(n){const e=A.c(11),{target:t,onOpenChange:s}=n,r=!!t,i=t?.kind==="dir"?"folder":"file";let o;e[0]!==i?(o=c.jsx(Sn,{children:c.jsxs(Ze,{children:["Share ",i]})}),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t?(l=t&&c.jsx(nn,{...t}),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==l?(a=c.jsxs(kt,{className:"sm:max-w-md",children:[o,l]}),e[4]=o,e[5]=l,e[6]=a):a=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==a?(u=c.jsx(Pt,{open:r,onOpenChange:s,children:a}),e[7]=s,e[8]=r,e[9]=a,e[10]=u):u=e[10],u}function Ws(n){const e=n?n.split("/").filter(Boolean):[],t=e[0]==="public",s=t?e[1]??null:null,r=t?s?`public-${s}`:null:e[0]??null,i=(t?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:r,dirPath:i,isPublic:t,publicSet:s,readOnly:t}}function Dr(n,e){return n.isPublic&&n.publicSet?`public/${n.publicSet}/${e}`:n.volume?`${n.volume}/${e}`:e}function qs(n){const e=n.lastIndexOf("/");return e===-1?n:n.slice(e+1)}function Bs(n){const e=A.c(11),{org:t,previewPath:s}=n;let r;e[0]!==s?(r=s.split("/").slice(0,-1).join("/"),e[0]=s,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o={org:t},e[2]=t,e[3]=o):o=e[3];let l;e[4]!==i||e[5]!==s?(l={path:i,preview:s},e[4]=i,e[5]=s,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(vn,{size:14}),e[7]=a):a=e[7];let u;return e[8]!==o||e[9]!==l?(u=c.jsx(ee,{variant:"ghost",size:"sm",asChild:!0,className:"shrink-0 gap-1.5 text-xs text-muted-foreground",children:c.jsxs(pn,{to:"/$org/files",params:o,search:l,children:[a,"See in library"]})}),e[8]=o,e[9]=l,e[10]=u):u=e[10],u}const Ks=n=>/\.html?$/i.test(n);function jt(n){const e=A.c(6),{onClose:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(zn,{size:14}),e[0]=s):s=e[0];let r;e[1]!==t?(r=c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon",onClick:t,children:s})}),e[1]=t,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(fe,{side:"bottom",children:"Close"}),e[3]=i):i=e[3];let o;return e[4]!==r?(o=c.jsxs(ue,{children:[r,i]}),e[4]=r,e[5]=o):o=e[5],o}function sn(n){const e=A.c(37),{previewPath:t,onClose:s,showSeeInLibrary:r,variant:i}=n,o=r===void 0?!1:r;let l;e[0]!==t?(l=Ws(t),e[0]=t,e[1]=l):l=e[1];const a=l,{volume:u,dirPath:p}=a,{data:d,isPending:f}=Jt(u,p),x=ms(u??""),m=qs(p);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={strict:!1},e[2]=z):z=e[2];const{org:v}=mn(z),y=i==="dialog";let P;e[3]!==v||e[4]!==t||e[5]!==o?(P=o&&v?c.jsx(Bs,{org:v,previewPath:t}):null,e[3]=v,e[4]=t,e[5]=o,e[6]=P):P=e[6];const M=P,k=d&&d.kind==="file"?{key:t,filename:m,size:d.size,downloadUrl:x(d.path)}:null;if(k&&d&&Ks(m)){const U=k.downloadUrl;let T;e[7]!==d?(T=Qt(d),e[7]=d,e[8]=T):T=e[8];const D=u??"",X=d.shareMode??"private",_=d.effectivePublic??!1,L=window.location.origin+k.downloadUrl;let F;e[9]!==p||e[10]!==L||e[11]!==D||e[12]!==X||e[13]!==_?(F=c.jsx(zt,{volume:D,path:p,shareMode:X,effectivePublic:_,url:L}),e[9]=p,e[10]=L,e[11]=D,e[12]=X,e[13]=_,e[14]=F):F=e[14];let H;e[15]!==y||e[16]!==s?(H=y?c.jsx("div",{className:"w-8 shrink-0"}):c.jsx(jt,{onClose:s}),e[15]=y,e[16]=s,e[17]=H):H=e[17];let J;return e[18]!==M||e[19]!==F||e[20]!==H?(J=c.jsxs(c.Fragment,{children:[F,M,H]}),e[18]=M,e[19]=F,e[20]=H,e[21]=J):J=e[21],c.jsxs(c.Fragment,{children:[y&&c.jsx(Ze,{className:"sr-only",children:m}),c.jsx(Hs,{readUrl:U,marker:T,title:m,savePath:u==="home"?p:void 0,trailing:J},t)]})}const W=y?"h-11 py-1 pr-12 pl-2":"h-9 px-2";let N;e[22]!==W?(N=ve("flex shrink-0 items-center gap-1 border-b border-border/60",W),e[22]=W,e[23]=N):N=e[23];let w;e[24]!==d?.effectivePublic||e[25]!==d?.shareMode||e[26]!==k||e[27]!==p||e[28]!==u?(w=k&&c.jsxs(c.Fragment,{children:[c.jsx(zt,{volume:u??"",path:p,shareMode:d?.shareMode??"private",effectivePublic:d?.effectivePublic??!1,url:window.location.origin+k.downloadUrl}),c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon",asChild:!0,children:c.jsx("a",{href:k.downloadUrl,download:k.filename,children:c.jsx(Fe,{size:14})})})}),c.jsx(fe,{side:"bottom",children:"Download"})]}),c.jsxs(ue,{children:[c.jsx(de,{asChild:!0,children:c.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>window.open(k.downloadUrl,"_blank","noopener"),children:c.jsx($t,{size:14})})}),c.jsx(fe,{side:"bottom",children:"Open in new tab"})]})]}),e[24]=d?.effectivePublic,e[25]=d?.shareMode,e[26]=k,e[27]=p,e[28]=u,e[29]=w):w=e[29];let K;e[30]!==y||e[31]!==s?(K=!y&&c.jsx(jt,{onClose:s}),e[30]=y,e[31]=s,e[32]=K):K=e[32];let q;return e[33]!==k||e[34]!==m||e[35]!==f?(q=c.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:k?c.jsx(Is,{file:k}):f?c.jsx(Zt,{}):c.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[c.jsx(et,{filename:m,className:"h-7.5 w-6"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[33]=k,e[34]=m,e[35]=f,e[36]=q):q=e[36],c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:N,children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[c.jsx(et,{filename:m,className:"h-4.5 w-3.5 shrink-0"}),y?c.jsx(Ze,{className:"truncate text-xs font-medium text-foreground",children:m}):c.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:m}),k&&c.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Yt(k.size)})]}),M,w,K]}),q]})}function Lr(n){const e=A.c(4),{previewPath:t,onClose:s,showSeeInLibrary:r}=n,i=r===void 0?!1:r;let o;return e[0]!==s||e[1]!==t||e[2]!==i?(o=c.jsx("div",{className:"flex h-full w-full flex-col bg-background",children:c.jsx(sn,{previewPath:t,onClose:s,showSeeInLibrary:i,variant:"panel"})}),e[0]=s,e[1]=t,e[2]=i,e[3]=o):o=e[3],o}function Gs(n){const e=A.c(5),{icon:t}=n;if(t.kind==="component"){const{Component:r}=t;let i;return e[0]!==r?(i=c.jsx(r,{className:"size-4"}),e[0]=r,e[1]=i):i=e[1],i}if(t.kind==="url"){let r;return e[2]!==t.src?(r=c.jsx("img",{src:t.src,alt:"",className:"size-4 rounded-sm object-cover"}),e[2]=t.src,e[3]=r):r=e[3],r}let s;return e[4]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(bn,{className:"size-4"}),e[4]=s):s=e[4],s}function _r(n){const e=A.c(13),{title:t,icon:s,active:r,onClick:i}=n,o=r?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let l;e[0]!==o?(l=ve("shrink-0 flex items-center gap-1.5 h-8 rounded-md px-2","[transition:background-color_180ms_ease,color_180ms_ease]",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==s?(a=c.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:c.jsx(Gs,{icon:s})}),e[2]=s,e[3]=a):a=e[3];let u;e[4]!==t?(u=c.jsx("span",{className:"whitespace-nowrap text-sm font-medium leading-none",children:t}),e[4]=t,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==i||e[8]!==l||e[9]!==a||e[10]!==u||e[11]!==t?(p=c.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,"aria-label":t,className:l,children:[a,u]}),e[6]=r,e[7]=i,e[8]=l,e[9]=a,e[10]=u,e[11]=t,e[12]=p):p=e[12],p}function Ar(n){const e=A.c(9),{previewPath:t,onClose:s,showSeeInLibrary:r}=n,i=r===void 0?!1:r;let o;e[0]!==s?(o=u=>{u||s()},e[0]=s,e[1]=o):o=e[1];let l;e[2]!==s||e[3]!==t||e[4]!==i?(l=c.jsx(kt,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:c.jsx(sn,{previewPath:t,onClose:s,showSeeInLibrary:i,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=i,e[5]=l):l=e[5];let a;return e[6]!==o||e[7]!==l?(a=c.jsx(Pt,{open:!0,onOpenChange:o,children:l}),e[6]=o,e[7]=l,e[8]=a):a=e[8],a}export{Nr as A,Ir as B,Ps as C,jr as D,Ss as E,Zt as F,at as G,Hs as H,Oe as I,Cr as J,Mr as K,Lr as L,kr as M,zs as N,zr as O,$r as P,Er as Q,fr as R,Rr as S,Gs as T,Pr as U,wr as a,xr as b,gr as c,bs as d,br as e,Is as f,ks as g,Yt as h,Jt as i,ms as j,Qt as k,zt as l,pr as m,dr as n,_r as o,Ar as p,Ws as q,qs as r,hs as s,mr as t,vr as u,yr as v,Dr as w,hr as x,ys as y,Sr as z};