decocms 4.60.0 → 4.61.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 (228) hide show
  1. package/dist/client/assets/{AlertCircle-By5V_OAI.js → AlertCircle-DAGlTauL.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DYFue3AB.js → AreaChart-MIyjAQp9.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CPmpTxqA.js → ArrowUp-CbpIfhnu.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DTva-CtK.js → ArrowUpRight-DpLwyu_e.js} +1 -1
  5. package/dist/client/assets/{Check-BbBVbCml.js → Check-CQkTVrms.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CjRjq78H.js → CheckCircle-B3CY8jDS.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DujWjiEx.js → ChevronDown-DhIYpVW6.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-4FTF4WqI.js → ChevronRight-CGMQ9_U1.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-LzTIy1Gg.js → ChevronUp-Bo_9AeLR.js} +1 -1
  10. package/dist/client/assets/{Circle-Ba61O7v3.js → Circle-Bp5dCa5T.js} +1 -1
  11. package/dist/client/assets/{Copy01-B0978reE.js → Copy01-B-Bw91-9.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BWXuIIeo.js → DotsVertical-rms0S2mG.js} +1 -1
  13. package/dist/client/assets/{Eye-CLyPbWNp.js → Eye-DiRw0Qiz.js} +1 -1
  14. package/dist/client/assets/{FilterLines-CZvywTHD.js → FilterLines-C2Mku5dO.js} +1 -1
  15. package/dist/client/assets/{Globe01-c9kQJ0J1.js → Globe01-BzW3NSbG.js} +1 -1
  16. package/dist/client/assets/{Globe04-EfBNVCza.js → Globe04-Cp9buDFj.js} +1 -1
  17. package/dist/client/assets/{HardDrive-3x4L_urK.js → HardDrive-BM7rwcN-.js} +1 -1
  18. package/dist/client/assets/{Key01-D0e_huT5.js → Key01-tUHgEoCR.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CBWI-N6A.js → LayoutLeft-DZ-jCFY6.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-CbZ5Q1kR.js → LinkExternal01-kp6-i_It.js} +1 -1
  21. package/dist/client/assets/{List-CKuVIidV.js → List-trC6pVdm.js} +1 -1
  22. package/dist/client/assets/{Loading02-OOljSfhT.js → Loading02-CUHThLam.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CIDTmDYS.js → Monitor01-B267agOB.js} +1 -1
  24. package/dist/client/assets/{Package-BT2pZEKs.js → Package-T_ZOTpyK.js} +1 -1
  25. package/dist/client/assets/{Palette-B4t53EuZ.js → Palette-CvpDh6yH.js} +1 -1
  26. package/dist/client/assets/{Play-YTvPwfKb.js → Play-B1DOcowx.js} +1 -1
  27. package/dist/client/assets/{Plus-BQc-qQk7.js → Plus-BndSMgXV.js} +1 -1
  28. package/dist/client/assets/{SearchLg-Cm7KW90l.js → SearchLg-CHM0ESn_.js} +1 -1
  29. package/dist/client/assets/{SearchMd-C7y5LJQw.js → SearchMd-D2Dw5ika.js} +1 -1
  30. package/dist/client/assets/{Settings02-Cr0VpQbw.js → Settings02-C_Z4I0Fv.js} +1 -1
  31. package/dist/client/assets/{Shield01-D2bvXHJr.js → Shield01-DfhHg1kb.js} +1 -1
  32. package/dist/client/assets/{Star01-BPwcVgMJ.js → Star01-zfOxTJkJ.js} +1 -1
  33. package/dist/client/assets/{Stars01-z2NZeFbA.js → Stars01-BQvwTUo0.js} +1 -1
  34. package/dist/client/assets/{Stars02-A9_Qn88t.js → Stars02-D5YT7SQm.js} +1 -1
  35. package/dist/client/assets/{Sun-DBwGI45B.js → Sun-vn3d1Wcz.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-CyHxNN_R.js → SwitchHorizontal01-DTta-kDo.js} +1 -1
  37. package/dist/client/assets/{Tool01-DTcOZbnu.js → Tool01-CLVNSbbM.js} +1 -1
  38. package/dist/client/assets/{Tool02-DN7RIFuA.js → Tool02-Ck98CPCG.js} +1 -1
  39. package/dist/client/assets/{Trash01-CRdtidTM.js → Trash01-BAtkdZ_P.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CFBaEMFF.js → TrendUp01-C0oRXmsG.js} +1 -1
  41. package/dist/client/assets/{Upload01-Cwtb67Lw.js → Upload01-D2kAayNK.js} +1 -1
  42. package/dist/client/assets/{User01-dV6U41aQ.js → User01-DKKGw2UE.js} +1 -1
  43. package/dist/client/assets/{Users01-DfR0NZI2.js → Users01-DnpgqZo2.js} +1 -1
  44. package/dist/client/assets/{Users03-D26TNI6S.js → Users03-BaqhajkW.js} +1 -1
  45. package/dist/client/assets/{X-9ap9xtG7.js → X-ukK64B_p.js} +1 -1
  46. package/dist/client/assets/{XCircle-DTf-SPGi.js → XCircle-B61g0Em1.js} +1 -1
  47. package/dist/client/assets/{XClose-Bx_SHZf9.js → XClose-DSwVoJ4X.js} +1 -1
  48. package/dist/client/assets/{Zap-DTYY_yG6.js → Zap-CQek3oek.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-CSYmmZIg.js → ZapSquare-MnTb6qUC.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-BfjzuKIF.js → ZoomOut-BEgIfWMd.js} +1 -1
  51. package/dist/client/assets/{access-gate-5OdRTd9-.js → access-gate-C5PfIkp_.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-Bh2DSNN9.js → add-section-modal-S88chbGR.js} +1 -1
  53. package/dist/client/assets/{agent-icon-DdKclnWr.js → agent-icon-DCI_kWkQ.js} +1 -1
  54. package/dist/client/assets/{agents-list-DlTu2Um8.js → agents-list-C3DlDPHU.js} +1 -1
  55. package/dist/client/assets/{ai-providers-uAoTUNGY.js → ai-providers-p-mCKizc.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-CySfFhdC.js → alert-dialog-SvFNgDAx.js} +1 -1
  57. package/dist/client/assets/{alert-BTdHvxv9.js → alert-w0pRm3Ye.js} +1 -1
  58. package/dist/client/assets/{app-editor-CeiK6G7B.js → app-editor-mQZXlJO1.js} +1 -1
  59. package/dist/client/assets/{auth-BiABWEcr.js → auth-D5nv6qUT.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-CIaQOvQ2.js → auth-catchall-D8ghA-q4.js} +1 -1
  61. package/dist/client/assets/{auth-entry-DuUkflLb.js → auth-entry-C0BeFSAL.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-DuFVX_V2.js → auth-split-layout-Cuk7s4Fv.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-BnB-i5Hx.js → authenticate-and-persist-oauth-Cs7_VHEO.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-fGuDXKMz.js → automation-list-row-CkbC4GZH.js} +1 -1
  65. package/dist/client/assets/{automation-runs-Dk0QSvXf.js → automation-runs-0jNiDOC_.js} +1 -1
  66. package/dist/client/assets/{automations-BfAuQT3p.js → automations-CObjGi18.js} +1 -1
  67. package/dist/client/assets/{autosend-OBVQJIwA.js → autosend-DlnrNbeW.js} +1 -1
  68. package/dist/client/assets/{avatar-D6tfDvwN.js → avatar-CYrddKyv.js} +1 -1
  69. package/dist/client/assets/{badge-BeBCWRwF.js → badge-BQjWTAmy.js} +1 -1
  70. package/dist/client/assets/{block-document-ohDylXKj.js → block-document-BbAS0up9.js} +1 -1
  71. package/dist/client/assets/{brand-context-feu1Zzai.js → brand-context-D5QNytBy.js} +1 -1
  72. package/dist/client/assets/{buckets-BIShXHgT.js → buckets-B2OyFmht.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-DOc5PpcE.js → bulk-category-panel-g5pevuzr.js} +1 -1
  74. package/dist/client/assets/{calendar-B8LPJQzI.js → calendar-BZEYQWys.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-CWu6wHWg.js → capability-load-error-Di-gNbEE.js} +1 -1
  76. package/dist/client/assets/{card-DQteBSZy.js → card-C71rqWCY.js} +1 -1
  77. package/dist/client/assets/{category-editor-DYMd2s4M.js → category-editor-CWM1tU47.js} +1 -1
  78. package/dist/client/assets/{chat-context-BFU9KNJs.js → chat-context-BMW1fK19.js} +1 -1
  79. package/dist/client/assets/{checkbox-DyFXnv_N.js → checkbox-BTo7CKhD.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-D86WoQgn.js → cli-auth-success-Cqca9Nbv.js} +1 -1
  81. package/dist/client/assets/{collection-detail-CnvXlo2s.js → collection-detail-DinSV2em.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-BkU2D40S.js → collection-display-button-D-A8zEDp.js} +1 -1
  83. package/dist/client/assets/{collection-search-DUDcpj0N.js → collection-search-pUUIAKXN.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-4ppIv-p9.js → collection-table-wrapper-Drk8o7iu.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-BoJeinsY.js → collection-tabs-BAurpL4U.js} +1 -1
  86. package/dist/client/assets/{command-N6cziNOU.js → command-BVOOO02Z.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-CftlY9zF.js → commerce-onboarding-CkHtx3Vn.js} +1 -1
  88. package/dist/client/assets/{connect-desktop-dialog-D5uIE_v3.js → connect-desktop-dialog-DjlNOENW.js} +1 -1
  89. package/dist/client/assets/{connection-card-CjpTLTCF.js → connection-card-ozCISq4f.js} +1 -1
  90. package/dist/client/assets/{connection-detail-CZqw9SA-.js → connection-detail-BLwFZG6e.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-B9LwF6od.js → connection-form-helpers-1blq8y12.js} +1 -1
  92. package/dist/client/assets/{connections-DhGBcx8p.js → connections-BWgUo2V4.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-DlhjUAGk.js → decopilot-sse-pool-CKDa5DkM.js} +1 -1
  94. package/dist/client/assets/{dialog-Hnvvuwtr.js → dialog-ClYAYRmD.js} +1 -1
  95. package/dist/client/assets/{domain-settings-LhdwESEP.js → domain-settings-Cws6RuSg.js} +1 -1
  96. package/dist/client/assets/{drawer-BN7xa-Kn.js → drawer-BHfpzQkJ.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-C1oaxvGA.js → dropdown-menu-DpW1bhzp.js} +1 -1
  98. package/dist/client/assets/{empty-state-2f1dk8dl.js → empty-state-C-a1elZk.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-C9LhPqdN.js → extract-connection-data-DFrcqAuT.js} +1 -1
  100. package/dist/client/assets/{file-explorer-CT0ZNlod.js → file-explorer-CYZW3loA.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-DCAOo88S.js → file-type-icon-DKWyyplC.js} +1 -1
  102. package/dist/client/assets/{files-C3TUsfg2.js → files-CPivJMUM.js} +1 -1
  103. package/dist/client/assets/{form-44AoMqLt.js → form-BNdKU9Dq.js} +1 -1
  104. package/dist/client/assets/{general-DWjuvMyc.js → general-Bb9cjsIY.js} +1 -1
  105. package/dist/client/assets/{github-repo-picker-CW5PRm8S.js → github-repo-picker-C7CPZtzH.js} +1 -1
  106. package/dist/client/assets/{hooks-DxKHI4Sv.js → hooks-st2jEiBn.js} +1 -1
  107. package/dist/client/assets/{index-DLUt_tIW.js → index-1BYkUND5.js} +1 -1
  108. package/dist/client/assets/{index-BhNEoGT9.js → index-B2Tu0xuB.js} +1 -1
  109. package/dist/client/assets/index-B86H8ACF.js +1 -0
  110. package/dist/client/assets/{index-5UHEAMsR.js → index-BpvrxRl5.js} +1 -1
  111. package/dist/client/assets/{index-Cw63Whs6.js → index-CTVAda4V.js} +5 -5
  112. package/dist/client/assets/{index-DqAJeepK.js → index-D2g_oXYY.js} +1 -1
  113. package/dist/client/assets/{index-CRhm_2EO.js → index-DBRobA-m.js} +1 -1
  114. package/dist/client/assets/{index-hwaeRRf3.js → index-DNhAZb-t.js} +1 -1
  115. package/dist/client/assets/{index-BvOxfdXi.js → index-D_6BVyXJ.js} +1 -1
  116. package/dist/client/assets/{index-Bz0Py2rP.js → index-Dg9Fd5mD.js} +1 -1
  117. package/dist/client/assets/{index-DXQi4Q1O.js → index-GRB9PSKj.js} +1 -1
  118. package/dist/client/assets/{index-Dyecjn9n.js → index-S_g8cP5n.js} +1 -1
  119. package/dist/client/assets/{index-B4UIYyWJ.js → index-UlaIU46R.js} +1 -1
  120. package/dist/client/assets/{index-DcIBnpEi.js → index-oRUXeO_q.js} +3 -3
  121. package/dist/client/assets/{index-redirect-BZ5Y2gfs.js → index-redirect-Dh080QB_.js} +1 -1
  122. package/dist/client/assets/{input-CzqITCIW.js → input--jaCPjE2.js} +1 -1
  123. package/dist/client/assets/{integration-icon-ZhMn59o3.js → integration-icon-JxE4r7FJ.js} +1 -1
  124. package/dist/client/assets/{invite-member-dialog-sUSWgiSG.js → invite-member-dialog-DjLLH0ZG.js} +1 -1
  125. package/dist/client/assets/{label-XzNlba7M.js → label-BlrGf89p.js} +1 -1
  126. package/dist/client/assets/{layout-B74lGCBQ.js → layout-D9e3OrKt.js} +1 -1
  127. package/dist/client/assets/{login-CYG6CxNP.js → login-BSlqOqcd.js} +1 -1
  128. package/dist/client/assets/{mcp-oauth-CpkgHFkt.js → mcp-oauth-AxamdNEM.js} +1 -1
  129. package/dist/client/assets/{members-CwzXHe9g.js → members-D85DEhNy.js} +1 -1
  130. package/dist/client/assets/{monaco-editor-oYFtE1AD.js → monaco-editor-Vus30gf1.js} +1 -1
  131. package/dist/client/assets/{monitoring-stats-row-Gf4MDwb4.js → monitoring-stats-row-CPhHb-t-.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-DUYwo8XA.js → oauth-callback-BbluzVyT.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ai-provider-CH7ngq6_.js → oauth-callback-ai-provider-B0q9de98.js} +1 -1
  134. package/dist/client/assets/{onboarding-EKsWcCLU.js → onboarding-DythzV9-.js} +1 -1
  135. package/dist/client/assets/{org-install-VWhntSAF.js → org-install-BkpWkVoe.js} +1 -1
  136. package/dist/client/assets/{org-layout-B0YkVceJ.js → org-layout-lx7lOPhY.js} +1 -1
  137. package/dist/client/assets/{organization-choice-CmuJBrOp.js → organization-choice-CWKezDdt.js} +1 -1
  138. package/dist/client/assets/{orgs-hY3hGpI2.js → orgs-Cv89Ks-z.js} +1 -1
  139. package/dist/client/assets/{page-seo-form-C5auzZh8.js → page-seo-form-CB9P0P9P.js} +1 -1
  140. package/dist/client/assets/page-seo-sheet-BsYRyc8C.js +1 -0
  141. package/dist/client/assets/{popover-CH5b_fiQ.js → popover-BEP_E0EQ.js} +1 -1
  142. package/dist/client/assets/{post-editor-DOvyL6wS.js → post-editor-C3RggI8L.js} +1 -1
  143. package/dist/client/assets/{primitives-DFbg_AMZ.js → primitives-BzwS8ncY.js} +1 -1
  144. package/dist/client/assets/{profile-CO8Giz28.js → profile-BQQaXFxw.js} +1 -1
  145. package/dist/client/assets/project-app-view-BFEV4QhN.js +1 -0
  146. package/dist/client/assets/record-editor-CTcq8Phb.js +1 -0
  147. package/dist/client/assets/registry-D4JcRrc9.js +2 -0
  148. package/dist/client/assets/{registry-layout-DRXLNW97.js → registry-layout-CNiGFdMZ.js} +1 -1
  149. package/dist/client/assets/{reports-DzupeaKs.js → reports-BJvBvA9b.js} +1 -1
  150. package/dist/client/assets/{require-capability-CuikEqkA.js → require-capability-BsLEmyED.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-B-X0Ygcy.js → required-auth-layout-DQyF_xIe.js} +1 -1
  152. package/dist/client/assets/{reset-password-CDNvgX42.js → reset-password-D_TsFYmY.js} +1 -1
  153. package/dist/client/assets/{roles-BV1-93aA.js → roles-MdFI_mdF.js} +1 -1
  154. package/dist/client/assets/{search-input-CWI66WZh.js → search-input-Bz2hFuEk.js} +1 -1
  155. package/dist/client/assets/{secrets-MwGQLxY8.js → secrets-BF2ZECAj.js} +1 -1
  156. package/dist/client/assets/{sections-editor-BK1kttfD.js → sections-editor-Rjn8r2D3.js} +1 -1
  157. package/dist/client/assets/{select-B769KgqG.js → select-BrgzOX_V.js} +1 -1
  158. package/dist/client/assets/{select-model-DBtqvDeJ.js → select-model-CgWW1-BL.js} +1 -1
  159. package/dist/client/assets/{seo-editor-DIU-XPL5.js → seo-editor-DiwEUw86.js} +1 -1
  160. package/dist/client/assets/{settings-layout-BeiWdJrF.js → settings-layout-BM8pLcR9.js} +1 -1
  161. package/dist/client/assets/{settings-section-DlrJmzQQ.js → settings-section-y4ffj1At.js} +1 -1
  162. package/dist/client/assets/{shell-controls-Dr0tjvY3.js → shell-controls-6tyymcGo.js} +1 -1
  163. package/dist/client/assets/shell-layout-Ce4WRVJF.js +1 -0
  164. package/dist/client/assets/{sidebar-CnVq7sh3.js → sidebar-B4MOdumX.js} +1 -1
  165. package/dist/client/assets/{skeleton-DDgvHM8p.js → skeleton-CXgII3Bw.js} +1 -1
  166. package/dist/client/assets/{sso-DiC6sEo0.js → sso-BylHOu42.js} +1 -1
  167. package/dist/client/assets/{store-BBj31B5C.js → store-D54xtHcf.js} +1 -1
  168. package/dist/client/assets/store-registry-B98Re6PZ.js +2 -0
  169. package/dist/client/assets/{studio-tools-Bdai-xGF.js → studio-tools-DoO0tZRE.js} +1 -1
  170. package/dist/client/assets/{switch-josi6Uyt.js → switch-BxGe0YL3.js} +1 -1
  171. package/dist/client/assets/{table-Cpz7KTQ5.js → table-C3991oKW.js} +1 -1
  172. package/dist/client/assets/{tabs-Bd4tTw7M.js → tabs-Cikp5jE7.js} +1 -1
  173. package/dist/client/assets/{textarea-CN1NcM6-.js → textarea-uGqD7j3K.js} +1 -1
  174. package/dist/client/assets/{toggle-group-CCVpVQJx.js → toggle-group-DwaxjPTf.js} +1 -1
  175. package/dist/client/assets/{toolbar-4tiJk0vY.js → toolbar-BGvLO6RZ.js} +1 -1
  176. package/dist/client/assets/{toolbar-icon-button-B4ns4onG.js → toolbar-icon-button-CZvOgHXD.js} +1 -1
  177. package/dist/client/assets/{tools-list-OlvXGJpp.js → tools-list-DEQafb6n.js} +1 -1
  178. package/dist/client/assets/{tooltip-FbSqyAkw.js → tooltip-D6EFrI2I.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-rBuyV02F.js → use-ai-providers-DANWCVaB.js} +1 -1
  180. package/dist/client/assets/{use-automations-eRXq8hNu.js → use-automations-BE41mYJs.js} +1 -1
  181. package/dist/client/assets/{use-capability-DG3TMrBr.js → use-capability-CEXpJHQ-.js} +1 -1
  182. package/dist/client/assets/{use-clock-tick-Dx2kBV_T.js → use-clock-tick-PoDACkB7.js} +1 -1
  183. package/dist/client/assets/{use-collections-B6JlYHnr.js → use-collections-DWE5dA61.js} +1 -1
  184. package/dist/client/assets/{use-connection-BQbRdj4A.js → use-connection-bzmsqnbu.js} +1 -1
  185. package/dist/client/assets/{use-copy-DxP-67RS.js → use-copy-DXNsYnYv.js} +1 -1
  186. package/dist/client/assets/{use-create-virtual-mcp-Bst5H_XV.js → use-create-virtual-mcp-C3ccej0o.js} +1 -1
  187. package/dist/client/assets/{use-debounced-autosave-DUw5dpg0.js → use-debounced-autosave-D35Yi13Z.js} +1 -1
  188. package/dist/client/assets/{use-debounced-value-CEU4XuDq.js → use-debounced-value-Bek1HKp-.js} +1 -1
  189. package/dist/client/assets/{use-deco-credits-BIY8ss-U.js → use-deco-credits-DnBl7ZHb.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-BrhYZT96.js → use-decopilot-events-DIbAOXdz.js} +1 -1
  191. package/dist/client/assets/{use-delete-connection-BITyrKJU.js → use-delete-connection-TTxlKCSt.js} +1 -1
  192. package/dist/client/assets/{use-deployment-admin-Bvs3xtBP.js → use-deployment-admin-D9u3BrsQ.js} +1 -1
  193. package/dist/client/assets/{use-file-configs-DL6xLLlG.js → use-file-configs-B70z57OV.js} +1 -1
  194. package/dist/client/assets/{use-infinite-scroll-Y5a7xah6.js → use-infinite-scroll-Cp3fCiXF.js} +1 -1
  195. package/dist/client/assets/{use-join-requests-BIz68DvI.js → use-join-requests-kXa1HrsO.js} +1 -1
  196. package/dist/client/assets/{use-mcp-client-CP4c9F3u.js → use-mcp-client-CjIdboe6.js} +1 -1
  197. package/dist/client/assets/{use-mcp-tools-Bt4ZQFfJ.js → use-mcp-tools-D8RhjXm_.js} +1 -1
  198. package/dist/client/assets/{use-members-BrCJmQZK.js → use-members-BKd3LPox.js} +1 -1
  199. package/dist/client/assets/{use-mobile-CNvoxL11.js → use-mobile-M8W7Kv1V.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-S62tKbn_.js → use-navigate-to-agent-8ICyqr4j.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-D2oZvH8p.js → use-org-auth-client-8hx0Yi1Z.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-CuQ1DX-B.js → use-org-sso-ksTAOkzG.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-Ck6IZDBi.js → use-organization-roles-D5s14_A8.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-DPWTEzqv.js → use-organization-settings-BsHnInld.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-Qwuyc_tK.js → use-registry-connections-BUPQ7scU.js} +1 -1
  206. package/dist/client/assets/{use-secrets-Bog2G1S_.js → use-secrets-BRlGD1XL.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-Qyl_ERMg.js → use-status-sounds-BDbBONgL.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-B8GphToI.js → use-view-mode-8eFM3FyD.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-BYkuAhYP.js → use-virtual-mcp-CmA7MJ_3.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-gEqtoOdV.js +1 -0
  211. package/dist/client/assets/{useRouterState-5lGDnVdP.js → useRouterState-KH8KOLnW.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-C1-97kj5.js +1 -0
  213. package/dist/client/assets/{users-CGznhyCC.js → users-BMkXaUmm.js} +1 -1
  214. package/dist/client/assets/{variant-calendar-BPf-15R_.js → variant-calendar-BZEkxfCa.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-CZo99tNV.js → view-mode-toggle-DRZnhLAW.js} +1 -1
  216. package/dist/client/index.html +1 -1
  217. package/dist/server/cli.js +1 -1
  218. package/dist/server/server.js +1 -1
  219. package/package.json +1 -1
  220. package/dist/client/assets/index-DPS1o7Hz.js +0 -1
  221. package/dist/client/assets/page-seo-sheet-D-IbLfTT.js +0 -1
  222. package/dist/client/assets/project-app-view-CQ6rdSU6.js +0 -1
  223. package/dist/client/assets/record-editor-BmdfGrm9.js +0 -1
  224. package/dist/client/assets/registry-wey5deW7.js +0 -2
  225. package/dist/client/assets/shell-layout-CvmkWYxb.js +0 -1
  226. package/dist/client/assets/store-registry-mqrT12io.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-CgoqkRWJ.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-BW3gCCYi.js +0 -1
@@ -1,4 +1,4 @@
1
- import{dx as _t,dy as St,bh as R,I as c,dz as de,bn as Ve,bu as It,bg as Et,aV as Tt,ae as O,ad as W,ab as oe,H as _,bi as f,b2 as F,dA as wt,dB as I,ac as Mt,t as ge,c as Ie,r as Y,a4 as At,j as Ot}from"./index-DcIBnpEi.js";import{u as Ct}from"./use-mcp-client-CP4c9F3u.js";import{S as Rt}from"./constants-CaIX_f5U.js";import{d as Nt,D as xt}from"./decopilot-sse-pool-DlhjUAGk.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Me;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Me||(Me={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var ze="vercel.ai.error",kt=Symbol.for(ze),Oe,Ce,Z=class Je extends(Ce=Error,Oe=kt,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",qe=`vercel.ai.error.${We}`,Lt=Symbol.for(qe),Re,Ne,jt=class extends(Ne=Z,Re=Lt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},He="AI_JSONParseError",Ge=`vercel.ai.error.${He}`,Zt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=Z,xe=Zt,Pe){constructor({text:t,cause:e}){super({name:He,message:`JSON parsing failed: Text: ${t}.
1
+ import{dx as _t,dy as St,bh as R,I as c,dz as de,bn as Ve,bu as It,bg as Et,aV as Tt,ae as O,ad as W,ab as oe,H as _,bi as f,b2 as F,dA as wt,dB as I,ac as Mt,t as ge,c as Ie,r as Y,a4 as At,j as Ot}from"./index-oRUXeO_q.js";import{u as Ct}from"./use-mcp-client-CjIdboe6.js";import{S as Rt}from"./constants-CaIX_f5U.js";import{d as Nt,D as xt}from"./decopilot-sse-pool-CKDa5DkM.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Me;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Me||(Me={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var ze="vercel.ai.error",kt=Symbol.for(ze),Oe,Ce,Z=class Je extends(Ce=Error,Oe=kt,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",qe=`vercel.ai.error.${We}`,Lt=Symbol.for(qe),Re,Ne,jt=class extends(Ne=Z,Re=Lt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},He="AI_JSONParseError",Ge=`vercel.ai.error.${He}`,Zt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=Z,xe=Zt,Pe){constructor({text:t,cause:e}){super({name:He,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ye(e)}`,cause:e}),this[xe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Ge)}},Xe="AI_TypeValidationError",Qe=`vercel.ai.error.${Xe}`,$t=Symbol.for(Qe),ke,Le,X=class ve extends(Le=Z,ke=$t,Le){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Xe,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ye(a)}`,cause:a}),this[ke]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Qe)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new jt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ut=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Ft=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function je(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ut.test(t)===!1&&Ft.test(t)===!1?e:Bt(e)}function Bt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function Vt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return je(t)}try{return je(t)}finally{Error.stackTraceLimit=e}}function Ee(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Ee(t)}var zt=Symbol("Let zodToJsonSchema decide on which parser to use"),Ze={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Jt=t=>typeof t=="string"?{...Ze,name:t}:{...Ze,...t};function N(){return{}}function Yt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Wt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function qt(){return{type:"boolean"}}function Ke(t,e){return b(t.type._def,e)}var Ht=(t,e)=>b(t.innerType._def,e);function et(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>et(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Gt(t)}}var Gt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Xt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Qt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function Kt(t){return{type:"string",enum:Array.from(t.values)}}var ea=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function ta(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ea(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function aa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function tt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?sa(t):t}var ra=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sa(t){let e="";for(let a=0;a<t.length;a++)ra.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$e(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=$e(e,r)}function $e(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
@@ -1,4 +1,4 @@
1
- import{c as $,a4 as de,n as Ze,d as We,K as Q,m as ie,aX as kn,r as k,ao as Ss,l as ce,j as l,a6 as Ns,i as zs,B as Z,aK as Sn,t as ue,$ as Cs,L as $s,e as Ps,b as Nn,u as zn,U as Tt}from"./index-DcIBnpEi.js";import{i as Es}from"./ChevronRight-4FTF4WqI.js";import{s as Cn}from"./Eye-CLyPbWNp.js";import{n as Ve,i as yt}from"./Globe01-c9kQJ0J1.js";import{b as Ds,c as Ts,e as Fs,i as Ms,f as $n,a as Ht,g as Is,d as Ls}from"./ZoomOut-BfjzuKIF.js";import{a as ht}from"./Palette-B4t53EuZ.js";import{s as Os}from"./Plus-BQc-qQk7.js";import{i as Rs}from"./SearchLg-Cm7KW90l.js";import{t as As}from"./Stars01-z2NZeFbA.js";import{i as mt}from"./Upload01-Cwtb67Lw.js";import{s as Pn}from"./XClose-Bx_SHZf9.js";import{i as qt}from"./Zap-DTYY_yG6.js";import{u as En}from"./use-mobile-CNvoxL11.js";import{f as _s,a as Us,b as Bs,c as Hs,d as qs,e as Ks,A as Ws,g as Gs}from"./alert-dialog-CySfFhdC.js";import{D as Dn,a as Ue,d as Je,e as et,g as Tn,f as Vs,c as Xs}from"./dialog-Hnvvuwtr.js";import{I as Xe}from"./input-CzqITCIW.js";import{S as ae}from"./skeleton-DDgvHM8p.js";import{F as Se,M as Kt,d as Fn}from"./file-type-icon-DCAOo88S.js";import{T as Qs}from"./toolbar-4tiJk0vY.js";import{a as Ys}from"./Package-BT2pZEKs.js";import{u as Zs}from"./use-debounced-value-CEU4XuDq.js";import{i as vt}from"./DotsVertical-BWXuIIeo.js";import{i as Mn}from"./Key01-D0e_huT5.js";import{s as wt}from"./Trash01-CRdtidTM.js";import{D as tt,a as nt,c as st,d as be}from"./dropdown-menu-C1oaxvGA.js";import{T as Js}from"./textarea-CN1NcM6-.js";import{t as el}from"./ChevronDown-DujWjiEx.js";import{n as tl}from"./ChevronUp-LzTIy1Gg.js";import{i as pt}from"./X-9ap9xtG7.js";import{P as nl,b as sl,a as ll}from"./popover-CH5b_fiQ.js";import{T as ye,a as ve,b as we}from"./tooltip-FbSqyAkw.js";import{i as rl}from"./Check-BbBVbCml.js";import{a as il}from"./Copy01-B0978reE.js";import{n as In}from"./LinkExternal01-CbZ5Q1kR.js";import{l as ol,F as al}from"./index-hwaeRRf3.js";import{i as cl}from"./LayoutLeft-CBWI-N6A.js";function Ln(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function pe(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function he(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 Wt(n,e){const t=$.c(11),{org:s}=de();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=Q.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 he(pe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(dl),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:kn,queryFn:i},t[8]=r,t[9]=i,t[10]=o):o=t[10],ie(o)}function dl(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function On(n,e,t){const s=$.c(15),{org:r}=de();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=Q.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 a;s[4]!==t?(a=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=a):a=s[5];let c;s[6]!==r.slug||s[7]!==e||s[8]!==n?(c=async()=>{const f=await fetch(pe(r.slug,n??"","stat",{path:e}));if(f.status===404)return null;if(!f.ok)throw new Error(`HTTP ${f.status}`);return(await f.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let d;return s[10]!==i||s[11]!==o||s[12]!==a||s[13]!==c?(d={queryKey:i,enabled:o,refetchInterval:a,queryFn:c},s[10]=i,s[11]=o,s[12]=a,s[13]=c,s[14]=d):d=s[14],ie(d)}function ul(n){const e=$.c(9),{org:t}=de();let s;e[0]!==t.id||e[1]!==n?(s=Q.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 he(pe(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],ie(i)}function fl(n,e){const t=$.c(9),s=n===void 0?60:n,{org:r}=de();let i;t[0]!==r.id?(i=Q.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const o=e?.enabled;let a;t[2]!==s||t[3]!==r.slug?(a=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=a):a=t[4];let c;return t[5]!==i||t[6]!==o||t[7]!==a?(c={queryKey:i,enabled:o,queryFn:a},t[5]=i,t[6]=o,t[7]=a,t[8]=c):c=t[8],ie(c)}function hl(n,e){const t=$.c(11),s=50,{org:r}=de();let i;t[0]!==r.id||t[1]!==n?(i=Q.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const o=n.length>0;let a;t[3]!==s||t[4]!==r.slug||t[5]!==n?(a=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=a):a=t[6];let c;return t[7]!==i||t[8]!==o||t[9]!==a?(c={queryKey:i,enabled:o,placeholderData:kn,queryFn:a},t[7]=i,t[8]=o,t[9]=a,t[10]=c):c=t[10],ie(c)}function Fo(n){const e=$.c(8),{org:t}=de();let s;e[0]!==t.id?(s=Q.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 a=await he(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await a.json();return c.map(ml)},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],ie(o)}function ml(n){return{volume:n.volume,path:n.path}}async function Mo(n){const e=await he(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function pl(n,e,t){return(await he(pe(n,e,"read",{path:t}))).text()}const xl=new Set(["md","mdx","markdown","txt","text"]),gl=25,bl=64*1024,yl=256*1024,vl=4;function wl(n){const e=n.lastIndexOf(".");return e===-1?!1:xl.has(n.slice(e+1).toLowerCase())}async function Io(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],o=[],a=[{path:t,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await he(pe(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,g)=>p.path.localeCompare(g.path))){if(m.kind==="dir"){u.depth<vl&&a.push({path:m.path,depth:u.depth+1});continue}wl(m.path)&&m.size<=bl&&i.length<gl?i.push(m.path):o.push(r(m.path))}}const c=await Promise.all(i.map(u=>pl(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=c[h];if(m==null||f+m.length>yl){o.push(r(u));return}f+=m.length,d.push({relPath:r(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:d,omittedPaths:o}}function Rn(){const n=$.c(7),{org:e}=de();let t;n[0]!==e.id?(t=Q.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await he(`/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],ie(r)}function jl(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>pe(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function lt(){const n=$.c(2),{org:e}=de();let t;return n[0]!==e.slug?(t=(s,r)=>pe(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function An(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await he(pe(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],We(s)}function kl(n){const e=$.c(18),{org:t}=de(),s=Ze();let r;e[0]!==t||e[1]!==n?(r=async d=>(await(await he(pe(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.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 d=>{const f=Q.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let o;e[7]!==s?(o=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=o):o=e[8];let a;e[9]!==t||e[10]!==s||e[11]!==n?(a=(d,f,u)=>{s.invalidateQueries({queryKey:Q.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=a):a=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==o||e[16]!==a?(c={mutationFn:r,onMutate:i,onError:o,onSettled:a},e[13]=r,e[14]=i,e[15]=o,e[16]=a,e[17]=c):c=e[17],We(c)}function At(n){const e=$.c(26),{org:t}=de(),s=Ze();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(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 b=>{for(const x of b.files){const y=b.dir?`${b.dir}/${x.name}`:x.name;await he(pe(t.slug,n,"file",{path:y}),{method:"PUT",headers:{"content-type":x.type||"application/octet-stream"},body:x})}},e[4]=t,e[5]=n,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const c=We(a);let d;e[10]!==t||e[11]!==n?(d=async b=>{await he(pe(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=We(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await he(pe(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=We(m);let g;return e[22]!==u||e[23]!==p||e[24]!==c?(g={upload:c,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=c,e[25]=g):g=e[25],g}const jt=k.createContext(null);jt.displayName="PanelGroupContext";const se={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"},Gt=10,Fe=k.useLayoutEffect,sn=Ss.useId,Sl=typeof sn=="function"?sn:()=>null;let Nl=0;function Vt(n=null){const e=Sl(),t=k.useRef(n||e||null);return t.current===null&&(t.current=""+Nl++),n??t.current}function _n({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...g}){const b=k.useContext(jt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:j,getPanelStyle:N,groupId:z,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:I,unregisterPanel:F}=b,v=Vt(o),P=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:h});k.useRef({didLogMissingDefaultSizeWarning:!1}),Fe(()=>{const{callbacks:A,constraints:_}=P.current,B={..._};P.current.id=v,P.current.idIsFromProps=o!==void 0,P.current.order=h,A.onCollapse=d,A.onExpand=f,A.onResize=u,_.collapsedSize=t,_.collapsible=s,_.defaultSize=r,_.maxSize=a,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w(P.current,B)}),Fe(()=>{const A=P.current;return M(A),()=>{F(A)}},[h,v,M,F]),k.useImperativeHandle(i,()=>({collapse:()=>{x(P.current)},expand:A=>{y(P.current,A)},getId(){return v},getSize(){return j(P.current)},isCollapsed(){return C(P.current)},isExpanded(){return!C(P.current)},resize:A=>{I(P.current,A)}}),[x,y,j,C,v,I]);const W=N(P.current,r);return k.createElement(p,{...g,children:n,className:e,id:v,style:{...W,...m},[se.groupId]:z,[se.panel]:"",[se.panelCollapsible]:s||void 0,[se.panelId]:v,[se.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const Un=k.forwardRef((n,e)=>k.createElement(_n,{...n,forwardedRef:e}));_n.displayName="Panel";Un.displayName="forwardRef(Panel)";let _t=null,ft=-1,Ce=null;function zl(n,e){if(e){const t=(e&Wn)!==0,s=(e&Gn)!==0,r=(e&Vn)!==0,i=(e&Xn)!==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 Cl(){Ce!==null&&(document.head.removeChild(Ce),_t=null,Ce=null,ft=-1)}function Ft(n,e){var t,s;const r=zl(n,e);if(_t!==r){if(_t=r,Ce===null&&(Ce=document.createElement("style"),document.head.appendChild(Ce)),ft>=0){var i;(i=Ce.sheet)===null||i===void 0||i.removeRule(ft)}ft=(t=(s=Ce.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Bn(n){return n.type==="keydown"}function Hn(n){return n.type.startsWith("pointer")}function qn(n){return n.type.startsWith("mouse")}function kt(n){if(Hn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(qn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function $l(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Pl(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 El(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:on(n),b:on(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;V(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:rn(ln(t.a)),b:rn(ln(t.b))};if(r.a===r.b){const i=s.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const Dl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tl(n){var e;const t=getComputedStyle((e=Kn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Fl(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Tl(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"||Dl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ln(n){let e=n.length;for(;e--;){const t=n[e];if(V(t,"Missing node"),Fl(t))return t}return null}function rn(n){return n&&Number(getComputedStyle(n).zIndex)||0}function on(n){const e=[];for(;n;)e.push(n),n=Kn(n);return e}function Kn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Wn=1,Gn=2,Vn=4,Xn=8,Ml=$l()==="coarse";let xe=[],_e=!1,Te=new Map,St=new Map;const Qe=new Set;function Il(n,e,t,s,r){var i;const{ownerDocument:o}=e,a={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},c=(i=Te.get(o))!==null&&i!==void 0?i:0;return Te.set(o,c+1),Qe.add(a),xt(),function(){var f;St.delete(n),Qe.delete(a);const u=(f=Te.get(o))!==null&&f!==void 0?f:1;if(Te.set(o,u-1),xt(),u===1&&Te.delete(o),xe.includes(a)){const h=xe.indexOf(a);h>=0&&xe.splice(h,1),Qt(),r("up",!0,null)}}}function Ll(n){const{target:e}=n,{x:t,y:s}=kt(n);_e=!0,Xt({target:e,x:t,y:s}),xt(),xe.length>0&&(gt("down",n),n.preventDefault(),Qn(e)||n.stopImmediatePropagation())}function Mt(n){const{x:e,y:t}=kt(n);if(_e&&n.buttons===0&&(_e=!1,gt("up",n)),!_e){const{target:s}=n;Xt({target:s,x:e,y:t})}gt("move",n),Qt(),xe.length>0&&n.preventDefault()}function It(n){const{target:e}=n,{x:t,y:s}=kt(n);St.clear(),_e=!1,xe.length>0&&(n.preventDefault(),Qn(e)||n.stopImmediatePropagation()),gt("up",n),Xt({target:e,x:t,y:s}),Qt(),xt()}function Qn(n){let e=n;for(;e;){if(e.hasAttribute(se.resizeHandle))return!0;e=e.parentElement}return!1}function Xt({target:n,x:e,y:t}){xe.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Qe.forEach(r=>{const{element:i,hitAreaMargins:o}=r,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,h=Ml?o.coarse:o.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=c+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&El(s,i)>0){let p=s,g=!1;for(;p&&!p.contains(i);){if(Pl(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}xe.push(r)}})}function Lt(n,e){St.set(n,e)}function Qt(){let n=!1,e=!1;xe.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;St.forEach(s=>{t|=s}),n&&e?Ft("intersection",t):n?Ft("horizontal",t):e?Ft("vertical",t):Cl()}let Ot=new AbortController;function xt(){Ot.abort(),Ot=new AbortController;const n={capture:!0,signal:Ot.signal};Qe.size&&(_e?(xe.length>0&&Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",It,n),s.addEventListener("pointerleave",Mt,n),s.addEventListener("pointermove",Mt,n))}),window.addEventListener("pointerup",It,n),window.addEventListener("pointercancel",It,n)):Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Ll,n),s.addEventListener("pointermove",Mt,n))}))}function gt(n,e){Qe.forEach(t=>{const{setResizeHandlerState:s}=t,r=xe.includes(t);s(n,r,e)})}function Ol(){const[n,e]=k.useState(0);return k.useCallback(()=>e(t=>t+1),[])}function V(n,e){if(!n)throw console.error(e),Error(e)}function Me(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function je(n,e,t=Gt){return Me(n,e,t)===0}function me(n,e,t){return Me(n,e,t)===0}function Rl(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(!me(r,i,t))return!1}return!0}function Ae({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];V(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:a=0}=s;if(Me(t,a)<0)if(i){const c=(r+a)/2;Me(t,c)<0?t=r:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Gt)),t}function He({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(me(n,0))return e;const o=[...e],[a,c]=s;V(a!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?c:a,h=t[u];V(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,m)){const x=g-b;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}{const u=n<0?a:c,h=t[u];V(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,g)){const x=b-m;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}}{const u=n<0?1:-1;let h=n<0?c:a,m=0;for(;;){const g=e[h];V(g!=null,`Previous layout not found for panel index ${h}`);const x=Ae({panelConstraints:t,panelIndex:h,size:100})-g;if(m+=x,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?a:c;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];V(p!=null,`Previous layout not found for panel index ${h}`);const g=p-m,b=Ae({panelConstraints:t,panelIndex:h,size:g});if(!me(p,b)&&(d+=p-b,o[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(Rl(r,o))return r;{const u=n<0?c:a,h=e[u];V(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=Ae({panelConstraints:t,panelIndex:u,size:m});if(o[u]=p,!me(p,m)){let g=m-p,x=n<0?c:a;for(;x>=0&&x<t.length;){const y=o[x];V(y!=null,`Previous layout not found for panel index ${x}`);const j=y+g,N=Ae({panelConstraints:t,panelIndex:x,size:j});if(me(y,N)||(g-=N-y,o[x]=N),me(g,0))break;n>0?x--:x++}}}const f=o.reduce((u,h)=>h+u,0);return me(f,100)?o:r}function Al({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,o=0;const a=t[0];V(a!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:g=0}=m;h===a?(s=g,r=p):(i+=g,o+=p)});const c=Math.min(r,100-i),d=Math.max(s,100-o),f=n[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ye(n,e=document){return Array.from(e.querySelectorAll(`[${se.resizeHandleId}][data-panel-group-id="${n}"]`))}function Yn(n,e,t=document){const r=Ye(n,t).findIndex(i=>i.getAttribute(se.resizeHandleId)===e);return r??null}function Zn(n,e,t){const s=Yn(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function Jn(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 Nt(n,e=document){const t=e.querySelector(`[${se.resizeHandleId}="${n}"]`);return t||null}function _l(n,e,t,s=document){var r,i,o,a;const c=Nt(e,s),d=Ye(n,s),f=c?d.indexOf(c):-1,u=(r=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,h=(o=(a=t[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,h]}function Ul({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:o}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Fe(()=>{if(!i)return;const a=Ye(t,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Al({layout:s,panelsArray:r,pivotIndices:[c,c+1]}),h=a[c];if(h!=null){const m=r[c];V(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[t,s,r,i]),k.useEffect(()=>{if(!i)return;const a=e.current;V(a,"Eager values not found");const{panelDataArray:c}=a,d=Jn(t,i);V(d!=null,`No group found for id "${t}"`);const f=Ye(t,i);V(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(se.resizeHandleId);V(m,"Resize handle element has no handle id attribute");const[p,g]=_l(t,m,c,i);if(p==null||g==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];V(j,`No panel data found for index ${y}`);const N=s[y],{collapsedSize:z=0,collapsible:C,minSize:w=0}=j.constraints;if(N!=null&&C){const M=He({delta:me(N,z)?w-z:z-N,initialLayout:s,panelConstraints:c.map(I=>I.constraints),pivotIndices:Zn(t,m,i),prevLayout:s,trigger:"keyboard"});s!==M&&o(M)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,r,o])}function an(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 es(n,e){const t=n==="horizontal",{x:s,y:r}=kt(e);return t?s:r}function Bl(n,e,t,s,r){const i=t==="horizontal",o=Nt(e,r);V(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(se.groupId);V(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=es(t,n),f=Jn(a,r);V(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-c)/h*100}function Hl(n,e,t,s,r,i){if(Bn(n)){const o=t==="horizontal";let a=0;n.shiftKey?a=100:r!=null?a=r:a=10;let c=0;switch(n.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Bl(n,e,t,s,i)}function ql({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];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(s++,e[i]=a,r-=a)}for(let i=0;i<n.length;i++){const o=t[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=n.length-s,d=r/c;s++,e[i]=d,r-=d}return e}function Ie(n,e,t){e.forEach((s,r)=>{const i=n[r];V(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=t[c];if(u==null||s!==u){t[c]=s;const{onCollapse:h,onExpand:m,onResize:p}=o;p&&p(s,u),f&&(h||m)&&(m&&(u==null||je(u,d))&&!je(s,d)&&m(),h&&(u==null||!je(u,d))&&je(s,d)&&h())}})}function ut(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 Kl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const o=t[r];let a;return o==null?a=n!=null?n.toPrecision(i):"1":s.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Wl(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function cn(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 ts(n){return`react-resizable-panels:${n}`}function ns(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 ss(n,e){try{const t=ts(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gl(n,e,t){var s,r;const i=(s=ss(n,t))!==null&&s!==void 0?s:{},o=ns(e);return(r=i[o])!==null&&r!==void 0?r:null}function Vl(n,e,t,s,r){var i;const o=ts(n),a=ns(e),c=(i=ss(n,r))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function dn({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(!me(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const o=t[i];V(o!=null,`No layout data found for index ${i}`);const a=100/s*o;t[i]=a}let r=0;for(let i=0;i<e.length;i++){const o=t[i];V(o!=null,`No layout data found for index ${i}`);const a=Ae({panelConstraints:e,panelIndex:i,size:o});o!=a&&(r+=o-a,t[i]=a)}if(!me(r,0))for(let i=0;i<e.length;i++){const o=t[i];V(o!=null,`No layout data found for index ${i}`);const a=o+r,c=Ae({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(r-=c-o,t[i]=c,me(r,0)))break}return t}const Xl=100,qe={getItem:n=>(cn(qe),qe.getItem(n)),setItem:(n,e)=>{cn(qe),qe.setItem(n,e)}},un={};function ls({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=qe,style:d,tagName:f="div",...u}){const h=Vt(i),m=k.useRef(null),[p,g]=k.useState(null),[b,x]=k.useState([]),y=Ol(),j=k.useRef({}),N=k.useRef(new Map),z=k.useRef(0),C=k.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:a,onLayout:o,storage:c}),w=k.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});k.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k.useImperativeHandle(r,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:S}=w.current;return S},setLayout:S=>{const{onLayout:O}=C.current,{layout:R,panelDataArray:U}=w.current,T=dn({layout:S,panelConstraints:U.map(H=>H.constraints)});an(R,T)||(x(T),w.current.layout=T,O&&O(T),Ie(U,T,j.current))}}),[]),Fe(()=>{C.current.autoSaveId=n,C.current.direction=s,C.current.dragState=p,C.current.id=h,C.current.onLayout=o,C.current.storage=c}),Ul({committedValuesRef:C,eagerValuesRef:w,groupId:h,layout:b,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(n){if(b.length===0||b.length!==S.length)return;let O=un[n];O==null&&(O=Wl(Vl,Xl),un[n]=O);const R=[...S],U=new Map(N.current);O(n,R,U,b,c)}},[n,b,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:O}=C.current,{layout:R,panelDataArray:U}=w.current;if(S.constraints.collapsible){const T=U.map(fe=>fe.constraints),{collapsedSize:H=0,panelSize:Y,pivotIndices:te}=De(U,S,R);if(V(Y!=null,`Panel size not found for panel "${S.id}"`),!je(Y,H)){N.current.set(S.id,Y);const E=Oe(U,S)===U.length-1?Y-H:H-Y,X=He({delta:E,initialLayout:R,panelConstraints:T,pivotIndices:te,prevLayout:R,trigger:"imperative-api"});ut(R,X)||(x(X),w.current.layout=X,O&&O(X),Ie(U,X,j.current))}}},[]),I=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current;if(S.constraints.collapsible){const H=T.map(ne=>ne.constraints),{collapsedSize:Y=0,panelSize:te=0,minSize:fe=0,pivotIndices:E}=De(T,S,U),X=O??fe;if(je(te,Y)){const ne=N.current.get(S.id),ge=ne!=null&&ne>=X?ne:X,Pe=Oe(T,S)===T.length-1?te-ge:ge-te,oe=He({delta:Pe,initialLayout:U,panelConstraints:H,pivotIndices:E,prevLayout:U,trigger:"imperative-api"});ut(U,oe)||(x(oe),w.current.layout=oe,R&&R(oe),Ie(T,oe,j.current))}}},[]),F=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{panelSize:U}=De(R,S,O);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,O)=>{const{panelDataArray:R}=w.current,U=Oe(R,S);return Kl({defaultSize:O,dragState:p,layout:b,panelData:R,panelIndex:U})},[p,b]),P=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),T===!0&&je(H,U)},[]),W=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),!T||Me(H,U)>0},[]),A=k.useCallback(S=>{const{panelDataArray:O}=w.current;O.push(S),O.sort((R,U)=>{const T=R.order,H=U.order;return T==null&&H==null?0:T==null?-1:H==null?1:T-H}),w.current.panelDataArrayChanged=!0,y()},[y]);Fe(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:O,storage:R}=C.current,{layout:U,panelDataArray:T}=w.current;let H=null;if(S){const te=Gl(S,T,R);te&&(N.current=new Map(Object.entries(te.expandToSizes)),H=te.layout)}H==null&&(H=ql({panelDataArray:T}));const Y=dn({layout:H,panelConstraints:T.map(te=>te.constraints)});an(U,Y)||(x(Y),w.current.layout=Y,O&&O(Y),Ie(T,Y,j.current))}}),Fe(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let O=!1;const R=m.current;return R&&window.getComputedStyle(R,null).getPropertyValue("direction")==="rtl"&&(O=!0),function(T){T.preventDefault();const H=m.current;if(!H)return()=>null;const{direction:Y,dragState:te,id:fe,keyboardResizeBy:E,onLayout:X}=C.current,{layout:ne,panelDataArray:ge}=w.current,{initialLayout:Ne}=te??{},Pe=Zn(fe,S,H);let oe=Hl(T,S,Y,te,E,H);const at=Y==="horizontal";at&&O&&(oe=-oe);const Et=ge.map(Dt=>Dt.constraints),Ee=He({delta:oe,initialLayout:Ne??ne,panelConstraints:Et,pivotIndices:Pe,prevLayout:ne,trigger:Bn(T)?"keyboard":"mouse-or-touch"}),ct=!ut(ne,Ee);(Hn(T)||qn(T))&&z.current!=oe&&(z.current=oe,!ct&&oe!==0?at?Lt(S,oe<0?Wn:Gn):Lt(S,oe<0?Vn:Xn):Lt(S,0)),ct&&(x(Ee),w.current.layout=Ee,X&&X(Ee),Ie(ge,Ee,j.current))}},[]),B=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current,H=T.map(ne=>ne.constraints),{panelSize:Y,pivotIndices:te}=De(T,S,U);V(Y!=null,`Panel size not found for panel "${S.id}"`);const E=Oe(T,S)===T.length-1?Y-O:O-Y,X=He({delta:E,initialLayout:U,panelConstraints:H,pivotIndices:te,prevLayout:U,trigger:"imperative-api"});ut(U,X)||(x(X),w.current.layout=X,R&&R(X),Ie(T,X,j.current))},[]),G=k.useCallback((S,O)=>{const{layout:R,panelDataArray:U}=w.current,{collapsedSize:T=0,collapsible:H}=O,{collapsedSize:Y=0,collapsible:te,maxSize:fe=100,minSize:E=0}=S.constraints,{panelSize:X}=De(U,S,R);X!=null&&(H&&te&&je(X,T)?je(T,Y)||B(S,Y):X<E?B(S,E):X>fe&&B(S,fe))},[B]),q=k.useCallback((S,O)=>{const{direction:R}=C.current,{layout:U}=w.current;if(!m.current)return;const T=Nt(S,m.current);V(T,`Drag handle element not found for id "${S}"`);const H=es(R,O);g({dragHandleId:S,dragHandleRect:T.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),ee=k.useCallback(()=>{g(null)},[]),J=k.useCallback(S=>{const{panelDataArray:O}=w.current,R=Oe(O,S);R>=0&&(O.splice(R,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,y())},[y]),L=k.useMemo(()=>({collapsePanel:M,direction:s,dragState:p,expandPanel:I,getPanelSize:F,getPanelStyle:v,groupId:h,isPanelCollapsed:P,isPanelExpanded:W,reevaluatePanelConstraints:G,registerPanel:A,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:ee,unregisterPanel:J,panelGroupElement:m.current}),[M,p,s,I,F,v,h,P,W,G,A,_,B,q,ee,J]),K={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(jt.Provider,{value:L},k.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...K,...d},[se.group]:"",[se.groupDirection]:s,[se.groupId]:h}))}const rs=k.forwardRef((n,e)=>k.createElement(ls,{...n,forwardedRef:e}));ls.displayName="PanelGroup";rs.displayName="forwardRef(PanelGroup)";function Oe(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function De(n,e,t){const s=Oe(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],o=t[s];return{...e.constraints,panelSize:o,pivotIndices:i}}function Ql({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){k.useEffect(()=>{if(n||t==null||s==null)return;const r=Nt(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 a=r.getAttribute(se.groupId);V(a,`No group element found for id "${a}"`);const c=Ye(a,s),d=Yn(a,e,s);V(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[s,n,e,t])}function is({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var g,b;const x=k.useRef(null),y=k.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{y.current.onClick=o,y.current.onDragging=a,y.current.onPointerDown=d,y.current.onPointerUp=f});const j=k.useContext(jt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:z,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:I}=j,F=Vt(r),[v,P]=k.useState("inactive"),[W,A]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Fe(()=>{G.current.state=v}),k.useEffect(()=>{if(t)B(null);else{const L=C(F);B(()=>L)}},[t,F,C]);const q=(g=s?.coarse)!==null&&g!==void 0?g:15,ee=(b=s?.fine)!==null&&b!==void 0?b:5;k.useEffect(()=>{if(t||_==null)return;const L=x.current;V(L,"Element ref not attached");let K=!1;return Il(F,L,N,{coarse:q,fine:ee},(O,R,U)=>{if(!R){P("inactive");return}switch(O){case"down":{P("drag"),K=!1,V(U,'Expected event to be defined for "down" action'),w(F,U);const{onDragging:T,onPointerDown:H}=y.current;T?.(!0),H?.();break}case"move":{const{state:T}=G.current;K=!0,T!=="drag"&&P("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{P("hover"),M();const{onClick:T,onDragging:H,onPointerUp:Y}=y.current;H?.(!1),Y?.(),K||T?.();break}}})},[q,N,t,ee,C,F,_,w,M]),Ql({disabled:t,handleId:F,resizeHandler:_,panelGroupElement:I});const J={touchAction:"none",userSelect:"none"};return k.createElement(m,{...p,children:n,className:e,id:r,onBlur:()=>{A(!1),i?.()},onFocus:()=>{A(!0),c?.()},ref:x,role:"separator",style:{...J,...u},tabIndex:h,[se.groupDirection]:N,[se.groupId]:z,[se.resizeHandle]:"",[se.resizeHandleActive]:v==="drag"?"pointer":W?"keyboard":void 0,[se.resizeHandleEnabled]:!t,[se.resizeHandleId]:F,[se.resizeHandleState]:v})}is.displayName="PanelResizeHandle";function Yl(n){const e=$.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=ce("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=l.jsx(rs,{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 fn(n){const e=$.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=l.jsx(Un,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function Zl(n){const e=$.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=ce("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&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(Ds,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==s||e[9]!==i||e[10]!==o?(a=l.jsx(is,{"data-slot":"resizable-handle",className:i,...s,children:o}),e[8]=s,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function Jl(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 er(n){if(Jl(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function tr(n){try{return decodeURIComponent(n)}catch{return n}}function nr(n){return er(n),encodeURIComponent(n)}function sr(n){return`.deco/blocks/${nr(n)}.json`}function Lo(n){return`/${sr(n)}`}const Oo=1e4,lr=3;function Ut(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function Yt(n){return n.startsWith("/")?n.slice(1):n}function bt(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function rr(n){const e=bt(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function Ro(n,e){const t=e.replace(/^\/+|\/+$/g,"");return bt(t?`${n==="/"?"":n}/${t}`:n)}function Ao(n,e){return e==="directory"?n:rr(n)}function _o(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 ir(n){const e=Yt(n);return e?e.split("/").filter(Boolean).length:0}function Uo(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Bo(n,e){return ir(n)>=lr&&!e.has(n)}function Ho(n,e,t=[]){const s=Yt(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 qo(n){const e=Yt(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return tr(s)}function or(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 Ko(n){const e=Ut(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function Wo(n,e=[]){const t={children:[]},s=i=>{const a=Ut(i).split("/").filter(Boolean);let c=t,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(h=>h.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of n){const a=Ut(i).split("/").filter(Boolean);let c=t,d="";a.forEach((f,u)=>{d+=`/${f}`;const h=u===a.length-1;let m=c.children.find(p=>p.name===f);m||(m={name:f,path:d,kind:h?"file":"directory",children:[]},c.children.push(m)),c=m})}for(const i of e)s(bt(i));const r=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&r(o.children)};return r(t.children),t.children}function ar(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(...ar(r.children,e,t+1)));return s}function Go(n){return n.split(`
1
+ import{c as $,a4 as de,n as Ze,d as We,K as Q,m as ie,aX as kn,r as k,ao as Ss,l as ce,j as l,a6 as Ns,i as zs,B as Z,aK as Sn,t as ue,$ as Cs,L as $s,e as Ps,b as Nn,u as zn,U as Tt}from"./index-oRUXeO_q.js";import{i as Es}from"./ChevronRight-CGMQ9_U1.js";import{s as Cn}from"./Eye-DiRw0Qiz.js";import{n as Ve,i as yt}from"./Globe01-BzW3NSbG.js";import{b as Ds,c as Ts,e as Fs,i as Ms,f as $n,a as Ht,g as Is,d as Ls}from"./ZoomOut-BEgIfWMd.js";import{a as ht}from"./Palette-CvpDh6yH.js";import{s as Os}from"./Plus-BndSMgXV.js";import{i as Rs}from"./SearchLg-CHM0ESn_.js";import{t as As}from"./Stars01-BQvwTUo0.js";import{i as mt}from"./Upload01-D2kAayNK.js";import{s as Pn}from"./XClose-DSwVoJ4X.js";import{i as qt}from"./Zap-CQek3oek.js";import{u as En}from"./use-mobile-M8W7Kv1V.js";import{f as _s,a as Us,b as Bs,c as Hs,d as qs,e as Ks,A as Ws,g as Gs}from"./alert-dialog-SvFNgDAx.js";import{D as Dn,a as Ue,d as Je,e as et,g as Tn,f as Vs,c as Xs}from"./dialog-ClYAYRmD.js";import{I as Xe}from"./input--jaCPjE2.js";import{S as ae}from"./skeleton-CXgII3Bw.js";import{F as Se,M as Kt,d as Fn}from"./file-type-icon-DKWyyplC.js";import{T as Qs}from"./toolbar-BGvLO6RZ.js";import{a as Ys}from"./Package-T_ZOTpyK.js";import{u as Zs}from"./use-debounced-value-Bek1HKp-.js";import{i as vt}from"./DotsVertical-rms0S2mG.js";import{i as Mn}from"./Key01-tUHgEoCR.js";import{s as wt}from"./Trash01-BAtkdZ_P.js";import{D as tt,a as nt,c as st,d as be}from"./dropdown-menu-DpW1bhzp.js";import{T as Js}from"./textarea-uGqD7j3K.js";import{t as el}from"./ChevronDown-DhIYpVW6.js";import{n as tl}from"./ChevronUp-Bo_9AeLR.js";import{i as pt}from"./X-ukK64B_p.js";import{P as nl,b as sl,a as ll}from"./popover-BEP_E0EQ.js";import{T as ye,a as ve,b as we}from"./tooltip-D6EFrI2I.js";import{i as rl}from"./Check-CQkTVrms.js";import{a as il}from"./Copy01-B-Bw91-9.js";import{n as In}from"./LinkExternal01-kp6-i_It.js";import{l as ol,F as al}from"./index-DNhAZb-t.js";import{i as cl}from"./LayoutLeft-DZ-jCFY6.js";function Ln(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function pe(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function he(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 Wt(n,e){const t=$.c(11),{org:s}=de();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=Q.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 he(pe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(dl),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:kn,queryFn:i},t[8]=r,t[9]=i,t[10]=o):o=t[10],ie(o)}function dl(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function On(n,e,t){const s=$.c(15),{org:r}=de();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=Q.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 a;s[4]!==t?(a=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=a):a=s[5];let c;s[6]!==r.slug||s[7]!==e||s[8]!==n?(c=async()=>{const f=await fetch(pe(r.slug,n??"","stat",{path:e}));if(f.status===404)return null;if(!f.ok)throw new Error(`HTTP ${f.status}`);return(await f.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let d;return s[10]!==i||s[11]!==o||s[12]!==a||s[13]!==c?(d={queryKey:i,enabled:o,refetchInterval:a,queryFn:c},s[10]=i,s[11]=o,s[12]=a,s[13]=c,s[14]=d):d=s[14],ie(d)}function ul(n){const e=$.c(9),{org:t}=de();let s;e[0]!==t.id||e[1]!==n?(s=Q.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 he(pe(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],ie(i)}function fl(n,e){const t=$.c(9),s=n===void 0?60:n,{org:r}=de();let i;t[0]!==r.id?(i=Q.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const o=e?.enabled;let a;t[2]!==s||t[3]!==r.slug?(a=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=a):a=t[4];let c;return t[5]!==i||t[6]!==o||t[7]!==a?(c={queryKey:i,enabled:o,queryFn:a},t[5]=i,t[6]=o,t[7]=a,t[8]=c):c=t[8],ie(c)}function hl(n,e){const t=$.c(11),s=50,{org:r}=de();let i;t[0]!==r.id||t[1]!==n?(i=Q.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const o=n.length>0;let a;t[3]!==s||t[4]!==r.slug||t[5]!==n?(a=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=a):a=t[6];let c;return t[7]!==i||t[8]!==o||t[9]!==a?(c={queryKey:i,enabled:o,placeholderData:kn,queryFn:a},t[7]=i,t[8]=o,t[9]=a,t[10]=c):c=t[10],ie(c)}function Fo(n){const e=$.c(8),{org:t}=de();let s;e[0]!==t.id?(s=Q.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 a=await he(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await a.json();return c.map(ml)},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],ie(o)}function ml(n){return{volume:n.volume,path:n.path}}async function Mo(n){const e=await he(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function pl(n,e,t){return(await he(pe(n,e,"read",{path:t}))).text()}const xl=new Set(["md","mdx","markdown","txt","text"]),gl=25,bl=64*1024,yl=256*1024,vl=4;function wl(n){const e=n.lastIndexOf(".");return e===-1?!1:xl.has(n.slice(e+1).toLowerCase())}async function Io(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],o=[],a=[{path:t,depth:0}];for(;a.length>0;){const u=a.shift();if(!u)break;let h;try{h=(await(await he(pe(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,g)=>p.path.localeCompare(g.path))){if(m.kind==="dir"){u.depth<vl&&a.push({path:m.path,depth:u.depth+1});continue}wl(m.path)&&m.size<=bl&&i.length<gl?i.push(m.path):o.push(r(m.path))}}const c=await Promise.all(i.map(u=>pl(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=c[h];if(m==null||f+m.length>yl){o.push(r(u));return}f+=m.length,d.push({relPath:r(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),o.sort(),{files:d,omittedPaths:o}}function Rn(){const n=$.c(7),{org:e}=de();let t;n[0]!==e.id?(t=Q.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await he(`/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],ie(r)}function jl(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>pe(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function lt(){const n=$.c(2),{org:e}=de();let t;return n[0]!==e.slug?(t=(s,r)=>pe(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function An(n){const e=$.c(3),{org:t}=de();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await he(pe(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],We(s)}function kl(n){const e=$.c(18),{org:t}=de(),s=Ze();let r;e[0]!==t||e[1]!==n?(r=async d=>(await(await he(pe(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.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 d=>{const f=Q.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let o;e[7]!==s?(o=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=o):o=e[8];let a;e[9]!==t||e[10]!==s||e[11]!==n?(a=(d,f,u)=>{s.invalidateQueries({queryKey:Q.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=a):a=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==o||e[16]!==a?(c={mutationFn:r,onMutate:i,onError:o,onSettled:a},e[13]=r,e[14]=i,e[15]=o,e[16]=a,e[17]=c):c=e[17],We(c)}function At(n){const e=$.c(26),{org:t}=de(),s=Ze();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(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 b=>{for(const x of b.files){const y=b.dir?`${b.dir}/${x.name}`:x.name;await he(pe(t.slug,n,"file",{path:y}),{method:"PUT",headers:{"content-type":x.type||"application/octet-stream"},body:x})}},e[4]=t,e[5]=n,e[6]=o):o=e[6];let a;e[7]!==i||e[8]!==o?(a={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=a):a=e[9];const c=We(a);let d;e[10]!==t||e[11]!==n?(d=async b=>{await he(pe(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=We(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await he(pe(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=We(m);let g;return e[22]!==u||e[23]!==p||e[24]!==c?(g={upload:c,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=c,e[25]=g):g=e[25],g}const jt=k.createContext(null);jt.displayName="PanelGroupContext";const se={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"},Gt=10,Fe=k.useLayoutEffect,sn=Ss.useId,Sl=typeof sn=="function"?sn:()=>null;let Nl=0;function Vt(n=null){const e=Sl(),t=k.useRef(n||e||null);return t.current===null&&(t.current=""+Nl++),n??t.current}function _n({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...g}){const b=k.useContext(jt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:j,getPanelStyle:N,groupId:z,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:I,unregisterPanel:F}=b,v=Vt(o),P=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:h});k.useRef({didLogMissingDefaultSizeWarning:!1}),Fe(()=>{const{callbacks:A,constraints:_}=P.current,B={..._};P.current.id=v,P.current.idIsFromProps=o!==void 0,P.current.order=h,A.onCollapse=d,A.onExpand=f,A.onResize=u,_.collapsedSize=t,_.collapsible=s,_.defaultSize=r,_.maxSize=a,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w(P.current,B)}),Fe(()=>{const A=P.current;return M(A),()=>{F(A)}},[h,v,M,F]),k.useImperativeHandle(i,()=>({collapse:()=>{x(P.current)},expand:A=>{y(P.current,A)},getId(){return v},getSize(){return j(P.current)},isCollapsed(){return C(P.current)},isExpanded(){return!C(P.current)},resize:A=>{I(P.current,A)}}),[x,y,j,C,v,I]);const W=N(P.current,r);return k.createElement(p,{...g,children:n,className:e,id:v,style:{...W,...m},[se.groupId]:z,[se.panel]:"",[se.panelCollapsible]:s||void 0,[se.panelId]:v,[se.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const Un=k.forwardRef((n,e)=>k.createElement(_n,{...n,forwardedRef:e}));_n.displayName="Panel";Un.displayName="forwardRef(Panel)";let _t=null,ft=-1,Ce=null;function zl(n,e){if(e){const t=(e&Wn)!==0,s=(e&Gn)!==0,r=(e&Vn)!==0,i=(e&Xn)!==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 Cl(){Ce!==null&&(document.head.removeChild(Ce),_t=null,Ce=null,ft=-1)}function Ft(n,e){var t,s;const r=zl(n,e);if(_t!==r){if(_t=r,Ce===null&&(Ce=document.createElement("style"),document.head.appendChild(Ce)),ft>=0){var i;(i=Ce.sheet)===null||i===void 0||i.removeRule(ft)}ft=(t=(s=Ce.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Bn(n){return n.type==="keydown"}function Hn(n){return n.type.startsWith("pointer")}function qn(n){return n.type.startsWith("mouse")}function kt(n){if(Hn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(qn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function $l(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Pl(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 El(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:on(n),b:on(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;V(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:rn(ln(t.a)),b:rn(ln(t.b))};if(r.a===r.b){const i=s.childNodes,o={a:t.a.at(-1),b:t.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const Dl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tl(n){var e;const t=getComputedStyle((e=Kn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Fl(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Tl(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"||Dl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ln(n){let e=n.length;for(;e--;){const t=n[e];if(V(t,"Missing node"),Fl(t))return t}return null}function rn(n){return n&&Number(getComputedStyle(n).zIndex)||0}function on(n){const e=[];for(;n;)e.push(n),n=Kn(n);return e}function Kn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Wn=1,Gn=2,Vn=4,Xn=8,Ml=$l()==="coarse";let xe=[],_e=!1,Te=new Map,St=new Map;const Qe=new Set;function Il(n,e,t,s,r){var i;const{ownerDocument:o}=e,a={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},c=(i=Te.get(o))!==null&&i!==void 0?i:0;return Te.set(o,c+1),Qe.add(a),xt(),function(){var f;St.delete(n),Qe.delete(a);const u=(f=Te.get(o))!==null&&f!==void 0?f:1;if(Te.set(o,u-1),xt(),u===1&&Te.delete(o),xe.includes(a)){const h=xe.indexOf(a);h>=0&&xe.splice(h,1),Qt(),r("up",!0,null)}}}function Ll(n){const{target:e}=n,{x:t,y:s}=kt(n);_e=!0,Xt({target:e,x:t,y:s}),xt(),xe.length>0&&(gt("down",n),n.preventDefault(),Qn(e)||n.stopImmediatePropagation())}function Mt(n){const{x:e,y:t}=kt(n);if(_e&&n.buttons===0&&(_e=!1,gt("up",n)),!_e){const{target:s}=n;Xt({target:s,x:e,y:t})}gt("move",n),Qt(),xe.length>0&&n.preventDefault()}function It(n){const{target:e}=n,{x:t,y:s}=kt(n);St.clear(),_e=!1,xe.length>0&&(n.preventDefault(),Qn(e)||n.stopImmediatePropagation()),gt("up",n),Xt({target:e,x:t,y:s}),Qt(),xt()}function Qn(n){let e=n;for(;e;){if(e.hasAttribute(se.resizeHandle))return!0;e=e.parentElement}return!1}function Xt({target:n,x:e,y:t}){xe.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Qe.forEach(r=>{const{element:i,hitAreaMargins:o}=r,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,h=Ml?o.coarse:o.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=c+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&El(s,i)>0){let p=s,g=!1;for(;p&&!p.contains(i);){if(Pl(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}xe.push(r)}})}function Lt(n,e){St.set(n,e)}function Qt(){let n=!1,e=!1;xe.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;St.forEach(s=>{t|=s}),n&&e?Ft("intersection",t):n?Ft("horizontal",t):e?Ft("vertical",t):Cl()}let Ot=new AbortController;function xt(){Ot.abort(),Ot=new AbortController;const n={capture:!0,signal:Ot.signal};Qe.size&&(_e?(xe.length>0&&Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",It,n),s.addEventListener("pointerleave",Mt,n),s.addEventListener("pointermove",Mt,n))}),window.addEventListener("pointerup",It,n),window.addEventListener("pointercancel",It,n)):Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Ll,n),s.addEventListener("pointermove",Mt,n))}))}function gt(n,e){Qe.forEach(t=>{const{setResizeHandlerState:s}=t,r=xe.includes(t);s(n,r,e)})}function Ol(){const[n,e]=k.useState(0);return k.useCallback(()=>e(t=>t+1),[])}function V(n,e){if(!n)throw console.error(e),Error(e)}function Me(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function je(n,e,t=Gt){return Me(n,e,t)===0}function me(n,e,t){return Me(n,e,t)===0}function Rl(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(!me(r,i,t))return!1}return!0}function Ae({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];V(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:a=0}=s;if(Me(t,a)<0)if(i){const c=(r+a)/2;Me(t,c)<0?t=r:t=a}else t=a;return t=Math.min(o,t),t=parseFloat(t.toFixed(Gt)),t}function He({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(me(n,0))return e;const o=[...e],[a,c]=s;V(a!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?c:a,h=t[u];V(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,m)){const x=g-b;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}{const u=n<0?a:c,h=t[u];V(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,g)){const x=b-m;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}}{const u=n<0?1:-1;let h=n<0?c:a,m=0;for(;;){const g=e[h];V(g!=null,`Previous layout not found for panel index ${h}`);const x=Ae({panelConstraints:t,panelIndex:h,size:100})-g;if(m+=x,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?a:c;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];V(p!=null,`Previous layout not found for panel index ${h}`);const g=p-m,b=Ae({panelConstraints:t,panelIndex:h,size:g});if(!me(p,b)&&(d+=p-b,o[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(Rl(r,o))return r;{const u=n<0?c:a,h=e[u];V(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=Ae({panelConstraints:t,panelIndex:u,size:m});if(o[u]=p,!me(p,m)){let g=m-p,x=n<0?c:a;for(;x>=0&&x<t.length;){const y=o[x];V(y!=null,`Previous layout not found for panel index ${x}`);const j=y+g,N=Ae({panelConstraints:t,panelIndex:x,size:j});if(me(y,N)||(g-=N-y,o[x]=N),me(g,0))break;n>0?x--:x++}}}const f=o.reduce((u,h)=>h+u,0);return me(f,100)?o:r}function Al({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,o=0;const a=t[0];V(a!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:g=0}=m;h===a?(s=g,r=p):(i+=g,o+=p)});const c=Math.min(r,100-i),d=Math.max(s,100-o),f=n[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ye(n,e=document){return Array.from(e.querySelectorAll(`[${se.resizeHandleId}][data-panel-group-id="${n}"]`))}function Yn(n,e,t=document){const r=Ye(n,t).findIndex(i=>i.getAttribute(se.resizeHandleId)===e);return r??null}function Zn(n,e,t){const s=Yn(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function Jn(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 Nt(n,e=document){const t=e.querySelector(`[${se.resizeHandleId}="${n}"]`);return t||null}function _l(n,e,t,s=document){var r,i,o,a;const c=Nt(e,s),d=Ye(n,s),f=c?d.indexOf(c):-1,u=(r=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,h=(o=(a=t[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,h]}function Ul({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:o}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Fe(()=>{if(!i)return;const a=Ye(t,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Al({layout:s,panelsArray:r,pivotIndices:[c,c+1]}),h=a[c];if(h!=null){const m=r[c];V(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[t,s,r,i]),k.useEffect(()=>{if(!i)return;const a=e.current;V(a,"Eager values not found");const{panelDataArray:c}=a,d=Jn(t,i);V(d!=null,`No group found for id "${t}"`);const f=Ye(t,i);V(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(se.resizeHandleId);V(m,"Resize handle element has no handle id attribute");const[p,g]=_l(t,m,c,i);if(p==null||g==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];V(j,`No panel data found for index ${y}`);const N=s[y],{collapsedSize:z=0,collapsible:C,minSize:w=0}=j.constraints;if(N!=null&&C){const M=He({delta:me(N,z)?w-z:z-N,initialLayout:s,panelConstraints:c.map(I=>I.constraints),pivotIndices:Zn(t,m,i),prevLayout:s,trigger:"keyboard"});s!==M&&o(M)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,r,o])}function an(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 es(n,e){const t=n==="horizontal",{x:s,y:r}=kt(e);return t?s:r}function Bl(n,e,t,s,r){const i=t==="horizontal",o=Nt(e,r);V(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(se.groupId);V(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=es(t,n),f=Jn(a,r);V(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-c)/h*100}function Hl(n,e,t,s,r,i){if(Bn(n)){const o=t==="horizontal";let a=0;n.shiftKey?a=100:r!=null?a=r:a=10;let c=0;switch(n.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Bl(n,e,t,s,i)}function ql({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];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(s++,e[i]=a,r-=a)}for(let i=0;i<n.length;i++){const o=t[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=n.length-s,d=r/c;s++,e[i]=d,r-=d}return e}function Ie(n,e,t){e.forEach((s,r)=>{const i=n[r];V(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=t[c];if(u==null||s!==u){t[c]=s;const{onCollapse:h,onExpand:m,onResize:p}=o;p&&p(s,u),f&&(h||m)&&(m&&(u==null||je(u,d))&&!je(s,d)&&m(),h&&(u==null||!je(u,d))&&je(s,d)&&h())}})}function ut(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 Kl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const o=t[r];let a;return o==null?a=n!=null?n.toPrecision(i):"1":s.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Wl(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function cn(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 ts(n){return`react-resizable-panels:${n}`}function ns(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 ss(n,e){try{const t=ts(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gl(n,e,t){var s,r;const i=(s=ss(n,t))!==null&&s!==void 0?s:{},o=ns(e);return(r=i[o])!==null&&r!==void 0?r:null}function Vl(n,e,t,s,r){var i;const o=ts(n),a=ns(e),c=(i=ss(n,r))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function dn({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(!me(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const o=t[i];V(o!=null,`No layout data found for index ${i}`);const a=100/s*o;t[i]=a}let r=0;for(let i=0;i<e.length;i++){const o=t[i];V(o!=null,`No layout data found for index ${i}`);const a=Ae({panelConstraints:e,panelIndex:i,size:o});o!=a&&(r+=o-a,t[i]=a)}if(!me(r,0))for(let i=0;i<e.length;i++){const o=t[i];V(o!=null,`No layout data found for index ${i}`);const a=o+r,c=Ae({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(r-=c-o,t[i]=c,me(r,0)))break}return t}const Xl=100,qe={getItem:n=>(cn(qe),qe.getItem(n)),setItem:(n,e)=>{cn(qe),qe.setItem(n,e)}},un={};function ls({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=qe,style:d,tagName:f="div",...u}){const h=Vt(i),m=k.useRef(null),[p,g]=k.useState(null),[b,x]=k.useState([]),y=Ol(),j=k.useRef({}),N=k.useRef(new Map),z=k.useRef(0),C=k.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:a,onLayout:o,storage:c}),w=k.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});k.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k.useImperativeHandle(r,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:S}=w.current;return S},setLayout:S=>{const{onLayout:O}=C.current,{layout:R,panelDataArray:U}=w.current,T=dn({layout:S,panelConstraints:U.map(H=>H.constraints)});an(R,T)||(x(T),w.current.layout=T,O&&O(T),Ie(U,T,j.current))}}),[]),Fe(()=>{C.current.autoSaveId=n,C.current.direction=s,C.current.dragState=p,C.current.id=h,C.current.onLayout=o,C.current.storage=c}),Ul({committedValuesRef:C,eagerValuesRef:w,groupId:h,layout:b,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(n){if(b.length===0||b.length!==S.length)return;let O=un[n];O==null&&(O=Wl(Vl,Xl),un[n]=O);const R=[...S],U=new Map(N.current);O(n,R,U,b,c)}},[n,b,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:O}=C.current,{layout:R,panelDataArray:U}=w.current;if(S.constraints.collapsible){const T=U.map(fe=>fe.constraints),{collapsedSize:H=0,panelSize:Y,pivotIndices:te}=De(U,S,R);if(V(Y!=null,`Panel size not found for panel "${S.id}"`),!je(Y,H)){N.current.set(S.id,Y);const E=Oe(U,S)===U.length-1?Y-H:H-Y,X=He({delta:E,initialLayout:R,panelConstraints:T,pivotIndices:te,prevLayout:R,trigger:"imperative-api"});ut(R,X)||(x(X),w.current.layout=X,O&&O(X),Ie(U,X,j.current))}}},[]),I=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current;if(S.constraints.collapsible){const H=T.map(ne=>ne.constraints),{collapsedSize:Y=0,panelSize:te=0,minSize:fe=0,pivotIndices:E}=De(T,S,U),X=O??fe;if(je(te,Y)){const ne=N.current.get(S.id),ge=ne!=null&&ne>=X?ne:X,Pe=Oe(T,S)===T.length-1?te-ge:ge-te,oe=He({delta:Pe,initialLayout:U,panelConstraints:H,pivotIndices:E,prevLayout:U,trigger:"imperative-api"});ut(U,oe)||(x(oe),w.current.layout=oe,R&&R(oe),Ie(T,oe,j.current))}}},[]),F=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{panelSize:U}=De(R,S,O);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,O)=>{const{panelDataArray:R}=w.current,U=Oe(R,S);return Kl({defaultSize:O,dragState:p,layout:b,panelData:R,panelIndex:U})},[p,b]),P=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),T===!0&&je(H,U)},[]),W=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),!T||Me(H,U)>0},[]),A=k.useCallback(S=>{const{panelDataArray:O}=w.current;O.push(S),O.sort((R,U)=>{const T=R.order,H=U.order;return T==null&&H==null?0:T==null?-1:H==null?1:T-H}),w.current.panelDataArrayChanged=!0,y()},[y]);Fe(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:O,storage:R}=C.current,{layout:U,panelDataArray:T}=w.current;let H=null;if(S){const te=Gl(S,T,R);te&&(N.current=new Map(Object.entries(te.expandToSizes)),H=te.layout)}H==null&&(H=ql({panelDataArray:T}));const Y=dn({layout:H,panelConstraints:T.map(te=>te.constraints)});an(U,Y)||(x(Y),w.current.layout=Y,O&&O(Y),Ie(T,Y,j.current))}}),Fe(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let O=!1;const R=m.current;return R&&window.getComputedStyle(R,null).getPropertyValue("direction")==="rtl"&&(O=!0),function(T){T.preventDefault();const H=m.current;if(!H)return()=>null;const{direction:Y,dragState:te,id:fe,keyboardResizeBy:E,onLayout:X}=C.current,{layout:ne,panelDataArray:ge}=w.current,{initialLayout:Ne}=te??{},Pe=Zn(fe,S,H);let oe=Hl(T,S,Y,te,E,H);const at=Y==="horizontal";at&&O&&(oe=-oe);const Et=ge.map(Dt=>Dt.constraints),Ee=He({delta:oe,initialLayout:Ne??ne,panelConstraints:Et,pivotIndices:Pe,prevLayout:ne,trigger:Bn(T)?"keyboard":"mouse-or-touch"}),ct=!ut(ne,Ee);(Hn(T)||qn(T))&&z.current!=oe&&(z.current=oe,!ct&&oe!==0?at?Lt(S,oe<0?Wn:Gn):Lt(S,oe<0?Vn:Xn):Lt(S,0)),ct&&(x(Ee),w.current.layout=Ee,X&&X(Ee),Ie(ge,Ee,j.current))}},[]),B=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current,H=T.map(ne=>ne.constraints),{panelSize:Y,pivotIndices:te}=De(T,S,U);V(Y!=null,`Panel size not found for panel "${S.id}"`);const E=Oe(T,S)===T.length-1?Y-O:O-Y,X=He({delta:E,initialLayout:U,panelConstraints:H,pivotIndices:te,prevLayout:U,trigger:"imperative-api"});ut(U,X)||(x(X),w.current.layout=X,R&&R(X),Ie(T,X,j.current))},[]),G=k.useCallback((S,O)=>{const{layout:R,panelDataArray:U}=w.current,{collapsedSize:T=0,collapsible:H}=O,{collapsedSize:Y=0,collapsible:te,maxSize:fe=100,minSize:E=0}=S.constraints,{panelSize:X}=De(U,S,R);X!=null&&(H&&te&&je(X,T)?je(T,Y)||B(S,Y):X<E?B(S,E):X>fe&&B(S,fe))},[B]),q=k.useCallback((S,O)=>{const{direction:R}=C.current,{layout:U}=w.current;if(!m.current)return;const T=Nt(S,m.current);V(T,`Drag handle element not found for id "${S}"`);const H=es(R,O);g({dragHandleId:S,dragHandleRect:T.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),ee=k.useCallback(()=>{g(null)},[]),J=k.useCallback(S=>{const{panelDataArray:O}=w.current,R=Oe(O,S);R>=0&&(O.splice(R,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,y())},[y]),L=k.useMemo(()=>({collapsePanel:M,direction:s,dragState:p,expandPanel:I,getPanelSize:F,getPanelStyle:v,groupId:h,isPanelCollapsed:P,isPanelExpanded:W,reevaluatePanelConstraints:G,registerPanel:A,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:ee,unregisterPanel:J,panelGroupElement:m.current}),[M,p,s,I,F,v,h,P,W,G,A,_,B,q,ee,J]),K={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(jt.Provider,{value:L},k.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...K,...d},[se.group]:"",[se.groupDirection]:s,[se.groupId]:h}))}const rs=k.forwardRef((n,e)=>k.createElement(ls,{...n,forwardedRef:e}));ls.displayName="PanelGroup";rs.displayName="forwardRef(PanelGroup)";function Oe(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function De(n,e,t){const s=Oe(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],o=t[s];return{...e.constraints,panelSize:o,pivotIndices:i}}function Ql({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){k.useEffect(()=>{if(n||t==null||s==null)return;const r=Nt(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 a=r.getAttribute(se.groupId);V(a,`No group element found for id "${a}"`);const c=Ye(a,s),d=Yn(a,e,s);V(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[s,n,e,t])}function is({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var g,b;const x=k.useRef(null),y=k.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{y.current.onClick=o,y.current.onDragging=a,y.current.onPointerDown=d,y.current.onPointerUp=f});const j=k.useContext(jt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:z,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:I}=j,F=Vt(r),[v,P]=k.useState("inactive"),[W,A]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Fe(()=>{G.current.state=v}),k.useEffect(()=>{if(t)B(null);else{const L=C(F);B(()=>L)}},[t,F,C]);const q=(g=s?.coarse)!==null&&g!==void 0?g:15,ee=(b=s?.fine)!==null&&b!==void 0?b:5;k.useEffect(()=>{if(t||_==null)return;const L=x.current;V(L,"Element ref not attached");let K=!1;return Il(F,L,N,{coarse:q,fine:ee},(O,R,U)=>{if(!R){P("inactive");return}switch(O){case"down":{P("drag"),K=!1,V(U,'Expected event to be defined for "down" action'),w(F,U);const{onDragging:T,onPointerDown:H}=y.current;T?.(!0),H?.();break}case"move":{const{state:T}=G.current;K=!0,T!=="drag"&&P("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{P("hover"),M();const{onClick:T,onDragging:H,onPointerUp:Y}=y.current;H?.(!1),Y?.(),K||T?.();break}}})},[q,N,t,ee,C,F,_,w,M]),Ql({disabled:t,handleId:F,resizeHandler:_,panelGroupElement:I});const J={touchAction:"none",userSelect:"none"};return k.createElement(m,{...p,children:n,className:e,id:r,onBlur:()=>{A(!1),i?.()},onFocus:()=>{A(!0),c?.()},ref:x,role:"separator",style:{...J,...u},tabIndex:h,[se.groupDirection]:N,[se.groupId]:z,[se.resizeHandle]:"",[se.resizeHandleActive]:v==="drag"?"pointer":W?"keyboard":void 0,[se.resizeHandleEnabled]:!t,[se.resizeHandleId]:F,[se.resizeHandleState]:v})}is.displayName="PanelResizeHandle";function Yl(n){const e=$.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=ce("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=l.jsx(rs,{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 fn(n){const e=$.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=l.jsx(Un,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function Zl(n){const e=$.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=ce("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&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(Ds,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==s||e[9]!==i||e[10]!==o?(a=l.jsx(is,{"data-slot":"resizable-handle",className:i,...s,children:o}),e[8]=s,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function Jl(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 er(n){if(Jl(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function tr(n){try{return decodeURIComponent(n)}catch{return n}}function nr(n){return er(n),encodeURIComponent(n)}function sr(n){return`.deco/blocks/${nr(n)}.json`}function Lo(n){return`/${sr(n)}`}const Oo=1e4,lr=3;function Ut(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function Yt(n){return n.startsWith("/")?n.slice(1):n}function bt(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function rr(n){const e=bt(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function Ro(n,e){const t=e.replace(/^\/+|\/+$/g,"");return bt(t?`${n==="/"?"":n}/${t}`:n)}function Ao(n,e){return e==="directory"?n:rr(n)}function _o(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 ir(n){const e=Yt(n);return e?e.split("/").filter(Boolean).length:0}function Uo(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function Bo(n,e){return ir(n)>=lr&&!e.has(n)}function Ho(n,e,t=[]){const s=Yt(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 qo(n){const e=Yt(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return tr(s)}function or(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 Ko(n){const e=Ut(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function Wo(n,e=[]){const t={children:[]},s=i=>{const a=Ut(i).split("/").filter(Boolean);let c=t,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(h=>h.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of n){const a=Ut(i).split("/").filter(Boolean);let c=t,d="";a.forEach((f,u)=>{d+=`/${f}`;const h=u===a.length-1;let m=c.children.find(p=>p.name===f);m||(m={name:f,path:d,kind:h?"file":"directory",children:[]},c.children.push(m)),c=m})}for(const i of e)s(bt(i));const r=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&r(o.children)};return r(t.children),t.children}function ar(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(...ar(r.children,e,t+1)));return s}function Go(n){return n.split(`
2
2
  `).map(e=>{const t=e.match(/^\d+\t(.*)/);return t?t[1]:e}).join(`
3
3
  `)}ol.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(n){const e=$.c(11),{value:t,filename:s}=n,[r]=Ns(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let o;e[0]!==s?(o=or(s),e[0]=s,e[1]=o):o=e[1];const a=i?"vs-dark":"light";let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsx(zs,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={enabled:!1},f={top:12,bottom:12},e[3]=d,e[4]=f):(d=e[3],f=e[4]);let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:d,padding:f,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=u):u=e[5];let h;return e[6]!==s||e[7]!==o||e[8]!==a||e[9]!==t?(h=l.jsx(al,{path:s,language:o,value:t,theme:a,loading:c,options:u},s),e[6]=s,e[7]=o,e[8]=a,e[9]=t,e[10]=h):h=e[10],h}function os(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const dr=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),ur=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),hn=2*1024*1024;function fr(n,e){const t=n.split(".").pop()?.toLowerCase()??"";return dr.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=hn?"markdown":"download":ur.has(t)&&e<=hn?"text":"download"}function as(){const n=$.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ae,{className:"h-6 w-2/3"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(ae,{className:"h-3 w-full"}),l.jsx(ae,{className:"h-3 w-5/6"}),l.jsx(ae,{className:"h-3 w-2/3"})]})]})}),n[1]=t):t=n[1],t}function cs(n){const e=$.c(20),{file:t,note:s}=n;let r;e[0]!==t.filename?(r=l.jsx(Se,{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=l.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=os(t.size),e[4]=t.size,e[5]=o):o=e[5];const a=s?` · ${s}`:"";let c;e[6]!==o||e[7]!==a?(c=l.jsxs("span",{className:"text-xs text-muted-foreground",children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==i||e[10]!==c?(d=l.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,c]}),e[9]=i,e[10]=c,e[11]=d):d=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(Ve,{size:14}),e[12]=f):f=e[12];let u;e[13]!==t.downloadUrl||e[14]!==t.filename?(u=l.jsx(Z,{asChild:!0,variant:"outline",size:"sm",children:l.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[f,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=u):u=e[15];let h;return e[16]!==r||e[17]!==d||e[18]!==u?(h=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[r,d,u]})}),e[16]=r,e[17]=d,e[18]=u,e[19]=h):h=e[19],h}function mn(n){const e=$.c(16),{file:t,markdown:s}=n;let r;e[0]!==t.downloadUrl?(r=Q.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==t.downloadUrl?(i=async()=>{const u=await fetch(t.downloadUrl,{credentials:"include"});if(!u.ok)throw new Error(`fetch failed: ${u.status}`);return u.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:a,isPending:c,isError:d}=ie(o);if(c){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(as,{}),e[7]=u):u=e[7],u}if(d||a===void 0){let u;return e[8]!==t?(u=l.jsx(cs,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=u):u=e[9],u}if(s){const u=`file-preview-${t.key}`;let h;return e[10]!==a||e[11]!==u?(h=l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:l.jsx(Kt,{id:u,text:a})})}),e[10]=a,e[11]=u,e[12]=h):h=e[12],h}let f;return e[13]!==a||e[14]!==t.filename?(f=l.jsx(cr,{value:a,filename:t.filename}),e[13]=a,e[14]=t.filename,e[15]=f):f=e[15],f}function ds(n){const e=$.c(15),{file:t}=n;switch(fr(t.filename,t.size)){case"image":{let r;return e[0]!==t.downloadUrl||e[1]!==t.filename?(r=l.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:l.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=l.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=l.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=l.jsx(mn,{file:t,markdown:!0}),e[9]=t,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==t?(r=l.jsx(mn,{file:t,markdown:!1}),e[11]=t,e[12]=r):r=e[12],r}default:{let r;return e[13]!==t?(r=l.jsx(cs,{file:t}),e[13]=t,e[14]=r):r=e[14],r}}}function hr(n){const e=$.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 a=o;let c;e[2]!==s?(c=s.deckDetected&&l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsx(Z,{variant:s.railOpen?"secondary":"ghost",size:"icon","aria-label":s.railOpen?"Hide slide list":"Show slide list",onClick:()=>s.setRailOpen(!s.railOpen),children:l.jsx(cl,{size:14})})}),l.jsx(we,{side:"bottom",children:s.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==a?(d=()=>window.open(a,"_blank","noopener"),e[4]=a,e[5]=d):d=e[5];let f;e[6]!==a?(f=l.jsx("span",{className:"truncate",children:a}),e[6]=a,e[7]=f):f=e[7];let u;e[8]!==a||e[9]!==d||e[10]!==f?(u=l.jsx("button",{type:"button",onClick:d,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:a,children:f}),e[8]=a,e[9]=d,e[10]=f,e[11]=u):u=e[11];let h;e[12]!==s.agentUpdated||e[13]!==s.reload?(h=s.agentUpdated&&l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:s.reload,children:[l.jsx(Sn,{size:12}),"Agent updated — reload"]})}),l.jsx(we,{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]=h):h=e[14];let m;e[15]!==s.saving?(m=s.saving&&l.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=s.saving,e[16]=m):m=e[16];let p;e[17]!==s?(p=s.deckDetected&&s.writable&&l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsx(Z,{variant:s.editMode?"secondary":"ghost",size:"icon","aria-label":s.editMode?"Done editing":"Edit inline",className:ce(s.editMode&&"text-primary"),onClick:()=>s.setEditMode(!s.editMode),children:l.jsx(Ts,{size:14})})}),l.jsx(we,{side:"bottom",children:s.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=s,e[18]=p):p=e[18];let g;e[19]!==a||e[20]!==r||e[21]!==s.deckDetected?(g=s.deckDetected?l.jsxs(tt,{children:[l.jsx(nt,{asChild:!0,children:l.jsx(Z,{variant:"ghost",size:"icon","aria-label":"Download",children:l.jsx(Ve,{size:14})})}),l.jsxs(st,{align:"end",children:[l.jsxs(be,{onClick:()=>window.open(`${a}#print`,"_blank","noopener"),children:[l.jsx(Fs,{size:14}),"Export as PDF"]}),l.jsx(be,{asChild:!0,children:l.jsxs("a",{href:a,download:r,children:[l.jsx(Ms,{size:14}),"Download HTML"]})})]})]}):l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsx(Z,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:l.jsx("a",{href:a,download:r,children:l.jsx(Ve,{size:14})})})}),l.jsx(we,{side:"bottom",children:"Download"})]}),e[19]=a,e[20]=r,e[21]=s.deckDetected,e[22]=g):g=e[22];let b;e[23]!==a?(b=()=>window.open(a,"_blank","noopener"),e[23]=a,e[24]=b):b=e[24];let x;e[25]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx(In,{size:14}),e[25]=x):x=e[25];let y;e[26]!==b?(y=l.jsx(ve,{asChild:!0,children:l.jsx(Z,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:b,children:x})}),e[26]=b,e[27]=y):y=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(we,{side:"bottom",children:"Open in new tab"}),e[28]=j):j=e[28];let N;e[29]!==y?(N=l.jsxs(ye,{children:[y,j]}),e[29]=y,e[30]=N):N=e[30];let z;return e[31]!==N||e[32]!==c||e[33]!==u||e[34]!==h||e[35]!==m||e[36]!==p||e[37]!==g||e[38]!==i?(z=l.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[c,u,h,m,p,g,N,i]}),e[31]=N,e[32]=c,e[33]=u,e[34]=h,e[35]=m,e[36]=p,e[37]=g,e[38]=i,e[39]=z):z=e[39],z}const Re=1;function mr(n){if(typeof n!="object"||n===null||n.v!==Re||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 ze extends Error{constructor(e,t){super(e),this.code=t,this.name="DeckOpError"}code}function us(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function pr(n){const t=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return t?us(t).length:null}function xr(n,e){const t=new DOMParser().parseFromString(n,"text/html"),s=t.querySelector("deck-viewer");if(!s)throw new ze("no <deck-viewer> element in source","no-viewer");const r=us(s),i=e.kind==="move"?e.from:e.at,o=r[i];if(!o)throw new ze(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new ze("cannot remove the last slide","bad-op");o.remove();break}case"duplicate":{const c=o.cloneNode(!0);c.removeAttribute("id");for(const d of c.querySelectorAll("[id]"))d.removeAttribute("id");o.after(c);break}case"move":{if(e.to<0||e.to>=r.length)throw new ze(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const c=e.to<e.from?r[e.to]:r[e.to].nextSibling;s.insertBefore(o,c)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new ze(`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 d=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!d)throw new ze("replace html has no root element","bad-op");o.replaceWith(t.importNode(d,!0));break}default:throw new ze(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
4
4
  `:""}${t.documentElement.outerHTML}
@@ -1 +1 @@
1
- import{r as s,aS as L,aQ as B,j as d,b8 as T,aN as x,aR as E,b6 as q,aT as C,b7 as P,b9 as K,aP as _,bH as U,bG as V}from"./index-DcIBnpEi.js";var I="Radio",[H,w]=_(I),[z,Q]=H(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(z,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(g,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var G="RadioIndicator",S=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=Q(G,o);return d.jsx(K,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});S.displayName=G;var W="RadioBubbleInput",g=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});g.displayName=W;function A(a){return a?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=_(y,[P,w]),N=P(),j=w(),[J,Z]=Y(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=N(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(J,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(T,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=N(o),f=j(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(q,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=j(o);return d.jsx(S,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,ae=F;export{re as I,oe as R,ae as a};
1
+ import{r as s,aS as L,aQ as B,j as d,b8 as T,aN as x,aR as E,b6 as q,aT as C,b7 as P,b9 as K,aP as _,bH as U,bG as V}from"./index-oRUXeO_q.js";var I="Radio",[H,w]=_(I),[z,Q]=H(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(z,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(g,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var G="RadioIndicator",S=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=Q(G,o);return d.jsx(K,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});S.displayName=G;var W="RadioBubbleInput",g=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});g.displayName=W;function A(a){return a?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=_(y,[P,w]),N=P(),j=w(),[J,Z]=Y(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=N(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(J,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(T,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=N(o),f=j(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(q,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=j(o);return d.jsx(S,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,ae=F;export{re as I,oe as R,ae as a};
@@ -0,0 +1 @@
1
+ import{c as I,j as s,a2 as Ze,r as L,l as E,R as me,H as Os,I as Ms,J as Ps,M as Ds,d as Fs,B as ht,a as ae,a3 as Es,b as xe,W as Rs,t as re,X as Ls,i as Qt,a4 as ne,e as jt,u as vt,L as Bs,a5 as Hs,a6 as Gs,a7 as Us,a8 as Ws,K as qs,m as Ks,a9 as Xs,U as Jt,O as Vs,aa as Ys}from"./index-oRUXeO_q.js";import{u as pe,S as yt,a as St,b as se,c as Q,d as U,e as Zt,f as Qs,g as es,h as Js,i as Re,j as Zs,k as en,l as tn}from"./sidebar-B4MOdumX.js";import{u as Nt}from"./use-mobile-M8W7Kv1V.js";import{S as oe}from"./skeleton-CXgII3Bw.js";import{i as ts}from"./LayoutLeft-DZ-jCFY6.js";import{t as _t}from"./ChevronDown-DhIYpVW6.js";import{a as ue,b as fe,T as he,c as xt}from"./tooltip-D6EFrI2I.js";import{a as Ye,i as sn,b as nn,S as ln}from"./constants-CaIX_f5U.js";import{u as ss,a as Ct}from"./use-virtual-mcp-CmA7MJ_3.js";import{A as je,b as It,c as zt,d as rn,e as on,f as ns,g as $t,i as an,s as cn,h as dn}from"./agent-icon-DCI_kWkQ.js";import{P as Ee,a as et,b as tt}from"./popover-BEP_E0EQ.js";import{i as is}from"./Check-CQkTVrms.js";import{s as Le}from"./Plus-BndSMgXV.js";import{i as ls}from"./SearchMd-D2Dw5ika.js";import{s as mn}from"./XClose-DSwVoJ4X.js";import{A as un,a as fn,b as hn,c as xn,d as pn,e as gn,f as bn}from"./alert-dialog-SvFNgDAx.js";import{F as jn,a as vn,b as yn,c as Sn,d as Nn,f as _n,e as Cn}from"./form-BNdKU9Dq.js";import{I as wn}from"./input--jaCPjE2.js";import{S as kn,u as An,C as In}from"./chat-context-BMW1fK19.js";import{T as ve}from"./toolbar-icon-button-CZvOgHXD.js";import{D as rs,a as os,b as as}from"./drawer-BHfpzQkJ.js";import{G as zn,a as $n}from"./github-repo-picker-C7CPZtzH.js";import{u as cs,a as wt,b as Tn,T as On}from"./hooks-st2jEiBn.js";import{r as Mn,u as kt,f as Pn}from"./shell-layout-Ce4WRVJF.js";import{u as Dn,g as Fn,a as En,b as Rn,S as ds}from"./use-navigate-to-agent-8ICyqr4j.js";import{g as Ln,a as ms,u as Bn,A as Hn,b as Gn}from"./use-deco-credits-DnBl7ZHb.js";import{f as Un}from"./reusable-new-chat-CouMjkYR.js";import{A as Qe}from"./avatar-CYrddKyv.js";import{a as Tt}from"./Copy01-B-Bw91-9.js";import{n as Wn,i as qn}from"./Globe01-BzW3NSbG.js";import{i as Kn}from"./ZoomOut-BEgIfWMd.js";import{i as Ot,a as Xn}from"./ZapSquare-MnTb6qUC.js";import{i as pt}from"./Monitor01-B267agOB.js";import{n as Vn,a as Yn}from"./Sun-vn3d1Wcz.js";import{a as st}from"./Settings02-C_Z4I0Fv.js";import{i as Qn}from"./Shield01-DfhHg1kb.js";import{a as Jn}from"./Users03-BaqhajkW.js";import{u as Zn}from"./use-deployment-admin-D9u3BrsQ.js";import"./index-D2g_oXYY.js";import{I as us}from"./invite-member-dialog-DjLLH0ZG.js";import{v as ei,C as Mt}from"./connect-desktop-dialog-DjlNOENW.js";import{u as nt}from"./use-organization-settings-BsHnInld.js";import{i as ti}from"./FilterLines-C2Mku5dO.js";import{T as si,a as ni}from"./toggle-group-DwaxjPTf.js";import{u as ii}from"./use-mcp-client-CjIdboe6.js";import{D as li,a as ri,f as oi,d as ai,e as ci}from"./dialog-ClYAYRmD.js";import{C as di,a as mi,b as ui,c as fi,d as hi}from"./command-BVOOO02Z.js";import{u as fs}from"./studio-tools-DoO0tZRE.js";import{i as hs}from"./Zap-CQek3oek.js";import{S as xs,M as xi}from"./shell-controls-6tyymcGo.js";import{n as pi}from"./Stars02-D5YT7SQm.js";import{g as gi,u as bi,S as ji}from"./use-clock-tick-PoDACkB7.js";import{a as vi}from"./format-time-BnbuEtat.js";import{i as yi}from"./ChevronRight-CGMQ9_U1.js";import{T as te}from"./toolbar-BGvLO6RZ.js";import"./X-ukK64B_p.js";import"./use-collections-DWE5dA61.js";import"./AlertCircle-DAGlTauL.js";import"./Tool01-CLVNSbbM.js";import"./ArrowUp-CbpIfhnu.js";import"./Tool02-Ck98CPCG.js";import"./XCircle-B61g0Em1.js";import"./ArrowUpRight-DpLwyu_e.js";import"./TrendUp01-C0oRXmsG.js";import"./Loading02-CUHThLam.js";import"./CheckCircle-B3CY8jDS.js";import"./ChevronUp-Bo_9AeLR.js";import"./Circle-Bp5dCa5T.js";import"./DotsVertical-rms0S2mG.js";import"./Eye-DiRw0Qiz.js";import"./Star01-zfOxTJkJ.js";import"./Globe04-Cp9buDFj.js";import"./SwitchHorizontal01-DTta-kDo.js";import"./HardDrive-BM7rwcN-.js";import"./Key01-tUHgEoCR.js";import"./LinkExternal01-kp6-i_It.js";import"./List-trC6pVdm.js";import"./Package-T_ZOTpyK.js";import"./Palette-CvpDh6yH.js";import"./Play-B1DOcowx.js";import"./SearchLg-CHM0ESn_.js";import"./Stars01-BQvwTUo0.js";import"./Trash01-BAtkdZ_P.js";import"./Upload01-D2kAayNK.js";import"./User01-DKKGw2UE.js";import"./Users01-DnpgqZo2.js";import"./label-BlrGf89p.js";import"./autosend-DlnrNbeW.js";import"./use-ai-providers-DANWCVaB.js";import"./use-decopilot-events-DIbAOXdz.js";import"./decopilot-sse-pool-CKDa5DkM.js";import"./backoff-CrEUbyZT.js";import"./tab-id-bb-jjgGv.js";import"./collection-search-pUUIAKXN.js";import"./use-debounced-value-Bek1HKp-.js";import"./use-connection-bzmsqnbu.js";import"./authenticate-and-persist-oauth-Cs7_VHEO.js";import"./mcp-oauth-AxamdNEM.js";import"./auth-D5nv6qUT.js";import"./use-mcp-tools-D8RhjXm_.js";import"./extract-connection-data-DFrcqAuT.js";import"./github-installations-D2vHSx02.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-DQyF_xIe.js";import"./use-org-sso-ksTAOkzG.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-ozCISq4f.js";import"./use-registry-connections-BUPQ7scU.js";import"./useInfiniteQuery-gEqtoOdV.js";import"./use-infinite-scroll-Cp3fCiXF.js";import"./card-C71rqWCY.js";import"./integration-icon-JxE4r7FJ.js";import"./collection-tabs-BAurpL4U.js";import"./badge-BQjWTAmy.js";import"./select-BrgzOX_V.js";import"./textarea-uGqD7j3K.js";import"./connection-form-helpers-1blq8y12.js";import"./useSuspenseInfiniteQuery-C1-97kj5.js";import"./use-org-auth-client-8hx0Yi1Z.js";import"./use-organization-roles-D5s14_A8.js";import"./index-S_g8cP5n.js";import"./differenceInSeconds-NQ4PDo0z.js";function Si(t){const e=I.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={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]=o,e[1]=a):(o=e[0],a=e[1]);let m;return e[2]!==l||e[3]!==n?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=m):m=e[4],m}const At=240,Ni=400,_i="sidebar.width";function Be(t){return Math.max(At,Math.min(Ni,t))}function Ci(){const t=I.c(11),[e,n]=Ze(_i,wi),l=L.useRef(null);let i;t[0]!==n||t[1]!==e?(i=d=>{d.preventDefault();const u=d.clientX,h=Be(e),f=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=f?Array.from(f.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const g=b=>{const j=Be(h+(b.clientX-u));f?.style.setProperty("--sidebar-width",`${j}px`)},p=b=>{const j=Be(h+(b.clientX-u));n(j);for(const y of x)y.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let o;t[3]!==n?(o=()=>{n(At)},t[3]=n,t[4]=o):o=t[4];const a=o;let m;t[5]!==e?(m=Be(e),t[5]=e,t[6]=m):m=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==m?(c={width:m,wrapperRef:l,onStartResize:r,resetWidth:a},t[7]=r,t[8]=a,t[9]=m,t[10]=c):c=t[10],c}function wi(t){return typeof t=="number"?Be(t):At}function ps(){return[]}function gs(t){const e=I.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(yt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(St,{children:s.jsx(se,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function bs(t){const e=I.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{me("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const o=r,a=n.key,m=n.isActive&&"z-10";let c;e[4]!==m?(c=E(m),e[4]=m,e[5]=c):c=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(u=s.jsxs(Q,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=u):u=e[13];let h;return e[14]!==n.key||e[15]!==c||e[16]!==u?(h=s.jsx(U,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=h):h=e[17],h}function ki(t){const e=I.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Zt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(Ii),e[2]=n.group.items,e[3]=r):r=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(o=s.jsx(gs,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map(Ai),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(yt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(St,{children:s.jsx(se,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function Ai(t){return s.jsx(bs,{item:t},t.key)}function Ii(t){return s.jsx(bs,{item:t},t.key)}function zi(t){const e=I.c(17),{sections:n,footer:l,additionalContent:i,header:r,variant:o,contentClassName:a}=t,m=o===void 0?"sidebar":o;let c;e[0]!==r?(c=r&&s.jsx(Qs,{className:"shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:r}),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=E("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n.map($i),e[4]=n,e[5]=u):u=e[5];let h;e[6]!==i?(h=i&&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:i}),e[6]=i,e[7]=h):h=e[7];let f;e[8]!==d||e[9]!==u||e[10]!==h?(f=s.jsxs(es,{className:d,children:[u,h]}),e[8]=d,e[9]=u,e[10]=h,e[11]=f):f=e[11];let x;return e[12]!==l||e[13]!==c||e[14]!==f||e[15]!==m?(x=s.jsxs(Js,{variant:m,children:[c,f,l]}),e[12]=l,e[13]=c,e[14]=f,e[15]=m,e[16]=x):x=e[16],x}function $i(t,e){return s.jsx(ki,{section:t},e)}function js(t){const e=I.c(2);let n;return e[0]!==t?(n=s.jsx(zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}js.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(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function vs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ti=Os({name:Ms().min(2,"Organization name is required")});function Oi(t){const e=I.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Ps(Ti),defaultValues:{name:""}},e[0]=i):i=e[0];const r=Ds(i);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:Pi,onSuccess:Mi},e[1]=o):o=e[1];const a=Fs(o),m=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(hn,{children:[s.jsx(xn,{children:"Create a new organization"}),s.jsx(pn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let d;if(e[3]!==a||e[4]!==r){let N;e[6]!==a?(N=S=>a.mutateAsync(S),e[6]=a,e[7]=N):N=e[7],d=r.handleSubmit(N),e[3]=a,e[4]=r,e[5]=d}else d=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(yn,{children:[s.jsx(Sn,{children:"Organization Name"}),s.jsx(Nn,{children:s.jsx(wn,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(_n,{children:"The name of your company or organization"}),S.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:"","/",vs(S.value)]})]}),s.jsx(Cn,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let h;e[10]!==r.control||e[11]!==u?(h=s.jsx(jn,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=h):h=e[12];let f;e[13]!==m?(f=m&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[13]=m,e[14]=f):f=e[14];let x;e[15]!==a||e[16]!==r?(x=()=>{a.reset(),r.reset()},e[15]=a,e[16]=r,e[17]=x):x=e[17];let g;e[18]!==r.formState.isSubmitting||e[19]!==x?(g=s.jsx(un,{disabled:r.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const p=!r.formState.isValid||r.formState.isSubmitting;let b;e[21]!==r.formState.isSubmitting?(b=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(kn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==p||e[24]!==b?(j=s.jsx(ht,{type:"submit",variant:"default",disabled:p,children:b}),e[23]=p,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==g?(y=s.jsxs(gn,{children:[g,j]}),e[26]=j,e[27]=g,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==d||e[31]!==h||e[32]!==f?(v=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[h,f,y]}),e[29]=y,e[30]=d,e[31]=h,e[32]=f,e[33]=v):v=e[33];let _;e[34]!==r||e[35]!==v?(_=s.jsxs(fn,{children:[c,s.jsx(vn,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=_):_=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==_?(C=s.jsx(bn,{open:n,onOpenChange:l,children:_}),e[37]=l,e[38]=n,e[39]=_,e[40]=C):C=e[40],C}function Mi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Pi(t){const e=vs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ae.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function ys(){const t=L.useContext(Es),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function Di(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function it(t){const e=I.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",o=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==r?(a=E(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=a):a=e[1];let m;e[2]!==n.logo||e[3]!==n.name?(m=n.logo?void 0:Di(n.name),e[2]=n.logo,e[3]=n.name,e[4]=m):m=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:E("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==m||e[11]!==c?(d=s.jsx("div",{className:a,style:m,children:c}),e[9]=a,e[10]=m,e[11]=c,e[12]=d):d=e[12],d}function Fi({invitation:t,onChanged:e}){const[n,l]=L.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const m=await ae.organization.acceptInvitation({invitationId:t.id});if(m.error){re.error(m.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Ls();let a;try{a=(await ae.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},o=async()=>{l(!0);try{const a=await ae.organization.rejectInvitation({invitationId:t.id});if(a.error){re.error(a.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(it,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(ht,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(ht,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:o,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(mn,{size:14})})]})]})}function Ei(t){const e=I.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Rs(),{invitations:o,refetch:a}=ys();let m;e[0]!==n?(m=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=m):m=e[1];const c=[...r??[]].sort(m),[d,u]=L.useState(""),h=d.toLowerCase(),f=h?c.filter(w=>w.name.toLowerCase().includes(h)||w.slug.toLowerCase().includes(h)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ls,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=w=>u(w.target.value),e[3]=g):g=e[3];let p;e[4]!==d?(p=w=>w.key==="Escape"&&d&&u(""),e[4]=d,e[5]=p):p=e[5];let b;e[6]!==d||e[7]!==p?(b=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:g,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=b):b=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Le,{size:16}),e[9]=j):j=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==b||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,y]}),e[12]=b,e[13]=y,e[14]=v):v=e[14];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==o||e[16]!==d||e[17]!==a?(C=!d&&o.map(w=>s.jsx(Fi,{invitation:w,onChanged:a},w.id)),e[15]=o,e[16]=d,e[17]=a,e[18]=C):C=e[18];const N=f.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=w=>s.jsxs("button",{type:"button",onClick:()=>l(w.slug),className:E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(it,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(is,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=f.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:_,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let $;return e[26]!==k||e[27]!==v?($=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=$):$=e[28],$}function Ss(t){const e=I.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,o=i===void 0?"start":i,a=r===void 0?"bottom":r,m=xe(),[c,d]=L.useState(!1),[u,h]=L.useState(!1);let f;e[0]!==n?(f=s.jsx(Ee,{asChild:!0,children:n}),e[0]=n,e[1]=f):f=e[1];const x=String(c);let g;e[2]!==m?(g=C=>{d(!1),m({to:"/$org",params:{org:C}})},e[2]=m,e[3]=g):g=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(!1),h(!0)},e[4]=p):p=e[4];let b;e[5]!==l||e[6]!==x||e[7]!==g?(b=s.jsx(Ei,{orgParam:l,onSelectOrg:g,onCreateOrg:p},x),e[5]=l,e[6]=x,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(et,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Li,onCloseAutoFocus:Ri,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let y;e[13]!==c||e[14]!==f||e[15]!==j?(y=s.jsxs(tt,{open:c,onOpenChange:d,children:[f,j]}),e[13]=c,e[14]=f,e[15]=j,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(Oi,{open:u,onOpenChange:h}),e[17]=u,e[18]=v):v=e[18];let _;return e[19]!==v||e[20]!==y?(_=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=_):_=e[21],_}function Ri(t){return t.preventDefault()}function Li(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Bi(t){const e=I.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:o,isSearching:a,disabled:m}=t,c=i===void 0?"Search...":i;let d;e[0]!==o?(d=E("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=d):d=e[1];const u=m?"cursor-not-allowed opacity-50":"cursor-text";let h;e[2]!==u?(h=E("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=h):h=e[3];let f;e[4]!==a?(f=a?s.jsx(Qt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ls,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=f):f=e[5];let x;e[6]!==l?(x=j=>l(j.target.value),e[6]=l,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==c||e[11]!==x||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:r,placeholder:c,disabled:m,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=m,e[9]=r,e[10]=c,e[11]=x,e[12]=n,e[13]=g):g=e[13];let p;e[14]!==h||e[15]!==f||e[16]!==g?(p=s.jsxs("label",{className:h,children:[f,g]}),e[14]=h,e[15]=f,e[16]=g,e[17]=p):p=e[17];let b;return e[18]!==d||e[19]!==p?(b=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=b):b=e[20],b}const Hi="Select an existing agent";function Gi(t){const e=I.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(ue,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fe,{side:"right",sideOffset:8,children:Hi}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(he,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function Ui(t){const e=xe(),{create:n}=cs(),{locator:l}=ne(),i=jt({strict:!1}),r=vt({strict:!1});return async o=>{const a=crypto.randomUUID(),m=o===r.virtualmcpid?Mn(t,l,i.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...m?{branch:m}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function dt(t){const e=I.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==r?(o=E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(je,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let m;e[5]!==n.title?(m=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=m):m=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==m||e[10]!==c?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=d):d=e[11];let u;e[12]!==l?(u=l&&s.jsx(is,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let h;return e[14]!==i||e[15]!==o||e[16]!==a||e[17]!==d||e[18]!==u?(h=s.jsxs("button",{type:"button",onClick:i,className:o,children:[a,d,u]}),e[14]=i,e[15]=o,e[16]=a,e[17]=d,e[18]=u,e[19]=h):h=e[19],h}function Pt(t){const e=I.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Wi(t){const e=I.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[o,a]=L.useState(""),m=ss(),c=m??[],{org:d}=ne(),{data:u}=ae.useSession(),h=u?.user?.id??"anon",f=Fn(m),x=En(),g=Ui(d.slug),p=Ln(m),b=o.toLowerCase(),j=c.filter(Vi).filter(B=>!p.has(B.id)).filter(Xi).filter(B=>!o||B.title.toLowerCase().includes(b)),y=j.filter(Ki),v=j.filter(qi),_=Ye(d.id),C=!o||_.title.toLowerCase().includes(b),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),a("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=B=>{if(l){l(B.id),n(),a("");return}Rn({orgId:d.id,userId:h},B.id,f),x(),n(),a(""),g(B.id)},$="flex flex-col max-h-[min(640px,80dvh)]";let w;e[3]!==o?(w=s.jsx(Bi,{value:o,onChange:a,placeholder:"Search agents..."}),e[3]=o,e[4]=w):w=e[4];const z="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",O=l&&C&&_&&s.jsx(dt,{agent:_,selected:!i||i===_.id,onClick:A}),P=v.length>0&&s.jsx(Pt,{children:"Agents"}),R=v.map(B=>s.jsx(dt,{agent:B,selected:l?i===B.id:void 0,onClick:()=>k(B)},B.id)),D=(y.length>0||!o)&&s.jsx(Pt,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx($n,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),F=y.map(B=>s.jsx(dt,{agent:B,selected:l?i===B.id:void 0,onClick:()=>k(B)},B.id));let M;e[5]!==N||e[6]!==o||e[7]!==j.length?(M=j.length===0&&!N&&o&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=o,e[7]=j.length,e[8]=M):M=e[8];let W;e[9]!==M||e[10]!==O||e[11]!==P||e[12]!==R||e[13]!==D||e[14]!==F?(W=s.jsxs("div",{className:z,children:[O,P,R,D,F,M]}),e[9]=M,e[10]=O,e[11]=P,e[12]=R,e[13]=D,e[14]=F,e[15]=W):W=e[15];let K;e[16]!==d.slug?(K={org:d.slug},e[16]=d.slug,e[17]=K):K=e[17];let G;e[18]!==n?(G=()=>n(),e[18]=n,e[19]=G):G=e[19];let q;e[20]!==K||e[21]!==G?(q=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Bs,{to:"/$org/settings/agents",params:K,onClick:G,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=K,e[21]=G,e[22]=q):q=e[22];let J;return e[23]!==W||e[24]!==q||e[25]!==w?(J=s.jsxs("div",{className:$,children:[w,W,q]}),e[23]=W,e[24]=q,e[25]=w,e[26]=J):J=e[26],J}function qi(t){return!ms(t.metadata)}function Ki(t){return ms(t.metadata)}function Xi(t){return!nn(t.id)}function Vi(t){return!sn(t.id)}function Yi(t){const e=I.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:o,side:a,align:m}=n,c=l===void 0?!1:l,d=a===void 0?"right":a,u=m===void 0?"start":m,[h,f]=L.useState(!1),[x,g]=L.useState(!1),p=Nt(),{setOpenMobile:b}=pe(),j=Dn(),y=j?"border border-border":void 0;let v;e[2]!==j?(v=P=>j?s.jsx(Gi,{children:P}):P,e[2]=j,e[3]=v):v=e[3];const _=v;let C;e[4]!==p||e[5]!==b?(C=()=>{f(!1),p&&b(!1)},e[4]=p,e[5]=b,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),g(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==h||e[13]!==o?(k=h&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Wi,{onClose:N,onSelectAgent:r,selectedAgentId:o,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=h,e[13]=o,e[14]=k):k=e[14];const $=k;let w;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==j||e[19]!==p||e[20]!==h||e[21]!==$||e[22]!==d||e[23]!==i||e[24]!==_?(w=p?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>f(!0),className:"contents",children:i}):c?_(s.jsx(ve,{"aria-label":"Browse agents",className:E(y),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),f(!0)},children:s.jsx(Le,{className:"size-4"})})):s.jsx(U,{children:_(s.jsxs(Q,{tooltip:j?void 0:"Browse agents",className:E(y),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),f(!0)},children:[s.jsx(Le,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(rs,{open:h,onOpenChange:f,direction:"bottom",children:s.jsxs(os,{className:"max-h-[85dvh] p-0",children:[s.jsx(as,{className:"sr-only",children:"Browse agents"}),$]})})]}):s.jsxs(tt,{open:h,onOpenChange:P=>{P&&!h&&me("agent_browser_opened",{surface:"desktop_popover"}),f(P)},children:[i?s.jsx(Ee,{asChild:!0,children:i}):c?_(s.jsx(Ee,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:E(y),children:s.jsx(Le,{className:"size-4"})})})):s.jsx(U,{children:_(s.jsx(Ee,{asChild:!0,children:s.jsxs(Q,{tooltip:j?void 0:"Browse agents",className:E(y),children:[s.jsx(Le,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(et,{className:"w-[380px] p-0 overflow-hidden",side:d,align:u,children:$})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=j,e[19]=p,e[20]=h,e[21]=$,e[22]=d,e[23]=i,e[24]=_,e[25]=w):w=e[25];let z;e[26]!==x?(z=s.jsx(zn,{open:x,onOpenChange:g,mode:"agent"}),e[26]=x,e[27]=z):z=e[27];let O;return e[28]!==z||e[29]!==w?(O=s.jsxs(s.Fragment,{children:[w,z]}),e[28]=z,e[29]=w,e[30]=O):O=e[30],O}const Qi="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Ji(t){const e=I.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,o=Ct(n)??l??null,a=o?.title??"Super Agent",m=`Open ${a} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==a?(d=s.jsx(je,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==i||e[4]!==m||e[5]!==d?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":m,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=i,e[4]=m,e[5]=d,e[6]=u):u=e[6];let h;e[7]!==a?(h=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=h):h=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let x;e[10]!==h?(x=s.jsxs("button",{type:"button",className:Qi,children:[h,f]}),e[10]=h,e[11]=x):x=e[11];let g;e[12]!==n||e[13]!==r||e[14]!==x?(g=s.jsx(Yi,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=g):g=e[15];let p;return e[16]!==u||e[17]!==g?(p=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=p):p=e[18],p}function gt(t){const e=I.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:l}=n,{org:i}=ne(),{state:r,isMobile:o}=pe(),a=ys().invitations.length>0,m=r==="collapsed"||o,c=a?`${i.name} — switch organization (pending invitation)`:`${i.name} — switch organization`;let d;e[2]!==i?(d=s.jsx(it,{org:i,size:"sm"}),e[2]=i,e[3]=d):d=e[3];let u;e[4]!==a||e[5]!==m?(u=a&&s.jsx("span",{className:E("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=m,e[6]=u):u=e[6];let h;e[7]!==d||e[8]!==u?(h=s.jsxs("span",{className:"relative inline-flex",children:[d,u]}),e[7]=d,e[8]=u,e[9]=h):h=e[9];let f;e[10]!==i.name||e[11]!==l?(f=l&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[10]=i.name,e[11]=l,e[12]=f):f=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==h||e[16]!==f?(g=s.jsx(ue,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[h,f,x]})}),e[14]=c,e[15]=h,e[16]=f,e[17]=g):g=e[17];let p;e[18]!==i.slug||e[19]!==g?(p=s.jsx(Ss,{orgParam:i.slug,trigger:g}),e[18]=i.slug,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==i.name?(b=s.jsx(fe,{side:"bottom",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==p?(j=s.jsxs(he,{children:[p,b]}),e[23]=b,e[24]=p,e[25]=j):j=e[25],j}function lt(t){const e=I.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:l}=n,{org:i}=ne(),r=xe();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[2]=o):o=e[2];const a=jt(o);let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[3]=m):m=e[3];const c=vt(m),{threads:d}=wt(),{data:u}=ae.useSession(),{setTaskId:h,createNewTask:f}=kt();let x;e[4]!==i.id?(x=Ye(i.id),e[4]=i.id,e[5]=x):x=e[5];const g=x,p=g.id,b=a.taskId?c.virtualmcpid??p:p;let j;e[6]!==f||e[7]!==p||e[8]!==r||e[9]!==l||e[10]!==i.slug||e[11]!==u?.user?.id||e[12]!==h||e[13]!==d?(j=S=>{if(!S||S===p){r({to:"/$org",params:{org:i.slug}}),l?.();return}const A=Un(d,S,u?.user?.id);A?h(A.id,S):f(S),l?.()},e[6]=f,e[7]=p,e[8]=r,e[9]=l,e[10]=i.slug,e[11]=u?.user?.id,e[12]=h,e[13]=d,e[14]=j):j=e[14];const y=j;let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=v):v=e[15];const _=b===p?g:void 0;let C;e[16]!==b||e[17]!==y?(C=()=>y(b),e[16]=b,e[17]=y,e[18]=C):C=e[18];let N;return e[19]!==b||e[20]!==y||e[21]!==_||e[22]!==C?(N=s.jsx(L.Suspense,{fallback:v,children:s.jsx(Ji,{agentId:b,fallback:_,onOpenHome:C,onPick:y})}),e[19]=b,e[20]=y,e[21]=_,e[22]=C,e[23]=N):N=e[23],N}function Dt(t){const e=I.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=E(i),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=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 m;e[7]!==n.label?(m=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=m):m=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==m?(c=s.jsxs(Q,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,m]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=m,e[14]=c):c=e[14];let d;return e[15]!==r||e[16]!==c?(d=s.jsx(U,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=d):d=e[17],d}function Zi(t){const e=I.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Zt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let m;e[5]!==l?(m=c=>s.jsx(Dt,{item:c,onClose:l},c.key),e[5]=l,e[6]=m):m=e[6],o=n.group.items.map(m),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(gs,{label:i,defaultExpanded:r,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(Dt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],i=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(yt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(St,{children:s.jsx(se,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function el(t){const e=I.c(24),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(gt,{}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(lt,{onNavigate:l}),e[1]=l,e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1"}),e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ts,{size:16}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx(ve,{onClick:l,"aria-label":"Close sidebar",children:c}),e[5]=l,e[6]=d):d=e[6];let u;e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[o,a,m,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9];let h;if(e[10]!==l||e[11]!==n){let p;e[13]!==l?(p=(b,j)=>s.jsx(Zi,{section:b,onClose:l},j),e[13]=l,e[14]=p):p=e[14],h=n.map(p),e[10]=l,e[11]=n,e[12]=h}else h=e[12];let f;e[15]!==r?(f=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[15]=r,e[16]=f):f=e[16];let x;e[17]!==h||e[18]!==f?(x=s.jsxs(es,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[h,f]}),e[17]=h,e[18]=f,e[19]=x):x=e[19];let g;return e[20]!==i||e[21]!==u||e[22]!==x?(g=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,x,i]}),e[20]=i,e[21]=u,e[22]=x,e[23]=g):g=e[23],g}function Fe(t){const e=I.c(26),{item:n,onClose:l}=t;let i;e[0]!==n.className?(i=E("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",n.className),e[0]=n.className,e[1]=i):i=e[1];const r=i;if(n.href){const d=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let h;e[2]!==n.icon?(h=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=h):h=e[3];let f;e[4]!==n.label?(f=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=f):f=e[5];let x;return e[6]!==r||e[7]!==n.href||e[8]!==l||e[9]!==d||e[10]!==u||e[11]!==h||e[12]!==f?(x=s.jsxs("a",{href:n.href,target:d,rel:u,className:r,onClick:l,children:[h,f]}),e[6]=r,e[7]=n.href,e[8]=l,e[9]=d,e[10]=u,e[11]=h,e[12]=f,e[13]=x):x=e[13],x}let o;e[14]!==n||e[15]!==l?(o=()=>{n.onClick?.(),l()},e[14]=n,e[15]=l,e[16]=o):o=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let m;e[19]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=m):m=e[20];let c;return e[21]!==r||e[22]!==o||e[23]!==a||e[24]!==m?(c=s.jsxs("button",{type:"button",onClick:o,className:r,children:[a,m]}),e[21]=r,e[22]=o,e[23]=a,e[24]=m,e[25]=c):c=e[25],c}function Ft(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-amber-100 dark:bg-amber-500/20 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-400",children:"Impersonating"}),t[0]=e):e=t[0],e}function Et(t){const e=I.c(144),{user:n,userImage:l,menuItems:i,signOutItem:r,stopImpersonatingItem:o,isImpersonating:a,themeOptions:m,preferences:c,setPreferences:d,close:u,isMobile:h}=t;if(h){const V=n?.name??"U";let Z;e[0]!==V||e[1]!==l?(Z=s.jsx(Qe,{url:l,fallback:V,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=V,e[1]=l,e[2]=Z):Z=e[2];const ge=n?.name??"User";let ee;e[3]!==ge?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:ge}),e[3]=ge,e[4]=ee):ee=e[4];let le;e[5]!==a?(le=a&&s.jsx(Ft,{}),e[5]=a,e[6]=le):le=e[6];let ie;e[7]!==ee||e[8]!==le?(ie=s.jsxs("div",{className:"flex items-center gap-2",children:[ee,le]}),e[7]=ee,e[8]=le,e[9]=ie):ie=e[9];const T=n?.email;let H;e[10]!==T?(H=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:T}),e[10]=T,e[11]=H):H=e[11];let Y;e[12]!==ie||e[13]!==H?(Y=s.jsxs("div",{className:"flex-1 min-w-0",children:[ie,H]}),e[12]=ie,e[13]=H,e[14]=Y):Y=e[14];let X;e[15]!==n?(X=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(il)},e[15]=n,e[16]=X):X=e[16];let be;e[17]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(Tt,{size:14}),e[17]=be):be=e[17];let Se;e[18]!==X?(Se=s.jsx(ue,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:X,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:be})}),e[18]=X,e[19]=Se):Se=e[19];let Ue;e[20]===Symbol.for("react.memo_cache_sentinel")?(Ue=s.jsx(fe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[20]=Ue):Ue=e[20];let Ne;e[21]!==Se?(Ne=s.jsx(xt,{delayDuration:300,children:s.jsxs(he,{children:[Se,Ue]})}),e[21]=Se,e[22]=Ne):Ne=e[22];let _e;e[23]!==Ne||e[24]!==Z||e[25]!==Y?(_e=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Z,Y,Ne]}),e[23]=Ne,e[24]=Z,e[25]=Y,e[26]=_e):_e=e[26];let Ce;if(e[27]!==u||e[28]!==i){let de;e[30]!==u?(de=Ke=>s.jsx(Fe,{item:Ke,onClose:u},Ke.key),e[30]=u,e[31]=de):de=e[31],Ce=i.map(de),e[27]=u,e[28]=i,e[29]=Ce}else Ce=e[29];let we;e[32]!==u||e[33]!==o?(we=o&&s.jsx(Fe,{item:o,onClose:u}),e[32]=u,e[33]=o,e[34]=we):we=e[34];let ke;e[35]!==u||e[36]!==r?(ke=s.jsx(Fe,{item:r,onClose:u}),e[35]=u,e[36]=r,e[37]=ke):ke=e[37];let Ae;e[38]!==Ce||e[39]!==we||e[40]!==ke?(Ae=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ce,we,ke]})}),e[38]=Ce,e[39]=we,e[40]=ke,e[41]=Ae):Ae=e[41];let Ie;if(e[42]!==c.theme||e[43]!==d||e[44]!==m){let de;e[46]!==c.theme||e[47]!==d?(de=Ke=>{const{value:ct,icon:zs,label:$s}=Ke;return s.jsx("button",{type:"button","aria-label":$s,onClick:()=>d(Ts=>({...Ts,theme:ct})),className:E("size-8 rounded-md flex items-center justify-center transition-colors",c.theme===ct?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:zs},ct)},e[46]=c.theme,e[47]=d,e[48]=de):de=e[48],Ie=m.map(de),e[42]=c.theme,e[43]=d,e[44]=m,e[45]=Ie}else Ie=e[45];let ze;e[49]!==Ie?(ze=s.jsx("div",{className:"flex items-center gap-0.5",children:Ie}),e[49]=Ie,e[50]=ze):ze=e[50];const ot=c.enableSounds?"Disable sounds":"Enable sounds";let $e;e[51]!==d?($e=()=>d(nl),e[51]=d,e[52]=$e):$e=e[52];const at=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Te;e[53]!==at?(Te=E("size-8 rounded-md flex items-center justify-center transition-colors",at),e[53]=at,e[54]=Te):Te=e[54];let Oe;e[55]!==c.enableSounds?(Oe=c.enableSounds?s.jsx(It,{size:14}):s.jsx(zt,{size:14}),e[55]=c.enableSounds,e[56]=Oe):Oe=e[56];let Me;e[57]!==ot||e[58]!==$e||e[59]!==Te||e[60]!==Oe?(Me=s.jsx("button",{type:"button","aria-label":ot,onClick:$e,className:Te,children:Oe}),e[57]=ot,e[58]=$e,e[59]=Te,e[60]=Oe,e[61]=Me):Me=e[61];let We;e[62]===Symbol.for("react.memo_cache_sentinel")?(We=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.61.0"]}),e[62]=We):We=e[62];let Pe;e[63]!==Me?(Pe=s.jsxs("div",{className:"flex items-center gap-2",children:[Me,We]}),e[63]=Me,e[64]=Pe):Pe=e[64];let De;e[65]!==ze||e[66]!==Pe?(De=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ze,Pe]}),e[65]=ze,e[66]=Pe,e[67]=De):De=e[67];let qe;return e[68]!==_e||e[69]!==Ae||e[70]!==De?(qe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[_e,Ae,De]}),e[68]=_e,e[69]=Ae,e[70]=De,e[71]=qe):qe=e[71],qe}const f=n?.name??"U";let x;e[72]!==f||e[73]!==l?(x=s.jsx(Qe,{url:l,fallback:f,shape:"circle",size:"sm",className:"shrink-0"}),e[72]=f,e[73]=l,e[74]=x):x=e[74];const g=n?.name??"User";let p;e[75]!==g?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[75]=g,e[76]=p):p=e[76];let b;e[77]!==a?(b=a&&s.jsx(Ft,{}),e[77]=a,e[78]=b):b=e[78];let j;e[79]!==p||e[80]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[79]=p,e[80]=b,e[81]=j):j=e[81];const y=n?.email;let v;e[82]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[82]=y,e[83]=v):v=e[83];let _;e[84]!==j||e[85]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[84]=j,e[85]=v,e[86]=_):_=e[86];let C;e[87]!==n?(C=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(sl)},e[87]=n,e[88]=C):C=e[88];let N;e[89]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Tt,{size:14}),e[89]=N):N=e[89];let S;e[90]!==C?(S=s.jsx(ue,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:C,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:N})}),e[90]=C,e[91]=S):S=e[91];let A;e[92]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(fe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[92]=A):A=e[92];let k;e[93]!==S?(k=s.jsx(xt,{delayDuration:300,children:s.jsxs(he,{children:[S,A]})}),e[93]=S,e[94]=k):k=e[94];let $;e[95]!==k||e[96]!==x||e[97]!==_?($=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[x,_,k]}),e[95]=k,e[96]=x,e[97]=_,e[98]=$):$=e[98];let w;if(e[99]!==u||e[100]!==i){let V;e[102]!==u?(V=Z=>s.jsx(Fe,{item:Z,onClose:u},Z.key),e[102]=u,e[103]=V):V=e[103],w=i.map(V),e[99]=u,e[100]=i,e[101]=w}else w=e[101];let z;e[104]!==u||e[105]!==o?(z=o&&s.jsx(Fe,{item:o,onClose:u}),e[104]=u,e[105]=o,e[106]=z):z=e[106];let O;e[107]!==u||e[108]!==r?(O=s.jsx(Fe,{item:r,onClose:u}),e[107]=u,e[108]=r,e[109]=O):O=e[109];let P;e[110]!==w||e[111]!==z||e[112]!==O?(P=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[w,z,O]}),e[110]=w,e[111]=z,e[112]=O,e[113]=P):P=e[113];let R;if(e[114]!==c.theme||e[115]!==d||e[116]!==m){let V;e[118]!==c.theme||e[119]!==d?(V=Z=>{const{value:ge,icon:ee,label:le}=Z;return s.jsx("button",{type:"button","aria-label":le,onClick:()=>d(ie=>({...ie,theme:ge})),className:E("size-7 rounded-md flex items-center justify-center transition-colors",c.theme===ge?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},ge)},e[118]=c.theme,e[119]=d,e[120]=V):V=e[120],R=m.map(V),e[114]=c.theme,e[115]=d,e[116]=m,e[117]=R}else R=e[117];let D;e[121]!==R?(D=s.jsx("div",{className:"flex items-center gap-0.5",children:R}),e[121]=R,e[122]=D):D=e[122];const F=c.enableSounds?"Disable sounds":"Enable sounds";let M;e[123]!==d?(M=()=>d(tl),e[123]=d,e[124]=M):M=e[124];const W=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let K;e[125]!==W?(K=E("size-7 rounded-md flex items-center justify-center transition-colors",W),e[125]=W,e[126]=K):K=e[126];let G;e[127]!==c.enableSounds?(G=c.enableSounds?s.jsx(It,{size:14}):s.jsx(zt,{size:14}),e[127]=c.enableSounds,e[128]=G):G=e[128];let q;e[129]!==F||e[130]!==M||e[131]!==K||e[132]!==G?(q=s.jsx("button",{type:"button","aria-label":F,onClick:M,className:K,children:G}),e[129]=F,e[130]=M,e[131]=K,e[132]=G,e[133]=q):q=e[133];let J;e[134]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.61.0"]}),e[134]=J):J=e[134];let B;e[135]!==q?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[q,J]}),e[135]=q,e[136]=B):B=e[136];let ce;e[137]!==D||e[138]!==B?(ce=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[D,B]}),e[137]=D,e[138]=B,e[139]=ce):ce=e[139];let ye;return e[140]!==$||e[141]!==P||e[142]!==ce?(ye=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[$,P,ce]})}),e[140]=$,e[141]=P,e[142]=ce,e[143]=ye):ye=e[143],ye}function tl(t){return{...t,enableSounds:!t.enableSounds}}function sl(){re.success("User ID copied")}function nl(t){return{...t,enableSounds:!t.enableSounds}}function il(){re.success("User ID copied")}function He(){const t=I.c(43),{data:e}=ae.useSession(),{org:n}=ne(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const o=Hs(i)?.params.org,[a,m]=Gs(),c=Nt(),{isAdmin:d}=Zn(),[u,h]=L.useState(!1),f=e?.user,x=f?.image,g=!!e?.session?.impersonatedBy;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>h(!1),t[1]=p):p=t[1];const b=p;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(st,{size:16}),t[2]=j):j=t[2];let y;t[3]!==l||t[4]!==o?(y={key:"preferences",label:"Preferences",icon:j,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=y):y=t[5];let v;t[6]!==n||t[7]!==l?(v=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Wn,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=v):v=t[8];let _;t[9]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(Kn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=_):_=t[9];let C;t[10]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(Qn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=C):C=t[10];let N;t[11]===Symbol.for("react.memo_cache_sentinel")?(N={key:"github",label:"decocms/studio",icon:s.jsx(Us,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=N):N=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S={key:"community",label:"Community",icon:s.jsx(Jn,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=S):S=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={key:"homepage",label:"Homepage",icon:s.jsx(qn,{size:16}),href:"https://decocms.com",external:!0},t[13]=A):A=t[13];let k;t[14]!==d||t[15]!==l?(k=d?[{key:"admin-dashboard",label:"Admin Dashboard",icon:s.jsx(rn,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-amber-700 dark:text-amber-400"}]:[],t[14]=d,t[15]=l,t[16]=k):k=t[16];let $;t[17]!==k||t[18]!==y||t[19]!==v?($=[y,...v,_,C,N,S,A,...k],t[17]=k,t[18]=y,t[19]=v,t[20]=$):$=t[20];const w=$;let z;t[21]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(Ot,{size:16}),onClick:ol},t[21]=z):z=t[21];const O=z;let P;t[22]!==g?(P=g?{key:"stop-impersonating",label:"Stop impersonation",icon:s.jsx(Ot,{size:16}),onClick:rl,className:"text-amber-700 dark:text-amber-400"}:null,t[22]=g,t[23]=P):P=t[23];const R=P;let D;t[24]===Symbol.for("react.memo_cache_sentinel")?(D={value:"light",icon:s.jsx(Vn,{size:14}),label:"Light theme"},t[24]=D):D=t[24];let F;t[25]===Symbol.for("react.memo_cache_sentinel")?(F={value:"dark",icon:s.jsx(Yn,{size:14}),label:"Dark theme"},t[25]=F):F=t[25];let M;t[26]===Symbol.for("react.memo_cache_sentinel")?(M=[D,F,{value:"system",icon:s.jsx(pt,{size:14}),label:"System theme"}],t[26]=M):M=t[26];const W=M;let K;t[27]!==g||t[28]!==c||t[29]!==w||t[30]!==a||t[31]!==m||t[32]!==R||t[33]!==f||t[34]!==x?(K={user:f,userImage:x,menuItems:w,signOutItem:O,stopImpersonatingItem:R,isImpersonating:g,themeOptions:W,preferences:a,setPreferences:m,close:b,isMobile:c},t[27]=g,t[28]=c,t[29]=w,t[30]=a,t[31]=m,t[32]=R,t[33]=f,t[34]=x,t[35]=K):K=t[35];const G=K;let q;return t[36]!==g||t[37]!==c||t[38]!==u||t[39]!==G||t[40]!==f?.name||t[41]!==x?(q=s.jsx(s.Fragment,{children:c?s.jsxs(rs,{open:u,onOpenChange:h,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>h(!0),className:E("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",g&&"border-2 border-dashed border-amber-500"),children:[s.jsx(Qe,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(os,{className:"h-[80dvh] p-0",children:[s.jsx(as,{className:"sr-only",children:"Account"}),s.jsx(Et,{...G})]})]}):s.jsxs(tt,{open:u,onOpenChange:h,children:[s.jsx(Ee,{asChild:!0,children:s.jsxs(Q,{tooltip:f?.name??"Account",className:E("rounded-md",g&&"border-2 border-dashed border-amber-500"),children:[s.jsx(Qe,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(et,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:ll,children:s.jsx(Et,{...G})})]})}),t[36]=g,t[37]=c,t[38]=u,t[39]=G,t[40]=f?.name,t[41]=x,t[42]=q):q=t[42],q}function ll(t){return t.preventDefault()}async function rl(){const{error:t}=await ae.admin.stopImpersonating();if(t){re.error(t.message||"Failed to stop impersonation");return}window.location.href="/"}function ol(){me("signed_out",{source:"account_popover"}),Ws(),ae.signOut()}function Ge(t){const e=I.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=An(),[r,o]=L.useState(!1);let a,m;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=ei(i.capabilities);a=i.online?"Desktop linked":"Connect desktop",m=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=a,e[5]=m}else a=e[4],m=e[5];const c=m;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>o(!0),v=s.jsx(pt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let _;e[8]!==a?(_=s.jsx("span",{children:a}),e[8]=a,e[9]=_):_=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==a||e[13]!==_||e[14]!==C?(N=s.jsx(ue,{asChild:!0,children:s.jsxs(Q,{tooltip:a,onClick:y,children:[v,_,C]})}),e[12]=a,e[13]=_,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(fe,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(he,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(Mt,{open:r,onOpenChange:o}),e[21]=r,e[22]=k):k=e[22];let $;return e[23]!==k||e[24]!==A?($=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=$):$=e[25],$}let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),e[26]=d):d=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(pt,{size:16}),e[27]=h):h=e[27];let f;e[28]!==i.online?(f=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=f):f=e[29];let x;e[30]!==u||e[31]!==f?(x=s.jsx(ue,{asChild:!0,children:s.jsxs(ve,{onClick:d,"aria-label":u,children:[h,f]})}),e[30]=u,e[31]=f,e[32]=x):x=e[32];let g;e[33]!==c?(g=s.jsx(fe,{side:"bottom",children:c}),e[33]=c,e[34]=g):g=e[34];let p;e[35]!==x||e[36]!==g?(p=s.jsxs(he,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=p):p=e[37];let b;e[38]!==r?(b=s.jsx(Mt,{open:r,onOpenChange:o}),e[38]=r,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[40]=b,e[41]=p,e[42]=j):j=e[42],j}class al extends L.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 cl(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function dl(){const t=I.c(17),e=xe(),{org:n}=ne(),{hasDecoKey:l,balanceDollars:i}=Bn();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let o;t[2]!==i?(o=E(i!=null&&cl(i)),t[2]=i,t[3]=o):o=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 m;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(on,{}),t[7]=m):m=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let d;t[10]!==c?(d=s.jsx("span",{children:c}),t[10]=c,t[11]=d):d=t[11];let u;return t[12]!==r||t[13]!==o||t[14]!==a||t[15]!==d?(u=s.jsx(se,{children:s.jsx(U,{children:s.jsxs(Q,{tooltip:r,className:o,onClick:a,children:[m,d]})})}),t[12]=r,t[13]=o,t[14]=a,t[15]=d,t[16]=u):u=t[16],u}function Rt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(al,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(dl,{})})}),t[0]=e):e=t[0],e}function mt(){const t=I.c(7),e=xe(),{org:n}=ne();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(st,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let o;return t[5]!==l?(o=s.jsxs(Q,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=o):o=t[6],o}function ml(){const t=I.c(6),e=xe(),{org:n}=ne();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(st,{size:15}),t[3]=i):i=t[3];let r;return t[4]!==l?(r=s.jsx("button",{type:"button","aria-label":"Settings",onClick:l,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:i}),t[4]=l,t[5]=r):r=t[5],r}function Lt(){const t=I.c(4),[e,n]=L.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(U,{children:s.jsx(us,{trigger:s.jsxs(Q,{tooltip:"Invite members",children:[s.jsx(ns,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(se,{className:"gap-0.5",children:[l,s.jsx(U,{children:s.jsxs(Q,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Xn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(Hn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Bt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(se,{className:"gap-0.5",children:s.jsx(U,{children:s.jsx(us,{trigger:s.jsxs(Q,{tooltip:"Invite members",children:[s.jsx(ns,{}),s.jsx("span",{children:"Invite members"})]})})})}),t[0]=e):e=t[0],e}function ul(){const t=I.c(17),{state:e}=pe(),n=e==="collapsed";if(nt()){if(n){let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Bt,{}),t[0]=h):h=t[0];let f;t[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(U,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Ge,{})})}),t[1]=f):f=t[1];let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(U,{children:s.jsx(mt,{})}),t[2]=x):x=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(Re,{className:"px-2 pb-3 gap-1",children:[h,s.jsxs(se,{children:[f,x,s.jsx(U,{children:s.jsx(He,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Bt,{}),t[4]=c):c=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(U,{children:s.jsx(Ge,{variant:"full"})}),t[5]=d):d=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Re,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(se,{className:"gap-0.5",children:[d,s.jsx(U,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(He,{})}),s.jsx(ml,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Lt,{}),d=s.jsx(Rt,{}),t[7]=c,t[8]=d):(c=t[7],d=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(U,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Ge,{})})}),t[9]=u):u=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(U,{children:s.jsx(mt,{})}),t[10]=h):h=t[10];let f;return t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Re,{className:"px-2 pb-3 gap-1",children:[c,d,s.jsxs(se,{children:[u,h,s.jsx(U,{children:s.jsx(He,{})})]})]}),t[11]=f):f=t[11],f}let i,r;t[12]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Lt,{}),r=s.jsx(Rt,{}),t[12]=i,t[13]=r):(i=t[12],r=t[13]);let o;t[14]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(U,{children:s.jsx(Ge,{variant:"full"})}),t[14]=o):o=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(U,{children:s.jsx(mt,{})}),t[15]=a):a=t[15];let m;return t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(Re,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(se,{className:"gap-0.5",children:[o,a,s.jsx(U,{children:s.jsx(He,{})})]})]}),t[16]=m):m=t[16],m}function fl(){const t=I.c(8),e=xe(),{org:n}=ne(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(se,{children:s.jsx(U,{children:s.jsx(He,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(st,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==r?(a=s.jsx(Re,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:o})]})}),t[6]=r,t[7]=a):a=t[7],a}function Ht(t){const e=I.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,o]=L.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const m=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const d=c;let u;e[2]!==l?(u=E("relative",l),e[2]=l,e[3]=u):u=e[3];let h;e[4]!==i||e[5]!==n?(h=s.jsx("div",{ref:m,onScroll:d,className:n,children:i}),e[4]=i,e[5]=n,e[6]=h):h=e[6];const f=r?"opacity-100":"opacity-0";let x;e[7]!==f?(x=E("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",f),e[7]=f,e[8]=x):x=e[8];let g;e[9]!==x?(g=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=g):g=e[10];let p;return e[11]!==u||e[12]!==h||e[13]!==g?(p=s.jsxs("div",{className:u,children:[h,g]}),e[11]=u,e[12]=h,e[13]=g,e[14]=p):p=e[14],p}function hl(t){const e=I.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let o;e[0]!==r||e[1]!==n?(o=n?s.jsx(xl,{virtualMcpId:n,size:r}):s.jsx(je,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(hs,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==a?(m=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=m):m=e[7],m}function xl(t){const e=I.c(6),{virtualMcpId:n,size:l}=t,i=Ct(n);if(!i){let a;return e[0]!==l?(a=s.jsx(je,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const r=i.icon??null;let o;return e[2]!==i.title||e[3]!==l||e[4]!==r?(o=s.jsx(je,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=o):o=e[5],o}function Gt(t){const e=I.c(36),{open:n,onOpenChange:l}=t,[i,r]=L.useState(""),{org:o}=ne(),{setTaskId:a}=kt(),m=fs();let c,d,u;e[0]!==o.id||e[1]!==i?(u=i.trim(),d=Ks,c=qs.globalSearch(o.id,u),e[0]=o.id,e[1]=i,e[2]=c,e[3]=d,e[4]=u):(c=e[2],d=e[3],u=e[4]);const h=n&&u.length>0;let f;e[5]!==m||e[6]!==u?(f=async()=>await m.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=m,e[6]=u,e[7]=f):f=e[7];let x;e[8]!==c||e[9]!==h||e[10]!==f?(x={queryKey:c,enabled:h,queryFn:f,staleTime:1e4},e[8]=c,e[9]=h,e[10]=f,e[11]=x):x=e[11];const{data:g,isFetching:p}=d(x);let b;e[12]!==g?.items?(b=g?.items??[],e[12]=g?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==l?(y=z=>{z||r(""),l(z)},e[14]=l,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=z=>{v(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const C=_;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(li,{className:"sr-only",children:[s.jsx(ri,{children:"Search"}),s.jsx(oi,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(ui,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==p||e[24]!==j||e[25]!==u?(A=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(di,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(mi,{value:`thread:${z.id}:${z.title}`,onSelect:()=>C(z),className:"gap-2.5",children:[s.jsx(hl,{virtualMcpId:z.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:z.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=p,e[24]=j,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(fi,{children:A}),e[27]=A,e[28]=k):k=e[28];let $;e[29]!==S||e[30]!==k?($=s.jsxs(ai,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(hi,{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:[S,k]})]}),e[29]=S,e[30]=k,e[31]=$):$=e[31];let w;return e[32]!==v||e[33]!==n||e[34]!==$?(w=s.jsx(ci,{open:n,onOpenChange:v,children:$}),e[32]=v,e[33]=n,e[34]=$,e[35]=w):w=e[35],w}function pl(t){return t==="ephemeral"||t.startsWith("thread:")}function Ns(t){const e=I.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:o,showAgentIcon:a,hideStatusIdle:m,indented:c}=t,d=gi(n.status),u=d.icon,h=n.metadata?.kind==="tool_call_run",f=Ct(h?void 0:n.virtual_mcp_id);let x;e[0]!==f?(x=Gn(f),e[0]=f,e[1]=x):x=e[1];const g=x;bi(6e4);const p=o||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==i?(v=W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const _=c?"-ml-4 pl-6":"pl-[7px]",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==_||e[5]!==C?(N=E("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",_,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=_,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==h||e[8]!==a||e[9]!==f?.icon||e[10]!==f?.title?(S=a&&!h&&s.jsx(je,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[7]=h,e[8]=a,e[9]=f?.icon,e[10]=f?.title,e[11]=S):S=e[11];let A;e[12]!==p?(A=p&&s.jsx(hs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=A):A=e[13];const k=n.title||"Untitled task";let $;e[14]!==k?($=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=$):$=e[15];let w;e[16]!==A||e[17]!==$?(w=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,$]}),e[16]=A,e[17]=$,e[18]=w):w=e[18];let z;e[19]!==g||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:E("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!pl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):g?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:vi(new Date(n.updated_at))})]}),e[19]=g,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=z):z=e[23];let O;e[24]!==w||e[25]!==z?(O=s.jsxs("div",{className:"flex-1 min-w-0",children:[w,z]}),e[24]=w,e[25]=z,e[26]=O):O=e[26];const P="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!m&&s.jsx("span",{className:E("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d.label,children:s.jsx(u,{size:14,className:E(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[27]!==r?(D=r&&s.jsxs(he,{children:[s.jsx(ue,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:W=>{W.stopPropagation(),r()},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-8 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:s.jsx(Xs,{size:14})})}),s.jsx(fe,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=D):D=e[28];let F;e[29]!==R||e[30]!==D?(F=s.jsxs("div",{className:P,children:[R,D]}),e[29]=R,e[30]=D,e[31]=F):F=e[31];let M;return e[32]!==i||e[33]!==O||e[34]!==F||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(M=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,O,F]}),e[32]=i,e[33]=O,e[34]=F,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=M):M=e[39],M}const Ut=["requires_action","in_progress","failed","expired","completed"];function gl(t){const e=new Map(Ut.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return Ut.map(n=>({status:n,threads:e.get(n)}))}const bl="sidebar.group.expanded.";function jl(t,e){const n=I.c(3),[l,i]=Ze(`${bl}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function _s(t){const e=I.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==r?(o=E("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"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]=r,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(Qt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const m=l?"Loading…":"Show more";let c;e[4]!==m?(c=s.jsx("span",{children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function vl(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function yl(t){return t.member==="mine"&&!t.currentUserId}const Cs=4;let Ve=0;const bt=[];function Sl(){for(;Ve<Cs&&bt.length>0;){const t=bt.shift();t&&t()}}function ws(t){return new Promise((e,n)=>{const l=()=>{Ve++,t().then(e,n).finally(()=>{Ve--,Sl()})};Ve<Cs?l():bt.push(l)})}const rt=10;function Wt(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const o={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Nl(t,e,n,l){let i=0;for(const r of t)ks(r,e,n,l)&&i++;return i}function ut(t,e,n,l){return Nl(t,e,n,l)}function _l(t,e){return!!(t>=rt||t===0&&e)}function qt(t,e){return t<e}function Cl(t,e){return e===!1?!1:e===!0?!0:t}function ks(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Je=new Map,Xe=new Map;function wl(t,e){return e?t>=rt?!0:null:!1}function Kt(t){return Je.get(t)}function kl(t,e){Je.set(t,e)}function Al(t,e,n){const l=Je.get(t);if(l!==void 0){n(l);return}let i=Xe.get(t);i||(i=ws(e).then(r=>(Je.set(t,r),Xe.delete(t),r)).catch(()=>(Xe.delete(t),Promise.reject(new Error("group probe failed")))),Xe.set(t,i)),i.then(n,()=>n(!1))}function Xt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===rt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Il(t,e,n,l,i){let r=0;for(const o of t)e.has(o.id)||ks(o,n,l,i)&&r++;return r}function zl(t,e,n,l){const i=I.c(8),{org:r}=ne(),o=vl(r.id,t,e,n);let a;i[0]!==n?(a=yl(n),i[0]=n,i[1]=a):a=i[1];const m=a,[c,d]=L.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=Tn(),{threads:h,hasMore:f}=wt(),x=ut(h,t,e,n),g=_l(x,f),p=wl(x,f),b=fs();if(c.identity===o&&c.serverHasMore===null){const N=p??Kt(o);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!m&&c.identity===o&&c.serverHasMore===null&&p===null&&Kt(o)===void 0&&c.probeSubscribedIdentity!==o&&(d(N=>N.identity===o?{...N,isProbing:!0,probeSubscribedIdentity:o}:N),Al(o,async()=>{const N=Wt(t,e,0,n,1),S=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Xt(S),k=ut(u.threads.get(),t,e,n);return A===void 0?!1:qt(k,A)},N=>{d(S=>S.identity!==o?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||m)return;const S=o;d(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=ut(h,t,e,n),k=Wt(t,e,A,n,rt),$=await ws(()=>b.call("COLLECTION_THREADS_LIST",k)),{items:w,hasMore:z,totalCount:O}=Xt($),P=new Set(h.map($l)),R=Il(w,P,t,e,n),D=A;u.mergeThreads(w),d(F=>{if(F.identity!==S)return F;let M;return O!==void 0?M=qt(D+R,O):M=w.length===0||R===0?!1:z,kl(S,M),{...F,isFetching:!1,serverHasMore:M}})}catch(A){const k=A,$=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${$}`),d(w=>w.identity===S?{...w,isFetching:!1}:w)}},v=c.isFetching||c.isProbing,_=!m&&!v&&Cl(g,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==_||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:_,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=_,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function $l(t){return t.id}function Tl(t){const e=I.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:h,serverHasMore:f}=zl("status",n,m),[x,g]=L.useState(!1);!x&&l.length===0&&f===!0&&!c&&!d&&(g(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==i||e[1]!==a||e[2]!==m||e[3]!==o||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==a||e[9]!==m||e[10]!==o||e[11]!==r?(y=v=>s.jsx(Ns,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:a&&v.created_by===m.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=a,e[9]=m,e[10]=o,e[11]=r,e[12]=y):y=e[12],p=l.map(y),e[0]=i,e[1]=a,e[2]=m,e[3]=o,e[4]=r,e[5]=l,e[6]=p}else p=e[6];let b;e[13]!==h||e[14]!==c||e[15]!==u?(b=(h||c)&&s.jsx(_s,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=h,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[17]=p,e[18]=b,e[19]=j):j=e[19],j}function Ol(t){const e=I.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,c=ji[n],d=c.icon,[u,h]=jl(`status-${n}`,!1);let f;e[0]!==u||e[1]!==h?(f=function(){h(!u)},e[0]=u,e[1]=h,e[2]=f):f=e[2];const x=f;let g;e[3]!==x?(g=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=g):g=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=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]=p):p=e[7];let b;e[8]!==u?(b=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(_t,{size:14}):s.jsx(yi,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==p||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,b]}),e[10]=p,e[11]=b,e[12]=j):j=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=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:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let _;e[17]!==u||e[18]!==x||e[19]!==g||e[20]!==j||e[21]!==y||e[22]!==v?(_=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:g,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:[j,y,v]}),e[17]=u,e[18]=x,e[19]=g,e[20]=j,e[21]=y,e[22]=v,e[23]=_):_=e[23];let C;e[24]!==i||e[25]!==a||e[26]!==u||e[27]!==m||e[28]!==o||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Tl,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m})}),e[24]=i,e[25]=a,e[26]=u,e[27]=m,e[28]=o,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==_||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,C]}),e[33]=_,e[34]=C,e[35]=N):N=e[35],N}function Vt(t){const e=I.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,filters:a,hasMore:m,isFetchingMore:c,onLoadMore:d,filtersActive:u}=t;if(n.length===0&&!m&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(pi,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const b=u?"No threads match your filters":"No threads yet";let j;return e[1]!==b?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:b})]}),e[1]=b,e[2]=j):j=e[2],j}const h=n.length>1||m;if(l==="status"){let p;if(e[3]!==i||e[4]!==h||e[5]!==a||e[6]!==o||e[7]!==r||e[8]!==n){let j;e[10]!==i||e[11]!==h||e[12]!==a||e[13]!==o||e[14]!==r?(j=y=>s.jsx(Ol,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:h,filters:a},y.status),e[10]=i,e[11]=h,e[12]=a,e[13]=o,e[14]=r,e[15]=j):j=e[15],p=gl(n).map(j),e[3]=i,e[4]=h,e[5]=a,e[6]=o,e[7]=r,e[8]=n,e[9]=p}else p=e[9];let b;return e[16]!==p?(b=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=b):b=e[17],b}let f;if(e[18]!==i||e[19]!==h||e[20]!==a||e[21]!==o||e[22]!==r||e[23]!==n){let p;e[25]!==i||e[26]!==h||e[27]!==a||e[28]!==o||e[29]!==r?(p=b=>s.jsx(Ns,{task:b,isActive:i===b.id,onClick:()=>r(b),onArchive:h&&b.created_by===a.currentUserId?()=>o(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=i,e[26]=h,e[27]=a,e[28]=o,e[29]=r,e[30]=p):p=e[30],f=n.map(p),e[18]=i,e[19]=h,e[20]=a,e[21]=o,e[22]=r,e[23]=n,e[24]=f}else f=e[24];let x;e[31]!==m||e[32]!==c||e[33]!==d?(x=(m||c)&&s.jsx(_s,{onClick:d,isFetching:c}),e[31]=m,e[32]=c,e[33]=d,e[34]=x):x=e[34];let g;return e[35]!==f||e[36]!==x?(g=s.jsxs(s.Fragment,{children:[f,x]}),e[35]=f,e[36]=x,e[37]=g):g=e[37],g}function Ml(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Yt(t){const e=I.c(17),{label:n,onClick:l,active:i,children:r}=t,[o,a]=L.useState(!1);let m,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),c=()=>a(!1),d=()=>a(!0),u=()=>a(!1),e[0]=m,e[1]=c,e[2]=d,e[3]=u):(m=e[0],c=e[1],d=e[2],u=e[3]);const h=i&&"bg-sidebar-accent text-foreground";let f;e[4]!==h?(f=E("md:size-[34px] rounded-lg",h),e[4]=h,e[5]=f):f=e[5];let x;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==f?(x=s.jsx(ue,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:m,onPointerLeave:c,onFocus:d,onBlur:u,className:f,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=f,e[10]=x):x=e[10];let g;e[11]!==n?(g=s.jsx(fe,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let p;return e[13]!==o||e[14]!==x||e[15]!==g?(p=s.jsxs(he,{open:o,children:[x,g]}),e[13]=o,e[14]=x,e[15]=g,e[16]=p):p=e[16],p}function ft(t){const e=I.c(13),{label:n,value:l,onChange:i,options: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 a;e[2]!==i?(a=u=>u&&i(u),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==r?(m=r.map(Pl),e[4]=r,e[5]=m):m=e[5];let c;e[6]!==a||e[7]!==m||e[8]!==l?(c=s.jsx(ni,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:m}),e[6]=a,e[7]=m,e[8]=l,e[9]=c):c=e[9];let d;return e[10]!==o||e[11]!==c?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=d):d=e[12],d}function Pl(t){return s.jsxs(si,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function As({onNavigate:t}={}){const{data:e}=ae.useSession(),n=e?.user?.id,{org:l}=ne(),i=ii({connectionId:ln,orgId:l.id,orgSlug:l.slug}),r=Ye(l.id).id,o=ss(),{threads:a,hasMore:m,isFetchingMore:c,fetchNextPage:d}=wt(),u=a.filter(T=>!T.hidden),{hide:h}=cs(),f=xe(),{setTaskId:x,createNewTask:g}=kt(),p=jt({strict:!1}),b=vt({strict:!1}),j=p.taskId??null,y=b.virtualmcpid??a.find(T=>T.id===j)?.virtual_mcp_id??null,v=()=>{t?.()},_=[...u].sort((T,H)=>(H.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=L.useState("all"),[S,A]=L.useState("flat"),[k,$]=Ze("sidebar-threads-scope-all",!1),[w,z]=L.useState(!1),[O,P]=L.useState(!1),R={type:C,member:"mine",currentUserId:n??null},D=T=>n?T.filter(H=>H.created_by===n):[],F=T=>C==="automation"?T.filter(H=>!!H.trigger_id):C==="manual"?T.filter(H=>!H.trigger_id):T,M=D(_),W=F(M),K=F(_),G=k?K:W,q=T=>{if(n&&T.created_by&&T.created_by!==n)return;const H=T.id===j;if(h(T.id),Pn(T.id),!H)return;const Y=Ml(G,T.id,n);v(),Y?x(Y.id,Y.virtual_mcp_id):f({to:"/$org",params:{org:l.slug}})},J=T=>{v(),x(T.id,T.virtual_mcp_id)},B=async T=>{try{const H=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((H.structuredContent??H).items?.length??0)===0}catch{return!1}},ce=async()=>{const T=y??r;me("sidebar_new_thread_clicked",{virtual_mcp_id:T});const H=M.find(Y=>Y.virtual_mcp_id===T&&Y.title==="New chat");if(H&&await B(H.id)){v(),x(H.id,T);return}v(),g(T)},{state:ye,isMobile:V,toggleSidebar:Z}=pe();if(ye==="collapsed"&&!V){const T=Ye(l.id),H=new Map((o??[]).map(X=>[X.id,X])),Y=X=>(X?H.get(X):void 0)??(X===r?T:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(Ss,{orgParam:l.slug,side:"right",align:"start",trigger:s.jsx(Q,{tooltip:l.name,children:s.jsx(it,{org:l,size:"sm"})})})}),s.jsxs(se,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(U,{children:s.jsx(Q,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:Z,children:s.jsx(ts,{size:16})})}),s.jsx(U,{children:s.jsx(Q,{tooltip:"New thread",onClick:()=>{ce()},children:s.jsx($t,{size:16})})}),G.map(X=>{const be=Y(X.virtual_mcp_id);return s.jsx(U,{children:s.jsx(Q,{tooltip:X.title||"New chat",isActive:X.id===j,onClick:()=>J(X),children:s.jsx(je,{icon:be?.icon??null,name:be?.title??"Agent",size:"xs"})})},X.id)})]})]})}const ee=S!=="flat"||C!=="all"||k===!0,le=s.jsxs(tt,{children:[s.jsxs(he,{children:[s.jsx(ue,{asChild:!0,children:s.jsx(Ee,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ee,className:"md:size-[34px] rounded-lg",children:[s.jsx(ti,{size:16}),ee&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(fe,{side:"bottom",children:"Filter threads"})]}),s.jsxs(et,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(ft,{label:"View",value:S,onChange:T=>{me("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(cn,{size:13})},{value:"status",label:"Status",icon:s.jsx(dn,{size:13})}]}),s.jsx(ft,{label:"Type",value:C,onChange:T=>{me("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(ft,{label:"Scope",value:k?"team":"mine",onChange:T=>$(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),ie=T=>s.jsx(xt,{delayDuration:300,children:s.jsxs("div",{className:E("shrink-0 flex items-center justify-between",T?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(xs,{className:"md:size-[34px] rounded-lg"}),le]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Yt,{label:"Search threads",onClick:()=>{me("tasks_panel_search_opened"),P(!0),z(!0)},children:s.jsx(an,{size:16})}),s.jsx(Yt,{label:"New thread",onClick:()=>{ce()},children:s.jsx($t,{size:16})})]})]})});return V?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ie(!0),s.jsx(Ht,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Vt,{threads:G,groupBy:S,activeTaskId:j,onSelectTask:J,onArchiveTask:q,filters:R,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:ee})}),O&&s.jsx(Gt,{open:w,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ie(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Ht,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Vt,{threads:G,groupBy:S,activeTaskId:j,onSelectTask:J,onArchiveTask:q,filters:R,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:ee})})}),O&&s.jsx(Gt,{open:w,onOpenChange:z})]})}const Dl=5,Fl=[{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 Is(){const t=I.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Dl}).map(Ll)}),t[0]=i):i=t[0],i}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(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=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:Fl.map(El)})]}),t[2]=l):l=t[2],l}function El(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(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:E("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(Rl)})]},e)}function Rl(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Ll(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function Bl(){const t=I.c(2);if(nt()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(gt,{showName:!0}),t[0]=l):l=t[0],l}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(gt,{}),s.jsx(lt,{})]}),t[1]=n):n=t[1],n}function Hl(){const t=I.c(5),e=ps();let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ul,{}),l=s.jsx(Bl,{}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Jt,{children:s.jsx(L.Suspense,{fallback:s.jsx(Is,{}),children:s.jsx(As,{})})}),t[2]=i):i=t[2];let r;return t[3]!==e?(r=s.jsx(ds,{children:s.jsx(js,{sections:e,footer:n,header:l,additionalContent:i})}),t[3]=e,t[4]=r):r=t[4],r}function Gl(t){const e=I.c(8),{onClose:n}=t,l=ps();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fl,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Is,{}),e[1]=r):r=e[1];let o;e[2]!==n?(o=s.jsx(Jt,{children:s.jsx(L.Suspense,{fallback:r,children:s.jsx(As,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(ds,{children:s.jsx(el,{sections:l,onClose:n,footer:i,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}const Ul="sidebar.open";function Wl(){const t=I.c(1),{state:e}=pe(),n=nt();if(e!=="collapsed"||n)return null;let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(lt,{}),t[0]=l):l=t[0],l}function ql(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{}),t[0]=e):e=t[0],e}function ca(){const t=I.c(38),e=Nt(),n=nt(),[l,i]=Ze(Ul,!1),{width:r,wrapperRef:o,onStartResize:a,resetWidth:m}=Ci(),c=!e;let d,u;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(te.LeftColumn,{children:[s.jsx(Wl,{}),s.jsx(te.TogglesSlot,{})]}),u=s.jsx(te.CenterSlot,{}),t[0]=d,t[1]=u):(d=t[0],u=t[1]);let h;t[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(te.Header,{children:[d,u,s.jsxs(te.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(te.TabsSlot,{})}),s.jsx(te.RightSlot,{})]})]}),t[2]=h):h=t[2];const f=h;let x;t[3]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(xs,{}),t[3]=x):x=t[3];let g;t[4]!==n?(g=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(lt,{})}),t[4]=n,t[5]=g):g=t[5];let p,b,j,y,v;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ge,{}),b=s.jsx(te.TogglesSlot,{}),j=s.jsx(te.TabsSlot,{className:"shrink-0"}),y=s.jsx(te.CenterSlot,{}),v=s.jsx(te.RightSlot,{}),t[6]=p,t[7]=b,t[8]=j,t[9]=y,t[10]=v):(p=t[6],b=t[7],j=t[8],y=t[9],v=t[10]);let _;t[11]!==g?(_=s.jsx(te.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[x,g,p,b,j,y,v]})}),t[11]=g,t[12]=_):_=t[12];const C=_;let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={background:"transparent",containerType:"inline-size"},t[13]=N):N=t[13];let S;t[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Zs,{className:"flex flex-col min-h-0",style:N,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(L.Suspense,{fallback:s.jsx(ql,{}),children:s.jsx(Vs,{})})})})}),t[14]=S):S=t[14];const A=S,k=!c&&(e?C:f),$=`${r}px`;let w;t[15]!==$?(w={"--sidebar-width":$,"--sidebar-width-icon":"3.125rem"},t[15]=$,t[16]=w):w=t[16];const z=w;let O;t[17]!==e||t[18]!==a||t[19]!==m?(O=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Hl,{}),s.jsx(Si,{onPointerDown:a,onDoubleClick:m})]}),t[17]=e,t[18]=a,t[19]=m,t[20]=O):O=t[20];let P;t[21]!==c?(P=c?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[f,A]}):A,t[21]=c,t[22]=P):P=t[22];let R;t[23]!==z||t[24]!==O||t[25]!==P||t[26]!==o?(R=s.jsxs(en,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:z,children:[O,P]}),t[23]=z,t[24]=O,t[25]=P,t[26]=o,t[27]=R):R=t[27];let D;t[28]!==e?(D=e&&s.jsx(xi,{renderSidebar:Kl}),t[28]=e,t[29]=D):D=t[29];let F;t[30]!==k||t[31]!==R||t[32]!==D?(F=s.jsx(In,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[k,R,D]})}),t[30]=k,t[31]=R,t[32]=D,t[33]=F):F=t[33];let M;return t[34]!==i||t[35]!==l||t[36]!==F?(M=s.jsx(On,{children:s.jsx(te.Provider,{children:s.jsx(tn,{open:l,onOpenChange:i,children:F})})}),t[34]=i,t[35]=l,t[36]=F,t[37]=M):M=t[37],M}function Kl(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(Gl,{onClose:e})})})}export{ca as default};