decocms 4.509.4 → 4.509.6

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 (379) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CV3zl1wy.js → ActiveShapeUtils-ooY8r381.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-NXgLHgNz.js → AlertCircle-BF0Ui0Pv.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DmYmrPlt.js → AreaChart-DlzEksfw.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BzveMFQj.js → ArrowLeft-BVlu9Dwz.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DAUPJuuP.js → ArrowUp-Dmyea9G6.js} +1 -1
  6. package/dist/client/assets/{BarChart-Cm_MRilF.js → BarChart-Das3ttsM.js} +1 -1
  7. package/dist/client/assets/{Building02-BxwY0KPK.js → Building02-DNBL7z8J.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CsHWTDmR.js → CategoricalChart-CJoGBfLe.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-C6hOGQtb.js → CheckCircle-Dk9xz_Bm.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DgvYFay1.js → ChevronSelectorVertical-C-NfCkc1.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-CLw_9Qso.js → ChevronUp-sk3QYx4w.js} +1 -1
  12. package/dist/client/assets/{Copy01-ERiooqLX.js → Copy01-NMmlHrlX.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-D8jNMQJx.js → CreditCard01-DEWemsgw.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-B1h3Jihf.js → DotsVertical-CpTUNuJb.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-BsFuTdlg.js → ErrorBarContext-Bl7uyjge.js} +1 -1
  16. package/dist/client/assets/{Globe04-Bh7J-5IF.js → Globe04-Vnz0t7eg.js} +1 -1
  17. package/dist/client/assets/{Image01-4n3A8r8Z.js → Image01-BNqUbbQC.js} +1 -1
  18. package/dist/client/assets/{Key01-C6u980OH.js → Key01-C31u2Eke.js} +1 -1
  19. package/dist/client/assets/{Link01-Dwd4LqmB.js → Link01-BHjj2bjq.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-BjccAKPx.js → LinkBroken01-nMXyJXKu.js} +1 -1
  21. package/dist/client/assets/{Monitor01-v-JR5BgI.js → Monitor01-D3IH3GgG.js} +1 -1
  22. package/dist/client/assets/{Play-Ce9aT9v6.js → Play-BZqogoCw.js} +1 -1
  23. package/dist/client/assets/{Plus-QrRV6-c4.js → Plus-DjDwXc6N.js} +1 -1
  24. package/dist/client/assets/{SearchMd-CHpsmgY4.js → SearchMd-dTBCIA0I.js} +1 -1
  25. package/dist/client/assets/{Sector-CWzg5EIp.js → Sector-PvHckCS_.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-BcXG1Y02.js → ShoppingBag01-iwBdEc_G.js} +1 -1
  27. package/dist/client/assets/{Sun-D6T_vWjG.js → Sun-DHMHnErN.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BSLmpTlq.js → SwitchHorizontal01-DFtDKKW5.js} +1 -1
  29. package/dist/client/assets/{Tool01--h_pVz4T.js → Tool01-BouMEVqo.js} +1 -1
  30. package/dist/client/assets/{Trash01-RwipSHZZ.js → Trash01-Bjr3GAHU.js} +1 -1
  31. package/dist/client/assets/{Upload01-eK2TNPZR.js → Upload01-CQLG0Ul6.js} +1 -1
  32. package/dist/client/assets/{User01-N2GTLnCq.js → User01-CK1N7iyP.js} +1 -1
  33. package/dist/client/assets/{UserSquare-CX5ecxEr.js → UserSquare-BNUksztK.js} +1 -1
  34. package/dist/client/assets/{Users01-CUohNTuz.js → Users01-DEsQIEI5.js} +1 -1
  35. package/dist/client/assets/{XAxis-BwUVK1FQ.js → XAxis-BAiBjBbe.js} +1 -1
  36. package/dist/client/assets/{XClose-BuvBFMv4.js → XClose-DOiKf-Eu.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-CoVzvNw2.js → ZoomOut-D6BrN1hH.js} +1 -1
  38. package/dist/client/assets/{access-gate-CbT1o3aQ.js → access-gate-9z08FPvn.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-CzOk83Hd.js → add-connection-dialog-CrU-1bfQ.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-DSQHGceC.js → agent-analytics-BfPA0B43.js} +1 -1
  41. package/dist/client/assets/agent-app-_zMO2Kgh.js +1 -0
  42. package/dist/client/assets/{agent-assets-D1KtQiap.js → agent-assets-BSjF7Qbc.js} +1 -1
  43. package/dist/client/assets/{agent-automation-mKsl4Duh.js → agent-automation-BvB5bkQ2.js} +1 -1
  44. package/dist/client/assets/{agent-automations-lTYAa4i5.js → agent-automations-CU8lAAO-.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-Bc6cTZv0.js → agent-connect-sources-C4RhfCRS.js} +1 -1
  46. package/dist/client/assets/agent-deck-B0HIBzDj.js +1 -0
  47. package/dist/client/assets/{agent-e2e-tiw4b7SY.js → agent-e2e-2FaFx0Ek.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-DZF2CJbj.js → agent-experiments-CuEYYmSc.js} +1 -1
  49. package/dist/client/assets/{agent-file-y02P7aBy.js → agent-file-DzRDLJc9.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-CX6Bbgql.js → agent-hosting-DlEgBC0K.js} +1 -1
  51. package/dist/client/assets/{agent-icon-RL-ye5ci.js → agent-icon-CFZX8pR7.js} +1 -1
  52. package/dist/client/assets/agent-library-CnfMApSG.js +1 -0
  53. package/dist/client/assets/agent-library-file-Dui-jRHc.js +1 -0
  54. package/dist/client/assets/{agent-monitor-D-dHU9LS.js → agent-monitor-BRQyfsgF.js} +1 -1
  55. package/dist/client/assets/{agent-overview-Cmz1bvJG.js → agent-overview-CohE0W4m.js} +1 -1
  56. package/dist/client/assets/{agent-releases-B4F3N1gM.js → agent-releases-CySJ1kvw.js} +1 -1
  57. package/dist/client/assets/agent-settings-BhpiMVSF.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-DZHOQIu3.js → agent-site-editor-ChtXrVib.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-fb4CzsoG.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-BRO1EgUR.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-1cxLImn-.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-BoL_3WsJ.js → agent-view-guard-BBvfShfh.js} +1 -1
  63. package/dist/client/assets/agent-view-pXrmGKHJ.js +1 -0
  64. package/dist/client/assets/{agents-list-CaJDo_m0.js → agents-list-DSxrSodP.js} +1 -1
  65. package/dist/client/assets/{ai-providers-BMPjVZSU.js → ai-providers-CWxcn_sv.js} +1 -1
  66. package/dist/client/assets/{alert-YkXC9hu2.js → alert-DEIPkOBz.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-DyrbJ0WW.js → alert-dialog-1AxPq0JV.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-2dA8zU_U.js → analytics-sections-B2LRIwJd.js} +1 -1
  69. package/dist/client/assets/api-keys-SX9BHdXd.js +1 -0
  70. package/dist/client/assets/{api-keys-CUXS_P7v.js → api-keys-zhfX9dUA.js} +1 -1
  71. package/dist/client/assets/{app-editor-DYayDnPR.js → app-editor-BbXisCvb.js} +1 -1
  72. package/dist/client/assets/{asset-utils-BbCTjOVx.js → asset-utils-BfCzyXmn.js} +1 -1
  73. package/dist/client/assets/{auth-BWnr0_lm.js → auth-DP4uSxPI.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-DCcv16ke.js → auth-catchall-BRZHWUGv.js} +1 -1
  75. package/dist/client/assets/{auth-entry-CY7SZd_k.js → auth-entry-LhUvcLui.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-DQN-aeTf.js → auth-split-layout-BWp54P0k.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-CBaG1Ea0.js → authenticate-and-persist-oauth-C_U6QZv3.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-ifNUJixD.js → automation-list-row-C0ZdxIJ1.js} +1 -1
  79. package/dist/client/assets/{automation-runs-ZODGWJTi.js → automation-runs-B_bJCxFO.js} +1 -1
  80. package/dist/client/assets/{automations-BDok8nH2.js → automations-L2pzeirr.js} +1 -1
  81. package/dist/client/assets/{autosend-DA5Ll-0f.js → autosend-cTnVaCJn.js} +1 -1
  82. package/dist/client/assets/{avatar-DRy8VbC0.js → avatar-Cr8xE9qr.js} +1 -1
  83. package/dist/client/assets/{badge-BUPu9gG1.js → badge-Cxzupfx0.js} +1 -1
  84. package/dist/client/assets/{block-document-B49Lu21W.js → block-document-J4pX0Skn.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-YiNrOMxP.js → blocks-preview-workspace-context-D569pbk9.js} +1 -1
  86. package/dist/client/assets/blocks-tab-states-CGzdJ5rB.js +20 -0
  87. package/dist/client/assets/{blog-schema-PiAd-EaK.js → blog-schema-B4fToRjB.js} +1 -1
  88. package/dist/client/assets/{board-analytics-BQ4mtn6t.js → board-analytics-Dx1OpXXJ.js} +1 -1
  89. package/dist/client/assets/{buckets-Dx6DSmhu.js → buckets-zOYXvUGG.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-BGp6acoK.js → build-improve-prompt-doc-DW5qKm5m.js} +1 -1
  91. package/dist/client/assets/{calendar-D9jTYu0Y.js → calendar-DrqH5Cxh.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-OjLyyx3_.js → capability-load-error-xEbIIOle.js} +1 -1
  93. package/dist/client/assets/{category-editor-fExcOdlX.js → category-editor-CogqhjJy.js} +1 -1
  94. package/dist/client/assets/{chart-BDcb54AI.js → chart-CWMR3hGU.js} +1 -1
  95. package/dist/client/assets/{chat-context-Ml4Gozft.js → chat-context-g_Eua-AQ.js} +1 -1
  96. package/dist/client/assets/{chat-draft-DPAaJMCE.js → chat-draft-Dzk8CPyW.js} +1 -1
  97. package/dist/client/assets/{checkbox-Dej0a_MZ.js → checkbox-BdeH_FyX.js} +1 -1
  98. package/dist/client/assets/{choose-editor-D0dHn1km.js → choose-editor-Cx8BWFni.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-DVDs0guM.js → cli-auth-success-0JNhZBeB.js} +1 -1
  100. package/dist/client/assets/{client-icons-jDtMVux0.js → client-icons-XzBjrLgb.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-v6Ztc9kc.js +1 -0
  102. package/dist/client/assets/{collapsible-DynWWdZY.js → collapsible-Dzc5nPbl.js} +1 -1
  103. package/dist/client/assets/{collection-detail-BQdQHWVJ.js → collection-detail-_FdttxMf.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-B0G6tC0y.js → collection-display-button-C0r3MAfu.js} +1 -1
  105. package/dist/client/assets/{collection-search-Dy92VLR3.js → collection-search-Dbvpgh25.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-Bt1K-hnk.js → collection-table-wrapper-DetseIgy.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-ByAybjjo.js → collection-tabs-BI09XyhI.js} +1 -1
  108. package/dist/client/assets/{column-rules-JZTg5OFd.js → column-rules-BlPEwh2V.js} +1 -1
  109. package/dist/client/assets/{combobox-DnmkkbPm.js → combobox-VUJ2nDqY.js} +1 -1
  110. package/dist/client/assets/{command-DD6ok1pX.js → command-Bd9hJorc.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-9J59mz9d.js → companion-mcps-section-Bp8UMiPg.js} +1 -1
  112. package/dist/client/assets/{config-DoPNV1hp.js → config-BeMd-l-0.js} +1 -1
  113. package/dist/client/assets/{connect-BgE8r_92.js → connect-M4-YMPKK.js} +1 -1
  114. package/dist/client/assets/{connect-layout-yUmzpbQ7.js → connect-layout-p17FH5DP.js} +1 -1
  115. package/dist/client/assets/{connection-card-C73qSj5G.js → connection-card-CAe2u903.js} +1 -1
  116. package/dist/client/assets/{connection-detail-CzC4FHcu.js → connection-detail-DIWkkxjY.js} +1 -1
  117. package/dist/client/assets/{connection-form-helpers-BKJUP1mG.js → connection-form-helpers-CALFSG79.js} +1 -1
  118. package/dist/client/assets/{connection-BY-oAv5n.js → connection-vGhXdKLD.js} +1 -1
  119. package/dist/client/assets/{connections-BSFhP9AT.js → connections-C7k4ulir.js} +1 -1
  120. package/dist/client/assets/{content-tab-CqFH5N9R.js → content-tab-BtHPg-dG.js} +3 -3
  121. package/dist/client/assets/{context-BCaHrPi2.js → context-CfvT2Wxa.js} +1 -1
  122. package/dist/client/assets/{context-menu-B8J7Oy5n.js → context-menu-CHwcnji9.js} +1 -1
  123. package/dist/client/assets/{core.esm-xbyEQMDb.js → core.esm-DWuiNwJT.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-B-CIZkPW.js → create-organization-dialog-CWxFR1z-.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-Djsrbe-C.js → daily-pulse-oRC4mLWF.js} +1 -1
  126. package/dist/client/assets/{discover-KZgOob2m.js → discover-p_nLaAlD.js} +1 -1
  127. package/dist/client/assets/{domain-settings-B4TC2NRE.js → domain-settings-OqiYIYXw.js} +1 -1
  128. package/dist/client/assets/{drawer-C97eOt-w.js → drawer-Cka0Eku6.js} +1 -1
  129. package/dist/client/assets/{editor-B4jue8QA.js → editor-B9Gjc4_u.js} +1 -1
  130. package/dist/client/assets/{editor-classes-PB6-Tskm.js → editor-classes-DDiNriHb.js} +1 -1
  131. package/dist/client/assets/{empty-state-Bl8xm5Rf.js → empty-state-CwFmbLsq.js} +1 -1
  132. package/dist/client/assets/{empty-state-BE81q3WX.js → empty-state-z2SR-Mog.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-Dn6rJFzB.js → extract-connection-data-XsQpf2Mh.js} +1 -1
  134. package/dist/client/assets/{feature-gate-Dsz4eN7W.js → feature-gate-B_wXef4W.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-Uqlg3bNA.js → feature-paywall-DchvuB27.js} +1 -1
  136. package/dist/client/assets/{file-explorer-DC2MbKrN.js → file-explorer-ApKfPZKL.js} +1 -1
  137. package/dist/client/assets/{file-preview-B01aT0SL.js → file-preview-tnzzCkAY.js} +1 -1
  138. package/dist/client/assets/{file-share-button-C2Gs9EX3.js → file-share-button-B3GxVN2J.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-3H7WzHap.js → file-type-icon-ryttgYi6.js} +1 -1
  140. package/dist/client/assets/flat-project-BRNrHCo0.js +1 -0
  141. package/dist/client/assets/{folder-icon-BjZ-JR59.js → folder-icon-CWST0MHG.js} +1 -1
  142. package/dist/client/assets/{form-BDu3IeIH.js → form-Bx-6xR5K.js} +1 -1
  143. package/dist/client/assets/{general-BsdmUS95.js → general-Dbe_Q4-X.js} +1 -1
  144. package/dist/client/assets/{home-8_CmNbFp.js → home-wrx8Wl5t.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-DSjc94oY.js → hosted-publish-feedback-CeIJQB2y.js} +1 -1
  146. package/dist/client/assets/{icon-button-DMaUfwmf.js → icon-button-MCLH5x1D.js} +1 -1
  147. package/dist/client/assets/{index-BMw66_nD.js → index-B0vZKQuD.js} +1 -1
  148. package/dist/client/assets/{index-JO6ffcEb.js → index-BO8JG4Hf.js} +1 -1
  149. package/dist/client/assets/{index-BK190UFK.js → index-BrXBiZn5.js} +2 -2
  150. package/dist/client/assets/{index-EY3UF1U7.js → index-C1aGtBNr.js} +1 -1
  151. package/dist/client/assets/{index-Dj68aY2U.js → index-C9pR_VKY.js} +1 -1
  152. package/dist/client/assets/{index-BteFHRAl.js → index-CClwXgvQ.js} +1 -1
  153. package/dist/client/assets/{index-ZVe9S7Za.js → index-CG5_7zQH.js} +1 -1
  154. package/dist/client/assets/{index-C9fKK-wk.js → index-D-fuKePD.js} +1 -1
  155. package/dist/client/assets/{index-CQDWoXvj.js → index-D0aQ5wnO.js} +1 -1
  156. package/dist/client/assets/{index-DL4uNgul.js → index-DdEWvRzm.js} +1 -1
  157. package/dist/client/assets/{index-PRDH4fOj.js → index-KyomgUB_.js} +1 -1
  158. package/dist/client/assets/{index-OOJwkPNP.js → index-Q89Fufvt.js} +3 -3
  159. package/dist/client/assets/{index-DUtn7cb7.js → index-ViwETQr3.js} +1 -1
  160. package/dist/client/assets/{index-CHzjSYqm.js → index-WLhTbYq7.js} +1 -1
  161. package/dist/client/assets/{index-BbrHALdQ.js → index-dfcCJdsL.js} +1 -1
  162. package/dist/client/assets/{index-redirect-BnSFGhQv.js → index-redirect-ESqjut1k.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-De4bQwNq.js → infiniteQueryObserver-PVfvYDsq.js} +1 -1
  164. package/dist/client/assets/{infra-billing-Cjb-5SPj.js → infra-billing-BSN0ioe1.js} +1 -1
  165. package/dist/client/assets/{input-JF63eNXE.js → input-D0n0Uf4T.js} +1 -1
  166. package/dist/client/assets/{input-COBaFE6j.js → input-r7BQhqBY.js} +3 -3
  167. package/dist/client/assets/{integration-icon-DooAPnA0.js → integration-icon-BB9Dv-nJ.js} +1 -1
  168. package/dist/client/assets/{jira-icon-5wuNhIhD.js → jira-icon-CdI8zaAu.js} +1 -1
  169. package/dist/client/assets/{label-BunRmshY.js → label-DmL4Uuof.js} +1 -1
  170. package/dist/client/assets/{layout--YzH-sG0.js → layout-BZDYRnNv.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-CcpzlDd8.js → legacy-agents-deep-DfPWY0Fg.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-Dxu6EzR_.js → legacy-main-redirect-M1U9G2Qs.js} +1 -1
  173. package/dist/client/assets/library-B6DHkhUv.js +1 -0
  174. package/dist/client/assets/{library-tab-SHb1k8XF.js → library-tab-BFQfsJS_.js} +1 -1
  175. package/dist/client/assets/{login-D0JiYPIC.js → login-B-ot9CSx.js} +1 -1
  176. package/dist/client/assets/{markdown-Nb1vuip_.js → markdown-fTGnhGxY.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-DcLA_J0y.js → mcp-app-renderer-qwpDp6Qi.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-Du734nk4.js → mcp-oauth-BylBFIJH.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-BD-0h7ak.js → mcp-oauth-D8EcE-Fc.js} +1 -1
  180. package/dist/client/assets/{members-CpbD1vAW.js → members-kE58YejJ.js} +1 -1
  181. package/dist/client/assets/{memory-oRzY_JZ0.js → memory-D0Pm7PpR.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-B8htqT-f.js → mini-report-page-ZxMwz6zr.js} +1 -1
  183. package/dist/client/assets/{mock-board-A2KyR68g.js → mock-board-BJYyyqa_.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-BuEapzg2.js → monaco-editor-CHi3WtH8.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CmLdoUBM.js → monitoring-stats-row-DMl3HRZi.js} +1 -1
  186. package/dist/client/assets/{multi-select-2u1iX52o.js → multi-select-3pvlXav0.js} +1 -1
  187. package/dist/client/assets/{mustache-CfcOVJml.js → mustache-D1Ud0cWF.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-Co9nzRWA.js → new-project-dialog-21yLHCn3.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-750m95vu.js → oauth-callback-C6P-q-Xb.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-D2eF1Ee5.js → oauth-callback-ai-provider-DyHy6BnJ.js} +1 -1
  191. package/dist/client/assets/{onboarding-DkgSoZ52.js → onboarding-DsDkmZX1.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-BvOCsL04.js → openai-conversation-CfxNWJin.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-DHmQObV1.js → optimistic-project-sidebar-views-WpLlSmRl.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-DwD8y3vy.js → order-monitor-day-azJod3uM.js} +1 -1
  195. package/dist/client/assets/{organization-choice-8hhbvDVr.js → organization-choice-Nc5D1yLA.js} +1 -1
  196. package/dist/client/assets/{orgs-CWAFkh9i.js → orgs-vI2cjJee.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-Cdr_Tziw.js → page-seo-form-BGn9HeIJ.js} +1 -1
  198. package/dist/client/assets/{pair-BsHnJbjX.js → pair-CsPV6jek.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-DKHYfsUX.js → plan-ladder-BY6xWeYj.js} +1 -1
  200. package/dist/client/assets/{popover-B4k9nGiU.js → popover-DwtUmLit.js} +1 -1
  201. package/dist/client/assets/{post-calendar-kS9kSzmH.js → post-calendar-pztmOziQ.js} +1 -1
  202. package/dist/client/assets/{post-editor-DPYl0fXd.js → post-editor-C3lzy0U_.js} +1 -1
  203. package/dist/client/assets/{preview-content-BQwHzeSS.js → preview-content-CVSaJSDI.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-xTG64ezy.js → preview-dialog-eNQBfFBe.js} +1 -1
  205. package/dist/client/assets/{preview-panel-DBeEW5pO.js → preview-panel-DXOY3jmH.js} +1 -1
  206. package/dist/client/assets/{preview-tab-G1BalzTr.js → preview-tab-DbE5m7B7.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-Ci4Mw-Sq.js → product-picker-dialog-Da-GpOyv.js} +1 -1
  208. package/dist/client/assets/{profile-WUzxU_wm.js → profile-U0DUwr93.js} +1 -1
  209. package/dist/client/assets/{project-app-view-BpmxltEa.js → project-app-view-FFRxOV_Q.js} +1 -1
  210. package/dist/client/assets/{project-feed-DtlFOJ_J.js → project-feed-DaL6uBL4.js} +1 -1
  211. package/dist/client/assets/{project-icon-B3mPNSKk.js → project-icon-BuRsdswx.js} +1 -1
  212. package/dist/client/assets/project-reports-CElPcDzJ.js +1 -0
  213. package/dist/client/assets/project-tasks-DV2eEDWl.js +1 -0
  214. package/dist/client/assets/{projects-KkpLImdx.js → projects-5riXPnmY.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-p7R98cUX.js → projects-empty-state-CiePMMPI.js} +1 -1
  216. package/dist/client/assets/{prompts-BBLXPrFf.js → prompts-CXHSiEhX.js} +1 -1
  217. package/dist/client/assets/record-editor-DAVvVNOZ.js +1 -0
  218. package/dist/client/assets/{redirect-editor-DxAuq7iy.js → redirect-editor-CwK3Vdqv.js} +1 -1
  219. package/dist/client/assets/{reports-zTXfgSxC.js → reports-BIgNms70.js} +1 -1
  220. package/dist/client/assets/reports-DVtGq3tm.js +1 -0
  221. package/dist/client/assets/{reports-onboarding-CuCGBTFc.js → reports-onboarding-Cmxh3afP.js} +1 -1
  222. package/dist/client/assets/{reports-tab-f1o8nSn2.js → reports-tab-DXxiJmPa.js} +2 -2
  223. package/dist/client/assets/{repositories-Dk410E1C.js → repositories-B42tZ01C.js} +1 -1
  224. package/dist/client/assets/{repository-binding-De4YD-ur.js → repository-binding-r55gGNBf.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-D9TcWtSt.js → repository-import-picker-VfSlhahJ.js} +1 -1
  226. package/dist/client/assets/{repository-picker-BN6FQay9.js → repository-picker-yFk80uej.js} +1 -1
  227. package/dist/client/assets/{require-capability-C2M-jHnW.js → require-capability-CT3TLGEw.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-DxHu4HdO.js → required-auth-layout-BWb5nKEq.js} +1 -1
  229. package/dist/client/assets/{reset-password-DN8BroA7.js → reset-password-BOxwShbH.js} +1 -1
  230. package/dist/client/assets/{resizable-DkYlMHir.js → resizable-ByGUts-q.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-DLZ3PeXC.js → resolve-tab-icon-Bdjqi0eE.js} +1 -1
  232. package/dist/client/assets/{review-settings-CiipJAp6.js → review-settings-DNLvLxnr.js} +1 -1
  233. package/dist/client/assets/{roles-BhI1rNIV.js → roles-DeWWpn_K.js} +1 -1
  234. package/dist/client/assets/{route-C1EkUidt.js → route-C4hauJvR.js} +1 -1
  235. package/dist/client/assets/{route-CNLDPUh8.js → route-CgE7-Lwt.js} +1 -1
  236. package/dist/client/assets/route-CoDyt08g.js +1 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-DdsU0yom.js → sandbox-lifecycle-context-t8rIJZQW.js} +1 -1
  238. package/dist/client/assets/{schema-OH4JBQTE.js → schema-MafV5cPV.js} +1 -1
  239. package/dist/client/assets/{schema-BkghSgU6.js → schema-flcIEWOM.js} +1 -1
  240. package/dist/client/assets/{scroll-area-EXqRHAMU.js → scroll-area-CbXr0Grw.js} +1 -1
  241. package/dist/client/assets/{search-input-DLOw4tAV.js → search-input-ClGBBhJ7.js} +1 -1
  242. package/dist/client/assets/{search-toggle-DdBWg4DF.js → search-toggle-CBojEkrt.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-CW-YasIr.js → secret-ciphertext-C7ulBnli.js} +1 -1
  244. package/dist/client/assets/{secret-picker-Dk9Bg5UA.js → secret-picker-DGeeRc6k.js} +1 -1
  245. package/dist/client/assets/{secrets-Ct4YPiyH.js → secrets-BlnhE8n4.js} +1 -1
  246. package/dist/client/assets/{sections-editor-JgARz_LO.js → sections-editor-3pSZsp94.js} +1 -1
  247. package/dist/client/assets/{select-BlwJBq6n.js → select-B2Hnkm4B.js} +1 -1
  248. package/dist/client/assets/{select-model-CWTTzqVn.js → select-model-DTTbzqH1.js} +1 -1
  249. package/dist/client/assets/{seo-editor-CLH8bBAu.js → seo-editor-DuxZUYjX.js} +1 -1
  250. package/dist/client/assets/{separator-CvGb7moo.js → separator-DBLpqDob.js} +1 -1
  251. package/dist/client/assets/{settings-tab-DtbnHAeg.js → settings-tab-8Dvvihdk.js} +1 -1
  252. package/dist/client/assets/{sheet-CNqgDBwb.js → sheet-BBhhx18B.js} +1 -1
  253. package/dist/client/assets/{shell-layout-MCnab3JI.js → shell-layout-CtvKUqqb.js} +1 -1
  254. package/dist/client/assets/site-editor-BkuBcCUi.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-DUaxkDtw.js → site-editor-toast-DpZxTku4.js} +1 -1
  256. package/dist/client/assets/{skills-BbxG69y1.js → skills-BYbTnQ5E.js} +1 -1
  257. package/dist/client/assets/{slider-D9D-us6t.js → slider-qy6cOEga.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-Cohqalwi.js → sortable.esm-B9-0HRD6.js} +1 -1
  259. package/dist/client/assets/{sso-CFy2-kN0.js → sso-CCG74lG7.js} +1 -1
  260. package/dist/client/assets/{suggestion-BAcUX8_L.js → suggestion-Cj0G_CXn.js} +1 -1
  261. package/dist/client/assets/{switch-DN2oDjus.js → switch-CS2FoIN2.js} +1 -1
  262. package/dist/client/assets/{symbol-Br0-VnsN.js → symbol-CON1ZOoB.js} +1 -1
  263. package/dist/client/assets/{synced-repos--57pERYV.js → synced-repos-CF0dvd0G.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-D-maYmFp.js → tab-icon-glyph-CYuIgDcf.js} +1 -1
  265. package/dist/client/assets/{table-DB2WdQPY.js → table-_D2SXrxl.js} +1 -1
  266. package/dist/client/assets/{tabs-Ph7SjF97.js → tabs-AcH3oy-t.js} +1 -1
  267. package/dist/client/assets/{task-board-CYpXhGQT.js → task-board-Bd17qbWq.js} +1 -1
  268. package/dist/client/assets/{task-route-C5itozGq.js → task-route-BZue4vOC.js} +1 -1
  269. package/dist/client/assets/{task-status-DTDvj1F1.js → task-status-DyMnNCkJ.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-CIGPLIZr.js +1 -0
  271. package/dist/client/assets/tasks-BN_Ove-o.js +1 -0
  272. package/dist/client/assets/{tasks-B8w3McK4.js → tasks-CiKT4FN2.js} +1 -1
  273. package/dist/client/assets/{textarea-DlGH37X3.js → textarea-DmcyokOy.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-CQNNQgc5.js → thread-analytics-CTCE6JPQ.js} +1 -1
  275. package/dist/client/assets/{thread-intent-Bs__gvfZ.js → thread-intent-CxzriSHz.js} +1 -1
  276. package/dist/client/assets/{thread-route-5jEeyUgj.js → thread-route-eo60lqrt.js} +1 -1
  277. package/dist/client/assets/{thread-route-DS39QkbF.js → thread-route-pp0AsxjZ.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-Dfgibfh6.js → thread-sheet-body-CRRp5dne.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-Z0RBfkV5.js → time-range-picker-D0t73aQX.js} +1 -1
  280. package/dist/client/assets/{toggle-group-TsnUbAB8.js → toggle-group-CknzSdoq.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-EhUoXk-S.js → tool-namespace-D3b3zmJP.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-BIVcEquC.js → toolbar-icon-button-CMsNog56.js} +1 -1
  283. package/dist/client/assets/{tooltip-BWcFijHU.js → tooltip-G8gY9Kly.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-CNWwS6Ia.js → tooltipContext-Dxi77IFN.js} +1 -1
  285. package/dist/client/assets/{track-DcgDDU71.js → track-D3LjrCDw.js} +1 -1
  286. package/dist/client/assets/{types-CBrlqewk.js → types-D_cyFCbx.js} +1 -1
  287. package/dist/client/assets/{url-slug-CDCbGOuX.js → url-slug-DX5VoG4H.js} +1 -1
  288. package/dist/client/assets/{usage-stats-Ch0VewCU.js → usage-stats-rnTJkD9x.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-DlCYkQtp.js → use-ai-providers-nflcvkej.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-CdRlUyD6.js → use-app-takeover-CPPeRs27.js} +1 -1
  291. package/dist/client/assets/{use-automations-YGFOIQAp.js → use-automations-wNPVrD6L.js} +1 -1
  292. package/dist/client/assets/{use-autosave-JYMEMW_M.js → use-autosave-BeOqsngE.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-ClWioV9i.js → use-chat-navigation-Ct0wuvGx.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-CvejttUf.js → use-clock-tick-CYUj2YN-.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-CbefqerD.js → use-connect-companion-BJzJ4g-y.js} +1 -1
  296. package/dist/client/assets/{use-connection-B0oPVblY.js → use-connection-BKEWodZb.js} +1 -1
  297. package/dist/client/assets/{use-content-sync-BRR8CyBn.js → use-content-sync-DhKXoE3-.js} +1 -1
  298. package/dist/client/assets/{use-copy-BIgY_WmV.js → use-copy-CEqxOatu.js} +1 -1
  299. package/dist/client/assets/{use-create-virtual-mcp-DJNzZvO5.js → use-create-virtual-mcp-BMSftbYN.js} +1 -1
  300. package/dist/client/assets/{use-date-fns-locale-BIUtfLPN.js → use-date-fns-locale-D4E1S0jf.js} +1 -1
  301. package/dist/client/assets/{use-debounced-autosave-Dj9r69Bg.js → use-debounced-autosave-DquKQIZH.js} +1 -1
  302. package/dist/client/assets/{use-debounced-value-C1WDkKos.js → use-debounced-value-CSstqSOk.js} +1 -1
  303. package/dist/client/assets/{use-deco-credits-DCap0Yml.js → use-deco-credits-m-YLDLrH.js} +1 -1
  304. package/dist/client/assets/{use-decopilot-events-XgFDUcx2.js → use-decopilot-events-CpujiQnI.js} +1 -1
  305. package/dist/client/assets/{use-delete-connection-_wv8yaj-.js → use-delete-connection-DCjbjXKx.js} +1 -1
  306. package/dist/client/assets/{use-deployment-admin-DfnUaqJc.js → use-deployment-admin-BdLlUR4P.js} +1 -1
  307. package/dist/client/assets/{use-ensure-project-folder-DNTLX-Eo.js → use-ensure-project-folder-qMCmZGpl.js} +1 -1
  308. package/dist/client/assets/{use-fast-preview-draft-url-B9bjV3Ma.js → use-fast-preview-draft-url-DJXYn21u.js} +1 -1
  309. package/dist/client/assets/{use-file-configs-CsC2BHQ-.js → use-file-configs-CWAIMRw4.js} +1 -1
  310. package/dist/client/assets/{use-infinite-scroll-NSUx4AXY.js → use-infinite-scroll-B02tUFCW.js} +1 -1
  311. package/dist/client/assets/{use-join-requests-paxQ0wb6.js → use-join-requests-BvbtrG44.js} +1 -1
  312. package/dist/client/assets/{use-main-panel-tabs-1qDqqVnc.js → use-main-panel-tabs-o7S-7VzY.js} +1 -1
  313. package/dist/client/assets/{use-mcp-auth-status-zfl5e-7T.js → use-mcp-auth-status-CITuNY2R.js} +1 -1
  314. package/dist/client/assets/{use-mcp-client-mz_YsdlD.js → use-mcp-client-DSSP1oDc.js} +1 -1
  315. package/dist/client/assets/{use-mcp-prompts-CvB0iFHn.js → use-mcp-prompts-BJxARCf8.js} +1 -1
  316. package/dist/client/assets/{use-mcp-tools-DZXyAqtp.js → use-mcp-tools-CDlmO0C-.js} +1 -1
  317. package/dist/client/assets/{use-members-vO4hRjDU.js → use-members-3tEAzKDw.js} +1 -1
  318. package/dist/client/assets/{use-mobile-DEaGyR0R.js → use-mobile-DnMZed-9.js} +1 -1
  319. package/dist/client/assets/{use-navigate-to-agent-CNix_it6.js → use-navigate-to-agent-KM58HZ9S.js} +1 -1
  320. package/dist/client/assets/{use-open-billing-url-DPgM3gyB.js → use-open-billing-url-CQGCulmA.js} +1 -1
  321. package/dist/client/assets/{use-org-auth-client-CXOq5-xT.js → use-org-auth-client-BRnWhfya.js} +1 -1
  322. package/dist/client/assets/{use-org-fs-B0NgsaSc.js → use-org-fs-2d0xJbBN.js} +1 -1
  323. package/dist/client/assets/{use-org-repo-syncs-BhyLoBPq.js → use-org-repo-syncs-Bkud4jNg.js} +1 -1
  324. package/dist/client/assets/{use-org-sso-BFzZVp3h.js → use-org-sso-D1Oe6UUb.js} +1 -1
  325. package/dist/client/assets/{use-organization-roles-D-LRi4jO.js → use-organization-roles-DXH_4zVT.js} +1 -1
  326. package/dist/client/assets/{use-organization-settings-HKWihJAK.js → use-organization-settings-DkqCYAjq.js} +1 -1
  327. package/dist/client/assets/{use-panel-navigate-Cu-t56cK.js → use-panel-navigate-BJSqjmuU.js} +1 -1
  328. package/dist/client/assets/{use-project-native-view-presence-Cmq-429L.js → use-project-native-view-presence-Ceczs2dP.js} +1 -1
  329. package/dist/client/assets/{use-project-scope-BDEPuYYY.js → use-project-scope-CuRM9scR.js} +1 -1
  330. package/dist/client/assets/{use-recent-apps-D3U1iwPp.js → use-recent-apps-CbbBzioG.js} +1 -1
  331. package/dist/client/assets/{use-releases-Dg1E_bvA.js → use-releases-D2klKVhk.js} +1 -1
  332. package/dist/client/assets/{use-reports-diagnostic-GkDIg2KK.js → use-reports-diagnostic-B7T0KiB5.js} +1 -1
  333. package/dist/client/assets/{use-secrets-CB7UyNIm.js → use-secrets-yXiqlkNU.js} +1 -1
  334. package/dist/client/assets/{use-section-preview-base-DrnoCy28.js → use-section-preview-base-DFAsOVer.js} +1 -1
  335. package/dist/client/assets/{use-tags-CiZ_QgNY.js → use-tags-CJzCEaQ0.js} +1 -1
  336. package/dist/client/assets/{use-task-board-analytics-BJWr5bhn.js → use-task-board-analytics-r0U-e4fB.js} +1 -1
  337. package/dist/client/assets/{use-task-board-events-Bp21prI2.js → use-task-board-events-DjMd8sPO.js} +1 -1
  338. package/dist/client/assets/{use-task-board-item-prs-Cy2pSBMJ.js → use-task-board-item-prs-CKVkUcg_.js} +1 -1
  339. package/dist/client/assets/{use-task-board-items-DhjYJI1r.js → use-task-board-items-cbZX6TEt.js} +1 -1
  340. package/dist/client/assets/{use-task-metadata-DUHZbnzQ.js → use-task-metadata-BS5LKdCm.js} +1 -1
  341. package/dist/client/assets/{use-thread-analytics-C7OirB5K.js → use-thread-analytics-BzF3EbsW.js} +1 -1
  342. package/dist/client/assets/{use-thread-outputs--mNS1DFq.js → use-thread-outputs-D9D4jURz.js} +1 -1
  343. package/dist/client/assets/useInfiniteQuery-CT2fnQjA.js +1 -0
  344. package/dist/client/assets/{useQueries-xFbJ4JDx.js → useQueries-NQIUklIj.js} +1 -1
  345. package/dist/client/assets/useSuspenseInfiniteQuery-1bfrxvMY.js +1 -0
  346. package/dist/client/assets/{users-NxATKm1J.js → users-B7H7w0IM.js} +1 -1
  347. package/dist/client/assets/{utils-DP_W8krW.js → utils-hC6jph5v.js} +1 -1
  348. package/dist/client/assets/{variant-calendar-BmeOu3H-.js → variant-calendar-BFHbViPm.js} +1 -1
  349. package/dist/client/assets/{variant-draft-pointer-Dn6wcjV_.js → variant-draft-pointer-dvL1YJWZ.js} +1 -1
  350. package/dist/client/assets/{view-mode-toggle-BGWfhqW6.js → view-mode-toggle-CrCfuVDs.js} +1 -1
  351. package/dist/client/assets/{virtual-mcp-DpPwyp9Y.js → virtual-mcp-Cf1Te1-F.js} +1 -1
  352. package/dist/client/assets/{watch-sse-pool-C6ByaeA4.js → watch-sse-pool-BNEDXIc1.js} +1 -1
  353. package/dist/client/index.html +1 -1
  354. package/dist/server/server.js +32 -32
  355. package/package.json +1 -1
  356. package/dist/client/assets/agent-app-BKQglSyA.js +0 -1
  357. package/dist/client/assets/agent-deck-DcWKbF_L.js +0 -1
  358. package/dist/client/assets/agent-library-Bn09Zi3C.js +0 -1
  359. package/dist/client/assets/agent-library-file-JR0ar7Fs.js +0 -1
  360. package/dist/client/assets/agent-settings-ktDoBtMC.js +0 -1
  361. package/dist/client/assets/agent-site-editor-code-DZ0hBSDO.js +0 -2
  362. package/dist/client/assets/agent-site-editor-content-BwVrsKyq.js +0 -1
  363. package/dist/client/assets/agent-site-editor-preview-DKANcMGw.js +0 -1
  364. package/dist/client/assets/agent-view-m8ZRTbzC.js +0 -1
  365. package/dist/client/assets/api-keys-NW8fFPfy.js +0 -1
  366. package/dist/client/assets/blocks-tab-states-DXjM93mT.js +0 -20
  367. package/dist/client/assets/cms-settings-editor-CnQOe-jq.js +0 -1
  368. package/dist/client/assets/flat-project-Wmh6rrh1.js +0 -1
  369. package/dist/client/assets/library-9J_F8Otr.js +0 -1
  370. package/dist/client/assets/project-reports-CnYxVtKV.js +0 -1
  371. package/dist/client/assets/project-tasks-DG-HA53W.js +0 -1
  372. package/dist/client/assets/record-editor-DmEqm8YK.js +0 -1
  373. package/dist/client/assets/reports-D0tBPXVA.js +0 -1
  374. package/dist/client/assets/route-CkXaNypH.js +0 -1
  375. package/dist/client/assets/site-editor-sSbb2sUp.js +0 -1
  376. package/dist/client/assets/taskboard-analytics-LP9Oz3pg.js +0 -1
  377. package/dist/client/assets/tasks-BnUPurF3.js +0 -1
  378. package/dist/client/assets/useInfiniteQuery-BueIgiQs.js +0 -1
  379. package/dist/client/assets/useSuspenseInfiniteQuery-Ce35mREH.js +0 -1
@@ -1 +1 @@
1
- import{c as P,at as Z,av as ee,b as Y,a2 as te,ab as ne,k as se,j as s,L as ae,n as J,r as M,d as oe,aK as W,H as q,P as _,a_ as ie,B as le}from"./index-BK190UFK.js";import{u as re}from"./use-mobile-DEaGyR0R.js";import{g as ce,u as ue,h as de,v as he}from"./use-app-takeover-CdRlUyD6.js";import{a as Q,R as fe,b as me}from"./resizable-DkYlMHir.js";import{g as pe,h as ge,m as xe}from"./use-project-native-view-presence-Cmq-429L.js";import{L as be,k as ye}from"./agent-icon-RL-ye5ci.js";import{s as je}from"./XClose-BuvBFMv4.js";import{I as ve}from"./icon-button-DMaUfwmf.js";import{c as Se,T as Ce,a as Te}from"./tooltip-BWcFijHU.js";import{T as G}from"./toolbar-icon-button-BIVcEquC.js";import{a as Le}from"./use-project-scope-BDEPuYYY.js";import{c as Ne}from"./repository-binding-De4YD-ur.js";function U(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=P.c(8);let i;a[0]!==e?(i=r=>U(r,e),a[0]=e,a[1]=i):i=a[1];const[t,o]=Z(l,i);let n;a[2]!==e||a[3]!==t?(n=U(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let d;return a[5]!==o||a[6]!==n?(d=[n,o],a[5]=o,a[6]=n,a[7]=d):d=a[7],d}const ze=33;function _e(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=ee.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function we(l){const e=P.c(60),{actions:a,navigation:i}=l,t=Y(),{org:o}=te(),n=Le(),d=Ne(n),r=ce(),{toggleSidebar:c}=ue(),u=de(),h=X(),m=ne();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={select:Oe},e[0]=x):x=e[0];const y=se(x),b=y?.mainView==="overview";let T;e[1]!==d?.title||e[2]!==t?(T=d?.title??t("common.loading"),e[1]=d?.title,e[2]=t,e[3]=T):T=e[3];const g=T;let v;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==g||e[7]!==n||e[8]!==t?(v=b?n?g:t("sidebar.navDestinations.home"):t(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=g,e[7]=n,e[8]=t,e[9]=v):v=e[9];const j=v;let L;e[10]!==o.slug||e[11]!==m||e[12]!==n?(L=m?{to:"/$org/projects",params:{org:o.slug},search:{project:n??void 0}}:{to:"/$org/projects/$agentId",params:{org:o.slug,agentId:n??""}},e[10]=o.slug,e[11]=m,e[12]=n,e[13]=L):L=e[13];const f=L;let p;if(e[14]!==r||e[15]!==b||e[16]!==o.slug||e[17]!==f||e[18]!==g||e[19]!==n||e[20]!==t||e[21]!==j){if(p=[],r){let C;e[23]!==t?(C=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=C):C=e[24];let E;e[25]!==o.slug?(E={to:"/$org/settings/general",params:{org:o.slug}},e[25]=o.slug,e[26]=E):E=e[26];let A;e[27]!==C||e[28]!==E?(A={key:"settings",label:C,link:E},e[27]=C,e[28]=E,e[29]=A):A=e[29],p.push(A)}else if(n&&!b){let C;e[30]!==f||e[31]!==g?(C={key:"project",label:g,link:f},e[30]=f,e[31]=g,e[32]=C):C=e[32],p.push(C)}let $;e[33]!==j?($={key:"page",label:j},e[33]=j,e[34]=$):$=e[34],p.push($),e[14]=r,e[15]=b,e[16]=o.slug,e[17]=f,e[18]=g,e[19]=n,e[20]=t,e[21]=j,e[22]=p}else p=e[22];let N;e[35]!==f||e[36]!==n||e[37]!==t||e[38]!==u?(N=u&&n&&s.jsx(ve,{label:t("projects.flat.close"),asChild:!0,children:s.jsx(ae,{...f,children:s.jsx(je,{size:16})})}),e[35]=f,e[36]=n,e[37]=t,e[38]=u,e[39]=N):N=e[39];const S=N;let z;e[40]!==h||e[41]!==t||e[42]!==u?(z=u&&h&&!h.threadless&&s.jsxs(Se,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(G,{"aria-label":t(h.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":h.threadOpen,active:h.threadOpen,onClick:h.toggleThread,children:s.jsx(be,{size:16})})}),s.jsx(Te,{side:"bottom",children:t(h.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=h,e[41]=t,e[42]=u,e[43]=z):z=e[43];const K=z;let w;e[44]!==t?(w=t("layouts.shellControls.toggleSidebar"),e[44]=t,e[45]=w):w=e[45];let R;e[46]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ye,{size:16}),e[46]=R):R=e[46];let O;e[47]!==w||e[48]!==c?(O=s.jsx(G,{className:"md:hidden",onClick:c,"aria-label":w,children:R}),e[47]=w,e[48]=c,e[49]=O):O=e[49];let k;e[50]!==K||e[51]!==O?(k=s.jsxs(s.Fragment,{children:[O,K]}),e[50]=K,e[51]=O,e[52]=k):k=e[52];let B;return e[53]!==a||e[54]!==p||e[55]!==S||e[56]!==i||e[57]!==o.name||e[58]!==k?(B=s.jsx(J.Header,{leading:k,breadcrumbs:p,scope:o.name,actions:a,trailingActions:S,navigation:i}),e[53]=a,e[54]=p,e[55]=S,e[56]=i,e[57]=o.name,e[58]=k,e[59]=B):B=e[59],B}function Oe(l){return l.matches.findLast(ke)?.staticData}function ke(l){return l.staticData.pageTitle}const I="chat-layout-thread",D="chat-layout-content",F=M.createContext(null);function Ee(){return H()}function X(){return M.use(F)}function H(){const l=M.use(F);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=P.c(23),{children:a,...i}=l,t=re(),o=oe(),n=M.useRef(null),[d,r]=_e(),{threadOpen:c,contentOpen:u}=i,h=pe(i),m=c&&u?d:h.side,x=100-m,y=f=>{const p=f.getLayout(),N=p[I],S=p[D];typeof N!="number"||typeof S!="number"||Math.abs(N-m)<.001&&Math.abs(S-x)<.001||f.setLayout({[I]:m,[D]:x})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let T;e[0]!==t||e[1]!==i||e[2]!==b?(T={...i,isMobile:t,mobileSurface:b},e[0]=t,e[1]=i,e[2]=b,e[3]=T):T=e[3];const g=T;let v;e[4]!==t||e[5]!==i||e[6]!==o||e[7]!==c||e[8]!==g?(v=!i.threadless&&s.jsx(he,{open:t?g.mobileSurface==="chat":c,onToggle:()=>{t?o({to:".",search:f=>({...f,...xe(g.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()}}),e[4]=t,e[5]=i,e[6]=o,e[7]=c,e[8]=g,e[9]=v):v=e[9];let j;e[10]!==a||e[11]!==u||e[12]!==x||e[13]!==t||e[14]!==r||e[15]!==y||e[16]!==c||e[17]!==m?(j=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(fe,{ref:f=>{if(n.current=f,!f)return;let p=!0;return queueMicrotask(()=>{p&&y(f)}),()=>{p=!1,n.current===f&&(n.current=null)}},defaultLayout:{[I]:m,[D]:x},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(f,p)=>{const{isUserInteraction:N}=p;if(!N){const z=n.current;z&&y(z);return}const S=f[I];c&&u&&typeof S=="number"&&S>0&&S<100&&r(S)},children:a}),e[10]=a,e[11]=u,e[12]=x,e[13]=t,e[14]=r,e[15]=y,e[16]=c,e[17]=m,e[18]=j):j=e[18];let L;return e[19]!==v||e[20]!==j||e[21]!==g?(L=s.jsxs(F,{value:g,children:[v,j]}),e[19]=v,e[20]=j,e[21]=g,e[22]=L):L=e[22],L}function Me(l){const e=P.c(16),{children:a,topbar:i}=l,t=H();if(t.isMobile){let h;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==i?(h=t.mobileSurface==="chat"?s.jsxs(_,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=i,e[3]=h):h=e[3],h}const o=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==i?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=i,e[7]=n):n=e[7];let d;e[8]!==n?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(_,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=d):d=e[9];let r;e[10]!==o||e[11]!==d?(r=s.jsx(Q,{id:I,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":o,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=o,e[11]=d,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{className:"bg-sidebar"}),e[13]=c):c=e[13];let u;return e[14]!==r?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[14]=r,e[15]=u):u=e[15],u}function Re({children:l,routeId:e}){return l}function V(l){const e=P.c(23),{children:a,actions:i,drawer:t,aside:o}=l,n=H();if(n.isMobile&&n.mobileSurface!=="main")return null;const d=n.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==n.contentNavigation?(r=s.jsx(we,{navigation:n.contentNavigation,actions:i}),e[0]=i,e[1]=n.contentNavigation,e[2]=r):r=e[2];let c;e[3]!==a||e[4]!==n.contentKey?(c=s.jsx(W,{children:s.jsx(Re,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=c):c=e[5];let u;e[6]!==n.contentKey||e[7]!==c?(u=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:c},n.contentKey)}),e[6]=n.contentKey,e[7]=c,e[8]=u):u=e[8];let h;e[9]!==t||e[10]!==u?(h=s.jsxs(_.Content,{children:[u,t]}),e[9]=t,e[10]=u,e[11]=h):h=e[11];let m;e[12]!==r||e[13]!==h?(m=s.jsxs(J.Breadcrumbs.Provider,{children:[r,h]}),e[12]=r,e[13]=h,e[14]=m):m=e[14];let x;e[15]!==d||e[16]!==m?(x=s.jsx(_,{"data-testid":"main-panel",variant:d,children:m}),e[15]=d,e[16]=m,e[17]=x):x=e[17];const y=x;let b;return e[18]!==o||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==y?(b=n.isMobile?y:s.jsx(Q,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:y}),o&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(_,{"data-testid":"aside-panel",children:s.jsx(q,{children:s.jsx(W,{children:o})},M.isValidElement(o)?o.key??void 0:void 0)})})]})}),e[18]=o,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=y,e[22]=b):b=e[22],b}function Be(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function $e(l){const e=P.c(18),{error:a,reset:i}=l,t=Y();let o;e[0]!==t?(o=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=o):o=e[1];let n;e[2]!==o?(n=s.jsx("h2",{className:"text-lg font-medium",children:o}),e[2]=o,e[3]=n):n=e[3];let d;e[4]!==a.message||e[5]!==t?(d=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=d):d=e[6];let r;e[7]!==d?(r=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=r):r=e[8];let c;e[9]!==t?(c=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=c):c=e[10];let u;e[11]!==i||e[12]!==c?(u=s.jsx(le,{variant:"outline",onClick:i,children:c}),e[11]=i,e[12]=c,e[13]=u):u=e[13];let h;return e[14]!==n||e[15]!==r||e[16]!==u?(h=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,r,u]})}),e[14]=n,e[15]=r,e[16]=u,e[17]=h):h=e[17],h}const Ae=Object.assign(Ie,{Thread:Me,Content:V}),Xe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:Ae,ChatLayoutError:$e,ChatLayoutPending:Be,useChatLayout:Ee,useOptionalChatLayout:X},Symbol.toStringTag,{value:"Module"}));export{Ae as C,we as R,Xe as i,Ee as u};
1
+ import{c as P,at as Z,av as ee,b as Y,a2 as te,ab as ne,k as se,j as s,L as ae,n as J,r as M,d as oe,aK as W,H as q,P as _,a_ as ie,B as le}from"./index-BrXBiZn5.js";import{u as re}from"./use-mobile-DnMZed-9.js";import{g as ce,u as ue,h as de,v as he}from"./use-app-takeover-CPPeRs27.js";import{a as Q,R as fe,b as me}from"./resizable-ByGUts-q.js";import{g as pe,h as ge,m as xe}from"./use-project-native-view-presence-Ceczs2dP.js";import{L as be,k as ye}from"./agent-icon-CFZX8pR7.js";import{s as je}from"./XClose-DOiKf-Eu.js";import{I as ve}from"./icon-button-MCLH5x1D.js";import{c as Se,T as Ce,a as Te}from"./tooltip-G8gY9Kly.js";import{T as G}from"./toolbar-icon-button-CMsNog56.js";import{a as Le}from"./use-project-scope-CuRM9scR.js";import{c as Ne}from"./repository-binding-r55gGNBf.js";function U(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function Pe(l,e){const a=P.c(8);let i;a[0]!==e?(i=r=>U(r,e),a[0]=e,a[1]=i):i=a[1];const[t,o]=Z(l,i);let n;a[2]!==e||a[3]!==t?(n=U(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let d;return a[5]!==o||a[6]!==n?(d=[n,o],a[5]=o,a[6]=n,a[7]=d):d=a[7],d}const ze=33;function _e(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=ee.sidePanelWidth(),l[0]=e):e=l[0],Pe(e,ze)}function we(l){const e=P.c(60),{actions:a,navigation:i}=l,t=Y(),{org:o}=te(),n=Le(),d=Ne(n),r=ce(),{toggleSidebar:c}=ue(),u=de(),h=X(),m=ne();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={select:Oe},e[0]=x):x=e[0];const y=se(x),b=y?.mainView==="overview";let T;e[1]!==d?.title||e[2]!==t?(T=d?.title??t("common.loading"),e[1]=d?.title,e[2]=t,e[3]=T):T=e[3];const g=T;let v;e[4]!==b||e[5]!==y?.pageTitle||e[6]!==g||e[7]!==n||e[8]!==t?(v=b?n?g:t("sidebar.navDestinations.home"):t(y?.pageTitle??"page.view"),e[4]=b,e[5]=y?.pageTitle,e[6]=g,e[7]=n,e[8]=t,e[9]=v):v=e[9];const j=v;let L;e[10]!==o.slug||e[11]!==m||e[12]!==n?(L=m?{to:"/$org/projects",params:{org:o.slug},search:{project:n??void 0}}:{to:"/$org/projects/$agentId",params:{org:o.slug,agentId:n??""}},e[10]=o.slug,e[11]=m,e[12]=n,e[13]=L):L=e[13];const f=L;let p;if(e[14]!==r||e[15]!==b||e[16]!==o.slug||e[17]!==f||e[18]!==g||e[19]!==n||e[20]!==t||e[21]!==j){if(p=[],r){let C;e[23]!==t?(C=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=C):C=e[24];let E;e[25]!==o.slug?(E={to:"/$org/settings/general",params:{org:o.slug}},e[25]=o.slug,e[26]=E):E=e[26];let A;e[27]!==C||e[28]!==E?(A={key:"settings",label:C,link:E},e[27]=C,e[28]=E,e[29]=A):A=e[29],p.push(A)}else if(n&&!b){let C;e[30]!==f||e[31]!==g?(C={key:"project",label:g,link:f},e[30]=f,e[31]=g,e[32]=C):C=e[32],p.push(C)}let $;e[33]!==j?($={key:"page",label:j},e[33]=j,e[34]=$):$=e[34],p.push($),e[14]=r,e[15]=b,e[16]=o.slug,e[17]=f,e[18]=g,e[19]=n,e[20]=t,e[21]=j,e[22]=p}else p=e[22];let N;e[35]!==f||e[36]!==n||e[37]!==t||e[38]!==u?(N=u&&n&&s.jsx(ve,{label:t("projects.flat.close"),asChild:!0,children:s.jsx(ae,{...f,children:s.jsx(je,{size:16})})}),e[35]=f,e[36]=n,e[37]=t,e[38]=u,e[39]=N):N=e[39];const S=N;let z;e[40]!==h||e[41]!==t||e[42]!==u?(z=u&&h&&!h.threadless&&s.jsxs(Se,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(G,{"aria-label":t(h.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":h.threadOpen,active:h.threadOpen,onClick:h.toggleThread,children:s.jsx(be,{size:16})})}),s.jsx(Te,{side:"bottom",children:t(h.threadOpen?"page.closeThread":"page.openThread")})]}),e[40]=h,e[41]=t,e[42]=u,e[43]=z):z=e[43];const K=z;let w;e[44]!==t?(w=t("layouts.shellControls.toggleSidebar"),e[44]=t,e[45]=w):w=e[45];let R;e[46]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ye,{size:16}),e[46]=R):R=e[46];let O;e[47]!==w||e[48]!==c?(O=s.jsx(G,{className:"md:hidden",onClick:c,"aria-label":w,children:R}),e[47]=w,e[48]=c,e[49]=O):O=e[49];let k;e[50]!==K||e[51]!==O?(k=s.jsxs(s.Fragment,{children:[O,K]}),e[50]=K,e[51]=O,e[52]=k):k=e[52];let B;return e[53]!==a||e[54]!==p||e[55]!==S||e[56]!==i||e[57]!==o.name||e[58]!==k?(B=s.jsx(J.Header,{leading:k,breadcrumbs:p,scope:o.name,actions:a,trailingActions:S,navigation:i}),e[53]=a,e[54]=p,e[55]=S,e[56]=i,e[57]=o.name,e[58]=k,e[59]=B):B=e[59],B}function Oe(l){return l.matches.findLast(ke)?.staticData}function ke(l){return l.staticData.pageTitle}const I="chat-layout-thread",D="chat-layout-content",F=M.createContext(null);function Ee(){return H()}function X(){return M.use(F)}function H(){const l=M.use(F);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=P.c(23),{children:a,...i}=l,t=re(),o=oe(),n=M.useRef(null),[d,r]=_e(),{threadOpen:c,contentOpen:u}=i,h=pe(i),m=c&&u?d:h.side,x=100-m,y=f=>{const p=f.getLayout(),N=p[I],S=p[D];typeof N!="number"||typeof S!="number"||Math.abs(N-m)<.001&&Math.abs(S-x)<.001||f.setLayout({[I]:m,[D]:x})},b=ge({visibility:i,threadVisibilityExplicit:i.threadVisibilityExplicit});let T;e[0]!==t||e[1]!==i||e[2]!==b?(T={...i,isMobile:t,mobileSurface:b},e[0]=t,e[1]=i,e[2]=b,e[3]=T):T=e[3];const g=T;let v;e[4]!==t||e[5]!==i||e[6]!==o||e[7]!==c||e[8]!==g?(v=!i.threadless&&s.jsx(he,{open:t?g.mobileSurface==="chat":c,onToggle:()=>{t?o({to:".",search:f=>({...f,...xe(g.mobileSurface==="chat"?"main":"chat")}),replace:!0}):i.toggleThread()}}),e[4]=t,e[5]=i,e[6]=o,e[7]=c,e[8]=g,e[9]=v):v=e[9];let j;e[10]!==a||e[11]!==u||e[12]!==x||e[13]!==t||e[14]!==r||e[15]!==y||e[16]!==c||e[17]!==m?(j=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(fe,{ref:f=>{if(n.current=f,!f)return;let p=!0;return queueMicrotask(()=>{p&&y(f)}),()=>{p=!1,n.current===f&&(n.current=null)}},defaultLayout:{[I]:m,[D]:x},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(f,p)=>{const{isUserInteraction:N}=p;if(!N){const z=n.current;z&&y(z);return}const S=f[I];c&&u&&typeof S=="number"&&S>0&&S<100&&r(S)},children:a}),e[10]=a,e[11]=u,e[12]=x,e[13]=t,e[14]=r,e[15]=y,e[16]=c,e[17]=m,e[18]=j):j=e[18];let L;return e[19]!==v||e[20]!==j||e[21]!==g?(L=s.jsxs(F,{value:g,children:[v,j]}),e[19]=v,e[20]=j,e[21]=g,e[22]=L):L=e[22],L}function Me(l){const e=P.c(16),{children:a,topbar:i}=l,t=H();if(t.isMobile){let h;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==i?(h=t.mobileSurface==="chat"?s.jsxs(_,{variant:"plain","data-slot":"chat-layout-thread",children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=i,e[3]=h):h=e[3],h}const o=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==i?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[i,s.jsx(_.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=i,e[7]=n):n=e[7];let d;e[8]!==n?(d=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(_,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=d):d=e[9];let r;e[10]!==o||e[11]!==d?(r=s.jsx(Q,{id:I,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":o,className:"min-w-0 overflow-hidden bg-sidebar",children:d}),e[10]=o,e[11]=d,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{className:"bg-sidebar"}),e[13]=c):c=e[13];let u;return e[14]!==r?(u=s.jsxs(s.Fragment,{children:[r,c]}),e[14]=r,e[15]=u):u=e[15],u}function Re({children:l,routeId:e}){return l}function V(l){const e=P.c(23),{children:a,actions:i,drawer:t,aside:o}=l,n=H();if(n.isMobile&&n.mobileSurface!=="main")return null;const d=n.isMobile?"plain":"card";let r;e[0]!==i||e[1]!==n.contentNavigation?(r=s.jsx(we,{navigation:n.contentNavigation,actions:i}),e[0]=i,e[1]=n.contentNavigation,e[2]=r):r=e[2];let c;e[3]!==a||e[4]!==n.contentKey?(c=s.jsx(W,{children:s.jsx(Re,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=c):c=e[5];let u;e[6]!==n.contentKey||e[7]!==c?(u=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(q,{children:c},n.contentKey)}),e[6]=n.contentKey,e[7]=c,e[8]=u):u=e[8];let h;e[9]!==t||e[10]!==u?(h=s.jsxs(_.Content,{children:[u,t]}),e[9]=t,e[10]=u,e[11]=h):h=e[11];let m;e[12]!==r||e[13]!==h?(m=s.jsxs(J.Breadcrumbs.Provider,{children:[r,h]}),e[12]=r,e[13]=h,e[14]=m):m=e[14];let x;e[15]!==d||e[16]!==m?(x=s.jsx(_,{"data-testid":"main-panel",variant:d,children:m}),e[15]=d,e[16]=m,e[17]=x):x=e[17];const y=x;let b;return e[18]!==o||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==y?(b=n.isMobile?y:s.jsx(Q,{id:D,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:y}),o&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(_,{"data-testid":"aside-panel",children:s.jsx(q,{children:s.jsx(W,{children:o})},M.isValidElement(o)?o.key??void 0:void 0)})})]})}),e[18]=o,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=y,e[22]=b):b=e[22],b}function Be(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(ie,{})}),l[0]=e):e=l[0],e}function $e(l){const e=P.c(18),{error:a,reset:i}=l,t=Y();let o;e[0]!==t?(o=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=o):o=e[1];let n;e[2]!==o?(n=s.jsx("h2",{className:"text-lg font-medium",children:o}),e[2]=o,e[3]=n):n=e[3];let d;e[4]!==a.message||e[5]!==t?(d=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=d):d=e[6];let r;e[7]!==d?(r=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=r):r=e[8];let c;e[9]!==t?(c=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=c):c=e[10];let u;e[11]!==i||e[12]!==c?(u=s.jsx(le,{variant:"outline",onClick:i,children:c}),e[11]=i,e[12]=c,e[13]=u):u=e[13];let h;return e[14]!==n||e[15]!==r||e[16]!==u?(h=s.jsx(V,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,r,u]})}),e[14]=n,e[15]=r,e[16]=u,e[17]=h):h=e[17],h}const Ae=Object.assign(Ie,{Thread:Me,Content:V}),Xe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:Ae,ChatLayoutError:$e,ChatLayoutPending:Be,useChatLayout:Ee,useOptionalChatLayout:X},Symbol.toStringTag,{value:"Module"}));export{Ae as C,we as R,Xe as i,Ee as u};
@@ -1,4 +1,4 @@
1
- import{c as $,b as j,r as E,j as x,l as q,ah as Tt,t as ue,aX as Xe,a2 as vt,m as At,K as Mt,b4 as St,h as Je}from"./index-BK190UFK.js";import{a as Ct,n as Ye,E as ie,o as Rt,x as Et,y as P,z as $t,A as _t,B as et,C as N,G as Ee,H as Lt,I as It,J as $e,K as zt,L as V,N as D,m as H,O as Y,T as tt,R as ke,Q as be,U as Pt,V as Ht,W as jt,X as Nt,Y as Ot,s as Bt,Z as Dt,u as Ft,b as qt}from"./usage-stats-Ch0VewCU.js";import{T as _,n as Wt,i as Ut,E as Zt}from"./editor-classes-PB6-Tskm.js";import{a as Gt,e as nt,s as Vt,S as Kt}from"./suggestion-BAcUX8_L.js";import{B as Qt,c as Xt,t as Jt,C as rt,f as Yt,g as _e,s as en,m as Le,a as Ie,b as tn,d as ze,e as nn,h as rn,i as sn,j as an,k as on,l as ln,n as cn}from"./index-BbrHALdQ.js";import{ag as un,ah as hn,aj as dn,Z as pn,bd as fn,aV as gn}from"./agent-icon-RL-ye5ci.js";import{i as mn}from"./SwitchHorizontal01-BSLmpTlq.js";import{i as kn}from"./Link01-Dwd4LqmB.js";import{s as bn}from"./Trash01-RwipSHZZ.js";import{i as xn,b as wn}from"./use-org-fs-B0NgsaSc.js";import{E as Pe,i as st,c as yn,d as Tn,A as vn,e as An,m as Mn,f as Sn,g as Cn}from"./markdown-Nb1vuip_.js";import{A as Rn}from"./avatar-DRy8VbC0.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-DD6ok1pX.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-CXOq5-xT.js";import{I as Hn}from"./icon-button-DMaUfwmf.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Wt(a);if(M===""){g();return}if(!Ut(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(Tt,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=Ct(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Qt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(fn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Zn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Rt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Gn(t,e){return ee.getState(t)?.get(e)}function Vn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Et.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Vn(h,Gn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
1
+ import{c as $,b as j,r as E,j as x,l as q,ah as Tt,t as ue,aX as Xe,a2 as vt,m as At,K as Mt,b4 as St,h as Je}from"./index-BrXBiZn5.js";import{a as Ct,n as Ye,E as ie,o as Rt,x as Et,y as P,z as $t,A as _t,B as et,C as N,G as Ee,H as Lt,I as It,J as $e,K as zt,L as V,N as D,m as H,O as Y,T as tt,R as ke,Q as be,U as Pt,V as Ht,W as jt,X as Nt,Y as Ot,s as Bt,Z as Dt,u as Ft,b as qt}from"./usage-stats-rnTJkD9x.js";import{T as _,n as Wt,i as Ut,E as Zt}from"./editor-classes-DDiNriHb.js";import{a as Gt,e as nt,s as Vt,S as Kt}from"./suggestion-Cj0G_CXn.js";import{B as Qt,c as Xt,t as Jt,C as rt,f as Yt,g as _e,s as en,m as Le,a as Ie,b as tn,d as ze,e as nn,h as rn,i as sn,j as an,k as on,l as ln,n as cn}from"./index-dfcCJdsL.js";import{ag as un,ah as hn,aj as dn,Z as pn,bd as fn,aV as gn}from"./agent-icon-CFZX8pR7.js";import{i as mn}from"./SwitchHorizontal01-DFtDKKW5.js";import{i as kn}from"./Link01-BHjj2bjq.js";import{s as bn}from"./Trash01-Bjr3GAHU.js";import{i as xn,b as wn}from"./use-org-fs-2d0xJbBN.js";import{E as Pe,i as st,c as yn,d as Tn,A as vn,e as An,m as Mn,f as Sn,g as Cn}from"./markdown-fTGnhGxY.js";import{A as Rn}from"./avatar-Cr8xE9qr.js";import{d as En,e as $n,c as _n,C as Ln,b as In}from"./command-Bd9hJorc.js";import{g as zn}from"./get-initials-D-f_fDFw.js";import{u as Pn}from"./use-org-auth-client-BRnWhfya.js";import{I as Hn}from"./icon-button-MCLH5x1D.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const M=n.getAttributes("link").href;l(typeof M=="string"?M:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const M=Wt(a);if(M===""){g();return}if(!Ut(M)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:M}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let w;e[11]!==r?(w=r("markdownEditor.link"),e[11]=r,e[12]=w):w=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=x.jsx(kn,{size:14}),e[13]=y):y=e[13];let T;e[14]!==h||e[15]!==w||e[16]!==f?(T=x.jsx(_,{active:h,label:w,onClick:f,children:y}),e[14]=h,e[15]=w,e[16]=f,e[17]=T):T=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:M=>{M.currentTarget.contains(M.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:M=>{l(M.target.value),u(!1)},onKeyDown:M=>{M.key==="Enter"?(M.preventDefault(),k()):M.key==="Escape"&&(M.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(Tt,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(bn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let v;return e[27]!==T||e[28]!==b?(v=x.jsxs("div",{className:"relative",children:[T,b]}),e[27]=T,e[28]=b,e[29]=v):v=e[29],v}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},He=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},it=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=Ct(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(Qt,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(un,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(hn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(dn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(pn,{size:14})}),x.jsx(le,{}),it.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(He,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(He,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(fn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:it.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=xn(Pe),r=wn(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=st(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?yn:Tn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new Ye("uploadSlots"),Zn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Rt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Gn(t,e){return ee.getState(t)?.get(e)}function Vn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((T,b,v,M)=>{p=v,g=M});let m;f.doc.nodesBetween(p,g,(T,b)=>{T===l&&(m=b+T.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const w=i.nodes.paragraph;m!==void 0&&l.isBlock&&w&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,w.create()),k=m+1);const y=Et.near(f.doc.resolve(k));o&&f.setSelection(y),s&&he(f,s,y.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=st(g);Vn(h,Gn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=xe();function at(t){F=t}var O={exec:()=>null};function A(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lt=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=A(ot).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=A(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ct=A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ct).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:lt,list:ir,newline:Jn,paragraph:ct,table:O,text:rr},je=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:je,paragraph:A(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",lt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ut=/^( {2,}|\\)\n(?!\s*$)/,dr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,pr=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),ht=/(?!~)[\p{P}\p{S}]/u,fr=/(?!~)[\s\p{P}\p{S}]/u,gr=/(?:[^\s\p{P}\p{S}]|~)/u,mr=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kr=A(dt,"u").replace(/punct/g,W).getRegex(),br=A(dt,"u").replace(/punct/g,ht).getRegex(),pt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=A(pt,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),wr=A(pt,"gu").replace(/notPunctSpace/g,gr).replace(/punctSpace/g,fr).replace(/punct/g,ht).getRegex(),yr=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Tr=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),vr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ar=A(vr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Mr=A(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cr=A(ve).replace("(?:-->|$)","-->").getRegex(),Rr=A("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Er=A(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ft=A(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),gt=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),$r=A("reflink|nolink(?!\\()","g").replace("reflink",ft).replace("nolink",gt).getRegex(),Ne=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Mr,autolink:Sr,blockSkip:mr,br:ut,code:hr,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:kr,emStrongRDelimAst:xr,emStrongRDelimUnd:yr,escape:ur,link:Er,nolink:gt,punctuation:pr,reflink:ft,reflinkSearch:$r,tag:Rr,text:dr,url:O},_r={...Se,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Se,emStrongRDelimAst:wr,emStrongLDelim:br,delLDelim:Tr,delRDelim:Ar,url:A(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ne).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ne).getRegex()},Lr={...de,br:A(ut).replace("{2,}","*").getRegex(),text:A(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:lr,pedantic:cr},U={normal:Se,gfm:de,breaks:Lr,pedantic:_r},Ir={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Ir[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Oe)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Oe);return t}function Be(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function De(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function Z(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function zr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function Fe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Hr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
3
3
  `).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
4
4
  `)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
@@ -1 +1 @@
1
- import{cv as _}from"./index-BK190UFK.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
1
+ import{cv as _}from"./index-BrXBiZn5.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
@@ -1 +1 @@
1
- import{c as L,r as G,l as B,j as i,b as X,B as je,a as he,t as te,G as Te,at as fe,av as ge,a2 as we,d as Ie,E as Le,L as ze,Y as Ee,y as ue,ab as Pe,P as $e}from"./index-BK190UFK.js";import{h as Me,P as Oe,u as xe,i as De,j as Ke,l as We,m as Be}from"./use-app-takeover-CdRlUyD6.js";import{S as Fe,a as Ge,b as Xe}from"./sheet-CNqgDBwb.js";import{u as He}from"./use-mobile-DEaGyR0R.js";import{u as Ye,a as qe,D as Ue,c as Je,C as Ve,P as Ze}from"./core.esm-xbyEQMDb.js";import{S as Qe,v as et,u as tt}from"./sortable.esm-Cohqalwi.js";import{i as st}from"./Tool01--h_pVz4T.js";import{A as nt,z as ve,B as it}from"./agent-icon-RL-ye5ci.js";import{s as rt}from"./Plus-QrRV6-c4.js";import{s as _e}from"./XClose-BuvBFMv4.js";import{T as ie,a as re,c as oe}from"./tooltip-BWcFijHU.js";import{C as me,f as ot,g as lt,e as at}from"./context-menu-B8J7Oy5n.js";import{C as ct}from"./create-organization-dialog-B-CIZkPW.js";import{u as dt,a as ut,b as ft}from"./use-recent-apps-D3U1iwPp.js";import{i as ht}from"./UserSquare-CX5ecxEr.js";import{e as mt,C as pt,b as gt,c as xt,f as bt}from"./command-DD6ok1pX.js";function jt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const o=Math.abs(e)%360;return{backgroundColor:`hsl(${o} 55% 70%)`,color:`hsl(${o} 55% 20%)`}}const vt={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},lg:{box:"size-9",text:"text-sm"}};function be(t){const e=L.c(14),{org:o,size:r,rounded:n}=t,l=r===void 0?"sm":r,s=n===void 0?"rounded-md":n,{box:a,text:c}=vt[l],[d,p]=G.useState(null),u=o.logo&&o.logo!==d?o.logo:null;let h;e[0]!==s||e[1]!==a?(h=B(a,s,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=s,e[1]=a,e[2]=h):h=e[2];let m;e[3]!==u||e[4]!==o.name?(m=u?void 0:jt(o.name),e[3]=u,e[4]=o.name,e[5]=m):m=e[5];let f;e[6]!==u||e[7]!==o.name||e[8]!==c?(f=u?i.jsx("img",{src:u,alt:"",className:"size-full object-cover",onError:()=>p(u)}):i.jsx("span",{className:B("font-semibold leading-none",c),children:o.name.slice(0,2).toUpperCase()}),e[6]=u,e[7]=o.name,e[8]=c,e[9]=f):f=e[9];let g;return e[10]!==h||e[11]!==m||e[12]!==f?(g=i.jsx("div",{className:h,style:m,children:f}),e[10]=h,e[11]=m,e[12]=f,e[13]=g):g=e[13],g}function bs({invitation:t,onChanged:e}){const o=X(),[r,n]=G.useState(!1),l=t.organizationName??o("header.orgSwitcher.unknownOrganization"),s=async()=>{n(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),n(!1);return}}catch{te.error(o("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}te.success(o("header.orgSwitcher.joined",{name:l})),Te();let c;try{c=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{n(!0);try{const c=await he.organization.rejectInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}te.success(o("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{te.error(o("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(be,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:o("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:s,disabled:r,children:o("header.orgSwitcher.accept")}),i.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:r,"aria-label":o("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(_e,{size:14})})]})]})}const yt=3,Ce=10,St=440,wt=55;function Re(t){const e=Math.floor((t-St)/wt);return Math.min(Ce,Math.max(yt,e))}function zt(t,e,o=Ce*3,r=[]){return[...new Set([e,...r,...t])].slice(0,o)}function Ot(t,e,o,r,n=[]){if(t.length<=r)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),s=new Set;o&&l.has(o)&&s.add(o);for(const a of n)l.has(a)&&s.add(a);for(const a of e){if(s.size>=r)break;l.has(a)&&s.add(a)}for(const a of t){if(s.size>=r)break;s.add(a.slug)}return{shown:t.filter(a=>s.has(a.slug)),hidden:t.filter(a=>!s.has(a.slug))}}const ye=[];function _t(){const t=L.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ge.recentOrgs(),t[0]=e):e=t[0];const[o,r]=fe(e,ye),n=Array.isArray(o)?o:ye;let l;t[1]!==r?(l=(a,c)=>r(d=>zt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=r,t[2]=l):l=t[2];let s;return t[3]!==n||t[4]!==l?(s={recent:n,remember:l},t[3]=n,t[4]=l,t[5]=s):s=t[5],s}const Ne={hidden:[],pinned:[],order:[]},ne=(t,e)=>t.filter(o=>o!==e);function se(t){if(typeof t!="object"||t===null)return Ne;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[],o=t;return{hidden:e(o.hidden),pinned:e(o.pinned),order:e(o.order)}}function Ct(t,e){return{...t,hidden:[...ne(t.hidden,e),e],pinned:ne(t.pinned,e)}}function Rt(t,e){return{...t,hidden:ne(t.hidden,e)}}function Nt(t,e){return t.pinned.includes(e)?{...t,pinned:ne(t.pinned,e)}:{...t,hidden:ne(t.hidden,e),pinned:[...t.pinned,e]}}function At(t,e,o){const r=n=>{const l=e.order.indexOf(n);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(n=>n.slug===o||!e.hidden.includes(n.slug)).map((n,l)=>({org:n,index:l})).sort((n,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(n.org.slug))||r(n.org.slug)-r(l.org.slug)||n.index-l.index).map(({org:n})=>n)}function kt(t,e,o,r){const n=e.indexOf(o),l=e.indexOf(r);if(n===-1||l===-1||n===l||t.pinned.includes(o)!==t.pinned.includes(r))return t;const s=[...e];return s.splice(n,1),s.splice(l,0,o),{...t,order:[...s,...t.order.filter(a=>!s.includes(a))]}}function le(t){const e=L.c(11),{active:o,label:r,children:n}=t,l=o?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let s;e[0]!==l?(s=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-0 flex h-9 items-center",children:i.jsx("span",{className:s})}),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==r?(c=r&&i.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",o?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=o,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==n||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,n,c]}),e[7]=n,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Tt(t){const e=L.c(47),{orgs:o,currentSlug:r,hiddenCount:n,onSelect:l}=t,s=X(),[a,c]=G.useState(!1);let d;e[0]!==s?(d=s("sidebar.rail.searchOrganizations"),e[0]=s,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[2]=p):p=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ht,{size:18}),e[3]=u):u=e[3];let h;e[4]!==d?(h=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":d,onClick:p,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u})}),e[4]=d,e[5]=h):h=e[5];let m;e[6]!==n||e[7]!==s?(m=n>0?s("sidebar.rail.searchMoreOrganizations",{count:n}):s("sidebar.rail.searchOrganizations"),e[6]=n,e[7]=s,e[8]=m):m=e[8];let f;e[9]!==m?(f=i.jsx(re,{side:"right",children:m}),e[9]=m,e[10]=f):f=e[10];let g;e[11]!==h||e[12]!==f?(g=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[h,f]})}),e[11]=h,e[12]=f,e[13]=g):g=e[13];let b;e[14]!==s?(b=s("sidebar.rail.searchOrganizations"),e[14]=s,e[15]=b):b=e[15];let y;e[16]!==s?(y=s("sidebar.rail.searchPlaceholder"),e[16]=s,e[17]=y):y=e[17];let v;e[18]!==s?(v=s("sidebar.rail.searchPlaceholder"),e[18]=s,e[19]=v):v=e[19];let w;e[20]!==v?(w=i.jsx(mt,{placeholder:v}),e[20]=v,e[21]=w):w=e[21];let S;e[22]!==s?(S=s("sidebar.rail.searchEmpty"),e[22]=s,e[23]=S):S=e[23];let j;e[24]!==S?(j=i.jsx(pt,{children:S}),e[24]=S,e[25]=j):j=e[25];let x;if(e[26]!==r||e[27]!==l||e[28]!==o||e[29]!==s){let R;e[31]!==r||e[32]!==l||e[33]!==s?(R=_=>i.jsxs(gt,{value:`${_.name} ${_.slug}`,onSelect:()=>{c(!1),_.slug!==r&&l(_.slug)},className:"gap-2.5",children:[i.jsx(be,{org:_,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),_.slug===r&&i.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},_.id),e[31]=r,e[32]=l,e[33]=s,e[34]=R):R=e[34],x=o.map(R),e[26]=r,e[27]=l,e[28]=o,e[29]=s,e[30]=x}else x=e[30];let O;e[35]!==j||e[36]!==x?(O=i.jsxs(xt,{children:[j,x]}),e[35]=j,e[36]=x,e[37]=O):O=e[37];let C;e[38]!==a||e[39]!==w||e[40]!==O||e[41]!==b||e[42]!==y?(C=i.jsxs(bt,{open:a,onOpenChange:c,title:b,description:y,children:[w,O]}),e[38]=a,e[39]=w,e[40]=O,e[41]=b,e[42]=y,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==g?(N=i.jsxs(i.Fragment,{children:[g,C]}),e[44]=C,e[45]=g,e[46]=N):N=e[46],N}function It(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Lt=()=>Re(globalThis.innerHeight),Et=()=>Re(0);function Pt(t){const e=L.c(57),{org:o,active:r,onSelect:n,pinned:l,onOpenSettings:s,onTogglePin:a,onHide:c}=t,d=X();let p;e[0]!==o.slug?(p={id:o.slug},e[0]=o.slug,e[1]=p):p=e[1];const{setNodeRef:u,listeners:h,transform:m,transition:f,isDragging:g}=tt(p);let b;e[2]!==m?(b=Ve.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=b):b=e[3];const y=g?1:void 0;let v;e[4]!==b||e[5]!==y||e[6]!==f?(v={transform:b,transition:f,zIndex:y},e[4]=b,e[5]=y,e[6]=f,e[7]=v):v=e[7];const w=o.name,S=r||void 0,j=r?void 0:n,x=r?"opacity-100":"cursor-pointer opacity-60 hover:scale-105 hover:opacity-100";let O;e[8]!==x?(O=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",x),e[8]=x,e[9]=O):O=e[9];let C;e[10]!==o?(C=i.jsx(be,{org:o,size:"lg",rounded:"rounded-xl"}),e[10]=o,e[11]=C):C=e[11];let N;e[12]!==l?(N=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ve,{size:9})}),e[12]=l,e[13]=N):N=e[13];let R;e[14]!==o.name||e[15]!==C||e[16]!==N||e[17]!==S||e[18]!==j||e[19]!==O?(R=i.jsx(ie,{asChild:!0,children:i.jsx(ot,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":w,"aria-current":S,onClick:j,className:O,children:[C,N]})})}),e[14]=o.name,e[15]=C,e[16]=N,e[17]=S,e[18]=j,e[19]=O,e[20]=R):R=e[20];let _;e[21]!==o.name?(_=i.jsx(re,{side:"right",children:o.name}),e[21]=o.name,e[22]=_):_=e[22];let A;e[23]!==R||e[24]!==_?(A=i.jsxs(oe,{children:[R,_]}),e[23]=R,e[24]=_,e[25]=A):A=e[25];let E;e[26]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(it,{}),e[26]=E):E=e[26];let $;e[27]!==d?($=d("sidebar.rail.organizationSettings"),e[27]=d,e[28]=$):$=e[28];let M;e[29]!==s||e[30]!==$?(M=i.jsxs(me,{onSelect:s,children:[E,$]}),e[29]=s,e[30]=$,e[31]=M):M=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(ve,{}),e[32]=F):F=e[32];let D;e[33]!==l||e[34]!==d?(D=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[33]=l,e[34]=d,e[35]=D):D=e[35];let K;e[36]!==a||e[37]!==D?(K=i.jsxs(me,{onSelect:a,children:[F,D]}),e[36]=a,e[37]=D,e[38]=K):K=e[38];let W;e[39]!==c||e[40]!==d?(W=c&&i.jsxs(me,{onSelect:c,children:[i.jsx(st,{}),d("sidebar.rail.hideOrganization")]}),e[39]=c,e[40]=d,e[41]=W):W=e[41];let k;e[42]!==M||e[43]!==K||e[44]!==W?(k=i.jsxs(lt,{children:[M,K,W]}),e[42]=M,e[43]=K,e[44]=W,e[45]=k):k=e[45];let T;e[46]!==A||e[47]!==k?(T=i.jsxs(at,{children:[A,k]}),e[46]=A,e[47]=k,e[48]=T):T=e[48];let I;e[49]!==r||e[50]!==T?(I=i.jsx(le,{active:r,children:T}),e[49]=r,e[50]=T,e[51]=I):I=e[51];let P;return e[52]!==h||e[53]!==u||e[54]!==I||e[55]!==v?(P=i.jsx("div",{ref:u,...h,style:v,className:"w-full shrink-0 touch-none",children:I}),e[52]=h,e[53]=u,e[54]=I,e[55]=v,e[56]=P):P=e[56],P}function $t(t,e,o){const r={org:e,agentId:t.projectId};if(t.connection){const{label:l,icon:s,id:a,toolName:c}=t.connection;return{label:l,link:{to:Ee.app,params:{...r,connectionId:a,toolName:c}},glyph:i.jsx(nt,{icon:s,name:l,size:"sm+",className:"size-9 rounded-xl"})}}const n=Oe[t.app];return n?{label:o(n.labelKey),link:{to:n.to,params:r},tone:n.tone,glyph:i.jsx(n.Icon,{size:18})}:null}function Mt(t){const e=L.c(31),{entry:o,orgSlug:r,active:n,onClose:l}=t,s=X();let a,c,d,p,u,h,m,f;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s){f=Symbol.for("react.early_return_sentinel");e:{const j=$t(o,r,s);if(!j){f=null;break e}a=le,h=n,m=j.label,p="relative";let x;e[12]!==o.projectTitle?(x=i.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",o.projectTitle]}),e[12]=o.projectTitle,e[13]=x):x=e[13],u=i.jsxs(oe,{children:[i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:j.link.to,params:j.link.params,"aria-label":`${j.label} · ${o.projectTitle}`,"aria-current":n||void 0,onClick:Dt,className:B("flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",j.tone,n?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100"),children:j.glyph})}),i.jsxs(re,{side:"right",children:[j.label,x]})]}),c="button",d=s("sidebar.rail.closeApp",{name:j.label})}e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=p,e[8]=u,e[9]=h,e[10]=m,e[11]=f}else a=e[4],c=e[5],d=e[6],p=e[7],u=e[8],h=e[9],m=e[10],f=e[11];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[14]!==l?(g=()=>{ue("org_rail_recent_app_closed"),l()},e[14]=l,e[15]=g):g=e[15];let b,y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=B("absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),b=i.jsx(_e,{size:10}),e[16]=b,e[17]=y):(b=e[16],y=e[17]);let v;e[18]!==c||e[19]!==d||e[20]!==g?(v=i.jsx("button",{type:c,"aria-label":d,onClick:g,className:y,children:b}),e[18]=c,e[19]=d,e[20]=g,e[21]=v):v=e[21];let w;e[22]!==v||e[23]!==p||e[24]!==u?(w=i.jsxs("div",{className:p,children:[u,v]}),e[22]=v,e[23]=p,e[24]=u,e[25]=w):w=e[25];let S;return e[26]!==a||e[27]!==w||e[28]!==h||e[29]!==m?(S=i.jsx(a,{active:h,label:m,children:w}),e[26]=a,e[27]=w,e[28]=h,e[29]=m,e[30]=S):S=e[30],S}function Dt(){return ue("org_rail_recent_app_opened")}const Kt={"site-editor":"/site-editor"};function Wt(t){const e=L.c(26),{app:o}=t,r=X(),n=Oe[o],l=Kt[o];if(!n||!l)return null;let s;e[0]!==n.labelKey||e[1]!==r?(s=r(n.labelKey),e[0]=n.labelKey,e[1]=r,e[2]=s):s=e[2];let a;e[3]!==n.labelKey||e[4]!==r?(a=r(n.labelKey),e[3]=n.labelKey,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==n.tone?(c=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",n.tone),e[6]=n.tone,e[7]=c):c=e[7];let d;e[8]!==n.Icon?(d=i.jsx(n.Icon,{size:18}),e[8]=n.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let u;e[15]!==n.labelKey||e[16]!==r?(u=r(n.labelKey),e[15]=n.labelKey,e[16]=r,e[17]=u):u=e[17];let h;e[18]!==u?(h=i.jsx(re,{side:"right",children:u}),e[18]=u,e[19]=h):h=e[19];let m;e[20]!==p||e[21]!==h?(m=i.jsxs(oe,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=m):m=e[22];let f;return e[23]!==s||e[24]!==m?(f=i.jsx(le,{active:!0,label:s,children:m}),e[23]=s,e[24]=m,e[25]=f):f=e[25],f}function Bt(){const{org:t}=we();return dt(t.slug),null}function Ft(){const t=L.c(56),e=X(),o=Ie(),{org:r}=we(),{data:n}=Le(),[l,s]=G.useState(!1),a=Me(),{recent:c,forget:d}=ut(r.slug),p=ft(),u=p&&p.projectId===null?p.app:null;let h;t[0]!==u||t[1]!==c?(h=u?[]:c,t[0]=u,t[1]=c,t[2]=h):h=t[2];const m=h,f=n??[],{recent:g,remember:b}=_t();let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=ge.railOrgPrefs(),t[3]=y):y=t[3];const[v,w]=fe(y,Ne),S=se(v),j=G.useSyncExternalStore(It,Lt,Et),{shown:x}=Ot(At(f,S,r.slug),g,r.slug,j,S.pinned);let O;t[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},t[4]=O):O=t[4];const C=Ye(qe(Ze,O)),N=z=>{const{active:H,over:ee}=z;ee&&(ue("org_rail_reordered"),w(ke=>kt(se(ke),x.map(Ht),String(H.id),String(ee.id))))},R=z=>{ue("org_rail_travel");const H=x.some(ee=>ee.slug===z);w(ee=>Rt(se(ee),z)),b(z,H?x.map(Xt):void 0),o({to:"/$org/home",params:{org:z}})},_=!a&&"border-r border-sidebar-border";let A;t[5]!==_?(A=B("flex w-16 shrink-0 flex-col items-center gap-1.5 overflow-y-auto bg-sidebar pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_),t[5]=_,t[6]=A):A=t[6];let E;t[7]!==e?(E=e("sidebar.rail.ariaLabel"),t[7]=e,t[8]=E):E=t[8];const $=Ue,M=Je,F=Qe,D=x.map(Gt),K=et,W=x.map(z=>i.jsx(Pt,{org:z,active:z.slug===r.slug,pinned:S.pinned.includes(z.slug),onSelect:()=>R(z.slug),onOpenSettings:()=>o({to:"/$org/settings",params:{org:z.slug}}),onTogglePin:()=>w(H=>Nt(se(H),z.slug)),onHide:z.slug===r.slug?void 0:()=>w(H=>Ct(se(H),z.slug))},z.id));let k;t[9]!==F||t[10]!==W||t[11]!==D||t[12]!==K?(k=i.jsx(F,{items:D,strategy:K,children:W}),t[9]=F,t[10]=W,t[11]=D,t[12]=K,t[13]=k):k=t[13];let T;t[14]!==$||t[15]!==N||t[16]!==C||t[17]!==k||t[18]!==M?(T=i.jsx($,{sensors:C,collisionDetection:M,onDragEnd:N,children:k}),t[14]=$,t[15]=N,t[16]=C,t[17]=k,t[18]=M,t[19]=T):T=t[19];let I;t[20]!==r.slug||t[21]!==f||t[22]!==x.length||t[23]!==R?(I=f.length>x.length&&i.jsx(Tt,{orgs:f,currentSlug:r.slug,hiddenCount:f.length-x.length,onSelect:R}),t[20]=r.slug,t[21]=f,t[22]=x.length,t[23]=R,t[24]=I):I=t[24];let P;t[25]!==e?(P=e("sidebar.picker.newOrganization"),t[25]=e,t[26]=P):P=t[26];let ae;t[27]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>s(!0),t[27]=ae):ae=t[27];let ce;t[28]===Symbol.for("react.memo_cache_sentinel")?(ce=i.jsx(rt,{size:18}),t[28]=ce):ce=t[28];let Y;t[29]!==P?(Y=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":P,onClick:ae,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:ce})}),t[29]=P,t[30]=Y):Y=t[30];let q;t[31]!==e?(q=e("sidebar.picker.newOrganization"),t[31]=e,t[32]=q):q=t[32];let U;t[33]!==q?(U=i.jsx(re,{side:"right",children:q}),t[33]=q,t[34]=U):U=t[34];let J;t[35]!==Y||t[36]!==U?(J=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[Y,U]})}),t[35]=Y,t[36]=U,t[37]=J):J=t[37];let V;t[38]!==r.slug||t[39]!==d||t[40]!==u||t[41]!==p||t[42]!==m?(V=(m.length>0||u)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),m.map(z=>i.jsx(Mt,{entry:z,orgSlug:r.slug,active:p?.app===z.app&&p.projectId===z.projectId,onClose:()=>d(z)},`${z.app}:${z.projectId}`)),u&&i.jsx(Wt,{app:u})]}),t[38]=r.slug,t[39]=d,t[40]=u,t[41]=p,t[42]=m,t[43]=V):V=t[43];let Z;t[44]!==T||t[45]!==I||t[46]!==J||t[47]!==V||t[48]!==A||t[49]!==E?(Z=i.jsxs("div",{className:A,"aria-label":E,children:[T,I,J,V]}),t[44]=T,t[45]=I,t[46]=J,t[47]=V,t[48]=A,t[49]=E,t[50]=Z):Z=t[50];let Q;t[51]!==l?(Q=i.jsx(ct,{open:l,onOpenChange:s}),t[51]=l,t[52]=Q):Q=t[52];let de;return t[53]!==Z||t[54]!==Q?(de=i.jsxs(i.Fragment,{children:[Z,Q]}),t[53]=Z,t[54]=Q,t[55]=de):de=t[55],de}function Gt(t){return t.slug}function Xt(t){return t.slug}function Ht(t){return t.slug}function Yt(){const{state:t,isMobile:e}=xe();return t==="collapsed"&&!e}function qt(t){const e=L.c(15),{width:o,minWidth:r,maxWidth:n,onPointerDown:l,onKeyDown:s,onDoubleClick:a}=t,c=X(),{isMobile:d}=xe(),p=Yt();if(d||p)return null;let u;e[0]!==c?(u=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=u):u=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let m,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},f=i.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 group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=f):(m=e[4],f=e[5]);let g;return e[6]!==n||e[7]!==r||e[8]!==a||e[9]!==s||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==o?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u,"aria-valuenow":o,"aria-valuemin":r,"aria-valuemax":n,title:h,tabIndex:0,onPointerDown:l,onKeyDown:s,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:f}),e[6]=n,e[7]=r,e[8]=a,e[9]=s,e[10]=l,e[11]=u,e[12]=h,e[13]=o,e[14]=g):g=e[14],g}const pe=400,Se=16,Ut="sidebar.width.v2";function Jt(){const t=L.c(14),e=Vt;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=f=>typeof f=="number"?e(f):192,t[0]=o):o=t[0];const[r,n]=fe(Ut,o),l=G.useRef(null);let s;t[1]!==n||t[2]!==r?(s=f=>{f.preventDefault();const g=f.clientX,b=e(r),y=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),v=y?Array.from(y.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const j of v)j.style.transition="none";const w=j=>{const x=e(b+(j.clientX-g));y?.style.setProperty("--sidebar-width",`${x}px`)},S=j=>{const x=e(b+(j.clientX-g));n(x);for(const O of v)O.style.transition="";window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",w),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s;let c;t[4]!==n?(c=()=>{n(192)},t[4]=n,t[5]=c):c=t[5];const d=c;let p;t[6]!==n||t[7]!==r?(p=f=>{if(f.key==="ArrowLeft")n(e(r-Se));else if(f.key==="ArrowRight")n(e(r+Se));else if(f.key==="Home")n(192);else if(f.key==="End")n(pe);else return;f.preventDefault()},t[6]=n,t[7]=r,t[8]=p):p=t[8];const u=p,h=e(r);let m;return t[9]!==u||t[10]!==a||t[11]!==d||t[12]!==h?(m={width:h,minWidth:192,maxWidth:pe,wrapperRef:l,onStartResize:a,onKeyDownResize:u,resetWidth:d},t[9]=u,t[10]=a,t[11]=d,t[12]=h,t[13]=m):m=t[13],m}function Vt(t){return Math.max(192,Math.min(pe,t))}const Ae=G.createContext(null);function Zt(){const t=G.use(Ae);if(!t)throw new Error("Layout regions require a Layout");return t}function Qt({children:t,notice:e,outsideOrg:o}){const r=He(),[n,l]=fe(ge.sidebarOpen(),!0),s=Jt(),a=Pe();return i.jsx(Ae,{value:{isMobile:r,resize:s},children:i.jsx(De,{open:n,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!o&&i.jsx(Bt,{}),!r&&a&&(o?.rail??!0)&&i.jsx(Ft,{}),i.jsx(Ke,{ref:s.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${s.width}px`,"--sidebar-width-icon":a?"3.25rem":"3.125rem"},children:i.jsx(We,{children:t})})]})]})})})}function es(t){const e=L.c(26),{children:o,renderMobile:r}=t,n=X(),{isMobile:l,resize:s}=Zt(),{openMobile:a,setOpenMobile:c}=xe();if(!l){let g;e[0]!==s.maxWidth||e[1]!==s.minWidth||e[2]!==s.onKeyDownResize||e[3]!==s.onStartResize||e[4]!==s.resetWidth||e[5]!==s.width?(g=i.jsx(qt,{width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,onPointerDown:s.onStartResize,onKeyDown:s.onKeyDownResize,onDoubleClick:s.resetWidth}),e[0]=s.maxWidth,e[1]=s.minWidth,e[2]=s.onKeyDownResize,e[3]=s.onStartResize,e[4]=s.resetWidth,e[5]=s.width,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==g?(b=i.jsxs(i.Fragment,{children:[o,g]}),e[7]=o,e[8]=g,e[9]=b):b=e[9],b}let d;e[10]!==n?(d=n("layouts.shellControls.navigationTitle"),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==d?(p=i.jsx(Fe,{className:"sr-only",children:d}),e[12]=d,e[13]=p):p=e[13];let u;e[14]!==c?(u=()=>c(!1),e[14]=c,e[15]=u):u=e[15];let h;e[16]!==r||e[17]!==u?(h=r({onClose:u}),e[16]=r,e[17]=u,e[18]=h):h=e[18];let m;e[19]!==p||e[20]!==h?(m=i.jsxs(Ge,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[p,h]}),e[19]=p,e[20]=h,e[21]=m):m=e[21];let f;return e[22]!==a||e[23]!==c||e[24]!==m?(f=i.jsx(Xe,{open:a,onOpenChange:c,children:m}),e[22]=a,e[23]=c,e[24]=m,e[25]=f):f=e[25],f}function ts(t){const e=L.c(3),{children:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let n;return e[1]!==o?(n=i.jsx(Be,{className:"flex flex-col min-h-0",style:r,children:i.jsx($e,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o})})}),e[1]=o,e[2]=n):n=e[2],n}const js=Object.assign(Qt,{Sidebar:es,Content:ts});export{bs as I,js as L,be as O,Yt as u};
1
+ import{c as L,r as G,l as B,j as i,b as X,B as je,a as he,t as te,G as Te,at as fe,av as ge,a2 as we,d as Ie,E as Le,L as ze,Y as Ee,y as ue,ab as Pe,P as $e}from"./index-BrXBiZn5.js";import{h as Me,P as Oe,u as xe,i as De,j as Ke,l as We,m as Be}from"./use-app-takeover-CPPeRs27.js";import{S as Fe,a as Ge,b as Xe}from"./sheet-BBhhx18B.js";import{u as He}from"./use-mobile-DnMZed-9.js";import{u as Ye,a as qe,D as Ue,c as Je,C as Ve,P as Ze}from"./core.esm-DWuiNwJT.js";import{S as Qe,v as et,u as tt}from"./sortable.esm-B9-0HRD6.js";import{i as st}from"./Tool01-BouMEVqo.js";import{A as nt,z as ve,B as it}from"./agent-icon-CFZX8pR7.js";import{s as rt}from"./Plus-DjDwXc6N.js";import{s as _e}from"./XClose-DOiKf-Eu.js";import{T as ie,a as re,c as oe}from"./tooltip-G8gY9Kly.js";import{C as me,f as ot,g as lt,e as at}from"./context-menu-CHwcnji9.js";import{C as ct}from"./create-organization-dialog-CWxFR1z-.js";import{u as dt,a as ut,b as ft}from"./use-recent-apps-CbbBzioG.js";import{i as ht}from"./UserSquare-BNUksztK.js";import{e as mt,C as pt,b as gt,c as xt,f as bt}from"./command-Bd9hJorc.js";function jt(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const o=Math.abs(e)%360;return{backgroundColor:`hsl(${o} 55% 70%)`,color:`hsl(${o} 55% 20%)`}}const vt={xs:{box:"size-5",text:"text-[9px]"},sm:{box:"size-6",text:"text-xs"},lg:{box:"size-9",text:"text-sm"}};function be(t){const e=L.c(14),{org:o,size:r,rounded:n}=t,l=r===void 0?"sm":r,s=n===void 0?"rounded-md":n,{box:a,text:c}=vt[l],[d,p]=G.useState(null),u=o.logo&&o.logo!==d?o.logo:null;let h;e[0]!==s||e[1]!==a?(h=B(a,s,"shrink-0 flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=s,e[1]=a,e[2]=h):h=e[2];let m;e[3]!==u||e[4]!==o.name?(m=u?void 0:jt(o.name),e[3]=u,e[4]=o.name,e[5]=m):m=e[5];let f;e[6]!==u||e[7]!==o.name||e[8]!==c?(f=u?i.jsx("img",{src:u,alt:"",className:"size-full object-cover",onError:()=>p(u)}):i.jsx("span",{className:B("font-semibold leading-none",c),children:o.name.slice(0,2).toUpperCase()}),e[6]=u,e[7]=o.name,e[8]=c,e[9]=f):f=e[9];let g;return e[10]!==h||e[11]!==m||e[12]!==f?(g=i.jsx("div",{className:h,style:m,children:f}),e[10]=h,e[11]=m,e[12]=f,e[13]=g):g=e[13],g}function bs({invitation:t,onChanged:e}){const o=X(),[r,n]=G.useState(!1),l=t.organizationName??o("header.orgSwitcher.unknownOrganization"),s=async()=>{n(!0);try{const d=await he.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),n(!1);return}}catch{te.error(o("header.orgSwitcher.failedToAcceptInvitation")),n(!1);return}te.success(o("header.orgSwitcher.joined",{name:l})),Te();let c;try{c=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{n(!0);try{const c=await he.organization.rejectInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}te.success(o("header.orgSwitcher.invitationDeclined")),n(!1),e()}catch{te.error(o("header.orgSwitcher.failedToDeclineInvitation")),n(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(be,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:o("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:s,disabled:r,children:o("header.orgSwitcher.accept")}),i.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:r,"aria-label":o("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(_e,{size:14})})]})]})}const yt=3,Ce=10,St=440,wt=55;function Re(t){const e=Math.floor((t-St)/wt);return Math.min(Ce,Math.max(yt,e))}function zt(t,e,o=Ce*3,r=[]){return[...new Set([e,...r,...t])].slice(0,o)}function Ot(t,e,o,r,n=[]){if(t.length<=r)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),s=new Set;o&&l.has(o)&&s.add(o);for(const a of n)l.has(a)&&s.add(a);for(const a of e){if(s.size>=r)break;l.has(a)&&s.add(a)}for(const a of t){if(s.size>=r)break;s.add(a.slug)}return{shown:t.filter(a=>s.has(a.slug)),hidden:t.filter(a=>!s.has(a.slug))}}const ye=[];function _t(){const t=L.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ge.recentOrgs(),t[0]=e):e=t[0];const[o,r]=fe(e,ye),n=Array.isArray(o)?o:ye;let l;t[1]!==r?(l=(a,c)=>r(d=>zt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=r,t[2]=l):l=t[2];let s;return t[3]!==n||t[4]!==l?(s={recent:n,remember:l},t[3]=n,t[4]=l,t[5]=s):s=t[5],s}const Ne={hidden:[],pinned:[],order:[]},ne=(t,e)=>t.filter(o=>o!==e);function se(t){if(typeof t!="object"||t===null)return Ne;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[],o=t;return{hidden:e(o.hidden),pinned:e(o.pinned),order:e(o.order)}}function Ct(t,e){return{...t,hidden:[...ne(t.hidden,e),e],pinned:ne(t.pinned,e)}}function Rt(t,e){return{...t,hidden:ne(t.hidden,e)}}function Nt(t,e){return t.pinned.includes(e)?{...t,pinned:ne(t.pinned,e)}:{...t,hidden:ne(t.hidden,e),pinned:[...t.pinned,e]}}function At(t,e,o){const r=n=>{const l=e.order.indexOf(n);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(n=>n.slug===o||!e.hidden.includes(n.slug)).map((n,l)=>({org:n,index:l})).sort((n,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(n.org.slug))||r(n.org.slug)-r(l.org.slug)||n.index-l.index).map(({org:n})=>n)}function kt(t,e,o,r){const n=e.indexOf(o),l=e.indexOf(r);if(n===-1||l===-1||n===l||t.pinned.includes(o)!==t.pinned.includes(r))return t;const s=[...e];return s.splice(n,1),s.splice(l,0,o),{...t,order:[...s,...t.order.filter(a=>!s.includes(a))]}}function le(t){const e=L.c(11),{active:o,label:r,children:n}=t,l=o?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let s;e[0]!==l?(s=B("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==s?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-0 flex h-9 items-center",children:i.jsx("span",{className:s})}),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==r?(c=r&&i.jsx("span",{"aria-hidden":!0,className:B("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",o?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:r}),e[4]=o,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==n||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,n,c]}),e[7]=n,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Tt(t){const e=L.c(47),{orgs:o,currentSlug:r,hiddenCount:n,onSelect:l}=t,s=X(),[a,c]=G.useState(!1);let d;e[0]!==s?(d=s("sidebar.rail.searchOrganizations"),e[0]=s,e[1]=d):d=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[2]=p):p=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ht,{size:18}),e[3]=u):u=e[3];let h;e[4]!==d?(h=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":d,onClick:p,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u})}),e[4]=d,e[5]=h):h=e[5];let m;e[6]!==n||e[7]!==s?(m=n>0?s("sidebar.rail.searchMoreOrganizations",{count:n}):s("sidebar.rail.searchOrganizations"),e[6]=n,e[7]=s,e[8]=m):m=e[8];let f;e[9]!==m?(f=i.jsx(re,{side:"right",children:m}),e[9]=m,e[10]=f):f=e[10];let g;e[11]!==h||e[12]!==f?(g=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[h,f]})}),e[11]=h,e[12]=f,e[13]=g):g=e[13];let b;e[14]!==s?(b=s("sidebar.rail.searchOrganizations"),e[14]=s,e[15]=b):b=e[15];let y;e[16]!==s?(y=s("sidebar.rail.searchPlaceholder"),e[16]=s,e[17]=y):y=e[17];let v;e[18]!==s?(v=s("sidebar.rail.searchPlaceholder"),e[18]=s,e[19]=v):v=e[19];let w;e[20]!==v?(w=i.jsx(mt,{placeholder:v}),e[20]=v,e[21]=w):w=e[21];let S;e[22]!==s?(S=s("sidebar.rail.searchEmpty"),e[22]=s,e[23]=S):S=e[23];let j;e[24]!==S?(j=i.jsx(pt,{children:S}),e[24]=S,e[25]=j):j=e[25];let x;if(e[26]!==r||e[27]!==l||e[28]!==o||e[29]!==s){let R;e[31]!==r||e[32]!==l||e[33]!==s?(R=_=>i.jsxs(gt,{value:`${_.name} ${_.slug}`,onSelect:()=>{c(!1),_.slug!==r&&l(_.slug)},className:"gap-2.5",children:[i.jsx(be,{org:_,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),_.slug===r&&i.jsx("span",{className:"text-meta shrink-0",children:s("sidebar.rail.currentOrganization")})]},_.id),e[31]=r,e[32]=l,e[33]=s,e[34]=R):R=e[34],x=o.map(R),e[26]=r,e[27]=l,e[28]=o,e[29]=s,e[30]=x}else x=e[30];let O;e[35]!==j||e[36]!==x?(O=i.jsxs(xt,{children:[j,x]}),e[35]=j,e[36]=x,e[37]=O):O=e[37];let C;e[38]!==a||e[39]!==w||e[40]!==O||e[41]!==b||e[42]!==y?(C=i.jsxs(bt,{open:a,onOpenChange:c,title:b,description:y,children:[w,O]}),e[38]=a,e[39]=w,e[40]=O,e[41]=b,e[42]=y,e[43]=C):C=e[43];let N;return e[44]!==C||e[45]!==g?(N=i.jsxs(i.Fragment,{children:[g,C]}),e[44]=C,e[45]=g,e[46]=N):N=e[46],N}function It(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Lt=()=>Re(globalThis.innerHeight),Et=()=>Re(0);function Pt(t){const e=L.c(57),{org:o,active:r,onSelect:n,pinned:l,onOpenSettings:s,onTogglePin:a,onHide:c}=t,d=X();let p;e[0]!==o.slug?(p={id:o.slug},e[0]=o.slug,e[1]=p):p=e[1];const{setNodeRef:u,listeners:h,transform:m,transition:f,isDragging:g}=tt(p);let b;e[2]!==m?(b=Ve.Transform.toString(m?{...m,x:0}:null),e[2]=m,e[3]=b):b=e[3];const y=g?1:void 0;let v;e[4]!==b||e[5]!==y||e[6]!==f?(v={transform:b,transition:f,zIndex:y},e[4]=b,e[5]=y,e[6]=f,e[7]=v):v=e[7];const w=o.name,S=r||void 0,j=r?void 0:n,x=r?"opacity-100":"cursor-pointer opacity-60 hover:scale-105 hover:opacity-100";let O;e[8]!==x?(O=B("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",x),e[8]=x,e[9]=O):O=e[9];let C;e[10]!==o?(C=i.jsx(be,{org:o,size:"lg",rounded:"rounded-xl"}),e[10]=o,e[11]=C):C=e[11];let N;e[12]!==l?(N=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ve,{size:9})}),e[12]=l,e[13]=N):N=e[13];let R;e[14]!==o.name||e[15]!==C||e[16]!==N||e[17]!==S||e[18]!==j||e[19]!==O?(R=i.jsx(ie,{asChild:!0,children:i.jsx(ot,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":w,"aria-current":S,onClick:j,className:O,children:[C,N]})})}),e[14]=o.name,e[15]=C,e[16]=N,e[17]=S,e[18]=j,e[19]=O,e[20]=R):R=e[20];let _;e[21]!==o.name?(_=i.jsx(re,{side:"right",children:o.name}),e[21]=o.name,e[22]=_):_=e[22];let A;e[23]!==R||e[24]!==_?(A=i.jsxs(oe,{children:[R,_]}),e[23]=R,e[24]=_,e[25]=A):A=e[25];let E;e[26]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(it,{}),e[26]=E):E=e[26];let $;e[27]!==d?($=d("sidebar.rail.organizationSettings"),e[27]=d,e[28]=$):$=e[28];let M;e[29]!==s||e[30]!==$?(M=i.jsxs(me,{onSelect:s,children:[E,$]}),e[29]=s,e[30]=$,e[31]=M):M=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(ve,{}),e[32]=F):F=e[32];let D;e[33]!==l||e[34]!==d?(D=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[33]=l,e[34]=d,e[35]=D):D=e[35];let K;e[36]!==a||e[37]!==D?(K=i.jsxs(me,{onSelect:a,children:[F,D]}),e[36]=a,e[37]=D,e[38]=K):K=e[38];let W;e[39]!==c||e[40]!==d?(W=c&&i.jsxs(me,{onSelect:c,children:[i.jsx(st,{}),d("sidebar.rail.hideOrganization")]}),e[39]=c,e[40]=d,e[41]=W):W=e[41];let k;e[42]!==M||e[43]!==K||e[44]!==W?(k=i.jsxs(lt,{children:[M,K,W]}),e[42]=M,e[43]=K,e[44]=W,e[45]=k):k=e[45];let T;e[46]!==A||e[47]!==k?(T=i.jsxs(at,{children:[A,k]}),e[46]=A,e[47]=k,e[48]=T):T=e[48];let I;e[49]!==r||e[50]!==T?(I=i.jsx(le,{active:r,children:T}),e[49]=r,e[50]=T,e[51]=I):I=e[51];let P;return e[52]!==h||e[53]!==u||e[54]!==I||e[55]!==v?(P=i.jsx("div",{ref:u,...h,style:v,className:"w-full shrink-0 touch-none",children:I}),e[52]=h,e[53]=u,e[54]=I,e[55]=v,e[56]=P):P=e[56],P}function $t(t,e,o){const r={org:e,agentId:t.projectId};if(t.connection){const{label:l,icon:s,id:a,toolName:c}=t.connection;return{label:l,link:{to:Ee.app,params:{...r,connectionId:a,toolName:c}},glyph:i.jsx(nt,{icon:s,name:l,size:"sm+",className:"size-9 rounded-xl"})}}const n=Oe[t.app];return n?{label:o(n.labelKey),link:{to:n.to,params:r},tone:n.tone,glyph:i.jsx(n.Icon,{size:18})}:null}function Mt(t){const e=L.c(31),{entry:o,orgSlug:r,active:n,onClose:l}=t,s=X();let a,c,d,p,u,h,m,f;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==s){f=Symbol.for("react.early_return_sentinel");e:{const j=$t(o,r,s);if(!j){f=null;break e}a=le,h=n,m=j.label,p="relative";let x;e[12]!==o.projectTitle?(x=i.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",o.projectTitle]}),e[12]=o.projectTitle,e[13]=x):x=e[13],u=i.jsxs(oe,{children:[i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:j.link.to,params:j.link.params,"aria-label":`${j.label} · ${o.projectTitle}`,"aria-current":n||void 0,onClick:Dt,className:B("flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",j.tone,n?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100"),children:j.glyph})}),i.jsxs(re,{side:"right",children:[j.label,x]})]}),c="button",d=s("sidebar.rail.closeApp",{name:j.label})}e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=p,e[8]=u,e[9]=h,e[10]=m,e[11]=f}else a=e[4],c=e[5],d=e[6],p=e[7],u=e[8],h=e[9],m=e[10],f=e[11];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[14]!==l?(g=()=>{ue("org_rail_recent_app_closed"),l()},e[14]=l,e[15]=g):g=e[15];let b,y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=B("absolute -top-1.5 -right-1.5 flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),b=i.jsx(_e,{size:10}),e[16]=b,e[17]=y):(b=e[16],y=e[17]);let v;e[18]!==c||e[19]!==d||e[20]!==g?(v=i.jsx("button",{type:c,"aria-label":d,onClick:g,className:y,children:b}),e[18]=c,e[19]=d,e[20]=g,e[21]=v):v=e[21];let w;e[22]!==v||e[23]!==p||e[24]!==u?(w=i.jsxs("div",{className:p,children:[u,v]}),e[22]=v,e[23]=p,e[24]=u,e[25]=w):w=e[25];let S;return e[26]!==a||e[27]!==w||e[28]!==h||e[29]!==m?(S=i.jsx(a,{active:h,label:m,children:w}),e[26]=a,e[27]=w,e[28]=h,e[29]=m,e[30]=S):S=e[30],S}function Dt(){return ue("org_rail_recent_app_opened")}const Kt={"site-editor":"/site-editor"};function Wt(t){const e=L.c(26),{app:o}=t,r=X(),n=Oe[o],l=Kt[o];if(!n||!l)return null;let s;e[0]!==n.labelKey||e[1]!==r?(s=r(n.labelKey),e[0]=n.labelKey,e[1]=r,e[2]=s):s=e[2];let a;e[3]!==n.labelKey||e[4]!==r?(a=r(n.labelKey),e[3]=n.labelKey,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==n.tone?(c=B("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",n.tone),e[6]=n.tone,e[7]=c):c=e[7];let d;e[8]!==n.Icon?(d=i.jsx(n.Icon,{size:18}),e[8]=n.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ie,{asChild:!0,children:i.jsx(ze,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let u;e[15]!==n.labelKey||e[16]!==r?(u=r(n.labelKey),e[15]=n.labelKey,e[16]=r,e[17]=u):u=e[17];let h;e[18]!==u?(h=i.jsx(re,{side:"right",children:u}),e[18]=u,e[19]=h):h=e[19];let m;e[20]!==p||e[21]!==h?(m=i.jsxs(oe,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=m):m=e[22];let f;return e[23]!==s||e[24]!==m?(f=i.jsx(le,{active:!0,label:s,children:m}),e[23]=s,e[24]=m,e[25]=f):f=e[25],f}function Bt(){const{org:t}=we();return dt(t.slug),null}function Ft(){const t=L.c(56),e=X(),o=Ie(),{org:r}=we(),{data:n}=Le(),[l,s]=G.useState(!1),a=Me(),{recent:c,forget:d}=ut(r.slug),p=ft(),u=p&&p.projectId===null?p.app:null;let h;t[0]!==u||t[1]!==c?(h=u?[]:c,t[0]=u,t[1]=c,t[2]=h):h=t[2];const m=h,f=n??[],{recent:g,remember:b}=_t();let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=ge.railOrgPrefs(),t[3]=y):y=t[3];const[v,w]=fe(y,Ne),S=se(v),j=G.useSyncExternalStore(It,Lt,Et),{shown:x}=Ot(At(f,S,r.slug),g,r.slug,j,S.pinned);let O;t[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},t[4]=O):O=t[4];const C=Ye(qe(Ze,O)),N=z=>{const{active:H,over:ee}=z;ee&&(ue("org_rail_reordered"),w(ke=>kt(se(ke),x.map(Ht),String(H.id),String(ee.id))))},R=z=>{ue("org_rail_travel");const H=x.some(ee=>ee.slug===z);w(ee=>Rt(se(ee),z)),b(z,H?x.map(Xt):void 0),o({to:"/$org/home",params:{org:z}})},_=!a&&"border-r border-sidebar-border";let A;t[5]!==_?(A=B("flex w-16 shrink-0 flex-col items-center gap-1.5 overflow-y-auto bg-sidebar pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",_),t[5]=_,t[6]=A):A=t[6];let E;t[7]!==e?(E=e("sidebar.rail.ariaLabel"),t[7]=e,t[8]=E):E=t[8];const $=Ue,M=Je,F=Qe,D=x.map(Gt),K=et,W=x.map(z=>i.jsx(Pt,{org:z,active:z.slug===r.slug,pinned:S.pinned.includes(z.slug),onSelect:()=>R(z.slug),onOpenSettings:()=>o({to:"/$org/settings",params:{org:z.slug}}),onTogglePin:()=>w(H=>Nt(se(H),z.slug)),onHide:z.slug===r.slug?void 0:()=>w(H=>Ct(se(H),z.slug))},z.id));let k;t[9]!==F||t[10]!==W||t[11]!==D||t[12]!==K?(k=i.jsx(F,{items:D,strategy:K,children:W}),t[9]=F,t[10]=W,t[11]=D,t[12]=K,t[13]=k):k=t[13];let T;t[14]!==$||t[15]!==N||t[16]!==C||t[17]!==k||t[18]!==M?(T=i.jsx($,{sensors:C,collisionDetection:M,onDragEnd:N,children:k}),t[14]=$,t[15]=N,t[16]=C,t[17]=k,t[18]=M,t[19]=T):T=t[19];let I;t[20]!==r.slug||t[21]!==f||t[22]!==x.length||t[23]!==R?(I=f.length>x.length&&i.jsx(Tt,{orgs:f,currentSlug:r.slug,hiddenCount:f.length-x.length,onSelect:R}),t[20]=r.slug,t[21]=f,t[22]=x.length,t[23]=R,t[24]=I):I=t[24];let P;t[25]!==e?(P=e("sidebar.picker.newOrganization"),t[25]=e,t[26]=P):P=t[26];let ae;t[27]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>s(!0),t[27]=ae):ae=t[27];let ce;t[28]===Symbol.for("react.memo_cache_sentinel")?(ce=i.jsx(rt,{size:18}),t[28]=ce):ce=t[28];let Y;t[29]!==P?(Y=i.jsx(ie,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":P,onClick:ae,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:ce})}),t[29]=P,t[30]=Y):Y=t[30];let q;t[31]!==e?(q=e("sidebar.picker.newOrganization"),t[31]=e,t[32]=q):q=t[32];let U;t[33]!==q?(U=i.jsx(re,{side:"right",children:q}),t[33]=q,t[34]=U):U=t[34];let J;t[35]!==Y||t[36]!==U?(J=i.jsx(le,{active:!1,children:i.jsxs(oe,{children:[Y,U]})}),t[35]=Y,t[36]=U,t[37]=J):J=t[37];let V;t[38]!==r.slug||t[39]!==d||t[40]!==u||t[41]!==p||t[42]!==m?(V=(m.length>0||u)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),m.map(z=>i.jsx(Mt,{entry:z,orgSlug:r.slug,active:p?.app===z.app&&p.projectId===z.projectId,onClose:()=>d(z)},`${z.app}:${z.projectId}`)),u&&i.jsx(Wt,{app:u})]}),t[38]=r.slug,t[39]=d,t[40]=u,t[41]=p,t[42]=m,t[43]=V):V=t[43];let Z;t[44]!==T||t[45]!==I||t[46]!==J||t[47]!==V||t[48]!==A||t[49]!==E?(Z=i.jsxs("div",{className:A,"aria-label":E,children:[T,I,J,V]}),t[44]=T,t[45]=I,t[46]=J,t[47]=V,t[48]=A,t[49]=E,t[50]=Z):Z=t[50];let Q;t[51]!==l?(Q=i.jsx(ct,{open:l,onOpenChange:s}),t[51]=l,t[52]=Q):Q=t[52];let de;return t[53]!==Z||t[54]!==Q?(de=i.jsxs(i.Fragment,{children:[Z,Q]}),t[53]=Z,t[54]=Q,t[55]=de):de=t[55],de}function Gt(t){return t.slug}function Xt(t){return t.slug}function Ht(t){return t.slug}function Yt(){const{state:t,isMobile:e}=xe();return t==="collapsed"&&!e}function qt(t){const e=L.c(15),{width:o,minWidth:r,maxWidth:n,onPointerDown:l,onKeyDown:s,onDoubleClick:a}=t,c=X(),{isMobile:d}=xe(),p=Yt();if(d||p)return null;let u;e[0]!==c?(u=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=u):u=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let m,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={left:"var(--sidebar-width)"},f=i.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 group-focus-visible/resize:bg-ring"}),e[4]=m,e[5]=f):(m=e[4],f=e[5]);let g;return e[6]!==n||e[7]!==r||e[8]!==a||e[9]!==s||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==o?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":u,"aria-valuenow":o,"aria-valuemin":r,"aria-valuemax":n,title:h,tabIndex:0,onPointerDown:l,onKeyDown:s,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:m,children:f}),e[6]=n,e[7]=r,e[8]=a,e[9]=s,e[10]=l,e[11]=u,e[12]=h,e[13]=o,e[14]=g):g=e[14],g}const pe=400,Se=16,Ut="sidebar.width.v2";function Jt(){const t=L.c(14),e=Vt;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=f=>typeof f=="number"?e(f):192,t[0]=o):o=t[0];const[r,n]=fe(Ut,o),l=G.useRef(null);let s;t[1]!==n||t[2]!==r?(s=f=>{f.preventDefault();const g=f.clientX,b=e(r),y=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),v=y?Array.from(y.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const j of v)j.style.transition="none";const w=j=>{const x=e(b+(j.clientX-g));y?.style.setProperty("--sidebar-width",`${x}px`)},S=j=>{const x=e(b+(j.clientX-g));n(x);for(const O of v)O.style.transition="";window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",w),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)},t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s;let c;t[4]!==n?(c=()=>{n(192)},t[4]=n,t[5]=c):c=t[5];const d=c;let p;t[6]!==n||t[7]!==r?(p=f=>{if(f.key==="ArrowLeft")n(e(r-Se));else if(f.key==="ArrowRight")n(e(r+Se));else if(f.key==="Home")n(192);else if(f.key==="End")n(pe);else return;f.preventDefault()},t[6]=n,t[7]=r,t[8]=p):p=t[8];const u=p,h=e(r);let m;return t[9]!==u||t[10]!==a||t[11]!==d||t[12]!==h?(m={width:h,minWidth:192,maxWidth:pe,wrapperRef:l,onStartResize:a,onKeyDownResize:u,resetWidth:d},t[9]=u,t[10]=a,t[11]=d,t[12]=h,t[13]=m):m=t[13],m}function Vt(t){return Math.max(192,Math.min(pe,t))}const Ae=G.createContext(null);function Zt(){const t=G.use(Ae);if(!t)throw new Error("Layout regions require a Layout");return t}function Qt({children:t,notice:e,outsideOrg:o}){const r=He(),[n,l]=fe(ge.sidebarOpen(),!0),s=Jt(),a=Pe();return i.jsx(Ae,{value:{isMobile:r,resize:s},children:i.jsx(De,{open:n,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!o&&i.jsx(Bt,{}),!r&&a&&(o?.rail??!0)&&i.jsx(Ft,{}),i.jsx(Ke,{ref:s.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${s.width}px`,"--sidebar-width-icon":a?"3.25rem":"3.125rem"},children:i.jsx(We,{children:t})})]})]})})})}function es(t){const e=L.c(26),{children:o,renderMobile:r}=t,n=X(),{isMobile:l,resize:s}=Zt(),{openMobile:a,setOpenMobile:c}=xe();if(!l){let g;e[0]!==s.maxWidth||e[1]!==s.minWidth||e[2]!==s.onKeyDownResize||e[3]!==s.onStartResize||e[4]!==s.resetWidth||e[5]!==s.width?(g=i.jsx(qt,{width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth,onPointerDown:s.onStartResize,onKeyDown:s.onKeyDownResize,onDoubleClick:s.resetWidth}),e[0]=s.maxWidth,e[1]=s.minWidth,e[2]=s.onKeyDownResize,e[3]=s.onStartResize,e[4]=s.resetWidth,e[5]=s.width,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==g?(b=i.jsxs(i.Fragment,{children:[o,g]}),e[7]=o,e[8]=g,e[9]=b):b=e[9],b}let d;e[10]!==n?(d=n("layouts.shellControls.navigationTitle"),e[10]=n,e[11]=d):d=e[11];let p;e[12]!==d?(p=i.jsx(Fe,{className:"sr-only",children:d}),e[12]=d,e[13]=p):p=e[13];let u;e[14]!==c?(u=()=>c(!1),e[14]=c,e[15]=u):u=e[15];let h;e[16]!==r||e[17]!==u?(h=r({onClose:u}),e[16]=r,e[17]=u,e[18]=h):h=e[18];let m;e[19]!==p||e[20]!==h?(m=i.jsxs(Ge,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[p,h]}),e[19]=p,e[20]=h,e[21]=m):m=e[21];let f;return e[22]!==a||e[23]!==c||e[24]!==m?(f=i.jsx(Xe,{open:a,onOpenChange:c,children:m}),e[22]=a,e[23]=c,e[24]=m,e[25]=f):f=e[25],f}function ts(t){const e=L.c(3),{children:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"transparent",containerType:"inline-size"},e[0]=r):r=e[0];let n;return e[1]!==o?(n=i.jsx(Be,{className:"flex flex-col min-h-0",style:r,children:i.jsx($e,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o})})}),e[1]=o,e[2]=n):n=e[2],n}const js=Object.assign(Qt,{Sidebar:es,Content:ts});export{bs as I,js as L,be as O,Yt as u};
@@ -1 +1 @@
1
- import{r as n,bz as j,di as R,dj as Ee,dk as ke,dl as Se,aJ as xe,dm as V}from"./index-BK190UFK.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=j(),ne=j(),J=j(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(J);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:J,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),z=m.getAttribute("id");return((g=e.get(z))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],z=le(S,y);r.current.filtered.items.set(g,z),z>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Je(s,P):Ne(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),B(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:J,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),B(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},B(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Be=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},B(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:ze,Item:Pe,Input:Oe,Group:Ve,Separator:Le,Dialog:Be,Empty:Ue,Loading:He});function Je(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function B({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
1
+ import{r as n,bz as j,di as R,dj as Ee,dk as ke,dl as Se,aJ as xe,dm as V}from"./index-BrXBiZn5.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=j(),ne=j(),J=j(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(J);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:J,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),z=m.getAttribute("id");return((g=e.get(z))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],z=le(S,y);r.current.filtered.items.set(g,z),z>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Je(s,P):Ne(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),B(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:J,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),B(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},B(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Be=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},B(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:ze,Item:Pe,Input:Oe,Group:Ve,Separator:Le,Dialog:Be,Empty:Ue,Loading:He});function Je(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function B({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
@@ -1,2 +1,2 @@
1
- import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-BK190UFK.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-Ml4Gozft.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-De4YD-ur.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-DAUPJuuP.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-EhUoXk-S.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-BWcFijHU.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-C97eOt-w.js";import{C as it}from"./collection-search-Dy92VLR3.js";import{u as ct}from"./use-mobile-DEaGyR0R.js";import{u as ut}from"./use-mcp-client-mz_YsdlD.js";import{u as dt,g as ft}from"./use-mcp-prompts-CvB0iFHn.js";import{c as mt,P as pt}from"./usage-stats-Ch0VewCU.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-COBaFE6j.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-BsHnJbjX.js";import{a as Et}from"./use-panel-navigate-Cu-t56cK.js";import{u as wt}from"./thread-intent-Bs__gvfZ.js";import{N as Nt}from"./index-CHzjSYqm.js";import{i as Ct}from"./LinkBroken01-BjccAKPx.js";import{e as Te}from"./agent-icon-RL-ye5ci.js";import{e as Tt}from"./use-decopilot-events-XgFDUcx2.js";import{u as kt}from"./use-deco-credits-DCap0Yml.js";import{F as Pt}from"./feature-paywall-Uqlg3bNA.js";import{i as Dt}from"./AlertCircle-NXgLHgNz.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
1
+ import{a2 as X,o as Be,r as k,j as n,K as W,b8 as ie,c as F,aL as Oe,l as H,H as Ae,b as Z,t as ce,h as ue,s as be,v as ye,q as ve,D as Se,d as je,y as de,aM as Ie,B as Ee}from"./index-BrXBiZn5.js";import{u as we,d as $e,b as Ne,f as Fe,T as He,A as ze,i as Ke,c as qe,j as Ge,k as Ue,p as Qe,L as Ve}from"./chat-context-g_Eua-AQ.js";import{b as Ye}from"./sandbox-url-D3mC8qhT.js";import{a as Je}from"./repository-binding-r55gGNBf.js";import{e as We}from"./backoff-CrEUbyZT.js";import{n as Xe}from"./ArrowUp-Dmyea9G6.js";import{s as Ze,g as Ce,d as et}from"./tool-namespace-D3b3zmJP.js";import{b as se,T as tt,a as st,c as nt}from"./tooltip-G8gY9Kly.js";import{d as rt,b as at,a as ot,D as lt}from"./drawer-Cka0Eku6.js";import{C as it}from"./collection-search-Dbvpgh25.js";import{u as ct}from"./use-mobile-DnMZed-9.js";import{u as ut}from"./use-mcp-client-DSSP1oDc.js";import{u as dt,g as ft}from"./use-mcp-prompts-BJxARCf8.js";import{c as mt,P as pt}from"./usage-stats-rnTJkD9x.js";import{T as ht,d as gt,c as xt,e as bt,H as yt}from"./input-r7BQhqBY.js";import{u as vt,a as St,S as jt,M as fe}from"./pair-CsPV6jek.js";import{a as Et}from"./use-panel-navigate-BJSqjmuU.js";import{u as wt}from"./thread-intent-CxzriSHz.js";import{N as Nt}from"./index-WLhTbYq7.js";import{i as Ct}from"./LinkBroken01-nMXyJXKu.js";import{e as Te}from"./agent-icon-CFZX8pR7.js";import{e as Tt}from"./use-decopilot-events-CpujiQnI.js";import{u as kt}from"./use-deco-credits-m-YLDLrH.js";import{F as Pt}from"./feature-paywall-DchvuB27.js";import{i as Dt}from"./AlertCircle-BF0Ui0Pv.js";function me(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const Rt={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ke=k.createContext(Rt),pe=16384;class _t{data="";append(e){this.data+=e,this.data.length>pe&&(this.data=this.data.slice(this.data.length-pe))}get(){return this.data}clear(){this.data=""}}const Lt=1e3,Mt=3e4,Bt=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],ge="log";function Ot(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function At(t){return t===404}async function It(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Bt)});return await e.body?.cancel().catch(()=>{}),At(e.status)}catch{return!1}}function Ds({virtualMcpId:t,branch:e,previewUrl:r=null,enabled:o=!0,children:s}){const{org:a}=X(),l=Be(),i=we()?.taskId??null,[c,u]=k.useState(null),[d,f]=k.useState({phase:"idle"}),[m,S]=k.useState({state:"running"}),[j,E]=k.useState({kind:"unknown"}),[x,b]=k.useState(!1),[C,y]=k.useState([]),[P,g]=k.useState([]),[,D]=k.useState(0),T=k.useRef(new Map),B=k.useRef(new Set),M=k.useRef(new Set),L=k.useRef(null),_=Ot(r),p=Je(t)?.metadata?.runtime?.selected==="deno",w=v=>{let N=T.current.get(v);return N||(N=new _t,T.current.set(v,N)),N};k.useEffect(()=>{if(u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),L.current=null,b(!1),y([]),g([]),T.current.clear(),!t||!e||!o)return;const v=Ye({orgSlug:a.slug,virtualMcpId:t,branch:e,threadId:i??null},"events");let N=!1,$=0,Y=null,q=null,G=null,K=null,z=null,J=null;const Le=R=>{try{const O=JSON.parse(R.data);u(O),O.kind!=="failed"&&(b(!1),$=0),O.kind==="ready"&&oe()}catch(O){console.warn("[vm-events] bad phase payload",O)}},ne=()=>{b(!0),u(null),f({phase:"idle"}),S({state:"running"}),E({kind:"unknown"}),y([]),g([]),T.current.clear()},re=R=>{try{const O=JSON.parse(R.data);if(typeof O.data!="string")return;$=0;const I=O.data.replace(/\r?\n/g,`\r
2
2
  `);w(O.source).append(I);for(const A of B.current)try{A(O.source,I)}catch{}D(A=>A+1)}catch{}},ae=R=>{const O=R.type;try{const I=JSON.parse(R.data);switch($=0,O){case"lifecycle":{const A=I;f(A.state);const U=`${a.slug}/${t}/${e}`;if(me(A.state.phase)&&!(J&&me(J))){ie(l,a.id);const V=W.decofile(U);l.getQueryData(V)===void 0&&l.invalidateQueries({queryKey:V})}A.state.phase==="running"&&J!=="running"&&(ie(l,a.id),l.invalidateQueries({queryKey:W.decofile(U)}),l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})),J=A.state.phase;const Q=A.state.phase==="running"?A.state.port:null,te=L.current;if(L.current=Q,te!==null&&Q!==null&&te!==Q)for(const V of M.current)try{V()}catch{}return}case"status":S(I);return;case"tasks":{const U=I.active.map(Q=>Q.logName??"").filter(Boolean);g(U);return}case"scripts":y(I.scripts);return;case"branch":{const A=I.meta;E(A);return}case"reload":for(const A of M.current)try{A()}catch{}return;case"file-changed":{const{path:A}=I,U=`${a.slug}/${t}/${e}`;if(A.startsWith(".deco/")||A.includes("/.deco/")){if(!(J==="running"))return;G&&clearTimeout(G),G=setTimeout(()=>{if(G=null,l.invalidateQueries({queryKey:W.decofile(U)}),p)for(const V of M.current)try{V()}catch{}},500)}else q&&clearTimeout(q),q=setTimeout(()=>{q=null,l.invalidateQueries({queryKey:W.liveMeta(a.slug,t,e)})},1e3);return}}}catch{}};function ee(){if(N)return;const R=new EventSource(v);K=R,R.onopen=()=>{},R.onerror=()=>{K===R&&R.readyState===EventSource.CLOSED&&le("studio")},R.addEventListener("phase",Le),R.addEventListener("gone",ne),R.addEventListener(ge,re);for(const O of he)R.addEventListener(O,ae)}function oe(){if(N||!_||z)return;const R=new EventSource(_);z=R;let O=!1;R.onopen=()=>{if(N||z!==R)return;O=!0,$=0;const I=K;K=null,I?.close()},R.onerror=()=>{z===R&&R.readyState===EventSource.CLOSED&&Me(R,O)},R.addEventListener(ge,re);for(const I of he)R.addEventListener(I,ae)}async function Me(R,O){const I=_?await It(_):!1;if(!(N||z!==R)){if(R.close(),z=null,I){ne(),K||ee();return}O&&le("direct")}}function le(R){if(N||Y)return;const O=We(Mt,Lt,$,2,0);$++,Y=setTimeout(()=>{if(Y=null,!N){if(R==="direct"){z?.close(),z=null,oe();return}K?.close(),K=null,ee()}},O)}return ee(),()=>{N=!0,K?.close(),z?.close(),Y&&clearTimeout(Y),q&&clearTimeout(q),G&&clearTimeout(G)}},[t,e,a.slug,a.id,o,i,_,l,p]);const h={phase:c,lifecycle:d,status:m,branch:j,notFound:x,scripts:C,activeProcesses:P,getBuffer:v=>T.current.get(v)?.get()??"",hasData:v=>(T.current.get(v)?.get().length??0)>0,subscribeChunks:v=>(B.current.add(v),()=>{B.current.delete(v)}),subscribeReload:v=>(M.current.add(v),()=>{M.current.delete(v)})};return n.jsx(ke,{value:h,children:s})}function Pe(){return k.use(ke)}function Rs(t){const{subscribeChunks:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e((a,l)=>{r.current?.(a,l)}),[e])}function _s(t){const{subscribeReload:e}=Pe(),r=k.useRef(t);r.current=t,k.useEffect(()=>e(()=>{r.current?.()}),[e])}const xe=3,De="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",$t="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function Re(t){const e=F.c(46),{item:r,onSelect:o,isLoading:s,isDisabled:a,variant:l}=t,i=l===void 0?"pill":l,{prompt:c}=r;let u;if(e[0]!==c._meta||e[1]!==c.name||e[2]!==c.title){const T=Ce(c._meta);u=c.title??et(c.name,T),e[0]=c._meta,e[1]=c.name,e[2]=c.title,e[3]=u}else u=e[3];const d=u,f=c.description||null;if(i==="card"){let T;e[4]!==o||e[5]!==c?(T=()=>o(c),e[4]=o,e[5]=c,e[6]=T):T=e[6];const B=a||s,M=s&&"bg-accent/40",L=(a||s)&&"cursor-not-allowed opacity-50";let _;e[7]!==M||e[8]!==L?(_=H($t,"hover:bg-accent/60 text-foreground",M,L),e[7]=M,e[8]=L,e[9]=_):_=e[9];let p;e[10]!==d?(p=n.jsx("span",{className:"font-medium truncate capitalize",children:d}),e[10]=d,e[11]=p):p=e[11];let w;e[12]!==s?(w=s&&n.jsx(ue,{size:"xs"}),e[12]=s,e[13]=w):w=e[13];let h;e[14]!==p||e[15]!==w?(h=n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,w]}),e[14]=p,e[15]=w,e[16]=h):h=e[16];let v;e[17]!==f?(v=f&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=v):v=e[18];let N;return e[19]!==h||e[20]!==v||e[21]!==T||e[22]!==B||e[23]!==_?(N=n.jsxs("button",{type:"button",onClick:T,disabled:B,className:_,children:[h,v]}),e[19]=h,e[20]=v,e[21]=T,e[22]=B,e[23]=_,e[24]=N):N=e[24],N}let m;e[25]!==o||e[26]!==c?(m=()=>o(c),e[25]=o,e[26]=c,e[27]=m):m=e[27];const S=a||s,j=s&&"bg-muted/50",E=(a||s)&&"cursor-not-allowed opacity-50";let x;e[28]!==j||e[29]!==E?(x=H(De,"hover:bg-muted/70 hover:text-foreground",j,E),e[28]=j,e[29]=E,e[30]=x):x=e[30];let b;e[31]!==d?(b=n.jsx("span",{className:"capitalize",children:d}),e[31]=d,e[32]=b):b=e[32];let C;e[33]!==s?(C=s&&n.jsx(ue,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let y;e[35]!==m||e[36]!==S||e[37]!==x||e[38]!==b||e[39]!==C?(y=n.jsx(tt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:m,disabled:S,className:x,children:[b,C]})}),e[35]=m,e[36]=S,e[37]=x,e[38]=b,e[39]=C,e[40]=y):y=e[40];const P=f??d;let g;e[41]!==P?(g=n.jsx(st,{side:"top",className:"max-w-xs",children:n.jsx("p",{className:"text-xs",children:P})}),e[41]=P,e[42]=g):g=e[42];let D;return e[43]!==y||e[44]!==g?(D=n.jsxs(nt,{delayDuration:400,children:[y,g]}),e[43]=y,e[44]=g,e[45]=D):D=e[45],D}function Ft(t){const e=F.c(61),{items:r,open:o,onOpenChange:s,onSelect:a,loadingPrompt:l}=t,i=Z(),[c,u]=k.useState(""),d=!!l;let f;e[0]!==r||e[1]!==c?(f=c.trim()?r.filter(p=>{const w=c.toLowerCase();return p.prompt.name.toLowerCase().includes(w)||(p.prompt.title??"").toLowerCase().includes(w)||(p.prompt.description??"").toLowerCase().includes(w)}):r,e[0]=r,e[1]=c,e[2]=f):f=e[2];const m=f,S=ct();let j;e[3]!==m.length||e[4]!==c||e[5]!==i?(j=m.length===0&&n.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:i("chat.iceBreakers.noPromptsMatch",{search:c})}),e[3]=m.length,e[4]=c,e[5]=i,e[6]=j):j=e[6];let E;if(e[7]!==m||e[8]!==d||e[9]!==l?.name||e[10]!==s||e[11]!==a){let p;e[13]!==d||e[14]!==l?.name||e[15]!==s||e[16]!==a?(p=w=>n.jsx(Re,{item:w,variant:"card",onSelect:h=>{s(!1),a(h)},isLoading:l?.name===w.prompt.name,isDisabled:d&&l?.name!==w.prompt.name},w.prompt.name),e[13]=d,e[14]=l?.name,e[15]=s,e[16]=a,e[17]=p):p=e[17],E=m.map(p),e[7]=m,e[8]=d,e[9]=l?.name,e[10]=s,e[11]=a,e[12]=E}else E=e[12];let x;e[18]!==j||e[19]!==E?(x=n.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[j,E]})}),e[18]=j,e[19]=E,e[20]=x):x=e[20];const b=x;let C;e[21]!==i?(C=i("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=i,e[22]=C):C=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=p=>{p.key==="Escape"&&u("")},e[23]=y):y=e[23];let P;e[24]!==c||e[25]!==C?(P=n.jsx(it,{value:c,onChange:u,placeholder:C,onKeyDown:y}),e[24]=c,e[25]=C,e[26]=P):P=e[26];const g=P;if(S){let p;e[27]!==i?(p=i("chat.iceBreakers.allPromptsTitle"),e[27]=i,e[28]=p):p=e[28];let w;e[29]!==p?(w=n.jsx(rt,{className:"sr-only",children:n.jsx(at,{children:p})}),e[29]=p,e[30]=w):w=e[30];let h;e[31]!==i?(h=i("chat.iceBreakers.promptsLabel"),e[31]=i,e[32]=h):h=e[32];let v;e[33]!==h?(v=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:h})}),e[33]=h,e[34]=v):v=e[34];let N;e[35]!==b||e[36]!==g||e[37]!==v||e[38]!==w?(N=n.jsxs(ot,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[w,v,g,b]}),e[35]=b,e[36]=g,e[37]=v,e[38]=w,e[39]=N):N=e[39];let $;return e[40]!==s||e[41]!==o||e[42]!==N?($=n.jsx(se,{delayDuration:400,children:n.jsx(lt,{open:o,onOpenChange:s,children:N})}),e[40]=s,e[41]=o,e[42]=N,e[43]=$):$=e[43],$}let D;e[44]!==i?(D=i("chat.iceBreakers.allPromptsTitle"),e[44]=i,e[45]=D):D=e[45];let T;e[46]!==D?(T=n.jsx(be,{className:"sr-only",children:n.jsx(ye,{children:D})}),e[46]=D,e[47]=T):T=e[47];let B;e[48]!==i?(B=i("chat.iceBreakers.promptsLabel"),e[48]=i,e[49]=B):B=e[49];let M;e[50]!==B?(M=n.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:n.jsx("span",{className:"text-sm font-medium text-foreground",children:B})}),e[50]=B,e[51]=M):M=e[51];let L;e[52]!==b||e[53]!==g||e[54]!==M||e[55]!==T?(L=n.jsxs(ve,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[T,M,g,b]}),e[52]=b,e[53]=g,e[54]=M,e[55]=T,e[56]=L):L=e[56];let _;return e[57]!==s||e[58]!==o||e[59]!==L?(_=n.jsx(se,{delayDuration:400,children:n.jsx(Se,{open:o,onOpenChange:s,children:L})}),e[57]=s,e[58]=o,e[59]=L,e[60]=_):_=e[60],_}function Ht(t){const e=F.c(30),{items:r,onSelect:o,loadingPrompt:s,className:a}=t,l=Z(),[i,c]=k.useState(!1);if(r.length===0)return null;let u,d,f,m,S;if(e[0]!==a||e[1]!==r||e[2]!==s||e[3]!==o||e[4]!==l){const b=r.slice(0,xe),C=r.slice(xe),y=!!s;let P;e[10]!==y||e[11]!==s?.name||e[12]!==o?(P=D=>n.jsx(Re,{item:D,onSelect:o,isLoading:s?.name===D.prompt.name,isDisabled:y&&s?.name!==D.prompt.name},D.prompt.name),e[10]=y,e[11]=s?.name,e[12]=o,e[13]=P):P=e[13];const g=b.map(P);u=se,S=400,e[14]!==a?(d=H("w-full flex flex-wrap gap-2 justify-center",a),e[14]=a,e[15]=d):d=e[15],f=g,m=C.length>0&&n.jsx("button",{type:"button",disabled:y,onClick:()=>c(!0),className:H(De,"hover:bg-muted/70 hover:text-foreground",y&&"opacity-50 cursor-not-allowed"),children:l("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=a,e[1]=r,e[2]=s,e[3]=o,e[4]=l,e[5]=u,e[6]=d,e[7]=f,e[8]=m,e[9]=S}else u=e[5],d=e[6],f=e[7],m=e[8],S=e[9];let j;e[16]!==d||e[17]!==f||e[18]!==m?(j=n.jsxs("div",{className:d,children:[f,m]}),e[16]=d,e[17]=f,e[18]=m,e[19]=j):j=e[19];let E;e[20]!==r||e[21]!==s||e[22]!==i||e[23]!==o?(E=n.jsx(Ft,{items:r,open:i,onOpenChange:c,onSelect:o,loadingPrompt:s}),e[20]=r,e[21]=s,e[22]=i,e[23]=o,e[24]=E):E=e[24];let x;return e[25]!==u||e[26]!==S||e[27]!==j||e[28]!==E?(x=n.jsxs(u,{delayDuration:S,children:[j,E]}),e[25]=u,e[26]=S,e[27]=j,e[28]=E,e[29]=x):x=e[29],x}function zt(){return null}function Kt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function qt(t){const e=F.c(31),{connectionId:r}=t,o=Z(),{sendMessage:s}=Ne(),{org:a}=X();let l;e[0]!==r||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:r,orgId:a.id,orgSlug:a.slug},e[0]=r,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const i=ut(l);let c;e[4]!==i?(c={client:i,staleTime:6e4},e[4]=i,e[5]=c):c=e[5];const{data:u}=dt(c);let d;e[6]!==u?.prompts?(d=u?.prompts??[],e[6]=u?.prompts,e[7]=d):d=e[7];const f=d;let m;e[8]!==f?(m=f.map(Gt),e[8]=f,e[9]=m):m=e[9];const S=m;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j={stage:"idle"},e[10]=j):j=e[10];const[E,x]=k.useReducer(Kt,j),[b,C]=k.useState(null);let y;e[11]!==i||e[12]!==s||e[13]!==o?(y=async(h,v)=>{if(!i){ce.error(o("chat.iceBreakers.mcpClientNotAvailable")),x({type:"RESET"});return}try{const N=await ft(i,h.name,v);x({type:"RESET"});const $={type:"doc",content:[{type:"paragraph",content:[mt({id:h.name,name:Ze(h.name,Ce(h._meta)),metadata:N.messages,char:"/",kind:"prompt",args:v}),{type:"text",text:" "}]}]};await s($)}catch(N){console.error("[ice-breakers] Failed to fetch prompt:",N),ce.error(o("chat.iceBreakers.failedToLoadPrompt")),x({type:"RESET"})}},e[11]=i,e[12]=s,e[13]=o,e[14]=y):y=e[14];const P=y;let g;e[15]!==P?(g=async h=>{if(h.arguments&&h.arguments.length>0){x({type:"SELECT_PROMPT",prompt:h}),C(h);return}x({type:"START_LOADING",prompt:h}),await P(h)},e[15]=P,e[16]=g):g=e[16];const D=g;let T;e[17]!==b||e[18]!==P?(T=async h=>{b&&(x({type:"START_LOADING",prompt:b,arguments:h}),C(null),await P(b,h))},e[17]=b,e[18]=P,e[19]=T):T=e[19];const B=T;if(S.length===0)return null;const M=E.stage==="loading"?E.prompt:null;let L;e[20]!==D||e[21]!==S||e[22]!==M?(L=n.jsx(Ht,{items:S,onSelect:D,loadingPrompt:M}),e[20]=D,e[21]=S,e[22]=M,e[23]=L):L=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{C(null),x({type:"RESET"})},e[24]=_):_=e[24];let p;e[25]!==b||e[26]!==B?(p=n.jsx(pt,{prompt:b,setPrompt:_,onSubmit:B}),e[25]=b,e[26]=B,e[27]=p):p=e[27];let w;return e[28]!==L||e[29]!==p?(w=n.jsxs(n.Fragment,{children:[L,p]}),e[28]=L,e[29]=p,e[30]=w):w=e[30],w}function Gt(t){return{prompt:t}}function Ut(t){const e=F.c(13),{className:r}=t,{selectedVirtualMcp:o}=$e(),{org:s}=X();let a;e[0]!==s.id?(a=Oe(s.id),e[0]=s.id,e[1]=a):a=e[1];const l=a.id,i=o?.id??l;let c;e[2]!==r?(c=H("w-full @container",r),e[2]=r,e[3]=c):c=e[3];const u=i??"default";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(zt,{}),e[4]=d):d=e[4];let f;e[5]!==i?(f=n.jsx(qt,{connectionId:i}),e[5]=i,e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==f?(m=n.jsx(Ae,{fallback:null,children:n.jsx(k.Suspense,{fallback:d,children:f},u)}),e[7]=u,e[8]=f,e[9]=m):m=e[9];let S;return e[10]!==c||e[11]!==m?(S=n.jsx("div",{className:c,children:m}),e[10]=c,e[11]=m,e[12]=S):S=e[12],S}function Qt(t){let e=0;for(const r of t)for(const o of r.parts??[]){const s=o;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function Vt(){const t=F.c(8),{openPanel:e}=Et(),r=wt(),o=Fe()?.messages??[],s=we()?.taskId??null;let a;t[0]!==o?(a=Qt(o),t[0]=o,t[1]=a):a=t[1];const l=a,i=k.useRef(null),c=k.useRef(null);let u,d;t[2]!==l||t[3]!==r||t[4]!==e||t[5]!==s?(u=()=>{if(!l||!s)return;const f=`${s}:${l}`;c.current!==f&&(c.current=f,r?.refreshThreadMetadata(s)),i.current!==s&&(i.current=s,e("site-editor"))},d=[l,s,e,r],t[2]=l,t[3]=r,t[4]=e,t[5]=s,t[6]=u,t[7]=d):(u=t[6],d=t[7]),k.useEffect(u,d)}function _e(t){return`deco-credits-empty-dismissed:${t}`}function Ls(t){try{return localStorage.getItem(_e(t))==="1"}catch{return!1}}function Yt(){const t=F.c(56),e=Z(),{org:r}=X(),o=Tt("credits"),s=je(),{decoKeyId:a}=kt(),[l,i]=k.useState(!0);let c;t[0]!==r.id?(c=()=>{de("credits_empty_state_dismissed",{organization_id:r.id}),i(!1);try{localStorage.setItem(_e(r.id),"1")}catch{}},t[0]=r.id,t[1]=c):c=t[1];const u=c;let d,f;if(t[2]!==l||t[3]!==r.id?(d=()=>{l&&de("credits_empty_state_shown",{organization_id:r.id})},f=[l,r.id],t[2]=l,t[3]=r.id,t[4]=d,t[5]=f):(d=t[4],f=t[5]),k.useEffect(d,f),!l)return null;if(!o){let h;t[6]!==e?(h=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=h):h=t[7];let v;t[8]!==h?(v={title:h},t[8]=h,t[9]=v):v=t[9];let N;return t[10]!==u||t[11]!==v?(N=n.jsx(Pt,{feature:"chat",copy:v,onDismiss:u}),t[10]=u,t[11]=v,t[12]=N):N=t[12],N}let m;t[13]!==u?(m=h=>!h&&u(),t[13]=u,t[14]=m):m=t[14];let S;t[15]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=S):S=t[15];let j;t[16]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:n.jsx(Te,{size:20,className:"text-warning"})}),t[16]=j):j=t[16];let E;t[17]!==e?(E=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=E):E=t[18];let x;t[19]!==E?(x=n.jsx(ye,{className:"text-lg font-semibold",children:E}),t[19]=E,t[20]=x):x=t[20];let b;t[21]!==e?(b=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=b):b=t[22];let C;t[23]!==b?(C=n.jsx(Ie,{className:"mt-2 text-[13px] leading-relaxed max-w-[320px] mx-auto",children:b}),t[23]=b,t[24]=C):C=t[24];let y;t[25]!==x||t[26]!==C?(y=n.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[S,n.jsxs(be,{className:"relative gap-3",children:[j,n.jsxs("div",{className:"text-center",children:[x,C]})]})]}),t[25]=x,t[26]=C,t[27]=y):y=t[27];let P;t[28]!==a||t[29]!==u?(P=a&&n.jsx("div",{className:"px-6 pb-5",children:n.jsx(ht,{source:"empty_state",onDone:u})}),t[28]=a,t[29]=u,t[30]=P):P=t[30];let g;t[31]!==u||t[32]!==s||t[33]!==r.slug?(g=()=>{s({to:"/$org/settings/ai-providers",params:{org:r.slug}}),u()},t[31]=u,t[32]=s,t[33]=r.slug,t[34]=g):g=t[34];let D;t[35]!==e?(D=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=D):D=t[36];let T;t[37]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(Ct,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=T):T=t[37];let B;t[38]!==g||t[39]!==D?(B=n.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:g,children:[D,T]}),t[38]=g,t[39]=D,t[40]=B):B=t[40];let M;t[41]!==e?(M=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=M):M=t[42];let L;t[43]!==u||t[44]!==M?(L=n.jsx(Ee,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:u,children:M}),t[43]=u,t[44]=M,t[45]=L):L=t[45];let _;t[46]!==B||t[47]!==L?(_=n.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[B,L]}),t[46]=B,t[47]=L,t[48]=_):_=t[48];let p;t[49]!==y||t[50]!==P||t[51]!==_?(p=n.jsxs(ve,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Jt,children:[y,P,_]}),t[49]=y,t[50]=P,t[51]=_,t[52]=p):p=t[52];let w;return t[53]!==p||t[54]!==m?(w=n.jsx(Se,{open:!0,onOpenChange:m,children:p}),t[53]=p,t[54]=m,t[55]=w):w=t[55],w}function Jt(t){return t.preventDefault()}function Wt(t){const e=F.c(6),{balanceDollars:r}=t;let o;e[0]!==r?(o=r.toFixed(2),e[0]=r,e[1]=o):o=e[1];const s=o;let a,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),l=n.jsx(Te,{size:13,className:"text-success"}),e[2]=a,e[3]=l):(a=e[2],l=e[3]);let i;return e[4]!==s?(i=n.jsxs("div",{className:a,children:[l,n.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=i):i=e[5],i}function Xt(){const t=F.c(8),{org:e}=X(),r=je();let o;t[0]!==r||t[1]!==e.slug?(o=()=>r({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=r,t[1]=e.slug,t[2]=o):o=t[2];let s,a,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=H("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),a=n.jsx(Dt,{size:13,className:"text-warning"}),l=n.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=a,t[5]=l):(s=t[3],a=t[4],l=t[5]);let i;return t[6]!==o?(i=n.jsxs("button",{type:"button",onClick:o,className:s,children:[a,l]}),t[6]=o,t[7]=i):i=t[7],i}function Zt(t){const e=F.c(7),{scrollRef:r,sentinelRef:o,hasMoreOlder:s,isFetchingOlder:a,fetchOlderMessages:l}=t;let i,c;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==o?(i=()=>{const u=o.current,d=r.current;if(!u||!d||!s)return;const f=new IntersectionObserver(async m=>{if(!m[0]?.isIntersecting||a||!s)return;const j=d.scrollHeight,E=d.scrollTop;await l(),requestAnimationFrame(()=>{const x=d.scrollHeight;d.scrollTop=E+(x-j)})},{root:d,rootMargin:"200px 0px 0px 0px"});return f.observe(u),()=>f.disconnect()},c=[r,o,s,a,l],e[0]=l,e[1]=s,e[2]=a,e[3]=r,e[4]=o,e[5]=i,e[6]=c):(i=e[5],c=e[6]),k.useEffect(i,c)}function es(t){const e=F.c(5),{className:r,children:o}=t;let s;e[0]!==r?(s=H("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",r),e[0]=r,e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==s?(a=n.jsx("div",{className:s,children:o}),e[2]=o,e[3]=s,e[4]=a):a=e[4],a}function ts(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-1 min-h-0 overflow-y-auto isolate",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}function ss(t){const e=F.c(2),{children:r}=t;let o;return e[0]!==r?(o=n.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:r}),e[0]=r,e[1]=o):o=e[1],o}function ns(){const t=Z(),{messages:e,status:r,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a,isRunInProgress:l}=Ne(),{taskId:i}=qe();Vt();const c=Ge(i??""),u=Ue(c),d=u.size===0?e:e.filter(g=>!u.has(g.id)),f=Qe(d,r==="submitted"||r==="streaming"||l),m=f.visible,S=vt(m),j=S.at(-1),x=bt()*yt+16,b=k.useRef(null),C=k.useRef(null);Zt({scrollRef:b,sentinelRef:C,hasMoreOlder:o,isFetchingOlder:s,fetchOlderMessages:a});const y=St({initial:!1}),P=g=>{b.current=g,y.scrollRef(g)};return n.jsx(Ve.Provider,{value:f,children:n.jsx(jt,{messages:e,children:n.jsxs("div",{className:"relative h-full w-full min-w-0",children:[n.jsx("div",{ref:P,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:x},children:n.jsxs("div",{ref:y.contentRef,className:"overflow-x-clip",children:[n.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[n.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&n.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),S.slice(0,-1).map((g,D)=>n.jsx(fe,{pair:g,isLastPair:!1,status:D===S.length-1?r:void 0},`pair-${g.user?.id??g.assistant?.id}`))]}),j&&n.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:n.jsx(fe,{pair:j,isLastPair:!0,status:r},`pair-${j.user?.id??j.assistant?.id}`)})]})}),!y.isAtBottom&&n.jsx(Ee,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-md animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:x+8},onClick:()=>{y.scrollToBottom()},children:n.jsx(Xe,{size:14})})]})})})}function rs(t){const e=F.c(5),{children:r,className:o}=t;let s;e[0]!==o?(s=H("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",o),e[0]=o,e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==s?(a=n.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=a):a=e[4],a}const Ms=Object.assign(es,{Main:ts,Messages:ns,EmptyState:ss,Footer:rs,Input:xt,Provider:Ke,ActiveTaskProvider:ze,ThreadlessProvider:He,IceBreakers:Ut,NoAiProviderEmptyState:Nt,CreditsEmptyState:Yt,CreditsEyebrow:Wt,NoCreditsEyebrow:Xt,CreditsExhaustedBanner:gt});export{Ms as C,Ds as S,Rs as a,_s as b,me as i,Pe as u,Ls as w};
@@ -1,4 +1,4 @@
1
- import{c as ue,r as xe,d as ns,a2 as ht,b as Pe,j as t,B as je,t as dt,ah as Wt,a9 as as,K as bt,m as Et,a3 as As,l as it,eW as _s,h as Ks,b1 as Us,L as Vs,u as qs,n as _t,y as Yt,H as Hs,b5 as Bs,J as Js,W as Gs,I as Xt}from"./index-BK190UFK.js";import{S as Qs}from"./search-input-DLOw4tAV.js";import{E as Ht}from"./empty-state-Bl8xm5Rf.js";import{R as Ws}from"./require-capability-C2M-jHnW.js";import{f as js}from"./pair-BsHnJbjX.js";import{u as ts}from"./use-connection-B0oPVblY.js";import{g as Ps}from"./connection-slug-CITJ0kGN.js";import{B as Lt}from"./badge-BUPu9gG1.js";import{P as cs,a as ds,b as ms}from"./popover-B4k9nGiU.js";import{c as Pt,T as Dt,a as Rt,b as Ys}from"./tooltip-BWcFijHU.js";import{a as Ut}from"./Copy01-ERiooqLX.js";import{n as Ns}from"./ZoomOut-CoVzvNw2.js";import{E as us,bF as Xs,Z as Zs}from"./agent-icon-RL-ye5ci.js";import{i as el}from"./Key01-C6u980OH.js";import{i as tl}from"./Play-Ce9aT9v6.js";import{MonacoCodeEditor as bs}from"./monaco-editor-BuEapzg2.js";import{a as sl}from"./use-members-vO4hRjDU.js";import{u as ll}from"./use-mcp-client-mz_YsdlD.js";import{b as rl}from"./repository-binding-De4YD-ur.js";import{n as Ot}from"./LinkBroken01-BjccAKPx.js";import{c as ol}from"./SwitchHorizontal01-BSLmpTlq.js";import{s as il}from"./Plus-QrRV6-c4.js";import{s as nl}from"./Trash01-RwipSHZZ.js";import{M as zt}from"./multi-select-2u1iX52o.js";import{b as yt,a as wt,c as ze,d as St,S as kt}from"./select-BlwJBq6n.js";import{e as ys,T as al}from"./time-range-picker-Z0RBfkV5.js";import{T as cl}from"./textarea-DlGH37X3.js";import{C as Ds}from"./collection-tabs-ByAybjjo.js";import{S as dl}from"./switch-DN2oDjus.js";import{L as ml}from"./label-BunRmshY.js";import{I as Ct}from"./integration-icon-DooAPnA0.js";import{A as fs}from"./avatar-DRy8VbC0.js";import{A as ul,a as fl,b as xl}from"./alert-YkXC9hu2.js";import{K as gt}from"./monitoring-stats-row-CmLdoUBM.js";import{c as Bt}from"./use-decopilot-events-XgFDUcx2.js";import{g as pl,b as ws,f as Nt,c as Zt,d as gl,e as Ss,a as xs,h as hl,i as ps,T as vl,j as jl,r as Nl,k as bl}from"./thread-sheet-body-Dfgibfh6.js";import{u as yl}from"./useSuspenseInfiniteQuery-Ce35mREH.js";import{c as wl,S as Sl,b as Rs,a as Ls}from"./sheet-CNqgDBwb.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-DB2WdQPY.js";import{n as ss,t as ls}from"./ChevronUp-CLw_9Qso.js";import{u as Os,A as kl}from"./automation-runs-ZODGWJTi.js";import{u as Fs}from"./use-infinite-scroll-NSUx4AXY.js";import{u as Cl}from"./useInfiniteQuery-BueIgiQs.js";import{g as Il}from"./task-status-DTDvj1F1.js";import{u as Tl,d as Ml}from"./use-automations-YGFOIQAp.js";import{i as _l}from"./ArrowLeft-BzveMFQj.js";import{E as ks}from"./empty-state-BE81q3WX.js";import{O as $s}from"./watch-sse-pool-C6ByaeA4.js";import{t as Pl}from"./task-key-BCHdFiOO.js";import{a as Dl}from"./format-time-CAj8AQXM.js";import{u as Rl,r as Ll,O as Ol,a as Fl}from"./order-monitor-day-DwD8y3vy.js";import{F as $l}from"./feature-gate-Dsz4eN7W.js";import"./SearchMd-CHpsmgY4.js";import"./access-gate-CbT1o3aQ.js";import"./capability-load-error-OjLyyx3_.js";import"./Tool01--h_pVz4T.js";import"./collapsible-DynWWdZY.js";import"./use-copy-BIgY_WmV.js";import"./usage-stats-Ch0VewCU.js";import"./tool-namespace-EhUoXk-S.js";import"./form-BDu3IeIH.js";import"./utils-CVEq3hMx.js";import"./markdown-Nb1vuip_.js";import"./location-BjlyegC2.js";import"./use-mobile-DEaGyR0R.js";import"./use-panel-navigate-Cu-t56cK.js";import"./thread-route-DS39QkbF.js";import"./use-project-scope-BDEPuYYY.js";import"./chat-context-Ml4Gozft.js";import"./autosend-DA5Ll-0f.js";import"./thread-intent-Bs__gvfZ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-DlCYkQtp.js";import"./use-chat-navigation-ClWioV9i.js";import"./use-organization-settings-HKWihJAK.js";import"./schema-BkghSgU6.js";import"./task-board-CYpXhGQT.js";import"./use-clock-tick-CvejttUf.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DcLA_J0y.js";import"./types-CBrlqewk.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-NXgLHgNz.js";import"./Image01-4n3A8r8Z.js";import"./XClose-BuvBFMv4.js";import"./ShoppingBag01-BcXG1Y02.js";import"./shell-layout-MCnab3JI.js";import"./Building02-BxwY0KPK.js";import"./UserSquare-CX5ecxEr.js";import"./CheckCircle-C6hOGQtb.js";import"./Monitor01-v-JR5BgI.js";import"./command-DD6ok1pX.js";import"./index-C9fKK-wk.js";import"./project-icon-B3mPNSKk.js";import"./new-project-dialog-Co9nzRWA.js";import"./repository-import-picker-D9TcWtSt.js";import"./use-navigate-to-agent-CNix_it6.js";import"./repository-picker-BN6FQay9.js";import"./collection-search-Dy92VLR3.js";import"./use-debounced-value-C1WDkKos.js";import"./required-auth-layout-DxHu4HdO.js";import"./use-org-sso-BFzZVp3h.js";import"./Link01-Dwd4LqmB.js";import"./use-mcp-prompts-CvB0iFHn.js";import"./use-thread-outputs--mNS1DFq.js";import"./file-type-icon-3H7WzHap.js";import"./index-BMw66_nD.js";import"./ArrowUp-DAUPJuuP.js";import"./ChevronSelectorVertical-DgvYFay1.js";import"./CreditCard01-D8jNMQJx.js";import"./DotsVertical-B1h3Jihf.js";import"./Globe04-Bh7J-5IF.js";import"./Sun-D6T_vWjG.js";import"./Upload01-eK2TNPZR.js";import"./User01-N2GTLnCq.js";import"./Users01-CUohNTuz.js";import"./editor-B4jue8QA.js";import"./use-org-auth-client-CXOq5-xT.js";import"./auth-BWnr0_lm.js";import"./checkbox-Dej0a_MZ.js";import"./index-BdQq_4o_.js";import"./scroll-area-EXqRHAMU.js";import"./calendar-D9jTYu0Y.js";import"./chart-BDcb54AI.js";import"./index-BteFHRAl.js";import"./symbol-Br0-VnsN.js";import"./CategoricalChart-CsHWTDmR.js";import"./AreaChart-DmYmrPlt.js";import"./XAxis-BwUVK1FQ.js";import"./tooltipContext-CNWwS6Ia.js";import"./BarChart-Cm_MRilF.js";import"./ActiveShapeUtils-CV3zl1wy.js";import"./Sector-CWzg5EIp.js";import"./ErrorBarContext-BsFuTdlg.js";import"./infiniteQueryObserver-De4bQwNq.js";import"./differenceInSeconds-C3x8sHUj.js";import"./feature-paywall-Uqlg3bNA.js";import"./plan-ladder-DKHYfsUX.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${o}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,o,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:o&&El(o)?o:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as ue,r as xe,d as ns,a2 as ht,b as Pe,j as t,B as je,t as dt,ah as Wt,a9 as as,K as bt,m as Et,a3 as As,l as it,eW as _s,h as Ks,b1 as Us,L as Vs,u as qs,n as _t,y as Yt,H as Hs,b5 as Bs,J as Js,W as Gs,I as Xt}from"./index-BrXBiZn5.js";import{S as Qs}from"./search-input-ClGBBhJ7.js";import{E as Ht}from"./empty-state-CwFmbLsq.js";import{R as Ws}from"./require-capability-CT3TLGEw.js";import{f as js}from"./pair-CsPV6jek.js";import{u as ts}from"./use-connection-BKEWodZb.js";import{g as Ps}from"./connection-slug-CITJ0kGN.js";import{B as Lt}from"./badge-Cxzupfx0.js";import{P as cs,a as ds,b as ms}from"./popover-DwtUmLit.js";import{c as Pt,T as Dt,a as Rt,b as Ys}from"./tooltip-G8gY9Kly.js";import{a as Ut}from"./Copy01-NMmlHrlX.js";import{n as Ns}from"./ZoomOut-D6BrN1hH.js";import{E as us,bF as Xs,Z as Zs}from"./agent-icon-CFZX8pR7.js";import{i as el}from"./Key01-C31u2Eke.js";import{i as tl}from"./Play-BZqogoCw.js";import{MonacoCodeEditor as bs}from"./monaco-editor-CHi3WtH8.js";import{a as sl}from"./use-members-3tEAzKDw.js";import{u as ll}from"./use-mcp-client-DSSP1oDc.js";import{b as rl}from"./repository-binding-r55gGNBf.js";import{n as Ot}from"./LinkBroken01-nMXyJXKu.js";import{c as ol}from"./SwitchHorizontal01-DFtDKKW5.js";import{s as il}from"./Plus-DjDwXc6N.js";import{s as nl}from"./Trash01-Bjr3GAHU.js";import{M as zt}from"./multi-select-3pvlXav0.js";import{b as yt,a as wt,c as ze,d as St,S as kt}from"./select-B2Hnkm4B.js";import{e as ys,T as al}from"./time-range-picker-D0t73aQX.js";import{T as cl}from"./textarea-DmcyokOy.js";import{C as Ds}from"./collection-tabs-BI09XyhI.js";import{S as dl}from"./switch-CS2FoIN2.js";import{L as ml}from"./label-DmL4Uuof.js";import{I as Ct}from"./integration-icon-BB9Dv-nJ.js";import{A as fs}from"./avatar-Cr8xE9qr.js";import{A as ul,a as fl,b as xl}from"./alert-DEIPkOBz.js";import{K as gt}from"./monitoring-stats-row-DMl3HRZi.js";import{c as Bt}from"./use-decopilot-events-CpujiQnI.js";import{g as pl,b as ws,f as Nt,c as Zt,d as gl,e as Ss,a as xs,h as hl,i as ps,T as vl,j as jl,r as Nl,k as bl}from"./thread-sheet-body-CRRp5dne.js";import{u as yl}from"./useSuspenseInfiniteQuery-1bfrxvMY.js";import{c as wl,S as Sl,b as Rs,a as Ls}from"./sheet-BBhhx18B.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-_D2SXrxl.js";import{n as ss,t as ls}from"./ChevronUp-sk3QYx4w.js";import{u as Os,A as kl}from"./automation-runs-B_bJCxFO.js";import{u as Fs}from"./use-infinite-scroll-B02tUFCW.js";import{u as Cl}from"./useInfiniteQuery-CT2fnQjA.js";import{g as Il}from"./task-status-DyMnNCkJ.js";import{u as Tl,d as Ml}from"./use-automations-wNPVrD6L.js";import{i as _l}from"./ArrowLeft-BVlu9Dwz.js";import{E as ks}from"./empty-state-z2SR-Mog.js";import{O as $s}from"./watch-sse-pool-BNEDXIc1.js";import{t as Pl}from"./task-key-BCHdFiOO.js";import{a as Dl}from"./format-time-CAj8AQXM.js";import{u as Rl,r as Ll,O as Ol,a as Fl}from"./order-monitor-day-azJod3uM.js";import{F as $l}from"./feature-gate-B_wXef4W.js";import"./SearchMd-dTBCIA0I.js";import"./access-gate-9z08FPvn.js";import"./capability-load-error-xEbIIOle.js";import"./Tool01-BouMEVqo.js";import"./collapsible-Dzc5nPbl.js";import"./use-copy-CEqxOatu.js";import"./usage-stats-rnTJkD9x.js";import"./tool-namespace-D3b3zmJP.js";import"./form-Bx-6xR5K.js";import"./utils-CVEq3hMx.js";import"./markdown-fTGnhGxY.js";import"./location-BjlyegC2.js";import"./use-mobile-DnMZed-9.js";import"./use-panel-navigate-BJSqjmuU.js";import"./thread-route-pp0AsxjZ.js";import"./use-project-scope-CuRM9scR.js";import"./chat-context-g_Eua-AQ.js";import"./autosend-cTnVaCJn.js";import"./thread-intent-CxzriSHz.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-nflcvkej.js";import"./use-chat-navigation-Ct0wuvGx.js";import"./use-organization-settings-DkqCYAjq.js";import"./schema-flcIEWOM.js";import"./task-board-Bd17qbWq.js";import"./use-clock-tick-CYUj2YN-.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-qwpDp6Qi.js";import"./types-D_cyFCbx.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-BF0Ui0Pv.js";import"./Image01-BNqUbbQC.js";import"./XClose-DOiKf-Eu.js";import"./ShoppingBag01-iwBdEc_G.js";import"./shell-layout-CtvKUqqb.js";import"./Building02-DNBL7z8J.js";import"./UserSquare-BNUksztK.js";import"./CheckCircle-Dk9xz_Bm.js";import"./Monitor01-D3IH3GgG.js";import"./command-Bd9hJorc.js";import"./index-D-fuKePD.js";import"./project-icon-BuRsdswx.js";import"./new-project-dialog-21yLHCn3.js";import"./repository-import-picker-VfSlhahJ.js";import"./use-navigate-to-agent-KM58HZ9S.js";import"./repository-picker-yFk80uej.js";import"./collection-search-Dbvpgh25.js";import"./use-debounced-value-CSstqSOk.js";import"./required-auth-layout-BWb5nKEq.js";import"./use-org-sso-D1Oe6UUb.js";import"./Link01-BHjj2bjq.js";import"./use-mcp-prompts-BJxARCf8.js";import"./use-thread-outputs-D9D4jURz.js";import"./file-type-icon-ryttgYi6.js";import"./index-B0vZKQuD.js";import"./ArrowUp-Dmyea9G6.js";import"./ChevronSelectorVertical-C-NfCkc1.js";import"./CreditCard01-DEWemsgw.js";import"./DotsVertical-CpTUNuJb.js";import"./Globe04-Vnz0t7eg.js";import"./Sun-DHMHnErN.js";import"./Upload01-CQLG0Ul6.js";import"./User01-CK1N7iyP.js";import"./Users01-DEsQIEI5.js";import"./editor-B9Gjc4_u.js";import"./use-org-auth-client-BRnWhfya.js";import"./auth-DP4uSxPI.js";import"./checkbox-BdeH_FyX.js";import"./index-BdQq_4o_.js";import"./scroll-area-CbXr0Grw.js";import"./calendar-DrqH5Cxh.js";import"./chart-CWMR3hGU.js";import"./index-CClwXgvQ.js";import"./symbol-CON1ZOoB.js";import"./CategoricalChart-CJoGBfLe.js";import"./AreaChart-DlzEksfw.js";import"./XAxis-BAiBjBbe.js";import"./tooltipContext-Dxi77IFN.js";import"./BarChart-Das3ttsM.js";import"./ActiveShapeUtils-ooY8r381.js";import"./Sector-PvHckCS_.js";import"./ErrorBarContext-Bl7uyjge.js";import"./infiniteQueryObserver-PVfvYDsq.js";import"./differenceInSeconds-C3x8sHUj.js";import"./feature-paywall-DchvuB27.js";import"./plan-ladder-BY6xWeYj.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${o}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,o,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:o&&El(o)?o:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Cs(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...o]=e.split("=");return{key:l||"",operator:"eq",value:o.join("=")}}if(e.includes("~")){const[l,...o]=e.split("~");return{key:l||"",operator:"contains",value:o.join("~")}}if(e.includes("@")){const[l,...o]=e.split("@");return{key:l||"",operator:"in",value:o.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Kl(s){const e={},l={},o=[],m={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":o.push(n.key);break;case"in":n.value&&(m[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:o.length>0?o:void 0,propertyInValues:Object.keys(m).length>0?m:void 0}}function Is(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const o=l.length;return o<=rs.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:o}:{content:l.slice(0,rs.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{r as l,bx as ce,j as p,bD as _,bC as T,bA as C,bH as le,bw as de,bT as ue,bP as fe,bI as me}from"./index-BK190UFK.js";import{c as Y}from"./index-BdQq_4o_.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[z,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],I]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);K(x,y)}function se(x){K(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function K(x,y,{commit:k}={commit:!1}){const U=_e(c),H=Ce(Math.round((x-n)/c)*c+n,U),A=Y(H,[n,s]);I((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(z.Provider,{scope:e.__scopeSlider,children:p.jsx(z.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&K(n,0,{commit:!0}),onEndKeyDown:()=>!a&&K(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const H=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*H*y;K(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),I=[0,S.width],B=O(I,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const I=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:I?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ke=q,Ae=te,Te=ne,Ve=oe;export{Te as R,Ae as T,Ke as a,Ve as b};
1
+ import{r as l,bx as ce,j as p,bD as _,bC as T,bA as C,bH as le,bw as de,bT as ue,bP as fe,bI as me}from"./index-BrXBiZn5.js";import{c as Y}from"./index-BdQq_4o_.js";var $=["PageUp","PageDown"],X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[z,Se,pe]=le(M),[W]=fe(M,[pe]),[he,V]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],I]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),j=l.useRef(S);function B(x){const y=ye(S,x);K(x,y)}function se(x){K(x,f.current)}function ae(){const x=j.current[f.current];S[f.current]!==x&&d(S)}function K(x,y,{commit:k}={commit:!1}){const U=_e(c),H=Ce(Math.round((x-n)/c)*c+n,U),A=Y(H,[n,s]);I((E=[])=>{const P=xe(E,A,y);if(Ee(P,u*c)){f.current=P.indexOf(A);const F=String(P)!==String(E);return F&&k&&d(P),F?P:E}else return E})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(z.Provider,{scope:e.__scopeSlider,children:p.jsx(z.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(j.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:B,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&K(n,0,{commit:!0}),onEndKeyDown:()=>!a&&K(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const H=$.includes(x.key)||x.shiftKey&&X.includes(x.key)?10:1,A=f.current,E=S[A],P=c*H*y;K(E+P,A,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function D(w){const S=R.current||i.getBoundingClientRect(),I=[0,S.width],B=O(I,f?[o,n]:[n,o]);return R.current=S,B(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=D(w.clientX);r?.(S)},onSlideMove:w=>{const S=D(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const I=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:I?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=V(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):$.concat(X).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=V(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=V(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,D=>b(D)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function De(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function Ee(e,t){if(t>0){const o=De(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ke=q,Ae=te,Te=ne,Ve=oe;export{Te as R,Ae as T,Ke as a,Ve as b};