decocms 4.574.10 → 4.576.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (407) hide show
  1. package/dist/client/assets/{AlertCircle-JrI6GhX-.js → AlertCircle-BoWj3bmI.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BCQgd1R0.js → AreaChart-CayWrMkG.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BY3YUYmg.js → ArrowLeft-BnmiAsgO.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Dbd0DsFj.js → ArrowUp-B1rRBoAl.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-D-__q6zo.js → CartesianChart-CLdJy-tG.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-CGbYI81w.js → CategoricalChart-DIMW48Er.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-Lk0BK653.js → CheckCircle-DqwYeIyi.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-D-Hk_1B6.js → ChevronSelectorVertical-CUAybNrz.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CypYcouh.js → ChevronUp-CjYakPcO.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-D4hEMIBc.js → CreditCard01-B2hFUd9r.js} +1 -1
  11. package/dist/client/assets/{Globe04-BSIf8tfY.js → Globe04-DDVQybOc.js} +1 -1
  12. package/dist/client/assets/{Key01-CCkW71V8.js → Key01-CP_3sF4j.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-dVGcDCd1.js → LinkBroken01-Dz0priKS.js} +1 -1
  14. package/dist/client/assets/{Minus-B6bCcC1a.js → Minus-BUE5BtZS.js} +1 -1
  15. package/dist/client/assets/{Monitor01-B1R4t9_g.js → Monitor01-Bv9vshAO.js} +1 -1
  16. package/dist/client/assets/{Play-nrEhEYaX.js → Play-BZxxVkLQ.js} +1 -1
  17. package/dist/client/assets/{Plus-CXFgI-7S.js → Plus-D9BJQ8Ip.js} +1 -1
  18. package/dist/client/assets/{ReferenceLine-9SV0TNSu.js → ReferenceLine-BGAigOEu.js} +1 -1
  19. package/dist/client/assets/{SearchMd-BgyEwNMN.js → SearchMd-eMVBpMYs.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-C8w58xcy.js → ShoppingBag01-CCbfQ2Ar.js} +1 -1
  21. package/dist/client/assets/{Sun-BbLelrLi.js → Sun-DYx61HHA.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-BKQGE_Gz.js → SwitchHorizontal01-D1J2TI3k.js} +1 -1
  23. package/dist/client/assets/{Tool01-3EDhR0eh.js → Tool01-lye9w7uq.js} +1 -1
  24. package/dist/client/assets/{Tooltip-BvsEJkNR.js → Tooltip-BbDbdtmF.js} +1 -1
  25. package/dist/client/assets/{Trash01-Cc7bOGxh.js → Trash01-BoIu5wHA.js} +1 -1
  26. package/dist/client/assets/{Upload01-CUdaL1MP.js → Upload01-CWarigy8.js} +1 -1
  27. package/dist/client/assets/{UserSquare-CgD5WRTE.js → UserSquare-BbdNewBi.js} +1 -1
  28. package/dist/client/assets/{Users01-D_DratJd.js → Users01-JvVmj0s2.js} +1 -1
  29. package/dist/client/assets/{XClose-Ba9vOcHg.js → XClose-D8nV11Fp.js} +1 -1
  30. package/dist/client/assets/{Zap-CGLJP1Pm.js → Zap-BNFgHEeM.js} +1 -1
  31. package/dist/client/assets/{access-gate-BkmPTKhe.js → access-gate-DMQroDuW.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-CfkDdpLR.js → add-connection-dialog-CumYTqRP.js} +1 -1
  33. package/dist/client/assets/agent-app-yGED1LS1.js +1 -0
  34. package/dist/client/assets/{agent-assets-CMHlV0cw.js → agent-assets-CeYgy5uR.js} +1 -1
  35. package/dist/client/assets/{agent-automation-D1d_SA1s.js → agent-automation-jc1a3Q5g.js} +1 -1
  36. package/dist/client/assets/{agent-automations-0O6U_BaC.js → agent-automations-DcM30lJx.js} +1 -1
  37. package/dist/client/assets/{agent-calendar-B5sssWfz.js → agent-calendar-C42tR2RR.js} +1 -1
  38. package/dist/client/assets/{agent-capabilities-Re3Rcd9U.js → agent-capabilities-Dnf4CKY_.js} +1 -1
  39. package/dist/client/assets/{agent-connect-sources-CEVb5ZQC.js → agent-connect-sources-D-SSC-jg.js} +1 -1
  40. package/dist/client/assets/agent-deck-LUFm8nK5.js +1 -0
  41. package/dist/client/assets/{agent-e2e-DfU5GcgW.js → agent-e2e-JPujhNJE.js} +1 -1
  42. package/dist/client/assets/agent-experiments-CrI0Xt-_.js +1 -0
  43. package/dist/client/assets/{agent-file-tQpTdSLO.js → agent-file-BT_7iBMO.js} +1 -1
  44. package/dist/client/assets/{agent-hosting-BIVmahmR.js → agent-hosting-DmAopBeY.js} +1 -1
  45. package/dist/client/assets/{agent-icon-De2MEsoK.js → agent-icon-CIk0WHPf.js} +1 -1
  46. package/dist/client/assets/agent-library-file-YDJ0zlYR.js +1 -0
  47. package/dist/client/assets/agent-library-wOcEVpTS.js +1 -0
  48. package/dist/client/assets/agent-overview-C4c1_ZnT.js +1 -0
  49. package/dist/client/assets/{agent-releases-C0fMyr3d.js → agent-releases-CVdcqHgm.js} +1 -1
  50. package/dist/client/assets/agent-settings-1nd2TnHk.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-CA2ft33p.js → agent-site-editor-C60bHZn5.js} +1 -1
  52. package/dist/client/assets/agent-site-editor-code-C9o2WiSd.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-B2S2vOuL.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-C_1acQkW.js +1 -0
  55. package/dist/client/assets/agent-view-BRDx54tu.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-DYNxqeX8.js → agent-view-guard-BxQEXEqp.js} +1 -1
  57. package/dist/client/assets/{ai-providers-BCNCtdBa.js → ai-providers-DPzbU011.js} +1 -1
  58. package/dist/client/assets/{alert-uAfMA0iM.js → alert-ZkM0KiHW.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-CNoqcvsB.js → analytics-sections-BeCItG-r.js} +1 -1
  60. package/dist/client/assets/api-keys-BlapvHSK.js +1 -0
  61. package/dist/client/assets/{api-keys-B5T8tqGJ.js → api-keys-CbrkjJrZ.js} +1 -1
  62. package/dist/client/assets/app-editor-D4GBuqRr.js +1 -0
  63. package/dist/client/assets/{asset-utils-JtmKNz_N.js → asset-utils-Bod0b-nj.js} +1 -1
  64. package/dist/client/assets/{auth-eTld9LX2.js → auth-Xuy-VreX.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-Dzg-edmQ.js → auth-catchall-DyHxOUjQ.js} +1 -1
  66. package/dist/client/assets/{auth-entry-BMj8fL-s.js → auth-entry-C3k-_dZK.js} +1 -1
  67. package/dist/client/assets/{auth-split-layout-Cc8hsshw.js → auth-split-layout-BiFyTeQF.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-CIIpordz.js → authenticate-and-persist-oauth-BcT61tas.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-DzzZLBM9.js → automation-list-row-psn1jT8Z.js} +1 -1
  70. package/dist/client/assets/{automation-runs-85Ff33Cw.js → automation-runs-DZMls_iH.js} +1 -1
  71. package/dist/client/assets/{automations-BEURwcUG.js → automations-DPAF2sPr.js} +1 -1
  72. package/dist/client/assets/{autosend-C7zfiAZa.js → autosend-lHRfnZnw.js} +1 -1
  73. package/dist/client/assets/{badge-Dmw39gk8.js → badge-DkZUyuLE.js} +1 -1
  74. package/dist/client/assets/{block-document-BJPvsr5R.js → block-document-lzBLHqet.js} +3 -3
  75. package/dist/client/assets/{blocks-preview-workspace-context-DHCuGpRF.js → blocks-preview-workspace-context-nVzlii3E.js} +1 -1
  76. package/dist/client/assets/{blocks-tab-states-UGg2OTih.js → blocks-tab-states-Bk50Moxc.js} +1 -1
  77. package/dist/client/assets/{blog-schema-BCoxbBJ-.js → blog-schema-_cHri49Q.js} +1 -1
  78. package/dist/client/assets/{buckets-BHmMQmes.js → buckets-xCVkFj72.js} +1 -1
  79. package/dist/client/assets/{build-improve-prompt-doc-CtCZmE42.js → build-improve-prompt-doc-BEqFpLp8.js} +1 -1
  80. package/dist/client/assets/{calendar-lV1do84b.js → calendar-DKdblSlt.js} +1 -1
  81. package/dist/client/assets/{capability-load-error-J4cHUY10.js → capability-load-error-DDwDpZAe.js} +1 -1
  82. package/dist/client/assets/category-editor-h9JRAnwx.js +1 -0
  83. package/dist/client/assets/{chart-CqpI550f.js → chart-CjVr_q9X.js} +1 -1
  84. package/dist/client/assets/{chat-context-CkHIxm7-.js → chat-context-CgzRmLj9.js} +2 -2
  85. package/dist/client/assets/{chat-draft-BiuP1YLO.js → chat-draft-B4UydoTt.js} +1 -1
  86. package/dist/client/assets/{checkbox-CTcmxKf9.js → checkbox-DWK-s7Qb.js} +1 -1
  87. package/dist/client/assets/{choose-editor-BMMl2UBw.js → choose-editor--2LsyfCd.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-DzTdo4Jo.js → cli-auth-success-CND8gpL5.js} +1 -1
  89. package/dist/client/assets/{client-icons-CO1vrTp-.js → client-icons-BaAUNhEJ.js} +1 -1
  90. package/dist/client/assets/cms-settings-editor-lqxcI5Hg.js +1 -0
  91. package/dist/client/assets/{cms-store-drafts-Te00tOIa.js → cms-store-drafts-C58TTepj.js} +1 -1
  92. package/dist/client/assets/{collapsible-Cef981-n.js → collapsible-BDLE2DdR.js} +1 -1
  93. package/dist/client/assets/{collection-detail-CimaYbt8.js → collection-detail-DOAZyoBJ.js} +1 -1
  94. package/dist/client/assets/{collection-display-button-DIAxsEaA.js → collection-display-button-DtSbqGBw.js} +1 -1
  95. package/dist/client/assets/{collection-search-RPq6faeR.js → collection-search-7CuPB6Mj.js} +1 -1
  96. package/dist/client/assets/{collection-table-wrapper-CFc_pRSp.js → collection-table-wrapper-C0bVVs5u.js} +1 -1
  97. package/dist/client/assets/{collection-tabs-DZtyDg8t.js → collection-tabs-BwjOtf-h.js} +1 -1
  98. package/dist/client/assets/{combobox-C7gjhmEU.js → combobox-DQc1zHex.js} +1 -1
  99. package/dist/client/assets/{command-D_vABNVv.js → command-S6wl_N-A.js} +1 -1
  100. package/dist/client/assets/{companion-mcps-section-lJWCKZlX.js → companion-mcps-section-qyqwAzKW.js} +1 -1
  101. package/dist/client/assets/{config-e0Nvtw2Y.js → config-B4N1KvK3.js} +1 -1
  102. package/dist/client/assets/{connect-DZp46x-D.js → connect-C19zSnhk.js} +3 -3
  103. package/dist/client/assets/{connect-layout-DV6kyauB.js → connect-layout-8NYqxlGK.js} +1 -1
  104. package/dist/client/assets/{connect-source-dialog-DePhFcrr.js → connect-source-dialog-DRb46j31.js} +1 -1
  105. package/dist/client/assets/{connection-BvqfkXwo.js → connection-RGsn1zoX.js} +1 -1
  106. package/dist/client/assets/{connection-card-BDFmpEai.js → connection-card-DVOlmkv8.js} +1 -1
  107. package/dist/client/assets/{connection-detail-CAgTUs6Z.js → connection-detail-C3GIijyZ.js} +1 -1
  108. package/dist/client/assets/{connection-form-helpers-EN5T3lTJ.js → connection-form-helpers-EUgEl7Bu.js} +1 -1
  109. package/dist/client/assets/{connection-slug-CfDyadIo.js → connection-slug-DgEoYwIW.js} +1 -1
  110. package/dist/client/assets/{connections-BANTiWC_.js → connections-CL_TB_cb.js} +1 -1
  111. package/dist/client/assets/content-tab-BUefWRPb.js +25 -0
  112. package/dist/client/assets/context-PcxN-Yb3.js +1 -0
  113. package/dist/client/assets/{context-menu-BFsADuow.js → context-menu-CCk675ED.js} +1 -1
  114. package/dist/client/assets/{context-shell-CdL8192k.js → context-shell-Y8UEjYd5.js} +3 -3
  115. package/dist/client/assets/{core.esm-OJgsJB-k.js → core.esm-GtXGAknm.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-DULZI-ch.js → create-organization-dialog-l03VBmUT.js} +1 -1
  117. package/dist/client/assets/{device-hint-B4h7argX.js → device-hint-DdS-9onj.js} +1 -1
  118. package/dist/client/assets/{discover-BJlgFEIL.js → discover-Dc5MvCTM.js} +1 -1
  119. package/dist/client/assets/{domain-settings-CT--UdMT.js → domain-settings-DhDqArit.js} +1 -1
  120. package/dist/client/assets/{drawer-B-H4hfQm.js → drawer-CeL3iOe9.js} +1 -1
  121. package/dist/client/assets/{editor-CsGz7SqJ.js → editor-DI-SD6st.js} +1 -1
  122. package/dist/client/assets/{editor-classes-_nt7TZ0L.js → editor-classes-rz90F5QL.js} +1 -1
  123. package/dist/client/assets/{empty-state-BMJVmWPT.js → empty-state-BzJZeJ1_.js} +1 -1
  124. package/dist/client/assets/{empty-state-B9Q-olZe.js → empty-state-CPXu2SjZ.js} +1 -1
  125. package/dist/client/assets/{experiments-tab-choice-rmEY3th7.js → experiments-tab-choice-BFkdJ9rD.js} +1 -1
  126. package/dist/client/assets/{extract-connection-data-CWUwzdyr.js → extract-connection-data-BiC-GhNR.js} +1 -1
  127. package/dist/client/assets/{feature-gate-Cd7EozQO.js → feature-gate-CCAJFbdi.js} +1 -1
  128. package/dist/client/assets/{feature-paywall-XlPt677B.js → feature-paywall-msT8ZMne.js} +1 -1
  129. package/dist/client/assets/{file-explorer-BOVoci0C.js → file-explorer-E9lr9dLc.js} +1 -1
  130. package/dist/client/assets/{file-preview-DMLj4MCU.js → file-preview-D5yUv2iw.js} +1 -1
  131. package/dist/client/assets/{file-share-button-CvkBxFom.js → file-share-button-DM_8wEfN.js} +2 -2
  132. package/dist/client/assets/{file-type-icon-g9-x3_cf.js → file-type-icon-BvWm1zTi.js} +1 -1
  133. package/dist/client/assets/{folder-icon-CA-yyvjC.js → folder-icon-Ba-oFD1p.js} +1 -1
  134. package/dist/client/assets/{form-D9ocAu49.js → form-L-VC2P7Q.js} +1 -1
  135. package/dist/client/assets/{general-BVROjYSK.js → general-BWnZfXcy.js} +1 -1
  136. package/dist/client/assets/{github-icon-BuHFJx0u.js → github-icon-B6p2n-Kl.js} +1 -1
  137. package/dist/client/assets/{home-CZO-BAxK.js → home-CwRSX6s5.js} +1 -1
  138. package/dist/client/assets/{home-overview-Dgo7cAUD.js → home-overview-C4tikkR5.js} +1 -1
  139. package/dist/client/assets/{hosted-reconcile-CiKTWXGS.js → hosted-reconcile-BDgHjLi6.js} +1 -1
  140. package/dist/client/assets/{icon-button-cmhhff3C.js → icon-button-B0NgHaBw.js} +1 -1
  141. package/dist/client/assets/{index-DIv66EvA.js → index-4il9ZN1V.js} +1 -1
  142. package/dist/client/assets/index-69S-cBsb.css +1 -0
  143. package/dist/client/assets/{index-Xu3sMDdX.js → index-BLztRQYt.js} +3 -3
  144. package/dist/client/assets/index-BM4aqxou.js +69 -0
  145. package/dist/client/assets/{index-B2f89yTC.js → index-BwRnmN3X.js} +1 -1
  146. package/dist/client/assets/{index-CpKrWBFM.js → index-C5rKbfQX.js} +37 -37
  147. package/dist/client/assets/{index-BWVe-okg.js → index-CBDkPY2u.js} +1 -1
  148. package/dist/client/assets/{index-CCr5d-bq.js → index-CbNS-lqc.js} +1 -1
  149. package/dist/client/assets/index-DAw2iB-r.js +1 -0
  150. package/dist/client/assets/{index-BvcpEDRp.js → index-DEjhS3On.js} +1 -1
  151. package/dist/client/assets/index-DdsVIe4X.js +15 -0
  152. package/dist/client/assets/{index-BgS_wSN7.js → index-DpapZCOM.js} +1 -1
  153. package/dist/client/assets/{index-CERqFrvp.js → index-DzDxrfRc.js} +1 -1
  154. package/dist/client/assets/{index-BH-yAxyT.js → index-G9etLsCu.js} +1 -1
  155. package/dist/client/assets/{index-BqpQ0Oz6.js → index-Kdb8LYBY.js} +1 -1
  156. package/dist/client/assets/{index-DYOJSKNv.js → index-LAMXRZBI.js} +1 -1
  157. package/dist/client/assets/{index-Cu0X1Ryu.js → index-LtcFVDl-.js} +1 -1
  158. package/dist/client/assets/{index-DfCff2zl.js → index-htBIzPBo.js} +1 -1
  159. package/dist/client/assets/{index-redirect-3g0WbUIU.js → index-redirect-D65M4lKT.js} +1 -1
  160. package/dist/client/assets/{infiniteQueryObserver-DB_1TZXQ.js → infiniteQueryObserver-YWHwwvoP.js} +1 -1
  161. package/dist/client/assets/{infra-billing-BkNwG0At.js → infra-billing-Xxb1Bh-S.js} +1 -1
  162. package/dist/client/assets/{input-CetABZ1t.js → input-BlK3U8US.js} +1 -1
  163. package/dist/client/assets/{input-BFegQsoJ.js → input-D27vv69n.js} +3 -3
  164. package/dist/client/assets/{integration-icon-B40Wh7Yg.js → integration-icon-Bsx-3jGF.js} +1 -1
  165. package/dist/client/assets/{jira-icon-DRT1LjUg.js → jira-icon-D4OqjMM1.js} +1 -1
  166. package/dist/client/assets/{label-BfDWtWVd.js → label-ClvjBErg.js} +1 -1
  167. package/dist/client/assets/{layout-D6GIbXPf.js → layout-dHNilPeS.js} +1 -1
  168. package/dist/client/assets/{legacy-admin-welcome-dialog-CWnygl8t.js → legacy-admin-welcome-dialog-BWjZM5AD.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-BON-Uap3.js → legacy-agents-deep-Cp7T1hMb.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-7K4gzdWJ.js → legacy-main-redirect-D2VmYkks.js} +1 -1
  171. package/dist/client/assets/{library-tab-cPvE59qy.js → library-tab-xCweoCmU.js} +1 -1
  172. package/dist/client/assets/library-x_PzwwCZ.js +1 -0
  173. package/dist/client/assets/{login-B1LerdGj.js → login-UoVVABWK.js} +1 -1
  174. package/dist/client/assets/{markdown-76gpdRfx.js → markdown-BdJYipZI.js} +7 -7
  175. package/dist/client/assets/{mcp-app-renderer-D2ApozFH.js → mcp-app-renderer-D5FAR8Ib.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-Ciaq70yo.js → mcp-oauth-DRARiFN2.js} +1 -1
  177. package/dist/client/assets/{mcp-oauth-Cv9nCTWQ.js → mcp-oauth-t279DpyZ.js} +1 -1
  178. package/dist/client/assets/{members-DhpI2yjO.js → members-DbmfOPrk.js} +1 -1
  179. package/dist/client/assets/{memory-C2cklx-U.js → memory-Bhu-z5Pk.js} +1 -1
  180. package/dist/client/assets/{mock-board-DMtyKhZF.js → mock-board-C3_eVd32.js} +3 -3
  181. package/dist/client/assets/{monaco-editor-B1sfLlbf.js → monaco-editor-BDOHWgUD.js} +1 -1
  182. package/dist/client/assets/{monitoring-Cko11Af4.js → monitoring-ovrO5sTD.js} +1 -1
  183. package/dist/client/assets/{monitoring-stats-row-CNgZcKxB.js → monitoring-stats-row-DH7xohBl.js} +1 -1
  184. package/dist/client/assets/{multi-select-C403rRdD.js → multi-select-R2NOj_5y.js} +1 -1
  185. package/dist/client/assets/{mustache-e4HtHwg-.js → mustache-D5PfsUhz.js} +3 -3
  186. package/dist/client/assets/{named-rule-view-Cc1641XV.js → named-rule-view-Djrur4H7.js} +1 -1
  187. package/dist/client/assets/{new-project-dialog-CBKXLl_5.js → new-project-dialog-2FiQJTVA.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-B-w7X7CW.js → oauth-callback-DUowyC76.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-BAYGboHu.js → oauth-callback-ai-provider-C1tRdwHi.js} +1 -1
  190. package/dist/client/assets/{oauth-consent-CoxfO_xS.js → oauth-consent-BVvs4mEw.js} +1 -1
  191. package/dist/client/assets/{onboarding-7GiDV_a-.js → onboarding-BCTjaPZ_.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-CWwnbl62.js → openai-conversation-D1PUy-BO.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-BktmZYTP.js → optimistic-project-sidebar-views-Bh3ICpY8.js} +1 -1
  194. package/dist/client/assets/{order-monitor-day-DCrwQKXh.js → order-monitor-day-DqdyBwnN.js} +1 -1
  195. package/dist/client/assets/{organization-choice--RCqz3ju.js → organization-choice-ZuFXzhnR.js} +1 -1
  196. package/dist/client/assets/{orgs-tCNrRFKw.js → orgs-9UW_iExW.js} +1 -1
  197. package/dist/client/assets/{own-accounts-section-ChZriIwH.js → own-accounts-section-isSB-FSp.js} +1 -1
  198. package/dist/client/assets/{pair-tmC6PpOp.js → pair-CElz1KSY.js} +7 -7
  199. package/dist/client/assets/parse-sections--hSYduXv.js +20 -0
  200. package/dist/client/assets/plan-D63C_MPU.js +1 -0
  201. package/dist/client/assets/{plan-ladder-DK7Z5wEN.js → plan-ladder-NpTeU9-u.js} +1 -1
  202. package/dist/client/assets/{plan-usage-card-DHkPqm05.js → plan-usage-card-DEXJyMAS.js} +1 -1
  203. package/dist/client/assets/{popover-DsnoY7gE.js → popover-CqBUgUd4.js} +1 -1
  204. package/dist/client/assets/post-calendar-B31lbJWM.js +1 -0
  205. package/dist/client/assets/post-editor-BpfbNo9B.js +2 -0
  206. package/dist/client/assets/{preview-content-W28O7oBF.js → preview-content-BhYb-Vka.js} +1 -1
  207. package/dist/client/assets/{preview-dialog-DS-Ukev2.js → preview-dialog-Cn9E_1ja.js} +1 -1
  208. package/dist/client/assets/{preview-panel-CtHwojzA.js → preview-panel-CnPb4vzV.js} +1 -1
  209. package/dist/client/assets/{preview-tab-B7WKX_jB.js → preview-tab-BPXubm1u.js} +3 -3
  210. package/dist/client/assets/{product-picker-dialog-DbnA1q8B.js → product-picker-dialog-Ln-fortG.js} +1 -1
  211. package/dist/client/assets/{profile-6j9OcP2L.js → profile-DWNOXniN.js} +1 -1
  212. package/dist/client/assets/{project-app-view-TULDeLlR.js → project-app-view-DWRWpiiK.js} +1 -1
  213. package/dist/client/assets/{project-apps-B8XrqASg.js → project-apps-CZSvF64d.js} +1 -1
  214. package/dist/client/assets/{project-icon-SG6bYAhL.js → project-icon-C4lVIM96.js} +1 -1
  215. package/dist/client/assets/{project-index-CKqx4tH5.js → project-index-x-ZOZ8Mf.js} +1 -1
  216. package/dist/client/assets/project-reports-Co8V8gK_.js +1 -0
  217. package/dist/client/assets/project-tasks-BZllmGjR.js +1 -0
  218. package/dist/client/assets/{projects-ZPSZzS-2.js → projects-BsM1ITvC.js} +1 -1
  219. package/dist/client/assets/{projects-empty-state-D0MMQ8sq.js → projects-empty-state-sTtuIh4q.js} +1 -1
  220. package/dist/client/assets/{prompts-9qkglIAd.js → prompts-dgUfCSOB.js} +1 -1
  221. package/dist/client/assets/record-editor-mwl6n7Or.js +1 -0
  222. package/dist/client/assets/redirect-editor-D-2T4F71.js +1 -0
  223. package/dist/client/assets/reports-BcYIlq-E.js +1 -0
  224. package/dist/client/assets/{reports-DCT8OLXu.js → reports-Cq6UP-zD.js} +1 -1
  225. package/dist/client/assets/{reports-onboarding-Co5Q5X1T.js → reports-onboarding-Cw1ES_fk.js} +1 -1
  226. package/dist/client/assets/{reports-tab-CUX0tKBD.js → reports-tab-BXxSmfY-.js} +2 -2
  227. package/dist/client/assets/repositories-DpxY5Srs.js +1 -0
  228. package/dist/client/assets/{repositories-BN38EwkA.js → repositories-zLGliE0C.js} +1 -1
  229. package/dist/client/assets/{repository-binding-FcrTKkLc.js → repository-binding-DUEv5f7z.js} +1 -1
  230. package/dist/client/assets/{repository-picker-uDInunvt.js → repository-picker-LEy-d9M8.js} +1 -1
  231. package/dist/client/assets/{require-capability-CLtIqMdo.js → require-capability-BFJscvRg.js} +1 -1
  232. package/dist/client/assets/{required-auth-layout-DYY0v5vc.js → required-auth-layout-CS2LsSXS.js} +1 -1
  233. package/dist/client/assets/{reset-password-DXzM6d6N.js → reset-password-CLJvl3-M.js} +1 -1
  234. package/dist/client/assets/{resizable-Cwvumcp8.js → resizable-BTzOABh_.js} +1 -1
  235. package/dist/client/assets/{resolve-tab-icon-CpKqYylc.js → resolve-tab-icon-Cx12hCTF.js} +1 -1
  236. package/dist/client/assets/{review-settings-DhXUecFY.js → review-settings-K73MViBj.js} +1 -1
  237. package/dist/client/assets/{role-color-Bmggoorj.js → role-color-wtFF9FyO.js} +1 -1
  238. package/dist/client/assets/{roles-CDov6Epa.js → roles-lA_VDVLq.js} +1 -1
  239. package/dist/client/assets/route-Ar-PaeSg.js +1 -0
  240. package/dist/client/assets/route-Db3DsYPk.js +1 -0
  241. package/dist/client/assets/{route-ByenP2AC.js → route-DvsMi8Up.js} +1 -1
  242. package/dist/client/assets/{sandbox-lifecycle-context-CWyZPDgB.js → sandbox-lifecycle-context-DDRNmIrA.js} +1 -1
  243. package/dist/client/assets/{schema-BzPNqisL.js → schema-BVevzILm.js} +1 -1
  244. package/dist/client/assets/{schema-BtgOmeu0.js → schema-X_RDdg-y.js} +1 -1
  245. package/dist/client/assets/{scroll-area-BetFFhjH.js → scroll-area-DKlcsV7g.js} +1 -1
  246. package/dist/client/assets/{search-input-B143wE4b.js → search-input-Dp__IM9S.js} +1 -1
  247. package/dist/client/assets/{search-toggle-B60V5fY3.js → search-toggle-CBmuZ2WE.js} +1 -1
  248. package/dist/client/assets/{secret-picker-0dwjcuZ2.js → secret-picker-DhQoz4cP.js} +1 -1
  249. package/dist/client/assets/{secrets-CaFiB2gJ.js → secrets-ClQzoiri.js} +1 -1
  250. package/dist/client/assets/{section-array-field-BGVc7GN5.js → section-array-field-BJlTuDJ0.js} +1 -1
  251. package/dist/client/assets/{sections-7hWvDZxF.js → sections-DawDKX-z.js} +1 -1
  252. package/dist/client/assets/{sections-editor-DV62ul9c.js → sections-editor-DxtomCA1.js} +1 -1
  253. package/dist/client/assets/{select-CynqC93H.js → select-CyUEqwIm.js} +1 -1
  254. package/dist/client/assets/{select-model-pbBNqCJO.js → select-model-BzSnEGgg.js} +1 -1
  255. package/dist/client/assets/{seo-editor-D_-BHzsC.js → seo-editor-3ngDHo5h.js} +1 -1
  256. package/dist/client/assets/{separator-BstUCndM.js → separator-CmzlIaEc.js} +1 -1
  257. package/dist/client/assets/settings-tab-BqZqehcR.js +1 -0
  258. package/dist/client/assets/{sheet-DRzohuTq.js → sheet-IIyyroSY.js} +1 -1
  259. package/dist/client/assets/{shell-layout-yWlnACBx.js → shell-layout-B3OvMhlE.js} +1 -1
  260. package/dist/client/assets/{site-draft-actions-CezwaYzG.js → site-draft-actions-DrqlFBor.js} +1 -1
  261. package/dist/client/assets/{site-draft-view-D3ax_gON.js → site-draft-view-D-ELfHPh.js} +1 -1
  262. package/dist/client/assets/site-editor-DLyKSqN3.js +1 -0
  263. package/dist/client/assets/{site-editor-toast-BzBdZBKk.js → site-editor-toast-DENHUiCT.js} +1 -1
  264. package/dist/client/assets/{skills-BVynzZAe.js → skills-B8RU12dT.js} +1 -1
  265. package/dist/client/assets/{slider-CVqkGq0u.js → slider-BepoHGY5.js} +1 -1
  266. package/dist/client/assets/{sortable.esm-CLb-zEUc.js → sortable.esm-BrSOrmKx.js} +1 -1
  267. package/dist/client/assets/{sso-D3L3bPHO.js → sso-BulaOiW_.js} +1 -1
  268. package/dist/client/assets/{suggestion-ZPwpaecb.js → suggestion-YqRrGHMj.js} +2 -2
  269. package/dist/client/assets/{super-agent-icon-CYwYFCF-.js → super-agent-icon-x69TX2ms.js} +1 -1
  270. package/dist/client/assets/{switch-DVFRbC37.js → switch-orhYNiag.js} +1 -1
  271. package/dist/client/assets/{synced-repos-CvJMz8IM.js → synced-repos-DGyWZrAj.js} +1 -1
  272. package/dist/client/assets/{tab-icon-glyph-CSVQlnge.js → tab-icon-glyph-BGRWjUyB.js} +1 -1
  273. package/dist/client/assets/{table-B7g6T_zR.js → table-CbTKxzQy.js} +1 -1
  274. package/dist/client/assets/{tabs-_i5AcyEU.js → tabs-DtSLfZo2.js} +1 -1
  275. package/dist/client/assets/{task-board-CwSJI_Nh.js → task-board-BRiMfa1H.js} +1 -1
  276. package/dist/client/assets/{task-route-DHnjMT6H.js → task-route-Ct1ewCdc.js} +1 -1
  277. package/dist/client/assets/{task-status-CoCBESax.js → task-status-CNp27qEf.js} +1 -1
  278. package/dist/client/assets/{taskboard-analytics-CkN-nZww.js → taskboard-analytics-BzQaMsBY.js} +1 -1
  279. package/dist/client/assets/{tasks-CvuI8Qsn.js → tasks-Pj9yL7A8.js} +1 -1
  280. package/dist/client/assets/tasks-wdjdAvFr.js +1 -0
  281. package/dist/client/assets/{textarea-BJYFhWH0.js → textarea-209m9vBn.js} +1 -1
  282. package/dist/client/assets/{thread-analytics-CDKp0-KR.js → thread-analytics-D53Jdel6.js} +1 -1
  283. package/dist/client/assets/{thread-intent-CaOco8G4.js → thread-intent-WcxoFFz-.js} +1 -1
  284. package/dist/client/assets/{thread-route-J75JIOlK.js → thread-route--T7U_PM9.js} +1 -1
  285. package/dist/client/assets/{thread-route-Ddday1Ur.js → thread-route-DPSPrt7d.js} +1 -1
  286. package/dist/client/assets/{thread-sheet-body-BRKc6pTX.js → thread-sheet-body-DND-PwQV.js} +1 -1
  287. package/dist/client/assets/{time-range-picker-DFFd7aW8.js → time-range-picker-DfNJN-OE.js} +1 -1
  288. package/dist/client/assets/{toggle-group-u9Wi3ddU.js → toggle-group-DM_BOhW0.js} +1 -1
  289. package/dist/client/assets/{tool-namespace-MYfklNim.js → tool-namespace-C59qlTVf.js} +1 -1
  290. package/dist/client/assets/{tool-set-selector-ByaGzWxc.js → tool-set-selector-DgrOma0D.js} +1 -1
  291. package/dist/client/assets/{toolbar-icon-button-DWFGDofy.js → toolbar-icon-button-CJQ4RpgO.js} +1 -1
  292. package/dist/client/assets/{tooltip-BN1ul0v0.js → tooltip-DfoRFUTt.js} +1 -1
  293. package/dist/client/assets/{tooltipContext-DYJdhWXE.js → tooltipContext-DkEG8PKQ.js} +1 -1
  294. package/dist/client/assets/{track-BvwOMvDA.js → track-nzJv4YA6.js} +1 -1
  295. package/dist/client/assets/{types-CZmkZk5S.js → types-Cgo3CFt9.js} +1 -1
  296. package/dist/client/assets/{url-slug-yKaykGVx.js → url-slug-D5Ql5NBy.js} +1 -1
  297. package/dist/client/assets/{usage-stats-B-U2im7t.js → usage-stats-D1pQya7R.js} +32 -32
  298. package/dist/client/assets/{use-ai-providers-DMerS0dR.js → use-ai-providers-FchZM1mi.js} +1 -1
  299. package/dist/client/assets/{use-apply-named-rule-B_pcj1fJ.js → use-apply-named-rule-CFJrM0f2.js} +1 -1
  300. package/dist/client/assets/use-ask-in-chat-CdLHTgVd.js +1 -0
  301. package/dist/client/assets/{use-automations-CotbuTIN.js → use-automations-CarYUcnW.js} +1 -1
  302. package/dist/client/assets/{use-autosave-BMHCMWOG.js → use-autosave-Csria5RZ.js} +1 -1
  303. package/dist/client/assets/use-blocks-v8-project-B0q_oYPf.js +1 -0
  304. package/dist/client/assets/{use-chat-layout-state-CKlzZSFB.js → use-chat-layout-state-BqEltHtu.js} +1 -1
  305. package/dist/client/assets/{use-cms-publish-actions-B18WgFwx.js → use-cms-publish-actions-DPRkhh6_.js} +1 -1
  306. package/dist/client/assets/{use-connect-companion-CP2lbL5p.js → use-connect-companion-BhmBql_v.js} +1 -1
  307. package/dist/client/assets/{use-connection-Yeg3sQ-l.js → use-connection-VuRKL2Wi.js} +1 -1
  308. package/dist/client/assets/{use-content-sync-DEW9pHRa.js → use-content-sync-CGHzShO7.js} +1 -1
  309. package/dist/client/assets/{use-copy-m2oUJF7G.js → use-copy-0cdTfCyw.js} +1 -1
  310. package/dist/client/assets/{use-date-fns-locale-7jMzA5l2.js → use-date-fns-locale-CaSBMCYV.js} +1 -1
  311. package/dist/client/assets/{use-debounced-autosave-C-UsjeaV.js → use-debounced-autosave-B_FG-Ld6.js} +1 -1
  312. package/dist/client/assets/{use-debounced-value-BlVaTHev.js → use-debounced-value-Dx--8iDQ.js} +1 -1
  313. package/dist/client/assets/{use-deco-credits-BvPiIPxy.js → use-deco-credits-CakmKLVf.js} +1 -1
  314. package/dist/client/assets/{use-decopilot-events-B0PBK1Av.js → use-decopilot-events-YhVenol5.js} +1 -1
  315. package/dist/client/assets/{use-delete-connection-DExrJh9G.js → use-delete-connection-CuVqc_g7.js} +1 -1
  316. package/dist/client/assets/{use-deployment-admin-CRigQkc2.js → use-deployment-admin-DQEDNV2B.js} +1 -1
  317. package/dist/client/assets/{use-entitlements-Bn1lpTMW.js → use-entitlements-D_MPAaiQ.js} +1 -1
  318. package/dist/client/assets/{use-fast-preview-draft-url-kLM5HS2Q.js → use-fast-preview-draft-url-Bh1bJ8Tn.js} +1 -1
  319. package/dist/client/assets/{use-file-configs-D7MvTYxK.js → use-file-configs-CXBJCroM.js} +1 -1
  320. package/dist/client/assets/{use-id-selection-BA3JsAi6.js → use-id-selection-BtSilIwG.js} +1 -1
  321. package/dist/client/assets/{use-inbox-feed-DwHoJq6j.js → use-inbox-feed-BPWzxstR.js} +1 -1
  322. package/dist/client/assets/{use-infinite-scroll-C87qe8Wa.js → use-infinite-scroll-B6u7Pc2_.js} +1 -1
  323. package/dist/client/assets/{use-join-requests-qfP8I5hc.js → use-join-requests-BPXOtsdm.js} +1 -1
  324. package/dist/client/assets/{use-main-panel-tabs-CPwSHrEE.js → use-main-panel-tabs-D5rq6cfQ.js} +1 -1
  325. package/dist/client/assets/{use-mcp-auth-status-BqFL1hj_.js → use-mcp-auth-status-DgRTk282.js} +1 -1
  326. package/dist/client/assets/{use-mcp-client-sJ5tYuZ0.js → use-mcp-client-CS5CWOuF.js} +1 -1
  327. package/dist/client/assets/{use-mcp-prompts-CLTd7fVx.js → use-mcp-prompts-CCE8Fbv3.js} +1 -1
  328. package/dist/client/assets/{use-mcp-tools-Ds_pRYTC.js → use-mcp-tools-BxzPGngG.js} +1 -1
  329. package/dist/client/assets/{use-mobile-Ca0mzlkS.js → use-mobile-BRC3jJYG.js} +1 -1
  330. package/dist/client/assets/{use-move-blocks-C4yvAsmR.js → use-move-blocks-CVmWlpJu.js} +1 -1
  331. package/dist/client/assets/{use-navigate-to-agent-Cxr48619.js → use-navigate-to-agent-DeqGja5R.js} +1 -1
  332. package/dist/client/assets/{use-org-fs-noLXcqcI.js → use-org-fs-BR5xSOAD.js} +1 -1
  333. package/dist/client/assets/{use-org-repo-syncs-PTxVSrm9.js → use-org-repo-syncs-992WvYkT.js} +1 -1
  334. package/dist/client/assets/{use-org-sso-29QrT10j.js → use-org-sso-CW-nSjRe.js} +1 -1
  335. package/dist/client/assets/{use-organization-settings-DEeoFtSz.js → use-organization-settings-CFMK78d5.js} +1 -1
  336. package/dist/client/assets/use-project-native-view-presence-BkX9SQu7.js +1 -0
  337. package/dist/client/assets/{use-project-scope-BXftze_e.js → use-project-scope-BytjCxz5.js} +1 -1
  338. package/dist/client/assets/{use-recent-apps-CIrhZcWD.js → use-recent-apps-fmj7r_1V.js} +1 -1
  339. package/dist/client/assets/{use-reports-diagnostic-oIW-vWNT.js → use-reports-diagnostic-ZH33t2Ry.js} +1 -1
  340. package/dist/client/assets/{use-sandbox-events-BG3ieUWQ.js → use-sandbox-events-BtH7E0uv.js} +1 -1
  341. package/dist/client/assets/{use-secrets-DkEnO-x0.js → use-secrets-MV8rBv8h.js} +1 -1
  342. package/dist/client/assets/{use-section-preview-base-BjAgfXf5.js → use-section-preview-base-NYQYAFvE.js} +1 -1
  343. package/dist/client/assets/{use-sidebar-collapsed-CvNtqVy2.js → use-sidebar-collapsed-DrrBSrPo.js} +1 -1
  344. package/dist/client/assets/{use-tags-BHiGxU75.js → use-tags-B4IWxKLq.js} +1 -1
  345. package/dist/client/assets/{use-task-board-analytics-Ckz7K9Sk.js → use-task-board-analytics-CPWfH5yX.js} +1 -1
  346. package/dist/client/assets/{use-task-board-events-N3Hmav6X.js → use-task-board-events-D2PTxteH.js} +1 -1
  347. package/dist/client/assets/{use-task-board-item-prs-BrW26Cl1.js → use-task-board-item-prs-D7OlirOV.js} +1 -1
  348. package/dist/client/assets/{use-task-board-items-Boto1WTW.js → use-task-board-items-BKptWuO1.js} +1 -1
  349. package/dist/client/assets/{use-task-board-prompts-BU1x5m9R.js → use-task-board-prompts-DnVDJ6_x.js} +1 -1
  350. package/dist/client/assets/{use-task-metadata-BB2iYALn.js → use-task-metadata-oUNTu7G7.js} +1 -1
  351. package/dist/client/assets/{use-thread-outputs-BUT_Bu11.js → use-thread-outputs-BZy8PRyS.js} +1 -1
  352. package/dist/client/assets/{use-voice-input-BlXyivEI.js → use-voice-input-DGGVK_ws.js} +1 -1
  353. package/dist/client/assets/useInfiniteQuery-D6ILTDQv.js +1 -0
  354. package/dist/client/assets/{useQueries-B4AI0K7c.js → useQueries-BL2FM5JE.js} +1 -1
  355. package/dist/client/assets/useSuspenseInfiniteQuery-BcYDPkVL.js +1 -0
  356. package/dist/client/assets/{users-BJUWBQrO.js → users-DN8b1dro.js} +1 -1
  357. package/dist/client/assets/{utils-Cwe-foul.js → utils-0-v3IEet.js} +2 -2
  358. package/dist/client/assets/{variant-calendar-DTdamyQ9.js → variant-calendar-AGawLsl4.js} +1 -1
  359. package/dist/client/assets/{variant-matcher-override-Ve07uZhZ.js → variant-matcher-override-bkTeCqdH.js} +1 -1
  360. package/dist/client/assets/{view-header-CcqynLIn.js → view-header-BIzMLTHX.js} +1 -1
  361. package/dist/client/assets/virtual-mcp-BMrSPW2C.js +1 -0
  362. package/dist/client/assets/{watch-sse-pool-C6-OWpzA.js → watch-sse-pool-GnUwxcY-.js} +1 -1
  363. package/dist/client/index.html +2 -2
  364. package/dist/server/server.js +2 -2
  365. package/package.json +1 -1
  366. package/dist/client/assets/agent-app-DIOn_zxU.js +0 -1
  367. package/dist/client/assets/agent-deck-D8sIhHcl.js +0 -1
  368. package/dist/client/assets/agent-experiments-CTwWI_LC.js +0 -1
  369. package/dist/client/assets/agent-library-C8-K4C_A.js +0 -1
  370. package/dist/client/assets/agent-library-file-CUAfUV8b.js +0 -1
  371. package/dist/client/assets/agent-overview-BA99Kh7t.js +0 -1
  372. package/dist/client/assets/agent-settings-BLtzbihE.js +0 -1
  373. package/dist/client/assets/agent-site-editor-code-Cz02M8Vo.js +0 -2
  374. package/dist/client/assets/agent-site-editor-content-BR1zYqRC.js +0 -1
  375. package/dist/client/assets/agent-site-editor-preview-DmnTxDaZ.js +0 -1
  376. package/dist/client/assets/agent-view-zCDPmtYP.js +0 -1
  377. package/dist/client/assets/api-keys-JGOPVjRU.js +0 -1
  378. package/dist/client/assets/app-editor-DToZlbxJ.js +0 -1
  379. package/dist/client/assets/category-editor-DCkmHYcQ.js +0 -1
  380. package/dist/client/assets/cms-settings-editor-CBpfvEej.js +0 -1
  381. package/dist/client/assets/content-tab-Df3tIOmt.js +0 -25
  382. package/dist/client/assets/context-C2o5DQEj.js +0 -1
  383. package/dist/client/assets/index-BYag0D9X.js +0 -83
  384. package/dist/client/assets/index-BkJtJQz4.css +0 -1
  385. package/dist/client/assets/index-Bu4stMck.js +0 -1
  386. package/dist/client/assets/library-DSOuf5_0.js +0 -1
  387. package/dist/client/assets/parse-sections-3ze3XXop.js +0 -20
  388. package/dist/client/assets/plan-BbVPxdYG.js +0 -1
  389. package/dist/client/assets/post-calendar-kAnC_2Hm.js +0 -1
  390. package/dist/client/assets/post-editor-DJ3OH6KB.js +0 -2
  391. package/dist/client/assets/project-reports-DBO5X-h0.js +0 -1
  392. package/dist/client/assets/project-tasks-CfmD3VHL.js +0 -1
  393. package/dist/client/assets/record-editor-BnGOXmOt.js +0 -1
  394. package/dist/client/assets/redirect-editor-OjmSo149.js +0 -1
  395. package/dist/client/assets/reports-DoGHDSe5.js +0 -1
  396. package/dist/client/assets/repositories-btzaY915.js +0 -1
  397. package/dist/client/assets/route-f2InXsa9.js +0 -1
  398. package/dist/client/assets/route-t1xHDXK-.js +0 -1
  399. package/dist/client/assets/settings-tab-CPJwJyA3.js +0 -1
  400. package/dist/client/assets/site-editor-cTg-Jmis.js +0 -1
  401. package/dist/client/assets/tasks-DZsRgr7r.js +0 -1
  402. package/dist/client/assets/use-ask-in-chat-DO48HVtQ.js +0 -1
  403. package/dist/client/assets/use-blocks-v8-project-2aeIHOAc.js +0 -1
  404. package/dist/client/assets/use-project-native-view-presence-BO67nAre.js +0 -1
  405. package/dist/client/assets/useInfiniteQuery-Dn6_bz5e.js +0 -1
  406. package/dist/client/assets/useSuspenseInfiniteQuery-FPhi-YvF.js +0 -1
  407. package/dist/client/assets/virtual-mcp-DvDiWLao.js +0 -1
@@ -1 +1 @@
1
- import{c as F,a4 as w,K as y,i as $,q as k,e as P}from"./index-CpKrWBFM.js";import{u as x}from"./useInfiniteQuery-Dn6_bz5e.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function ie(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(p(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
1
+ import{c as F,a4 as w,K as y,i as $,q as k,e as P}from"./index-C5rKbfQX.js";import{u as x}from"./useInfiniteQuery-D6ILTDQv.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==t.slug||e[4]!==n?(i=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const i=n?.enabled;let r;e[2]!==t.slug?(r=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function ie(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=F.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=r):r=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(p(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
@@ -1 +1 @@
1
- import{c as r,a4 as f,aj as y,K as S,i as _,q as d,e as R}from"./index-CpKrWBFM.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let i;e[0]!==n.id?(i=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==c||e[10]!==a?(l={mutationFn:c,onSuccess:a,onSettled:o},e[8]=o,e[9]=c,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),i=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==i?(o=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{P as a,q as b,T as c,g as u};
1
+ import{c as r,a4 as f,aj as y,K as S,i as _,q as d,e as R}from"./index-C5rKbfQX.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let i;e[0]!==n.id?(i=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==c||e[10]!==a?(l={mutationFn:c,onSuccess:a,onSettled:o},e[8]=o,e[9]=c,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),i=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==i?(o=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{P as a,q as b,T as c,g as u};
@@ -1 +1 @@
1
- import{c as u,i as S,q as r,e as y,K as c}from"./index-CpKrWBFM.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
1
+ import{c as u,i as S,q as r,e as y,K as c}from"./index-C5rKbfQX.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function m(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{C as a,O as b,m as c,h as d,q as u};
@@ -1 +1 @@
1
- import{c as u,a as w,bW as y,a4 as E,i as F,ak as M,K as b,aj as T,q as A,e as O}from"./index-CpKrWBFM.js";import{D as C,o as G,a as $}from"./schema-BtgOmeu0.js";import{r as z}from"./task-board-CwSJI_Nh.js";const I={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function P(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function c(t){const e=u.c(7),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=P(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],F(i)}function _(){const t=u.c(9),{org:e}=E(),n=T(),s=A();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(b.organizationSettings(e.id),r=>({...r??I,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],O(i)}function R(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:x}function v(){const{data:t}=c(D);return t??x}function D(t){return R(t.simple_mode)}function Y(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function B(){return d("reports_only")}function d(t){const e=u.c(5);let n;e[0]!==t?(n=a=>G(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=c(n);let o;return e[2]!==s||e[3]!==t?(o=s??C.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function W(t){const e=u.c(6);let n;e[0]!==t?(n=i=>G(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=c(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?C.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function V(){const t=d("chat_harness_sandbox_only");return y().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=T(),s=A();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(b.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],O(i)}function k(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const t=u.c(8),{data:e}=w.useSession(),n=y();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||k(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=d("hosting_enabled"),r=d("e2e_enabled"),m=d("monitor_enabled"),N=d("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||i||m,h=o||a||N;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==h?(f={hosting:g,e2e:S,monitor:p,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=h,t[7]=f):f=t[7],f}function X(){const{data:t}=c(L);return t??!1}function L(t){return $(t.flags)}function tt(){const{data:t}=c(q);return t??!0}function q(t){return z(t.flags)}function et(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function nt(){const t=u.c(2),{data:e}=c(Q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Q(t){return t.coding_agent_mcp_excluded}function st(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function ot(){const t=u.c(2),{data:e}=c(U);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function U(t){return t.submodule_credentials}function at(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{d as a,V as b,W as c,v as d,J as e,tt as f,H as g,X as h,et as i,nt as j,st as k,Y as l,ot as m,at as n,B as u};
1
+ import{c as u,a as w,bW as y,a4 as E,i as F,ak as M,K as b,aj as T,q as A,e as O}from"./index-C5rKbfQX.js";import{D as C,o as G,a as $}from"./schema-X_RDdg-y.js";import{r as z}from"./task-board-BRiMfa1H.js";const I={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function P(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function c(t){const e=u.c(7),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=P(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],F(i)}function _(){const t=u.c(9),{org:e}=E(),n=T(),s=A();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(b.organizationSettings(e.id),r=>({...r??I,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],O(i)}function R(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:x}function v(){const{data:t}=c(D);return t??x}function D(t){return R(t.simple_mode)}function Y(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function B(){return d("reports_only")}function d(t){const e=u.c(5);let n;e[0]!==t?(n=a=>G(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=c(n);let o;return e[2]!==s||e[3]!==t?(o=s??C.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function W(t){const e=u.c(6);let n;e[0]!==t?(n=i=>G(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=c(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?C.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function V(){const t=d("chat_harness_sandbox_only");return y().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=T(),s=A();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(b.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],O(i)}function k(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const t=u.c(8),{data:e}=w.useSession(),n=y();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||k(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=d("hosting_enabled"),r=d("e2e_enabled"),m=d("monitor_enabled"),N=d("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||i||m,h=o||a||N;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==h?(f={hosting:g,e2e:S,monitor:p,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=h,t[7]=f):f=t[7],f}function X(){const{data:t}=c(L);return t??!1}function L(t){return $(t.flags)}function tt(){const{data:t}=c(q);return t??!0}function q(t){return z(t.flags)}function et(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function nt(){const t=u.c(2),{data:e}=c(Q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Q(t){return t.coding_agent_mcp_excluded}function st(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function ot(){const t=u.c(2),{data:e}=c(U);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function U(t){return t.submodule_credentials}function at(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{d as a,V as b,W as c,v as d,J as e,tt as f,H as g,X as h,et as i,nt as j,st as k,Y as l,ot as m,at as n,B as u};
@@ -0,0 +1 @@
1
+ import{c as h,a4 as D,bW as O,gK as T,i as W,K as y}from"./index-C5rKbfQX.js";import{m as C}from"./match-site-slug-config-D3fUJ6vX.js";import{u as N}from"./use-file-configs-CXBJCroM.js";import{e as B}from"./use-organization-settings-CFMK78d5.js";import{b as F}from"./use-blocks-v8-project-B0q_oYPf.js";const u=["overview","context","monitor","plan","reports","board","site-editor","calendar","experiments","assets","releases","hosting","e2e","automations"],J=["overview","reports","board","site-editor"],R=1,I=["overview","context","monitor","plan","board"],K=["calendar","experiments"],U=["hosting"],$={calendar:!1,hosting:!1};function v(t){return[...I,...t.calendar?K:[],...t.hosting?U:[]]}function k(t,e){const n=new Set(t??[]);return v(e).filter(s=>!n.has(s))}function se(t,e){const n=new Set([...t??[],...v(e)]);return u.filter(s=>n.has(s))}function ne(t,e){if(!t&&e===void 0)return new Set(I);const n=new Set(e!==void 0?w(e,R):w(L(t),t?.sidebarViewsVersion,k(t?.sidebarViewsSeen,$)));return new Set(I.filter(s=>n.has(s)))}const q=["calendar","experiments","assets","releases","hosting","e2e"];function re(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const s=e?.id===t?e:n?.id===t?n:null;return{project:s,resolvedScopeId:s?t:null}}function L(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function w(t,e,n=[]){const s=new Set(t??[]);if(e!==R)for(const r of J)s.add(r);for(const r of n)s.add(r);return u.filter(r=>s.has(r))}function Q(t){return u.some(e=>e===t)}function H(t){return q.some(e=>e===t)}function Y(t,e){return{overview:t,context:!0,monitor:!0,plan:!0,reports:t,board:t,"site-editor":t,assets:e.assets,releases:t&&e.releases,hosting:e.hosting,e2e:e.e2e,calendar:t&&e.calendar,experiments:t&&e.experiments,automations:!0}}function oe(t,e,n){const s=Y(e,n);return t?s:{...s,overview:!0,reports:!0,board:!0}}function ie(t,e,n,s=[]){const r=new Set(w(t,n,s));return u.filter(o=>e[o]&&r.has(o))}function ce(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ae(t){return u.filter(e=>t[e])}function z(t,e,n){return!Q(t)||e[t]?!1:!H(t)||t==="releases"||t==="calendar"||t==="experiments"?!0:!(t==="assets"?n.assets:n.siteAccess)}function fe(t,e,n,s,r){return z(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!s.includes("content")||t==="code"&&r&&!s.includes("code")}function le(t,e,n,s){const r=new Set(w(t,s));return n?r.add(e):r.delete(e),u.filter(o=>r.has(o))}function ue(t){const e=h.c(19),{org:n}=D(),s=O(),r=B(),o=N();let i;e[0]!==t?(i=F(t),e[0]=t,e[1]=i):i=e[1];const c=i;let d;e[2]!==t?(d=T(t),e[2]=t,e[3]=d):d=e[3];const a=d,P=s.hostingEnabled===!0,A=P&&!!a,j=G(n.slug,a,A),x=j.data?.owned===!0;let f;e[4]!==o.data?.configs?(f=o.data?.configs??[],e[4]=o.data?.configs,e[5]=f):f=e[5];let S;e[6]!==a||e[7]!==f?(S=C(f,a),e[6]=a,e[7]=f,e[8]=S):S=e[8];const p=!!S,E=c&&!!t?.metadata?.siteSlug,b=P&&x&&r.hosting,m=P&&x&&r.e2e;let l;e[9]!==p||e[10]!==E||e[11]!==b||e[12]!==m||e[13]!==c?(l={assets:p,releases:E,hosting:b,e2e:m,calendar:c,experiments:c},e[9]=p,e[10]=E,e[11]=b,e[12]=m,e[13]=c,e[14]=l):l=e[14];const _=!!a&&o.isPending,g=A&&j.isPending;let V;return e[15]!==g||e[16]!==l||e[17]!==_?(V={presence:l,assetsPending:_,siteAccessPending:g},e[15]=g,e[16]=l,e[17]=_,e[18]=V):V=e[18],V}function G(t,e,n){const s=h.c(10);let r;s[0]!==t||s[1]!==e?(r=y.hostingAccess(t,e??""),s[0]=t,s[1]=e,s[2]=r):r=s[2];let o;s[3]!==t||s[4]!==e?(o=async()=>{const c=await fetch(`/api/${t}/hosting/${encodeURIComponent(e??"")}/access`);return c.ok?await c.json():{owned:!1,canWrite:!1}},s[3]=t,s[4]=e,s[5]=o):o=s[5];let i;return s[6]!==n||s[7]!==r||s[8]!==o?(i={queryKey:r,queryFn:o,enabled:n,staleTime:6e4},s[6]=n,s[7]=r,s[8]=o,s[9]=i):i=s[9],W(i)}export{q as P,ie as a,R as b,re as c,oe as d,fe as e,z as f,w as g,ae as h,I as i,se as j,ce as k,k as o,Y as p,L as r,ne as s,le as t,ue as u};
@@ -1 +1 @@
1
- import{c as I,f as P,u as T,d as N,eg as R,eh as E,di as k,ae as l}from"./index-CpKrWBFM.js";import{d as C,b as O,p as w}from"./repository-binding-FcrTKkLc.js";const x=1;function _(e){return(e??[]).filter(E)}function M(){const e=I.c(4);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=P(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const t=T(n);if(r.agentId)return r.agentId;let a;return e[2]!==t?(a="virtualmcpid"in t&&typeof t.virtualmcpid=="string"?t.virtualmcpid.trim():void 0,e[2]=t,e[3]=a):a=e[3],a||null}function D(){const e=I.c(16),o=N();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=P(r),t=R(),a=C(),c=_(a),s=M(),y=c.find(i=>i.id===s)??null;let p;e[1]!==a||e[2]!==s?(p=s&&a.length>0&&!a.some(i=>i.id===s)?s:null,e[1]=a,e[2]=s,e[3]=p):p=e[3];const b=O(p),u=y??_(b?[b]:[])[0]??null;let m;e[4]!==t||e[5]!==o||e[6]!==n||e[7]!==s?(m=i=>{if(i===s&&t!==void 0)return;const h=n.org??"",S=V;if(i){k(o,{org:h,agentId:i,tabId:t==="board"||t==="reports"?t:"overview",search:S,replace:!1});return}if(t==="board"){o({to:l.tasks,params:{org:h,taskKey:void 0},search:S});return}const j=t==="files"?l.library:t==="monitoring"?l.monitoring:t==="plan"?l.plan:l.home;o({to:j,params:{org:h},search:S})},e[4]=t,e[5]=o,e[6]=n,e[7]=s,e[8]=m):m=e[8];const f=m,v=w(u),g=c.length>=x;let d;return e[9]!==u||e[10]!==c||e[11]!==s||e[12]!==f||e[13]!==v||e[14]!==g?(d={scopeId:s,project:u,repo:v,projects:c,hasProjects:g,setScope:f},e[9]=u,e[10]=c,e[11]=s,e[12]=f,e[13]=v,e[14]=g,e[15]=d):d=e[15],d}function V(e){return{...e,virtualmcpid:void 0,thread:void 0,mainpanel:void 0,path:void 0,preview:void 0,expanded:void 0}}export{D as a,_ as s,M as u};
1
+ import{c as I,f as P,u as T,d as N,eg as R,eh as E,di as k,ae as l}from"./index-C5rKbfQX.js";import{d as C,b as O,p as w}from"./repository-binding-DUEv5f7z.js";const x=1;function _(e){return(e??[]).filter(E)}function M(){const e=I.c(4);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=P(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const t=T(n);if(r.agentId)return r.agentId;let a;return e[2]!==t?(a="virtualmcpid"in t&&typeof t.virtualmcpid=="string"?t.virtualmcpid.trim():void 0,e[2]=t,e[3]=a):a=e[3],a||null}function D(){const e=I.c(16),o=N();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=P(r),t=R(),a=C(),c=_(a),s=M(),y=c.find(i=>i.id===s)??null;let p;e[1]!==a||e[2]!==s?(p=s&&a.length>0&&!a.some(i=>i.id===s)?s:null,e[1]=a,e[2]=s,e[3]=p):p=e[3];const b=O(p),u=y??_(b?[b]:[])[0]??null;let m;e[4]!==t||e[5]!==o||e[6]!==n||e[7]!==s?(m=i=>{if(i===s&&t!==void 0)return;const h=n.org??"",S=V;if(i){k(o,{org:h,agentId:i,tabId:t==="board"||t==="reports"?t:"overview",search:S,replace:!1});return}if(t==="board"){o({to:l.tasks,params:{org:h,taskKey:void 0},search:S});return}const j=t==="files"?l.library:t==="monitoring"?l.monitoring:t==="plan"?l.plan:l.home;o({to:j,params:{org:h},search:S})},e[4]=t,e[5]=o,e[6]=n,e[7]=s,e[8]=m):m=e[8];const f=m,v=w(u),g=c.length>=x;let d;return e[9]!==u||e[10]!==c||e[11]!==s||e[12]!==f||e[13]!==v||e[14]!==g?(d={scopeId:s,project:u,repo:v,projects:c,hasProjects:g,setScope:f},e[9]=u,e[10]=c,e[11]=s,e[12]=f,e[13]=v,e[14]=g,e[15]=d):d=e[15],d}function V(e){return{...e,virtualmcpid:void 0,thread:void 0,mainpanel:void 0,path:void 0,preview:void 0,expanded:void 0}}export{D as a,_ as s,M as u};
@@ -1 +1 @@
1
- import{r as m,c as f,l as I,aq as A,as as j,ag as y}from"./index-CpKrWBFM.js";import{P as N}from"./project-apps-B8XrqASg.js";import{b}from"./repository-binding-FcrTKkLc.js";function C(n,t){const e=new Set(t);return e.size===0?n:n.filter(c=>e.has(c.connectionId))}function E(n){const t=n.metadata?.ui;return Array.isArray(t?.pinnedViews)?t.pinnedViews.filter(e=>!!e&&typeof e=="object"&&typeof e.connectionId=="string"&&typeof e.toolName=="string"&&["undefined","string"].includes(typeof e.label)&&(e.icon==null||typeof e.icon=="string")):[]}const P=4;function d(n,t){return n.app===t.app&&n.projectId===t.projectId}function R(n,t,e=P){return[t,...n.filter(c=>!d(c,t))].slice(0,e)}function h(n,t){return n.filter(e=>!d(e,t))}function w(n,t,e){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:r,siteEditorView:s,local:i}=c.staticData;if(!r)return null;const o=c.params,a=o?.agentId;if(a&&r==="app"&&o.connectionId&&o.toolName)return{app:e(o.connectionId,o.toolName),projectId:a,connection:{id:o.connectionId,toolName:o.toolName}};const p=s?"site-editor":r;return t(p)?a?{app:p,projectId:a}:i?{app:p,projectId:null}:null:null}const u=[];function V(n){const t=f.c(9);let e;t[0]!==n?(e=j.recentApps(n),t[0]=n,t[1]=e):e=t[1];const[c,r]=A(e,u),s=Array.isArray(c)?c:u;let i,o;t[2]!==r?(i=p=>r(l=>R(Array.isArray(l)?l:[],p)),o=p=>r(l=>h(Array.isArray(l)?l:[],p)),t[2]=r,t[3]=i,t[4]=o):(i=t[3],o=t[4]);let a;return t[5]!==s||t[6]!==i||t[7]!==o?(a={recent:s,remember:i,forget:o},t[5]=s,t[6]=i,t[7]=o,t[8]=a):a=t[8],a}function O(){const n=f.c(1);let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:S,structuralSharing:!0},n[0]=t):t=n[0],I(t)}function S(n){return w(n.matches,T,y)}function T(n){return n in N}function k(n){const{remember:t}=V(n),e=O(),c=b(e?.projectId),r=e?.projectId&&c?.id===e.projectId?c.title:null,s=e?.connection&&c?E(c).find(o=>o.connectionId===e.connection?.id&&o.toolName===e.connection.toolName):void 0,i=e?.connection&&{id:e.connection.id,toolName:e.connection.toolName,label:s?.label||e.connection.toolName,icon:s?.icon};m.useEffect(()=>{!e?.projectId||!r||t({app:e.app,projectId:e.projectId,projectTitle:r,...i&&{connection:i}})},[n,e?.app,e?.projectId,r,i?.label,i?.icon])}export{O as a,V as b,C as k,E as p,k as u};
1
+ import{r as m,c as f,l as I,aq as A,as as j,ag as y}from"./index-C5rKbfQX.js";import{P as N}from"./project-apps-CZSvF64d.js";import{b}from"./repository-binding-DUEv5f7z.js";function C(n,t){const e=new Set(t);return e.size===0?n:n.filter(c=>e.has(c.connectionId))}function E(n){const t=n.metadata?.ui;return Array.isArray(t?.pinnedViews)?t.pinnedViews.filter(e=>!!e&&typeof e=="object"&&typeof e.connectionId=="string"&&typeof e.toolName=="string"&&["undefined","string"].includes(typeof e.label)&&(e.icon==null||typeof e.icon=="string")):[]}const P=4;function d(n,t){return n.app===t.app&&n.projectId===t.projectId}function R(n,t,e=P){return[t,...n.filter(c=>!d(c,t))].slice(0,e)}function h(n,t){return n.filter(e=>!d(e,t))}function w(n,t,e){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:r,siteEditorView:s,local:i}=c.staticData;if(!r)return null;const o=c.params,a=o?.agentId;if(a&&r==="app"&&o.connectionId&&o.toolName)return{app:e(o.connectionId,o.toolName),projectId:a,connection:{id:o.connectionId,toolName:o.toolName}};const p=s?"site-editor":r;return t(p)?a?{app:p,projectId:a}:i?{app:p,projectId:null}:null:null}const u=[];function V(n){const t=f.c(9);let e;t[0]!==n?(e=j.recentApps(n),t[0]=n,t[1]=e):e=t[1];const[c,r]=A(e,u),s=Array.isArray(c)?c:u;let i,o;t[2]!==r?(i=p=>r(l=>R(Array.isArray(l)?l:[],p)),o=p=>r(l=>h(Array.isArray(l)?l:[],p)),t[2]=r,t[3]=i,t[4]=o):(i=t[3],o=t[4]);let a;return t[5]!==s||t[6]!==i||t[7]!==o?(a={recent:s,remember:i,forget:o},t[5]=s,t[6]=i,t[7]=o,t[8]=a):a=t[8],a}function O(){const n=f.c(1);let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:S,structuralSharing:!0},n[0]=t):t=n[0],I(t)}function S(n){return w(n.matches,T,y)}function T(n){return n in N}function k(n){const{remember:t}=V(n),e=O(),c=b(e?.projectId),r=e?.projectId&&c?.id===e.projectId?c.title:null,s=e?.connection&&c?E(c).find(o=>o.connectionId===e.connection?.id&&o.toolName===e.connection.toolName):void 0,i=e?.connection&&{id:e.connection.id,toolName:e.connection.toolName,label:s?.label||e.connection.toolName,icon:s?.icon};m.useEffect(()=>{!e?.projectId||!r||t({app:e.app,projectId:e.projectId,projectTitle:r,...i&&{connection:i}})},[n,e?.app,e?.projectId,r,i?.label,i?.icon])}export{O as a,V as b,C as k,E as p,k as u};
@@ -1 +1 @@
1
- import{c as N,a4 as Q,W as F,T as A,i as f,K as R,gS as L,$ as K,U}from"./index-CpKrWBFM.js";import{m as O}from"./use-mcp-client-sJ5tYuZ0.js";import{u as h}from"./companions-core-DhUD88pR.js";function D(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function M(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:R.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const _=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(_)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=R.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const _=await s.callTool({name:L,arguments:{}});return h(_).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,S=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==S?(a=M({connectionQueryPending:u.isPending,hasConnection:S,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=S,n[13]=a):a=n[13];const I=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const T=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==T||n[20]!==P||n[21]!==a||n[22]!==I?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:I,host:c,connectionId:t,cdClient:T},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=T,n[20]=P,n[21]=a,n[22]=I,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&D(n.state.data)==="generating"?b:!1}function B(n,e){return{to:K.app,params:{org:n.slug,agentId:U(n.id),connectionId:e,toolName:L},search:{}}}export{D as d,B as r,j as u};
1
+ import{c as N,a4 as Q,W as F,T as A,i as f,K as R,gS as L,$ as K,U}from"./index-C5rKbfQX.js";import{m as O}from"./use-mcp-client-CS5CWOuF.js";import{u as h}from"./companions-core-DhUD88pR.js";function D(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function M(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function j(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:R.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const _=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(_)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=R.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const _=await s.callTool({name:L,arguments:{}});return h(_).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,S=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==S?(a=M({connectionQueryPending:u.isPending,hasConnection:S,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=S,n[13]=a):a=n[13];const I=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const T=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==T||n[20]!==P||n[21]!==a||n[22]!==I?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:I,host:c,connectionId:t,cdClient:T},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=T,n[20]=P,n[21]=a,n[22]=I,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&D(n.state.data)==="generating"?b:!1}function B(n,e){return{to:K.app,params:{org:n.slug,agentId:U(n.id),connectionId:e,toolName:L},search:{}}}export{D as d,B as r,j as u};
@@ -1,2 +1,2 @@
1
- import{c as fe,j as Y,r as a,a4 as he,q as Ee,K as C,df as G}from"./index-CpKrWBFM.js";import{i as pe,u as ve}from"./chat-context-CkHIxm7-.js";import{b as Se}from"./sandbox-url-D3mC8qhT.js";import{u as ge}from"./repository-binding-FcrTKkLc.js";import{e as me}from"./backoff-CrEUbyZT.js";function J(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const ye={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},I=a.createContext(ye),W=16384;class be{data="";append(e){this.data+=e,this.data.length>W&&(this.data=this.data.slice(this.data.length-W))}get(){return this.data}clear(){this.data=""}}const De=1e3,Re=3e4,Te=3e3,z=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],X="log";function ke(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function xe(t){return t===404}async function Ce(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Te)});return await e.body?.cancel().catch(()=>{}),xe(e.status)}catch{return!1}}const Z=pe(I);function Ae(t){const e=fe.c(10);let i,f,c;e[0]!==t?({resetKey:c,children:i,...f}=t,e[0]=t,e[1]=i,e[2]=f,e[3]=c):(i=e[1],f=e[2],c=e[3]);let o;e[4]!==f||e[5]!==c?(o=Y.jsx(Le,{...f},c),e[4]=f,e[5]=c,e[6]=o):o=e[6];let h;return e[7]!==i||e[8]!==o?(h=Y.jsx(Z.Host,{source:o,children:i}),e[7]=i,e[8]=o,e[9]=h):h=e[9],h}function Le(t){return Z.usePublish(_e(t)),null}function _e({virtualMcpId:t,branch:e,previewUrl:i=null,enabled:f=!0}){const{org:c}=he(),o=Ee(),h=ve()?.taskId??null,[te,L]=a.useState(null),[ne,_]=a.useState({phase:"idle"}),[se,w]=a.useState({state:"running"}),[re,P]=a.useState({kind:"unknown"}),[ae,N]=a.useState(!1),[ce,O]=a.useState([]),[oe,B]=a.useState([]),[,ue]=a.useState(0),v=a.useRef(new Map),K=a.useRef(new Set),R=a.useRef(new Set),A=a.useRef(null),T=ke(i),Q=ge(t)?.metadata?.runtime?.selected==="deno",ie=l=>{let d=v.current.get(l);return d||(d=new be,v.current.set(l,d)),d};return a.useEffect(()=>{if(L(null),_({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),A.current=null,N(!1),O([]),B([]),v.current.clear(),!t||!e||!f)return;const l=Se({orgSlug:c.slug,virtualMcpId:t,branch:e,threadId:h??null},"events");let d=!1,S=0,k=null,g=null,m=null,p=null,E=null,x=null;const F=()=>{g&&clearTimeout(g),g=setTimeout(()=>{g=null,o.invalidateQueries({queryKey:C.liveMeta(c.slug,t,e)})},1e3)},le=n=>{try{const s=JSON.parse(n.data);L(s),s.kind!=="failed"&&(N(!1),S=0),s.kind==="ready"&&q()}catch(s){console.warn("[vm-events] bad phase payload",s)}},V=()=>{N(!0),L(null),_({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),O([]),B([]),v.current.clear()},$=n=>{try{const s=JSON.parse(n.data);if(typeof s.data!="string")return;S=0;const u=s.data.replace(/\r?\n/g,`\r
1
+ import{c as fe,j as Y,r as a,a4 as he,q as Ee,K as C,df as G}from"./index-C5rKbfQX.js";import{i as pe,u as ve}from"./chat-context-CgzRmLj9.js";import{b as Se}from"./sandbox-url-D3mC8qhT.js";import{u as ge}from"./repository-binding-DUEv5f7z.js";import{e as me}from"./backoff-CrEUbyZT.js";function J(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const ye={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},I=a.createContext(ye),W=16384;class be{data="";append(e){this.data+=e,this.data.length>W&&(this.data=this.data.slice(this.data.length-W))}get(){return this.data}clear(){this.data=""}}const De=1e3,Re=3e4,Te=3e3,z=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],X="log";function ke(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function xe(t){return t===404}async function Ce(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Te)});return await e.body?.cancel().catch(()=>{}),xe(e.status)}catch{return!1}}const Z=pe(I);function Ae(t){const e=fe.c(10);let i,f,c;e[0]!==t?({resetKey:c,children:i,...f}=t,e[0]=t,e[1]=i,e[2]=f,e[3]=c):(i=e[1],f=e[2],c=e[3]);let o;e[4]!==f||e[5]!==c?(o=Y.jsx(Le,{...f},c),e[4]=f,e[5]=c,e[6]=o):o=e[6];let h;return e[7]!==i||e[8]!==o?(h=Y.jsx(Z.Host,{source:o,children:i}),e[7]=i,e[8]=o,e[9]=h):h=e[9],h}function Le(t){return Z.usePublish(_e(t)),null}function _e({virtualMcpId:t,branch:e,previewUrl:i=null,enabled:f=!0}){const{org:c}=he(),o=Ee(),h=ve()?.taskId??null,[te,L]=a.useState(null),[ne,_]=a.useState({phase:"idle"}),[se,w]=a.useState({state:"running"}),[re,P]=a.useState({kind:"unknown"}),[ae,N]=a.useState(!1),[ce,O]=a.useState([]),[oe,B]=a.useState([]),[,ue]=a.useState(0),v=a.useRef(new Map),K=a.useRef(new Set),R=a.useRef(new Set),A=a.useRef(null),T=ke(i),Q=ge(t)?.metadata?.runtime?.selected==="deno",ie=l=>{let d=v.current.get(l);return d||(d=new be,v.current.set(l,d)),d};return a.useEffect(()=>{if(L(null),_({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),A.current=null,N(!1),O([]),B([]),v.current.clear(),!t||!e||!f)return;const l=Se({orgSlug:c.slug,virtualMcpId:t,branch:e,threadId:h??null},"events");let d=!1,S=0,k=null,g=null,m=null,p=null,E=null,x=null;const F=()=>{g&&clearTimeout(g),g=setTimeout(()=>{g=null,o.invalidateQueries({queryKey:C.liveMeta(c.slug,t,e)})},1e3)},le=n=>{try{const s=JSON.parse(n.data);L(s),s.kind!=="failed"&&(N(!1),S=0),s.kind==="ready"&&q()}catch(s){console.warn("[vm-events] bad phase payload",s)}},V=()=>{N(!0),L(null),_({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),O([]),B([]),v.current.clear()},$=n=>{try{const s=JSON.parse(n.data);if(typeof s.data!="string")return;S=0;const u=s.data.replace(/\r?\n/g,`\r
2
2
  `);ie(s.source).append(u);for(const r of K.current)try{r(s.source,u)}catch{}ue(r=>r+1)}catch{}},j=n=>{const s=n.type;try{const u=JSON.parse(n.data);switch(S=0,s){case"lifecycle":{const r=u;_(r.state);const y=`${c.slug}/${t}/${e}`;if(J(r.state.phase)&&!(x&&J(x))){G(o,c.id);const D=C.decofile(y);o.getQueryData(D)===void 0&&o.invalidateQueries({queryKey:D})}r.state.phase==="running"&&x!=="running"&&(G(o,c.id),o.invalidateQueries({queryKey:C.decofile(y)}),F()),x=r.state.phase;const b=r.state.phase==="running"?r.state.port:null,U=A.current;if(A.current=b,U!==null&&b!==null&&U!==b)for(const D of R.current)try{D()}catch{}return}case"status":w(u);return;case"tasks":{const y=u.active.map(b=>b.logName??"").filter(Boolean);B(y);return}case"scripts":O(u.scripts);return;case"branch":{const r=u.meta;P(r);return}case"reload":for(const r of R.current)try{r()}catch{}return;case"file-changed":{const{path:r}=u,y=`${c.slug}/${t}/${e}`;if(r.startsWith(".deco/")||r.includes("/.deco/")){if(!(x==="running"))return;r.endsWith(".deco/meta.gen.json")&&F(),m&&clearTimeout(m),m=setTimeout(()=>{if(m=null,o.invalidateQueries({queryKey:C.decofile(y)}),Q)for(const D of R.current)try{D()}catch{}},500)}else F();return}}}catch{}};function M(){if(d)return;const n=new EventSource(l);p=n,n.onopen=()=>{},n.onerror=()=>{p===n&&n.readyState===EventSource.CLOSED&&H("studio")},n.addEventListener("phase",le),n.addEventListener("gone",V),n.addEventListener(X,$);for(const s of z)n.addEventListener(s,j)}function q(){if(d||!T||E)return;const n=new EventSource(T);E=n;let s=!1;n.onopen=()=>{if(d||E!==n)return;s=!0,S=0;const u=p;p=null,u?.close()},n.onerror=()=>{E===n&&n.readyState===EventSource.CLOSED&&de(n,s)},n.addEventListener(X,$);for(const u of z)n.addEventListener(u,j)}async function de(n,s){const u=T?await Ce(T):!1;if(!(d||E!==n)){if(n.close(),E=null,u){V(),p||M();return}s&&H("direct")}}function H(n){if(d||k)return;const s=me(Re,De,S,2,0);S++,k=setTimeout(()=>{if(k=null,!d){if(n==="direct"){E?.close(),E=null,q();return}p?.close(),p=null,M()}},s)}return M(),()=>{d=!0,p?.close(),E?.close(),k&&clearTimeout(k),g&&clearTimeout(g),m&&clearTimeout(m)}},[t,e,c.slug,c.id,f,h,T,o,Q]),{phase:te,lifecycle:ne,status:se,branch:re,notFound:ae,scripts:ce,activeProcesses:oe,getBuffer:l=>v.current.get(l)?.get()??"",hasData:l=>(v.current.get(l)?.get().length??0)>0,subscribeChunks:l=>(K.current.add(l),()=>{K.current.delete(l)}),subscribeReload:l=>(R.current.add(l),()=>{R.current.delete(l)})}}function ee(){return a.use(I)}function Fe(t){const{subscribeChunks:e}=ee(),i=a.useRef(t);i.current=t,a.useEffect(()=>e((o,h)=>{i.current?.(o,h)}),[e])}function Me(t){const{subscribeReload:e}=ee(),i=a.useRef(t);i.current=t,a.useEffect(()=>e(()=>{i.current?.()}),[e])}export{Ae as S,Fe as a,Me as b,J as i,ee as u};
@@ -1 +1 @@
1
- import{c as u,a4 as c,aj as r,K as l,V as d,q as f,e as S}from"./index-CpKrWBFM.js";function C(){const e=u.c(7),{org:i}=c(),n=r();let a;e[0]!==i.id?(a=l.secrets(i.id),e[0]=i.id,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>await n.call("SECRET_LIST",{}),e[2]=n,e[3]=t):t=e[3];let s;e[4]!==a||e[5]!==t?(s={queryKey:a,staleTime:6e4,queryFn:t},e[4]=a,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:i}=c(),n=r(),a=f();let t;e[0]!==n?(t=async y=>await n.call("SECRET_CREATE",{...y}),e[0]=n,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==a?(s=()=>{a.invalidateQueries({queryKey:l.secrets(i.id)})},e[2]=i,e[3]=a,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
1
+ import{c as u,a4 as c,aj as r,K as l,V as d,q as f,e as S}from"./index-C5rKbfQX.js";function C(){const e=u.c(7),{org:i}=c(),n=r();let a;e[0]!==i.id?(a=l.secrets(i.id),e[0]=i.id,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>await n.call("SECRET_LIST",{}),e[2]=n,e[3]=t):t=e[3];let s;e[4]!==a||e[5]!==t?(s={queryKey:a,staleTime:6e4,queryFn:t},e[4]=a,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:i}=c(),n=r(),a=f();let t;e[0]!==n?(t=async y=>await n.call("SECRET_CREATE",{...y}),e[0]=n,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==a?(s=()=>{a.invalidateQueries({queryKey:l.secrets(i.id)})},e[2]=i,e[3]=a,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
@@ -1 +1 @@
1
- import{i0 as ee,bf as te,c as M,b as re,r as b,j as i,m as se,be as oe,D as ie,v as le,x as ne,I as ce,w as ae}from"./index-CpKrWBFM.js";import{a as G,e as V}from"./UserSquare-CgD5WRTE.js";import{b as fe}from"./agent-icon-De2MEsoK.js";import{i as ue}from"./SearchMd-BgyEwNMN.js";import{K as Y,O as de,Q as _}from"./parse-sections-3ze3XXop.js";import{a2 as me,k as ve,an as pe}from"./blocks-tab-states-UGg2OTih.js";import{a$ as X,c as xe,u as he,m as ge,B as we}from"./site-editor-toast-BzBdZBKk.js";import{u as Se}from"./use-voice-input-BlXyivEI.js";function be(r){return r.schema?.definitions??r.schema?.$defs??{}}function Z(r,e){const t=be(e),s=t[btoa(r)];if(!s)return[];const o=[s];if(Array.isArray(s.allOf)){const n=s.allOf.find(l=>typeof l.$ref=="string")?.$ref;if(typeof n=="string"){const l=t[n.replace("#/definitions/","")];l&&o.push(l)}}return o}function je(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s?.includes("{{{"))return s}}function ze(r,e){if(!e)return;const t=ee(r,te(e));if(!t)return;const s=je(t.resolveType,e);if(!s)return;const o=de(s,t.data);if(o)return Y(o)}function ye(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s&&!s.includes("{{"))return Y(s)}}const Ne=12,z=new Set,F=new Set;function Re(){for(const r of F)r()}function Pe(r){return z.has(r)?!0:z.size>=Ne?!1:(z.add(r),!0)}function J(r){z.delete(r)&&Re()}function Ie(r){return F.add(r),()=>{F.delete(r)}}function Te(r,e){const t=b.useRef(!1),[s,o]=b.useState(!1),n=b.useRef(null),l=b.useRef(null),f=b.useRef(null),c=b.useRef(r);c.current=r;const[p]=b.useState(()=>{const u=()=>{f.current?.(),f.current=null},d=()=>t.current?!0:Pe(e)?(t.current=!0,o(!0),u(),!0):!1;return a=>{if(l.current=a,n.current&&(n.current.disconnect(),n.current=null),u(),!a){t.current&&(J(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(l.current!==a)return;const w=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!d()&&!f.current&&(f.current=Ie(()=>{l.current===a&&d()}));return}u(),t.current&&(J(e),t.current=!1,o(!1))},{root:c.current.current,rootMargin:"160px 0px"});w.observe(a),n.current=w})}});return{ref:p,iframeActive:s}}function Ce(r){const e=M.c(9),{previewUrl:t,title:s,scrollRootRef:o,slotId:n}=r,{ref:l,iframeActive:f}=Te(o,n),[c,p]=b.useState(!1),u=_()?V:G;let d;e[0]!==u||e[1]!==f||e[2]!==c||e[3]!==t||e[4]!==s?(d=f?i.jsxs(i.Fragment,{children:[!c&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:i.jsx(u,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),i.jsx("iframe",{src:t,title:`Preview ${s}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>p(!0)})]}):i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(u,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=u,e[1]=f,e[2]=c,e[3]=t,e[4]=s,e[5]=d):d=e[5];let a;return e[6]!==l||e[7]!==d?(a=i.jsx("div",{ref:l,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:d}),e[6]=l,e[7]=d,e[8]=a):a=e[8],a}function Be(r){const e=M.c(3),{image:t}=r,s=_()?V:G;let o;return e[0]!==s||e[1]!==t?(o=i.jsx("div",{className:"relative flex aspect-[16/10] w-full items-center justify-center overflow-hidden bg-muted/40",children:t?i.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):i.jsx(s,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function Ue(r){const e=M.c(28),{entry:t,previewUrl:s,image:o,scrollRootRef:n,onSelect:l}=r,c=_()?t.isSavedBlock?fe:V:G,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let u;e[0]!==p?(u=se("group flex flex-col overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-lg))] border bg-card text-left transition-colors shadow-edge","hover:border-primary/40 hover:bg-accent",p),e[0]=p,e[1]=u):u=e[1];let d;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==o||e[5]!==s||e[6]!==n?(d=s?i.jsx(Ce,{previewUrl:s,title:t.title,scrollRootRef:n,slotId:t.resolveType}):i.jsx(Be,{image:o}),e[2]=t.resolveType,e[3]=t.title,e[4]=o,e[5]=s,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==t.isSavedBlock?(a=t.isSavedBlock?{color:oe}:void 0,e[8]=t.isSavedBlock,e[9]=a):a=e[9];let w;e[10]!==c||e[11]!==a?(w=i.jsx(c,{className:"h-4 w-4 shrink-0",style:a}),e[10]=c,e[11]=a,e[12]=w):w=e[12];let m;e[13]!==t.title?(m=i.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[13]=t.title,e[14]=m):m=e[14];let x;e[15]!==t.description?(x=t.description&&i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[15]=t.description,e[16]=x):x=e[16];let h;e[17]!==m||e[18]!==x?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[m,x]}),e[17]=m,e[18]=x,e[19]=h):h=e[19];let g;e[20]!==w||e[21]!==h?(g=i.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[w,h]}),e[20]=w,e[21]=h,e[22]=g):g=e[22];let S;return e[23]!==l||e[24]!==u||e[25]!==d||e[26]!==g?(S=i.jsxs("button",{type:"button",onClick:l,className:u,children:[d,g]}),e[23]=l,e[24]=u,e[25]=d,e[26]=g,e[27]=S):S=e[27],S}function We(r){const e=M.c(51),{open:t,onOpenChange:s,meta:o,decofile:n,previewBaseUrl:l,onSelect:f}=r,c=re(),[p,u]=b.useState(""),[d,a]=b.useState(t),w=b.useRef(null);t!==d&&(a(t),t&&u(""));let m,x,h,g,S,y,N,R,j,P,I;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==f||e[4]!==t||e[5]!==l||e[6]!==p||e[7]!==c){const W=t&&o&&n?me(o,n):[],q=o?ve(o):"",H=n?pe(n):void 0,K=new Map;if(t&&q&&l)for(const v of W)K.set(v.resolveType,X(l,q,v.previewBlock,H));const E=p.trim().toLowerCase(),Q=E?W.filter(v=>v.title.toLowerCase().includes(E)||v.resolveType.toLowerCase().includes(E)||v.description?.toLowerCase().includes(E)):W;x=ie,P=t,I=s,m=le,N="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==c?(U=c("sectionsEditor.addSectionModal.title"),e[19]=c,e[20]=U):U=e[20];let k;e[21]!==U?(k=i.jsx(ne,{children:U}),e[21]=U,e[22]=k):k=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx(ue,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=$):$=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=v=>u(v.target.value),e[24]=D):D=e[24];let A;e[25]!==c?(A=c("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=c,e[26]=A):A=e[26];let L;e[27]!==p||e[28]!==A?(L=i.jsxs("div",{className:"relative pt-2",children:[$,i.jsx(ce,{value:p,onChange:D,placeholder:A,className:"h-9 pl-8"})]}),e[27]=p,e[28]=A,e[29]=L):L=e[29],e[30]!==k||e[31]!==L?(j=i.jsxs(ae,{className:"shrink-0 border-b px-4 py-3 text-left",children:[k,L]}),e[30]=k,e[31]=L,e[32]=j):j=e[32],S=w,y="min-h-0 flex-1 overflow-y-auto",h="p-4",g=Q.length===0?i.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:c("sectionsEditor.addSectionModal.noSectionsFound")}):i.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Q.map(v=>i.jsx(Ue,{entry:v,scrollRootRef:w,previewUrl:l?K.get(v.resolveType)??X(l,q,v.previewBlock,H):null,image:l||!o?void 0:ye(v.resolveType,o),onSelect:()=>f(v)},v.resolveType))}),e[0]=n,e[1]=o,e[2]=s,e[3]=f,e[4]=t,e[5]=l,e[6]=p,e[7]=c,e[8]=m,e[9]=x,e[10]=h,e[11]=g,e[12]=S,e[13]=y,e[14]=N,e[15]=R,e[16]=j,e[17]=P,e[18]=I}else m=e[8],x=e[9],h=e[10],g=e[11],S=e[12],y=e[13],N=e[14],R=e[15],j=e[16],P=e[17],I=e[18];let T;e[33]!==h||e[34]!==g?(T=i.jsx("div",{className:h,children:g}),e[33]=h,e[34]=g,e[35]=T):T=e[35];let C;e[36]!==T||e[37]!==S||e[38]!==y?(C=i.jsx("div",{ref:S,className:y,children:T}),e[36]=T,e[37]=S,e[38]=y,e[39]=C):C=e[39];let B;e[40]!==m||e[41]!==C||e[42]!==N||e[43]!==R||e[44]!==j?(B=i.jsxs(m,{closeButtonClassName:N,className:R,children:[j,C]}),e[40]=m,e[41]=C,e[42]=N,e[43]=R,e[44]=j,e[45]=B):B=e[45];let O;return e[46]!==x||e[47]!==B||e[48]!==P||e[49]!==I?(O=i.jsx(x,{open:P,onOpenChange:I,children:B}),e[46]=x,e[47]=B,e[48]=P,e[49]=I,e[50]=O):O=e[50],O}function qe(r){const e=M.c(4),{previewServerUrl:t,runtime:s}=Se(r.virtualMcpId),{url:o}=xe(r.virtualMcpId),n=he(r.virtualMcpId,r.branch),l=s==="cms";if(ge(n))return null;if(o)return o;let f;return e[0]!==l||e[1]!==r.sandboxUrl||e[2]!==t?(f=we({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:l}),e[0]=l,e[1]=r.sandboxUrl,e[2]=t,e[3]=f):f=e[3],f}export{We as A,ze as g,Z as s,qe as u};
1
+ import{i0 as ee,bf as te,c as M,b as re,r as b,j as i,m as se,be as oe,D as ie,v as le,x as ne,I as ce,w as ae}from"./index-C5rKbfQX.js";import{a as F,e as G}from"./UserSquare-BbdNewBi.js";import{b as fe}from"./agent-icon-CIk0WHPf.js";import{i as ue}from"./SearchMd-eMVBpMYs.js";import{V as Y,W as de,X as _}from"./parse-sections--hSYduXv.js";import{a2 as me,k as ve,an as pe}from"./blocks-tab-states-Bk50Moxc.js";import{a$ as K,c as xe,u as he,m as ge,B as we}from"./site-editor-toast-DENHUiCT.js";import{u as Se}from"./use-voice-input-DGGVK_ws.js";function be(r){return r.schema?.definitions??r.schema?.$defs??{}}function Z(r,e){const t=be(e),s=t[btoa(r)];if(!s)return[];const o=[s];if(Array.isArray(s.allOf)){const n=s.allOf.find(l=>typeof l.$ref=="string")?.$ref;if(typeof n=="string"){const l=t[n.replace("#/definitions/","")];l&&o.push(l)}}return o}function je(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s?.includes("{{{"))return s}}function We(r,e){if(!e)return;const t=ee(r,te(e));if(!t)return;const s=je(t.resolveType,e);if(!s)return;const o=de(s,t.data);if(o)return Y(o)}function ye(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s&&!s.includes("{{"))return Y(s)}}const Ne=12,W=new Set,q=new Set;function Re(){for(const r of q)r()}function Pe(r){return W.has(r)?!0:W.size>=Ne?!1:(W.add(r),!0)}function Q(r){W.delete(r)&&Re()}function Ie(r){return q.add(r),()=>{q.delete(r)}}function Te(r,e){const t=b.useRef(!1),[s,o]=b.useState(!1),n=b.useRef(null),l=b.useRef(null),f=b.useRef(null),c=b.useRef(r);c.current=r;const[p]=b.useState(()=>{const u=()=>{f.current?.(),f.current=null},d=()=>t.current?!0:Pe(e)?(t.current=!0,o(!0),u(),!0):!1;return a=>{if(l.current=a,n.current&&(n.current.disconnect(),n.current=null),u(),!a){t.current&&(Q(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(l.current!==a)return;const w=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!d()&&!f.current&&(f.current=Ie(()=>{l.current===a&&d()}));return}u(),t.current&&(Q(e),t.current=!1,o(!1))},{root:c.current.current,rootMargin:"160px 0px"});w.observe(a),n.current=w})}});return{ref:p,iframeActive:s}}function Ce(r){const e=M.c(9),{previewUrl:t,title:s,scrollRootRef:o,slotId:n}=r,{ref:l,iframeActive:f}=Te(o,n),[c,p]=b.useState(!1),u=_()?G:F;let d;e[0]!==u||e[1]!==f||e[2]!==c||e[3]!==t||e[4]!==s?(d=f?i.jsxs(i.Fragment,{children:[!c&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:i.jsx(u,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),i.jsx("iframe",{src:t,title:`Preview ${s}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>p(!0)})]}):i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(u,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=u,e[1]=f,e[2]=c,e[3]=t,e[4]=s,e[5]=d):d=e[5];let a;return e[6]!==l||e[7]!==d?(a=i.jsx("div",{ref:l,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:d}),e[6]=l,e[7]=d,e[8]=a):a=e[8],a}function Be(r){const e=M.c(3),{image:t}=r,s=_()?G:F;let o;return e[0]!==s||e[1]!==t?(o=i.jsx("div",{className:"relative flex aspect-[16/10] w-full items-center justify-center overflow-hidden bg-muted/40",children:t?i.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):i.jsx(s,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function Ue(r){const e=M.c(28),{entry:t,previewUrl:s,image:o,scrollRootRef:n,onSelect:l}=r,c=_()?t.isSavedBlock?fe:G:F,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let u;e[0]!==p?(u=se("group flex flex-col overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-lg))] border bg-card text-left transition-colors shadow-edge","hover:border-primary/40 hover:bg-accent",p),e[0]=p,e[1]=u):u=e[1];let d;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==o||e[5]!==s||e[6]!==n?(d=s?i.jsx(Ce,{previewUrl:s,title:t.title,scrollRootRef:n,slotId:t.resolveType}):i.jsx(Be,{image:o}),e[2]=t.resolveType,e[3]=t.title,e[4]=o,e[5]=s,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==t.isSavedBlock?(a=t.isSavedBlock?{color:oe}:void 0,e[8]=t.isSavedBlock,e[9]=a):a=e[9];let w;e[10]!==c||e[11]!==a?(w=i.jsx(c,{className:"h-4 w-4 shrink-0",style:a}),e[10]=c,e[11]=a,e[12]=w):w=e[12];let m;e[13]!==t.title?(m=i.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[13]=t.title,e[14]=m):m=e[14];let x;e[15]!==t.description?(x=t.description&&i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[15]=t.description,e[16]=x):x=e[16];let h;e[17]!==m||e[18]!==x?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[m,x]}),e[17]=m,e[18]=x,e[19]=h):h=e[19];let g;e[20]!==w||e[21]!==h?(g=i.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[w,h]}),e[20]=w,e[21]=h,e[22]=g):g=e[22];let S;return e[23]!==l||e[24]!==u||e[25]!==d||e[26]!==g?(S=i.jsxs("button",{type:"button",onClick:l,className:u,children:[d,g]}),e[23]=l,e[24]=u,e[25]=d,e[26]=g,e[27]=S):S=e[27],S}function ze(r){const e=M.c(51),{open:t,onOpenChange:s,meta:o,decofile:n,previewBaseUrl:l,onSelect:f}=r,c=re(),[p,u]=b.useState(""),[d,a]=b.useState(t),w=b.useRef(null);t!==d&&(a(t),t&&u(""));let m,x,h,g,S,y,N,R,j,P,I;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==f||e[4]!==t||e[5]!==l||e[6]!==p||e[7]!==c){const z=t&&o&&n?me(o,n):[],V=o?ve(o):"",H=n?pe(n):void 0,X=new Map;if(t&&V&&l)for(const v of z)X.set(v.resolveType,K(l,V,v.previewBlock,H));const E=p.trim().toLowerCase(),J=E?z.filter(v=>v.title.toLowerCase().includes(E)||v.resolveType.toLowerCase().includes(E)||v.description?.toLowerCase().includes(E)):z;x=ie,P=t,I=s,m=le,N="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==c?(U=c("sectionsEditor.addSectionModal.title"),e[19]=c,e[20]=U):U=e[20];let k;e[21]!==U?(k=i.jsx(ne,{children:U}),e[21]=U,e[22]=k):k=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx(ue,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=$):$=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=v=>u(v.target.value),e[24]=D):D=e[24];let A;e[25]!==c?(A=c("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=c,e[26]=A):A=e[26];let L;e[27]!==p||e[28]!==A?(L=i.jsxs("div",{className:"relative pt-2",children:[$,i.jsx(ce,{value:p,onChange:D,placeholder:A,className:"h-9 pl-8"})]}),e[27]=p,e[28]=A,e[29]=L):L=e[29],e[30]!==k||e[31]!==L?(j=i.jsxs(ae,{className:"shrink-0 border-b px-4 py-3 text-left",children:[k,L]}),e[30]=k,e[31]=L,e[32]=j):j=e[32],S=w,y="min-h-0 flex-1 overflow-y-auto",h="p-4",g=J.length===0?i.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:c("sectionsEditor.addSectionModal.noSectionsFound")}):i.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:J.map(v=>i.jsx(Ue,{entry:v,scrollRootRef:w,previewUrl:l?X.get(v.resolveType)??K(l,V,v.previewBlock,H):null,image:l||!o?void 0:ye(v.resolveType,o),onSelect:()=>f(v)},v.resolveType))}),e[0]=n,e[1]=o,e[2]=s,e[3]=f,e[4]=t,e[5]=l,e[6]=p,e[7]=c,e[8]=m,e[9]=x,e[10]=h,e[11]=g,e[12]=S,e[13]=y,e[14]=N,e[15]=R,e[16]=j,e[17]=P,e[18]=I}else m=e[8],x=e[9],h=e[10],g=e[11],S=e[12],y=e[13],N=e[14],R=e[15],j=e[16],P=e[17],I=e[18];let T;e[33]!==h||e[34]!==g?(T=i.jsx("div",{className:h,children:g}),e[33]=h,e[34]=g,e[35]=T):T=e[35];let C;e[36]!==T||e[37]!==S||e[38]!==y?(C=i.jsx("div",{ref:S,className:y,children:T}),e[36]=T,e[37]=S,e[38]=y,e[39]=C):C=e[39];let B;e[40]!==m||e[41]!==C||e[42]!==N||e[43]!==R||e[44]!==j?(B=i.jsxs(m,{closeButtonClassName:N,className:R,children:[j,C]}),e[40]=m,e[41]=C,e[42]=N,e[43]=R,e[44]=j,e[45]=B):B=e[45];let O;return e[46]!==x||e[47]!==B||e[48]!==P||e[49]!==I?(O=i.jsx(x,{open:P,onOpenChange:I,children:B}),e[46]=x,e[47]=B,e[48]=P,e[49]=I,e[50]=O):O=e[50],O}function Ve(r){const e=M.c(4),{previewServerUrl:t,runtime:s}=Se(r.virtualMcpId),{url:o}=xe(r.virtualMcpId),n=he(r.virtualMcpId,r.branch),l=s==="cms";if(ge(n))return null;if(o)return o;let f;return e[0]!==l||e[1]!==r.sandboxUrl||e[2]!==t?(f=we({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:l}),e[0]=l,e[1]=r.sandboxUrl,e[2]=t,e[3]=f):f=e[3],f}export{ze as A,We as g,Z as s,Ve as u};
@@ -1 +1 @@
1
- import{r as C,c as j,j as o,m as y,cx as A,cy as R,a6 as H,bR as L,b as V,d as W,a4 as F}from"./index-CpKrWBFM.js";import{m as q}from"./use-chat-layout-state-CKlzZSFB.js";import{M as G}from"./agent-icon-De2MEsoK.js";import{b as J,a as E,T as P,c as z}from"./tooltip-BN1ul0v0.js";import{T as K}from"./toolbar-icon-button-DWFGDofy.js";import{g as Q}from"./shell-layout-yWlnACBx.js";import{u as U}from"./use-mobile-Ca0mzlkS.js";import{b as X,c as Y,S as Z,d as ee,a as te}from"./sheet-DRzohuTq.js";const se="15rem",ae="18rem",ie="4.5rem",D=C.createContext(null);function I(){const s=C.useContext(D);if(!s)throw new Error("useSidebar must be used within a SidebarProvider.");return s}function ge(s){const e=j.c(19),{children:t,defaultOpen:a,open:i,onOpenChange:n}=s,d=a===void 0?!1:a,r=U(),[l,c]=C.useState(d),[b,v]=C.useState(!1),u=i!==void 0,f=u?i:l;let h;e[0]!==u||e[1]!==n?(h=M=>{u||c(M),n?.(M)},e[0]=u,e[1]=n,e[2]=h):h=e[2];const p=h;let w;e[3]!==r||e[4]!==f||e[5]!==p?(w=()=>{r?v(ne):p(!f)},e[3]=r,e[4]=f,e[5]=p,e[6]=w):w=e[6];const N=w,x=f?"expanded":"collapsed";let m;e[7]!==r||e[8]!==f||e[9]!==b||e[10]!==p||e[11]!==x||e[12]!==N?(m={state:x,open:f,setOpen:p,isMobile:r,openMobile:b,setOpenMobile:v,toggleSidebar:N},e[7]=r,e[8]=f,e[9]=b,e[10]=p,e[11]=x,e[12]=N,e[13]=m):m=e[13];const S=m;let g;e[14]!==t?(g=o.jsx(J,{delayDuration:0,children:t}),e[14]=t,e[15]=g):g=e[15];let T;return e[16]!==S||e[17]!==g?(T=o.jsx(D.Provider,{value:S,children:g}),e[16]=S,e[17]=g,e[18]=T):T=e[18],T}function ne(s){return!s}function ve(s){const e=j.c(14);let t,a,i,n;e[0]!==s?({className:a,style:n,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n):(t=e[1],a=e[2],i=e[3],n=e[4]);let d;e[5]!==n?(d={"--sidebar-width":se,"--sidebar-width-icon":ie,...n},e[5]=n,e[6]=d):d=e[6];const r=d;let l;e[7]!==a?(l=y("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=l):l=e[8];let c;return e[9]!==t||e[10]!==i||e[11]!==r||e[12]!==l?(c=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:l,...i,children:t}),e[9]=t,e[10]=i,e[11]=r,e[12]=l,e[13]=c):c=e[13],c}function Se(s){const e=j.c(36);let t,a,i,n,d;e[0]!==s?({side:n,variant:d,className:a,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5]);const r=n===void 0?"left":n,l=d===void 0?"sidebar":d,{isMobile:c,state:b,openMobile:v,setOpenMobile:u}=I();if(c){let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T={"--sidebar-width":ae},e[6]=T):T=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(Y,{className:"sr-only",children:[o.jsx(Z,{children:"Sidebar"}),o.jsx(ee,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let $;e[8]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let _;e[10]!==r||e[11]!==$?(_=o.jsxs(te,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:T,side:r,children:[M,$]}),e[10]=r,e[11]=$,e[12]=_):_=e[12];let B;return e[13]!==v||e[14]!==i||e[15]!==u||e[16]!==_?(B=o.jsx(X,{open:v,onOpenChange:u,...i,children:_}),e[13]=v,e[14]=i,e[15]=u,e[16]=_,e[17]=B):B=e[17],B}const f=b==="expanded",h=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let p;e[18]!==h?(p=y("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",h),e[18]=h,e[19]=p):p=e[19];const w=f?void 0:"icon",N=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let x;e[20]!==a||e[21]!==N?(x=y("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",N,a),e[20]=a,e[21]=N,e[22]=x):x=e[22];let m;e[23]!==t?(m=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=m):m=e[24];let S;e[25]!==i||e[26]!==x||e[27]!==m?(S=o.jsx("div",{"data-slot":"sidebar-container",className:x,...i,children:m}),e[25]=i,e[26]=x,e[27]=m,e[28]=S):S=e[28];let g;return e[29]!==r||e[30]!==b||e[31]!==p||e[32]!==w||e[33]!==S||e[34]!==l?(g=o.jsx("div",{className:p,"data-state":b,"data-collapsible":w,"data-variant":l,"data-side":r,"data-slot":"sidebar",children:S}),e[29]=r,e[30]=b,e[31]=p,e[32]=w,e[33]=S,e[34]=l,e[35]=g):g=e[35],g}function je(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("main",{"data-slot":"sidebar-inset",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function we(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Ne(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Te(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function ye(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}const le=R("peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm focus-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground hover:[&_svg:not([class*='text-'])]:text-sidebar-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm group-data-[state=collapsed]/sidebar:size-8! group-data-[state=collapsed]/sidebar:rounded-full",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ce(s){const e=j.c(28);let t,a,i,n,d,r,l;e[0]!==s?({asChild:i,isActive:n,variant:d,size:r,tooltip:l,className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d,e[6]=r,e[7]=l):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5],r=e[6],l=e[7]);const c=i===void 0?!1:i,b=n===void 0?!1:n,v=d===void 0?"default":d,u=r===void 0?"default":r,f=c?A:"button",{isMobile:h}=I();let p;e[8]!==t||e[9]!==u||e[10]!==v?(p=y(le({variant:v,size:u}),t),e[8]=t,e[9]=u,e[10]=v,e[11]=p):p=e[11];let w;e[12]!==f||e[13]!==b||e[14]!==a||e[15]!==u||e[16]!==p?(w=o.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":b,className:p,...a}),e[12]=f,e[13]=b,e[14]=a,e[15]=u,e[16]=p,e[17]=w):w=e[17];const N=w;if(!l)return N;if(typeof l=="string"){let g;e[18]!==l?(g={children:l},e[18]=l,e[19]=g):g=e[19],l=g}let x;e[20]!==N?(x=o.jsx(P,{asChild:!0,children:N}),e[20]=N,e[21]=x):x=e[21];let m;e[22]!==h||e[23]!==l?(m=o.jsx(E,{side:"right",align:"center",hidden:h,...l}),e[22]=h,e[23]=l,e[24]=m):m=e[24];let S;return e[25]!==x||e[26]!==m?(S=o.jsxs(z,{children:[x,m]}),e[25]=x,e[26]=m,e[27]=S):S=e[27],S}function re(){const s=j.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},s[0]=e):e=s[0],!!H(e)}const O=C.createContext(null);function Me(s){const e=j.c(5),{children:t}=s,[a,i]=C.useState(null);let n;e[0]!==a?(n={target:a,setTarget:i},e[0]=a,e[1]=n):n=e[1];let d;return e[2]!==t||e[3]!==n?(d=o.jsx(O,{value:n,children:t}),e[2]=t,e[3]=n,e[4]=d):d=e[4],d}function oe(){const s=C.use(O);if(!s)throw new Error("Sidebar thread controls require a Layout");return s}function k(s){const e=j.c(17),{open:t,onToggle:a}=s,i=V(),{isMobile:n,setOpenMobile:d}=I(),r=t?"page.closeThread":"page.openThread";let l;e[0]!==i||e[1]!==r?(l=i(r),e[0]=i,e[1]=r,e[2]=l):l=e[2];const c=l;let b;e[3]!==n||e[4]!==a||e[5]!==d?(b=()=>{a(),n&&d(!1)},e[3]=n,e[4]=a,e[5]=d,e[6]=b):b=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(G,{size:16}),e[7]=v):v=e[7];let u;e[8]!==c||e[9]!==t||e[10]!==b?(u=o.jsx(P,{asChild:!0,children:o.jsx(K,{"aria-label":c,"aria-pressed":t,active:t,className:"size-7 shrink-0 group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:size-8",onClick:b,children:v})}),e[8]=c,e[9]=t,e[10]=b,e[11]=u):u=e[11];let f;e[12]!==c?(f=o.jsx(E,{side:"right",children:c}),e[12]=c,e[13]=f):f=e[13];let h;return e[14]!==u||e[15]!==f?(h=o.jsxs(z,{children:[u,f]}),e[14]=u,e[15]=f,e[16]=h):h=e[16],h}function $e(s){const e=j.c(3),t=C.use(O);let a;return e[0]!==s||e[1]!==t?(a=t?.target?L.createPortal(o.jsx(k,{...s}),t.target):null,e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function _e(){const s=j.c(11),{setTarget:e}=oe(),t=re(),{isMobile:a}=I(),i=W(),{org:n}=F(),{openSidePanel:d}=Q();let r;s[0]!==e?(r=o.jsx("div",{ref:e,className:"peer/thread-button contents empty:hidden"}),s[0]=e,s[1]=r):r=s[1];let l;s[2]!==t||s[3]!==a||s[4]!==i||s[5]!==d||s[6]!==n?(l=o.jsx("div",{className:"hidden peer-empty/thread-button:contents",children:o.jsx(k,{open:!1,onToggle:()=>{t?i({to:"/$org/home",params:{org:n.slug},search:{sidepanel:!0,mainpanel:!a}}):a?i({to:".",search:de,replace:!0}):d()}})}),s[2]=t,s[3]=a,s[4]=i,s[5]=d,s[6]=n,s[7]=l):l=s[7];let c;return s[8]!==r||s[9]!==l?(c=o.jsxs(o.Fragment,{children:[r,l]}),s[8]=r,s[9]=l,s[10]=c):c=s[10],c}function de(s){return{...s,...q("chat")}}function Ie(){const{state:s,isMobile:e}=I();return s==="collapsed"&&!e}export{Ce as S,Te as a,ye as b,I as c,we as d,_e as e,Ne as f,Se as g,re as h,ge as i,ve as j,Me as k,je as l,$e as m,Ie as u};
1
+ import{r as C,c as j,j as o,m as y,cx as A,cy as R,a6 as H,bR as L,b as V,d as W,a4 as F}from"./index-C5rKbfQX.js";import{m as q}from"./use-chat-layout-state-BqEltHtu.js";import{M as G}from"./agent-icon-CIk0WHPf.js";import{b as J,a as E,T as P,c as z}from"./tooltip-DfoRFUTt.js";import{T as K}from"./toolbar-icon-button-CJQ4RpgO.js";import{g as Q}from"./shell-layout-B3OvMhlE.js";import{u as U}from"./use-mobile-BRC3jJYG.js";import{b as X,c as Y,S as Z,d as ee,a as te}from"./sheet-IIyyroSY.js";const se="15rem",ae="18rem",ie="4.5rem",D=C.createContext(null);function I(){const s=C.useContext(D);if(!s)throw new Error("useSidebar must be used within a SidebarProvider.");return s}function ge(s){const e=j.c(19),{children:t,defaultOpen:a,open:i,onOpenChange:n}=s,d=a===void 0?!1:a,r=U(),[l,c]=C.useState(d),[b,v]=C.useState(!1),u=i!==void 0,f=u?i:l;let h;e[0]!==u||e[1]!==n?(h=M=>{u||c(M),n?.(M)},e[0]=u,e[1]=n,e[2]=h):h=e[2];const p=h;let w;e[3]!==r||e[4]!==f||e[5]!==p?(w=()=>{r?v(ne):p(!f)},e[3]=r,e[4]=f,e[5]=p,e[6]=w):w=e[6];const N=w,x=f?"expanded":"collapsed";let m;e[7]!==r||e[8]!==f||e[9]!==b||e[10]!==p||e[11]!==x||e[12]!==N?(m={state:x,open:f,setOpen:p,isMobile:r,openMobile:b,setOpenMobile:v,toggleSidebar:N},e[7]=r,e[8]=f,e[9]=b,e[10]=p,e[11]=x,e[12]=N,e[13]=m):m=e[13];const S=m;let g;e[14]!==t?(g=o.jsx(J,{delayDuration:0,children:t}),e[14]=t,e[15]=g):g=e[15];let T;return e[16]!==S||e[17]!==g?(T=o.jsx(D.Provider,{value:S,children:g}),e[16]=S,e[17]=g,e[18]=T):T=e[18],T}function ne(s){return!s}function ve(s){const e=j.c(14);let t,a,i,n;e[0]!==s?({className:a,style:n,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n):(t=e[1],a=e[2],i=e[3],n=e[4]);let d;e[5]!==n?(d={"--sidebar-width":se,"--sidebar-width-icon":ie,...n},e[5]=n,e[6]=d):d=e[6];const r=d;let l;e[7]!==a?(l=y("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=l):l=e[8];let c;return e[9]!==t||e[10]!==i||e[11]!==r||e[12]!==l?(c=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:l,...i,children:t}),e[9]=t,e[10]=i,e[11]=r,e[12]=l,e[13]=c):c=e[13],c}function Se(s){const e=j.c(36);let t,a,i,n,d;e[0]!==s?({side:n,variant:d,className:a,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5]);const r=n===void 0?"left":n,l=d===void 0?"sidebar":d,{isMobile:c,state:b,openMobile:v,setOpenMobile:u}=I();if(c){let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T={"--sidebar-width":ae},e[6]=T):T=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(Y,{className:"sr-only",children:[o.jsx(Z,{children:"Sidebar"}),o.jsx(ee,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let $;e[8]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let _;e[10]!==r||e[11]!==$?(_=o.jsxs(te,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:T,side:r,children:[M,$]}),e[10]=r,e[11]=$,e[12]=_):_=e[12];let B;return e[13]!==v||e[14]!==i||e[15]!==u||e[16]!==_?(B=o.jsx(X,{open:v,onOpenChange:u,...i,children:_}),e[13]=v,e[14]=i,e[15]=u,e[16]=_,e[17]=B):B=e[17],B}const f=b==="expanded",h=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let p;e[18]!==h?(p=y("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",h),e[18]=h,e[19]=p):p=e[19];const w=f?void 0:"icon",N=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let x;e[20]!==a||e[21]!==N?(x=y("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",N,a),e[20]=a,e[21]=N,e[22]=x):x=e[22];let m;e[23]!==t?(m=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=m):m=e[24];let S;e[25]!==i||e[26]!==x||e[27]!==m?(S=o.jsx("div",{"data-slot":"sidebar-container",className:x,...i,children:m}),e[25]=i,e[26]=x,e[27]=m,e[28]=S):S=e[28];let g;return e[29]!==r||e[30]!==b||e[31]!==p||e[32]!==w||e[33]!==S||e[34]!==l?(g=o.jsx("div",{className:p,"data-state":b,"data-collapsible":w,"data-variant":l,"data-side":r,"data-slot":"sidebar",children:S}),e[29]=r,e[30]=b,e[31]=p,e[32]=w,e[33]=S,e[34]=l,e[35]=g):g=e[35],g}function je(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("main",{"data-slot":"sidebar-inset",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function we(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Ne(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Te(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function ye(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=y("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}const le=R("peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm focus-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground hover:[&_svg:not([class*='text-'])]:text-sidebar-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm group-data-[state=collapsed]/sidebar:size-8! group-data-[state=collapsed]/sidebar:rounded-full",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ce(s){const e=j.c(28);let t,a,i,n,d,r,l;e[0]!==s?({asChild:i,isActive:n,variant:d,size:r,tooltip:l,className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d,e[6]=r,e[7]=l):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5],r=e[6],l=e[7]);const c=i===void 0?!1:i,b=n===void 0?!1:n,v=d===void 0?"default":d,u=r===void 0?"default":r,f=c?A:"button",{isMobile:h}=I();let p;e[8]!==t||e[9]!==u||e[10]!==v?(p=y(le({variant:v,size:u}),t),e[8]=t,e[9]=u,e[10]=v,e[11]=p):p=e[11];let w;e[12]!==f||e[13]!==b||e[14]!==a||e[15]!==u||e[16]!==p?(w=o.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":b,className:p,...a}),e[12]=f,e[13]=b,e[14]=a,e[15]=u,e[16]=p,e[17]=w):w=e[17];const N=w;if(!l)return N;if(typeof l=="string"){let g;e[18]!==l?(g={children:l},e[18]=l,e[19]=g):g=e[19],l=g}let x;e[20]!==N?(x=o.jsx(P,{asChild:!0,children:N}),e[20]=N,e[21]=x):x=e[21];let m;e[22]!==h||e[23]!==l?(m=o.jsx(E,{side:"right",align:"center",hidden:h,...l}),e[22]=h,e[23]=l,e[24]=m):m=e[24];let S;return e[25]!==x||e[26]!==m?(S=o.jsxs(z,{children:[x,m]}),e[25]=x,e[26]=m,e[27]=S):S=e[27],S}function re(){const s=j.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},s[0]=e):e=s[0],!!H(e)}const O=C.createContext(null);function Me(s){const e=j.c(5),{children:t}=s,[a,i]=C.useState(null);let n;e[0]!==a?(n={target:a,setTarget:i},e[0]=a,e[1]=n):n=e[1];let d;return e[2]!==t||e[3]!==n?(d=o.jsx(O,{value:n,children:t}),e[2]=t,e[3]=n,e[4]=d):d=e[4],d}function oe(){const s=C.use(O);if(!s)throw new Error("Sidebar thread controls require a Layout");return s}function k(s){const e=j.c(17),{open:t,onToggle:a}=s,i=V(),{isMobile:n,setOpenMobile:d}=I(),r=t?"page.closeThread":"page.openThread";let l;e[0]!==i||e[1]!==r?(l=i(r),e[0]=i,e[1]=r,e[2]=l):l=e[2];const c=l;let b;e[3]!==n||e[4]!==a||e[5]!==d?(b=()=>{a(),n&&d(!1)},e[3]=n,e[4]=a,e[5]=d,e[6]=b):b=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(G,{size:16}),e[7]=v):v=e[7];let u;e[8]!==c||e[9]!==t||e[10]!==b?(u=o.jsx(P,{asChild:!0,children:o.jsx(K,{"aria-label":c,"aria-pressed":t,active:t,className:"size-7 shrink-0 group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:size-8",onClick:b,children:v})}),e[8]=c,e[9]=t,e[10]=b,e[11]=u):u=e[11];let f;e[12]!==c?(f=o.jsx(E,{side:"right",children:c}),e[12]=c,e[13]=f):f=e[13];let h;return e[14]!==u||e[15]!==f?(h=o.jsxs(z,{children:[u,f]}),e[14]=u,e[15]=f,e[16]=h):h=e[16],h}function $e(s){const e=j.c(3),t=C.use(O);let a;return e[0]!==s||e[1]!==t?(a=t?.target?L.createPortal(o.jsx(k,{...s}),t.target):null,e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function _e(){const s=j.c(11),{setTarget:e}=oe(),t=re(),{isMobile:a}=I(),i=W(),{org:n}=F(),{openSidePanel:d}=Q();let r;s[0]!==e?(r=o.jsx("div",{ref:e,className:"peer/thread-button contents empty:hidden"}),s[0]=e,s[1]=r):r=s[1];let l;s[2]!==t||s[3]!==a||s[4]!==i||s[5]!==d||s[6]!==n?(l=o.jsx("div",{className:"hidden peer-empty/thread-button:contents",children:o.jsx(k,{open:!1,onToggle:()=>{t?i({to:"/$org/home",params:{org:n.slug},search:{sidepanel:!0,mainpanel:!a}}):a?i({to:".",search:de,replace:!0}):d()}})}),s[2]=t,s[3]=a,s[4]=i,s[5]=d,s[6]=n,s[7]=l):l=s[7];let c;return s[8]!==r||s[9]!==l?(c=o.jsxs(o.Fragment,{children:[r,l]}),s[8]=r,s[9]=l,s[10]=c):c=s[10],c}function de(s){return{...s,...q("chat")}}function Ie(){const{state:s,isMobile:e}=I();return s==="collapsed"&&!e}export{Ce as S,Te as a,ye as b,I as c,we as d,_e as e,Ne as f,Se as g,re as h,ge as i,ve as j,Me as k,je as l,$e as m,Ie as u};
@@ -1 +1 @@
1
- import{c as u,a4 as f,aj as y,i as m,q as g,e as T,K as l,t as E}from"./index-CpKrWBFM.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,M as c,A as d,K as u};
1
+ import{c as u,a4 as f,aj as y,i as m,q as g,e as T,K as l,t as E}from"./index-C5rKbfQX.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,M as c,A as d,K as u};
@@ -1 +1 @@
1
- import{c as O,f,i as S,K as _,ak as R,a4 as i,aj as l}from"./index-CpKrWBFM.js";const K=["TASK_BOARD_OPERATION","TASK_BOARD_REWORK","TASK_BOARD_DELIVERY","TASK_BOARD_SPRINTS","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function B(){const t=O.c(8),o=f({strict:!1}).org??"";let e;t[0]!==o?(e=_.taskBoardAdminOrgs(o),t[0]=o,t[1]=e):e=t[1];const s=!!o;let n;t[2]!==o?(n=()=>R(o,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=o,t[3]=n):n=t[3];let c;return t[4]!==e||t[5]!==s||t[6]!==n?(c={queryKey:e,enabled:s,queryFn:n,staleTime:3e5},t[4]=e,t[5]=s,t[6]=n,t[7]=c):c=t[7],S(c)}function y(t,o){const e=O.c(14),{locator:s}=i(),n=l();let c;e[0]!==s||e[1]!==o.from||e[2]!==o.org||e[3]!==o.project||e[4]!==o.to||e[5]!==t?(c=_.taskBoardAnalytics(s,t,o.org??"",o.project??"",o.from,o.to),e[0]=s,e[1]=o.from,e[2]=o.org,e[3]=o.project,e[4]=o.to,e[5]=t,e[6]=c):c=e[6];let T;e[7]!==o||e[8]!==n||e[9]!==t?(T=()=>n.call(t,o),e[7]=o,e[8]=n,e[9]=t,e[10]=T):T=e[10];let A;return e[11]!==c||e[12]!==T?(A={queryKey:c,queryFn:T},e[11]=c,e[12]=T,e[13]=A):A=e[13],S(A)}function D(t,o){const e=O.c(15),{locator:s}=i(),n=l();let c;e[0]!==o||e[1]!==s||e[2]!==t.from||e[3]!==t.org||e[4]!==t.project||e[5]!==t.to?(c=_.taskBoardOperationTasks(s,t.org??"",t.project??"",t.from,t.to,o??""),e[0]=o,e[1]=s,e[2]=t.from,e[3]=t.org,e[4]=t.project,e[5]=t.to,e[6]=c):c=e[6];const T=o!==null;let A;e[7]!==o||e[8]!==t||e[9]!==n?(A=()=>n.call("TASK_BOARD_OPERATION_TASKS",{...t,drill:o??""}),e[7]=o,e[8]=t,e[9]=n,e[10]=A):A=e[10];let u;return e[11]!==c||e[12]!==T||e[13]!==A?(u={queryKey:c,enabled:T,queryFn:A},e[11]=c,e[12]=T,e[13]=A,e[14]=u):u=e[14],S(u)}export{K as A,y as a,D as b,B as u};
1
+ import{c as O,f,i as S,K as _,ak as R,a4 as i,aj as l}from"./index-C5rKbfQX.js";const K=["TASK_BOARD_OPERATION","TASK_BOARD_REWORK","TASK_BOARD_DELIVERY","TASK_BOARD_SPRINTS","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function B(){const t=O.c(8),o=f({strict:!1}).org??"";let e;t[0]!==o?(e=_.taskBoardAdminOrgs(o),t[0]=o,t[1]=e):e=t[1];const s=!!o;let n;t[2]!==o?(n=()=>R(o,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=o,t[3]=n):n=t[3];let c;return t[4]!==e||t[5]!==s||t[6]!==n?(c={queryKey:e,enabled:s,queryFn:n,staleTime:3e5},t[4]=e,t[5]=s,t[6]=n,t[7]=c):c=t[7],S(c)}function y(t,o){const e=O.c(14),{locator:s}=i(),n=l();let c;e[0]!==s||e[1]!==o.from||e[2]!==o.org||e[3]!==o.project||e[4]!==o.to||e[5]!==t?(c=_.taskBoardAnalytics(s,t,o.org??"",o.project??"",o.from,o.to),e[0]=s,e[1]=o.from,e[2]=o.org,e[3]=o.project,e[4]=o.to,e[5]=t,e[6]=c):c=e[6];let T;e[7]!==o||e[8]!==n||e[9]!==t?(T=()=>n.call(t,o),e[7]=o,e[8]=n,e[9]=t,e[10]=T):T=e[10];let A;return e[11]!==c||e[12]!==T?(A={queryKey:c,queryFn:T},e[11]=c,e[12]=T,e[13]=A):A=e[13],S(A)}function D(t,o){const e=O.c(15),{locator:s}=i(),n=l();let c;e[0]!==o||e[1]!==s||e[2]!==t.from||e[3]!==t.org||e[4]!==t.project||e[5]!==t.to?(c=_.taskBoardOperationTasks(s,t.org??"",t.project??"",t.from,t.to,o??""),e[0]=o,e[1]=s,e[2]=t.from,e[3]=t.org,e[4]=t.project,e[5]=t.to,e[6]=c):c=e[6];const T=o!==null;let A;e[7]!==o||e[8]!==t||e[9]!==n?(A=()=>n.call("TASK_BOARD_OPERATION_TASKS",{...t,drill:o??""}),e[7]=o,e[8]=t,e[9]=n,e[10]=A):A=e[10];let u;return e[11]!==c||e[12]!==T||e[13]!==A?(u={queryKey:c,enabled:T,queryFn:A},e[11]=c,e[12]=T,e[13]=A,e[14]=u):u=e[14],S(u)}export{K as A,y as a,D as b,B as u};
@@ -1 +1 @@
1
- import{a as m}from"./task-board-CwSJI_Nh.js";import{r as e}from"./index-CpKrWBFM.js";import{t as g}from"./watch-sse-pool-C6-OWpzA.js";const p=()=>0;function v(E){const{orgSlug:r,enabled:t=!0,onUpdate:u,onDelete:c,onResync:o}=E,a=e.useRef(u);a.current=u;const f=e.useRef(c);f.current=c;const d=e.useRef(o);d.current=o;const s=e.useRef(null),R=e.useRef(t),i=e.useRef(r);(!s.current||R.current!==t||i.current!==r)&&(R.current=t,i.current=r,s.current=b=>{if(!t||!r)return()=>{};const S=l=>{let n;try{n=JSON.parse(l.data)}catch{return}n.data&&(l.type===m?f.current?.(n.data.id):a.current(n.data)),b()};return g.subscribe(r,S,()=>d.current?.())}),e.useSyncExternalStore(s.current,p,p)}export{v as u};
1
+ import{a as m}from"./task-board-BRiMfa1H.js";import{r as e}from"./index-C5rKbfQX.js";import{t as g}from"./watch-sse-pool-GnUwxcY-.js";const p=()=>0;function v(E){const{orgSlug:r,enabled:t=!0,onUpdate:u,onDelete:c,onResync:o}=E,a=e.useRef(u);a.current=u;const f=e.useRef(c);f.current=c;const d=e.useRef(o);d.current=o;const s=e.useRef(null),R=e.useRef(t),i=e.useRef(r);(!s.current||R.current!==t||i.current!==r)&&(R.current=t,i.current=r,s.current=b=>{if(!t||!r)return()=>{};const S=l=>{let n;try{n=JSON.parse(l.data)}catch{return}n.data&&(l.type===m?f.current?.(n.data.id):a.current(n.data)),b()};return g.subscribe(r,S,()=>d.current?.())}),e.useSyncExternalStore(s.current,p,p)}export{v as u};
@@ -1 +1 @@
1
- import{r as y,as as w,c as h,a4 as R,aj as T,q as k,i as O,K as A}from"./index-CpKrWBFM.js";import{c as B}from"./watch-sse-pool-C6-OWpzA.js";const P=()=>0;function C(e){const{orgSlug:t,itemId:s,onPrs:r}=e,o=y.useRef(r);o.current=r;const l=y.useRef(null),a=y.useRef(""),i=`${t}:${s??""}`;(!l.current||a.current!==i)&&(a.current=i,l.current=u=>{if(!t||!s)return()=>{};const d=c=>{let n;try{n=JSON.parse(c.data)}catch{return}n.data?.id!==s||!Array.isArray(n.data.prs)||(o.current(n.data.prs),u())};return B.subscribe(t,d)}),y.useSyncExternalStore(l.current,P,P)}const E=1440*60*1e3,D=40;function g(e){try{const t=window.localStorage.getItem(w.taskBoardPrs(e));return t?JSON.parse(t):{}}catch{return{}}}function L(e){const t=Date.now(),s=Object.entries(e).filter(([,r])=>t-r.updatedAt<=E);for(s.sort(([,r],[,o])=>r.updatedAt-o.updatedAt);s.length>D;)s.shift();return Object.fromEntries(s)}function _(e,t){if(typeof window>"u")return null;const s=g(e)[t];return!s||Date.now()-s.updatedAt>E?null:s}function b(e,t,s){if(!(typeof window>"u"))try{const r=g(e);r[t]={data:s,updatedAt:Date.now()},window.localStorage.setItem(w.taskBoardPrs(e),JSON.stringify(L(r)))}catch{}}const v=6e4,K=2e3,N=e=>e.state===null;function q(e){const t=h.c(25),{org:s,locator:r}=R(),o=T(),l=k();let a;t[0]!==e||t[1]!==r||t[2]!==l?(a=S=>{l.setQueryData(A.taskBoardItemPrs(r,e??""),S)},t[0]=e,t[1]=r,t[2]=l,t[3]=a):a=t[3];let i;t[4]!==e||t[5]!==s.slug||t[6]!==a?(i={orgSlug:s.slug,itemId:e,onPrs:a},t[4]=e,t[5]=s.slug,t[6]=a,t[7]=i):i=t[7],C(i);let u;t[8]!==e||t[9]!==r?(u=A.taskBoardItemPrs(r,e??""),t[8]=e,t[9]=r,t[10]=u):u=t[10];const d=!!e;let c,n;t[11]!==e||t[12]!==r?(c=()=>e?_(r,e)?.data??void 0:void 0,n=()=>e?_(r,e)?.updatedAt:void 0,t[11]=e,t[12]=r,t[13]=c,t[14]=n):(c=t[13],n=t[14]);let f;t[15]!==e||t[16]!==r||t[17]!==o?(f=async()=>{const{prs:S}=await o.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:e});return b(r,e,S),S},t[15]=e,t[16]=r,t[17]=o,t[18]=f):f=t[18];let p;return t[19]!==u||t[20]!==d||t[21]!==c||t[22]!==n||t[23]!==f?(p={queryKey:u,enabled:d,refetchInterval:M,initialData:c,initialDataUpdatedAt:n,queryFn:f},t[19]=u,t[20]=d,t[21]=c,t[22]=n,t[23]=f,t[24]=p):p=t[24],O(p)}function M(e){return e.state.data?.some(N)?K:v}export{q as u};
1
+ import{r as y,as as w,c as h,a4 as R,aj as T,q as k,i as O,K as A}from"./index-C5rKbfQX.js";import{c as B}from"./watch-sse-pool-GnUwxcY-.js";const P=()=>0;function C(e){const{orgSlug:t,itemId:s,onPrs:r}=e,o=y.useRef(r);o.current=r;const l=y.useRef(null),a=y.useRef(""),i=`${t}:${s??""}`;(!l.current||a.current!==i)&&(a.current=i,l.current=u=>{if(!t||!s)return()=>{};const d=c=>{let n;try{n=JSON.parse(c.data)}catch{return}n.data?.id!==s||!Array.isArray(n.data.prs)||(o.current(n.data.prs),u())};return B.subscribe(t,d)}),y.useSyncExternalStore(l.current,P,P)}const E=1440*60*1e3,D=40;function g(e){try{const t=window.localStorage.getItem(w.taskBoardPrs(e));return t?JSON.parse(t):{}}catch{return{}}}function L(e){const t=Date.now(),s=Object.entries(e).filter(([,r])=>t-r.updatedAt<=E);for(s.sort(([,r],[,o])=>r.updatedAt-o.updatedAt);s.length>D;)s.shift();return Object.fromEntries(s)}function _(e,t){if(typeof window>"u")return null;const s=g(e)[t];return!s||Date.now()-s.updatedAt>E?null:s}function b(e,t,s){if(!(typeof window>"u"))try{const r=g(e);r[t]={data:s,updatedAt:Date.now()},window.localStorage.setItem(w.taskBoardPrs(e),JSON.stringify(L(r)))}catch{}}const v=6e4,K=2e3,N=e=>e.state===null;function q(e){const t=h.c(25),{org:s,locator:r}=R(),o=T(),l=k();let a;t[0]!==e||t[1]!==r||t[2]!==l?(a=S=>{l.setQueryData(A.taskBoardItemPrs(r,e??""),S)},t[0]=e,t[1]=r,t[2]=l,t[3]=a):a=t[3];let i;t[4]!==e||t[5]!==s.slug||t[6]!==a?(i={orgSlug:s.slug,itemId:e,onPrs:a},t[4]=e,t[5]=s.slug,t[6]=a,t[7]=i):i=t[7],C(i);let u;t[8]!==e||t[9]!==r?(u=A.taskBoardItemPrs(r,e??""),t[8]=e,t[9]=r,t[10]=u):u=t[10];const d=!!e;let c,n;t[11]!==e||t[12]!==r?(c=()=>e?_(r,e)?.data??void 0:void 0,n=()=>e?_(r,e)?.updatedAt:void 0,t[11]=e,t[12]=r,t[13]=c,t[14]=n):(c=t[13],n=t[14]);let f;t[15]!==e||t[16]!==r||t[17]!==o?(f=async()=>{const{prs:S}=await o.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:e});return b(r,e,S),S},t[15]=e,t[16]=r,t[17]=o,t[18]=f):f=t[18];let p;return t[19]!==u||t[20]!==d||t[21]!==c||t[22]!==n||t[23]!==f?(p={queryKey:u,enabled:d,refetchInterval:M,initialData:c,initialDataUpdatedAt:n,queryFn:f},t[19]=u,t[20]=d,t[21]=c,t[22]=n,t[23]=f,t[24]=p):p=t[24],O(p)}function M(e){return e.state.data?.some(N)?K:v}export{q as u};
@@ -1 +1 @@
1
- import{i as j,b as Y}from"./config-e0Nvtw2Y.js";import{c as P,a4 as U,q as W,K as E,aj as G,i as V,b as X,e as R,E as Z,t as H}from"./index-CpKrWBFM.js";import{u as tt}from"./use-task-board-events-N3Hmav6X.js";import{u as et}from"./use-decopilot-events-B0PBK1Av.js";const st=new Set(["post_deploy_validation","done"]),at=new Set(["done","archived"]);function J(t){if(!st.has(t.status)||!t.updatedAt)return null;const r=Date.parse(t.updatedAt);return Number.isNaN(r)?null:r}function ft(t,r){return t.filter(s=>(J(s)??-1/0)>=r).length}function mt(t,r){return t.filter(s=>at.has(s.status)?!1:r&&s.assigneeId===r?!0:j(s)||Y(s)).sort((s,e)=>(s.updatedAt??"").localeCompare(e.updatedAt??""))}function yt(t){return j(t)?"answer":Y(t)?"review":"assigned"}function ht(t){const r=[];for(const s of t)for(const e of s.threads)e.status==="in_progress"&&r.push({threadId:e.threadId,taskId:s.id,taskTitle:s.title,runTitle:e.title,startedAt:e.createdAt});return r.sort((s,e)=>e.startedAt.localeCompare(s.startedAt))}const gt=14;function At(t,r,s=Date.now()){const e=new Array(r).fill(0);for(const a of t){const n=J(a);if(n===null)continue;const i=r-1-Math.floor(Math.max(0,s-n)/864e5);i>=0&&i<r&&(e[i]+=1)}return e}function It(t,r,s=Date.now()){const e=new Array(r).fill(0);for(const a of t)for(const n of a.threads){const i=Date.parse(n.lastActiveAt);if(Number.isNaN(i))continue;const o=r-1-Math.floor(Math.max(0,s-i)/864e5);o>=0&&o<r&&(e[o]+=1)}return e}function rt(t){const r=new Date(t);r.setDate(1),r.setHours(0,0,0,0);const s=r.getTime();return{since:s,days:Math.floor((t-s)/864e5)+1}}function St(t,r=Date.now()){const{since:s,days:e}=rt(r),a=new Array(e).fill(0);for(const n of t)for(const i of n.threads){const o=Date.parse(i.lastActiveAt);if(Number.isNaN(o)||o<s||o>r)continue;const m=Math.floor((o-s)/864e5);m>=0&&m<e&&(a[m]+=i.costUsd??0)}return a}function Tt(t){return t<=0?"$0":t>=1e3?`$${(t/1e3).toFixed(1)}k`:t>=10?`$${Math.round(t)}`:`$${t.toFixed(2)}`}function nt(t,r){return{queryKey:E.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:s,demoFrozenItemIds:e}=await r.call("TASK_BOARD_ITEM_LIST",{});return{items:s,demoFrozenItemIds:e}}}}function ot(){const t=P.c(21),{org:r,locator:s}=U(),e=W();let a;t[0]!==s?(a=E.taskBoardItems(s),t[0]=s,t[1]=a):a=t[1];const n=a;let i;t[2]!==s||t[3]!==e||t[4]!==n?(i=y=>{e.cancelQueries({queryKey:n}),e.setQueryData(n,d=>d&&{...d,items:d.items.some(c=>c.id===y.id)?d.items.map(c=>c.id===y.id?y:c):[y,...d.items]}),e.invalidateQueries({queryKey:E.taskBoardActivity(s,y.id)}),e.invalidateQueries({queryKey:E.taskBoardComments(s,y.id)})},t[2]=s,t[3]=e,t[4]=n,t[5]=i):i=t[5];let o,m;t[6]!==e||t[7]!==n?(o=()=>{e.invalidateQueries({queryKey:n})},m=y=>{e.cancelQueries({queryKey:n}),e.setQueryData(n,d=>d&&{...d,items:d.items.filter(c=>c.id!==y)})},t[6]=e,t[7]=n,t[8]=o,t[9]=m):(o=t[8],m=t[9]);let u;t[10]!==r.slug||t[11]!==i||t[12]!==o||t[13]!==m?(u={orgSlug:r.slug,onUpdate:i,onResync:o,onDelete:m},t[10]=r.slug,t[11]=i,t[12]=o,t[13]=m,t[14]=u):u=t[14],tt(u);let h;t[15]!==e||t[16]!==n?(h=y=>{const d=y.subject,c=y.data.status;e.cancelQueries({queryKey:n}),e.setQueryData(n,g=>g&&{...g,items:g.items.map(A=>A.threads.some(S=>S.threadId===d)?{...A,threads:A.threads.map(S=>S.threadId===d?{...S,status:c}:S)}:A)});const D=e.getQueryData(n)?.items.some(g=>g.threads.some(A=>A.threadId===d));c==="failed"&&D&&e.invalidateQueries({queryKey:n})},t[15]=e,t[16]=n,t[17]=h):h=t[17];let T;t[18]!==r.slug||t[19]!==h?(T={orgSlug:r.slug,onTaskStatus:h},t[18]=r.slug,t[19]=h,t[20]=T):T=t[20],et(T)}function Dt(){const t=P.c(13),{locator:r}=U(),s=G();let e;t[0]!==r||t[1]!==s?(e=nt(r,s),t[0]=r,t[1]=s,t[2]=e):e=t[2];const a=V(e);ot();let n;t[3]!==a.data?.items?(n=a.data?.items??[],t[3]=a.data?.items,t[4]=n):n=t[4];let i;t[5]!==a.data?.demoFrozenItemIds?(i=a.data?.demoFrozenItemIds??[],t[5]=a.data?.demoFrozenItemIds,t[6]=i):i=t[6];let o;return t[7]!==a.error||t[8]!==a.isFetching||t[9]!==a.isLoading||t[10]!==n||t[11]!==i?(o={items:n,demoFrozenItemIds:i,isLoading:a.isLoading,isFetching:a.isFetching,error:a.error},t[7]=a.error,t[8]=a.isFetching,t[9]=a.isLoading,t[10]=n,t[11]=i,t[12]=o):o=t[12],o}function Et(){const t=P.c(70),{org:r,locator:s}=U(),e=G(),a=W(),n=X();let i;t[0]!==s?(i=E.taskBoardItems(s),t[0]=s,t[1]=i):i=t[1];const o=i;let m;t[2]!==a||t[3]!==o?(m=()=>a.invalidateQueries({queryKey:o}),t[2]=a,t[3]=o,t[4]=m):m=t[4];const u=m;let h;t[5]!==e?(h=l=>e.call("TASK_BOARD_ITEM_CREATE",l),t[5]=e,t[6]=h):h=t[6];let T;t[7]!==u||t[8]!==h?(T={mutationFn:h,onSuccess:u},t[7]=u,t[8]=h,t[9]=T):T=t[9];const y=R(T);let d;t[10]!==e?(d=l=>e.call("TASK_BOARD_ITEM_UPDATE",l),t[10]=e,t[11]=d):d=t[11];let c;t[12]!==a||t[13]!==o?(c=async l=>{await a.cancelQueries({queryKey:o});const I=a.getQueryData(o);return a.setQueryData(o,f=>f&&{...f,items:f.items.map(O=>O.id===l.id?{...O,...l,...l.status!==void 0&&l.status!==O.status&&{statusSince:new Date().toISOString()}}:O)}),{previous:I}},t[12]=a,t[13]=o,t[14]=c):c=t[14];let D;t[15]!==r?(D=(l,I)=>{I.status==="done"&&Z("task_marked_done",{organization_id:r.id,task_board_item_id:I.id})},t[15]=r,t[16]=D):D=t[16];let g;t[17]!==a||t[18]!==o?(g=(l,I,f)=>{f?.previous&&a.setQueryData(o,f.previous)},t[17]=a,t[18]=o,t[19]=g):g=t[19];let A;t[20]!==u||t[21]!==s||t[22]!==a?(A=(l,I,f)=>{u(),a.invalidateQueries({queryKey:E.taskBoardActivity(s,f.id)})},t[20]=u,t[21]=s,t[22]=a,t[23]=A):A=t[23];let S;t[24]!==d||t[25]!==c||t[26]!==D||t[27]!==g||t[28]!==A?(S={mutationFn:d,onMutate:c,onSuccess:D,onError:g,onSettled:A},t[24]=d,t[25]=c,t[26]=D,t[27]=g,t[28]=A,t[29]=S):S=t[29];const $=R(S);let k;t[30]!==e?(k=l=>e.call("TASK_BOARD_ITEM_DELETE",{id:l}),t[30]=e,t[31]=k):k=t[31];let _;t[32]!==u||t[33]!==n?(_=l=>{H.error(l instanceof Error&&l.message?l.message:n("taskBoard.taskBoard.deleteError")),u()},t[32]=u,t[33]=n,t[34]=_):_=t[34];let w;t[35]!==u||t[36]!==k||t[37]!==_?(w={mutationFn:k,onSuccess:u,onError:_},t[35]=u,t[36]=k,t[37]=_,t[38]=w):w=t[38];const x=R(w);let B;t[39]!==e?(B=async l=>{const I=await Promise.allSettled(l.map(f=>e.call("TASK_BOARD_ITEM_DELETE",{id:f})));return{total:l.length,failed:I.filter(it).length}},t[39]=e,t[40]=B):B=t[40];let p,Q;t[41]!==n?(p=l=>{const{total:I,failed:f}=l;f!==0&&H.error(n("taskBoard.taskBoard.deleteBulkError",{failed:String(f),total:String(I)}))},Q=()=>H.error(n("taskBoard.taskBoard.deleteError")),t[41]=n,t[42]=p,t[43]=Q):(p=t[42],Q=t[43]);let q;t[44]!==u||t[45]!==B||t[46]!==p||t[47]!==Q?(q={mutationFn:B,onSuccess:p,onError:Q,onSettled:u},t[44]=u,t[45]=B,t[46]=p,t[47]=Q,t[48]=q):q=t[48];const L=R(q);let M;t[49]!==e?(M=l=>e.call("TASK_BOARD_ITEM_UPDATE",l),t[49]=e,t[50]=M):M=t[50];let v;t[51]!==u||t[52]!==M?(v={mutationFn:M,onSuccess:u},t[51]=u,t[52]=M,t[53]=v):v=t[53];const b=R(v);let F;t[54]!==e?(F=l=>e.call("TASK_BOARD_ITEM_RERUN",l),t[54]=e,t[55]=F):F=t[55];let K;t[56]!==u||t[57]!==s||t[58]!==a?(K=(l,I,f)=>{u(),a.invalidateQueries({queryKey:E.taskBoardActivity(s,f.id)})},t[56]=u,t[57]=s,t[58]=a,t[59]=K):K=t[59];let N;t[60]!==F||t[61]!==K?(N={mutationFn:F,onSettled:K},t[60]=F,t[61]=K,t[62]=N):N=t[62];const z=R(N);let C;return t[63]!==y||t[64]!==b||t[65]!==x||t[66]!==L||t[67]!==z||t[68]!==$?(C={create:y,update:$,remove:x,removeMany:L,link:b,rerun:z},t[63]=y,t[64]=b,t[65]=x,t[66]=L,t[67]=z,t[68]=$,t[69]=C):C=t[69],C}function it(t){return t.status==="rejected"}export{gt as R,nt as a,yt as b,At as c,It as d,St as e,Tt as f,Dt as g,Et as h,ht as r,ft as s,mt as t,ot as u};
1
+ import{i as j,b as Y}from"./config-B4N1KvK3.js";import{c as P,a4 as U,q as W,K as E,aj as G,i as V,b as X,e as R,E as Z,t as H}from"./index-C5rKbfQX.js";import{u as tt}from"./use-task-board-events-D2PTxteH.js";import{u as et}from"./use-decopilot-events-YhVenol5.js";const st=new Set(["post_deploy_validation","done"]),at=new Set(["done","archived"]);function J(t){if(!st.has(t.status)||!t.updatedAt)return null;const r=Date.parse(t.updatedAt);return Number.isNaN(r)?null:r}function ft(t,r){return t.filter(s=>(J(s)??-1/0)>=r).length}function mt(t,r){return t.filter(s=>at.has(s.status)?!1:r&&s.assigneeId===r?!0:j(s)||Y(s)).sort((s,e)=>(s.updatedAt??"").localeCompare(e.updatedAt??""))}function yt(t){return j(t)?"answer":Y(t)?"review":"assigned"}function ht(t){const r=[];for(const s of t)for(const e of s.threads)e.status==="in_progress"&&r.push({threadId:e.threadId,taskId:s.id,taskTitle:s.title,runTitle:e.title,startedAt:e.createdAt});return r.sort((s,e)=>e.startedAt.localeCompare(s.startedAt))}const gt=14;function At(t,r,s=Date.now()){const e=new Array(r).fill(0);for(const a of t){const n=J(a);if(n===null)continue;const i=r-1-Math.floor(Math.max(0,s-n)/864e5);i>=0&&i<r&&(e[i]+=1)}return e}function It(t,r,s=Date.now()){const e=new Array(r).fill(0);for(const a of t)for(const n of a.threads){const i=Date.parse(n.lastActiveAt);if(Number.isNaN(i))continue;const o=r-1-Math.floor(Math.max(0,s-i)/864e5);o>=0&&o<r&&(e[o]+=1)}return e}function rt(t){const r=new Date(t);r.setDate(1),r.setHours(0,0,0,0);const s=r.getTime();return{since:s,days:Math.floor((t-s)/864e5)+1}}function St(t,r=Date.now()){const{since:s,days:e}=rt(r),a=new Array(e).fill(0);for(const n of t)for(const i of n.threads){const o=Date.parse(i.lastActiveAt);if(Number.isNaN(o)||o<s||o>r)continue;const m=Math.floor((o-s)/864e5);m>=0&&m<e&&(a[m]+=i.costUsd??0)}return a}function Tt(t){return t<=0?"$0":t>=1e3?`$${(t/1e3).toFixed(1)}k`:t>=10?`$${Math.round(t)}`:`$${t.toFixed(2)}`}function nt(t,r){return{queryKey:E.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:s,demoFrozenItemIds:e}=await r.call("TASK_BOARD_ITEM_LIST",{});return{items:s,demoFrozenItemIds:e}}}}function ot(){const t=P.c(21),{org:r,locator:s}=U(),e=W();let a;t[0]!==s?(a=E.taskBoardItems(s),t[0]=s,t[1]=a):a=t[1];const n=a;let i;t[2]!==s||t[3]!==e||t[4]!==n?(i=y=>{e.cancelQueries({queryKey:n}),e.setQueryData(n,d=>d&&{...d,items:d.items.some(c=>c.id===y.id)?d.items.map(c=>c.id===y.id?y:c):[y,...d.items]}),e.invalidateQueries({queryKey:E.taskBoardActivity(s,y.id)}),e.invalidateQueries({queryKey:E.taskBoardComments(s,y.id)})},t[2]=s,t[3]=e,t[4]=n,t[5]=i):i=t[5];let o,m;t[6]!==e||t[7]!==n?(o=()=>{e.invalidateQueries({queryKey:n})},m=y=>{e.cancelQueries({queryKey:n}),e.setQueryData(n,d=>d&&{...d,items:d.items.filter(c=>c.id!==y)})},t[6]=e,t[7]=n,t[8]=o,t[9]=m):(o=t[8],m=t[9]);let u;t[10]!==r.slug||t[11]!==i||t[12]!==o||t[13]!==m?(u={orgSlug:r.slug,onUpdate:i,onResync:o,onDelete:m},t[10]=r.slug,t[11]=i,t[12]=o,t[13]=m,t[14]=u):u=t[14],tt(u);let h;t[15]!==e||t[16]!==n?(h=y=>{const d=y.subject,c=y.data.status;e.cancelQueries({queryKey:n}),e.setQueryData(n,g=>g&&{...g,items:g.items.map(A=>A.threads.some(S=>S.threadId===d)?{...A,threads:A.threads.map(S=>S.threadId===d?{...S,status:c}:S)}:A)});const D=e.getQueryData(n)?.items.some(g=>g.threads.some(A=>A.threadId===d));c==="failed"&&D&&e.invalidateQueries({queryKey:n})},t[15]=e,t[16]=n,t[17]=h):h=t[17];let T;t[18]!==r.slug||t[19]!==h?(T={orgSlug:r.slug,onTaskStatus:h},t[18]=r.slug,t[19]=h,t[20]=T):T=t[20],et(T)}function Dt(){const t=P.c(13),{locator:r}=U(),s=G();let e;t[0]!==r||t[1]!==s?(e=nt(r,s),t[0]=r,t[1]=s,t[2]=e):e=t[2];const a=V(e);ot();let n;t[3]!==a.data?.items?(n=a.data?.items??[],t[3]=a.data?.items,t[4]=n):n=t[4];let i;t[5]!==a.data?.demoFrozenItemIds?(i=a.data?.demoFrozenItemIds??[],t[5]=a.data?.demoFrozenItemIds,t[6]=i):i=t[6];let o;return t[7]!==a.error||t[8]!==a.isFetching||t[9]!==a.isLoading||t[10]!==n||t[11]!==i?(o={items:n,demoFrozenItemIds:i,isLoading:a.isLoading,isFetching:a.isFetching,error:a.error},t[7]=a.error,t[8]=a.isFetching,t[9]=a.isLoading,t[10]=n,t[11]=i,t[12]=o):o=t[12],o}function Et(){const t=P.c(70),{org:r,locator:s}=U(),e=G(),a=W(),n=X();let i;t[0]!==s?(i=E.taskBoardItems(s),t[0]=s,t[1]=i):i=t[1];const o=i;let m;t[2]!==a||t[3]!==o?(m=()=>a.invalidateQueries({queryKey:o}),t[2]=a,t[3]=o,t[4]=m):m=t[4];const u=m;let h;t[5]!==e?(h=l=>e.call("TASK_BOARD_ITEM_CREATE",l),t[5]=e,t[6]=h):h=t[6];let T;t[7]!==u||t[8]!==h?(T={mutationFn:h,onSuccess:u},t[7]=u,t[8]=h,t[9]=T):T=t[9];const y=R(T);let d;t[10]!==e?(d=l=>e.call("TASK_BOARD_ITEM_UPDATE",l),t[10]=e,t[11]=d):d=t[11];let c;t[12]!==a||t[13]!==o?(c=async l=>{await a.cancelQueries({queryKey:o});const I=a.getQueryData(o);return a.setQueryData(o,f=>f&&{...f,items:f.items.map(O=>O.id===l.id?{...O,...l,...l.status!==void 0&&l.status!==O.status&&{statusSince:new Date().toISOString()}}:O)}),{previous:I}},t[12]=a,t[13]=o,t[14]=c):c=t[14];let D;t[15]!==r?(D=(l,I)=>{I.status==="done"&&Z("task_marked_done",{organization_id:r.id,task_board_item_id:I.id})},t[15]=r,t[16]=D):D=t[16];let g;t[17]!==a||t[18]!==o?(g=(l,I,f)=>{f?.previous&&a.setQueryData(o,f.previous)},t[17]=a,t[18]=o,t[19]=g):g=t[19];let A;t[20]!==u||t[21]!==s||t[22]!==a?(A=(l,I,f)=>{u(),a.invalidateQueries({queryKey:E.taskBoardActivity(s,f.id)})},t[20]=u,t[21]=s,t[22]=a,t[23]=A):A=t[23];let S;t[24]!==d||t[25]!==c||t[26]!==D||t[27]!==g||t[28]!==A?(S={mutationFn:d,onMutate:c,onSuccess:D,onError:g,onSettled:A},t[24]=d,t[25]=c,t[26]=D,t[27]=g,t[28]=A,t[29]=S):S=t[29];const $=R(S);let k;t[30]!==e?(k=l=>e.call("TASK_BOARD_ITEM_DELETE",{id:l}),t[30]=e,t[31]=k):k=t[31];let _;t[32]!==u||t[33]!==n?(_=l=>{H.error(l instanceof Error&&l.message?l.message:n("taskBoard.taskBoard.deleteError")),u()},t[32]=u,t[33]=n,t[34]=_):_=t[34];let w;t[35]!==u||t[36]!==k||t[37]!==_?(w={mutationFn:k,onSuccess:u,onError:_},t[35]=u,t[36]=k,t[37]=_,t[38]=w):w=t[38];const x=R(w);let B;t[39]!==e?(B=async l=>{const I=await Promise.allSettled(l.map(f=>e.call("TASK_BOARD_ITEM_DELETE",{id:f})));return{total:l.length,failed:I.filter(it).length}},t[39]=e,t[40]=B):B=t[40];let p,Q;t[41]!==n?(p=l=>{const{total:I,failed:f}=l;f!==0&&H.error(n("taskBoard.taskBoard.deleteBulkError",{failed:String(f),total:String(I)}))},Q=()=>H.error(n("taskBoard.taskBoard.deleteError")),t[41]=n,t[42]=p,t[43]=Q):(p=t[42],Q=t[43]);let q;t[44]!==u||t[45]!==B||t[46]!==p||t[47]!==Q?(q={mutationFn:B,onSuccess:p,onError:Q,onSettled:u},t[44]=u,t[45]=B,t[46]=p,t[47]=Q,t[48]=q):q=t[48];const L=R(q);let M;t[49]!==e?(M=l=>e.call("TASK_BOARD_ITEM_UPDATE",l),t[49]=e,t[50]=M):M=t[50];let v;t[51]!==u||t[52]!==M?(v={mutationFn:M,onSuccess:u},t[51]=u,t[52]=M,t[53]=v):v=t[53];const b=R(v);let F;t[54]!==e?(F=l=>e.call("TASK_BOARD_ITEM_RERUN",l),t[54]=e,t[55]=F):F=t[55];let K;t[56]!==u||t[57]!==s||t[58]!==a?(K=(l,I,f)=>{u(),a.invalidateQueries({queryKey:E.taskBoardActivity(s,f.id)})},t[56]=u,t[57]=s,t[58]=a,t[59]=K):K=t[59];let N;t[60]!==F||t[61]!==K?(N={mutationFn:F,onSettled:K},t[60]=F,t[61]=K,t[62]=N):N=t[62];const z=R(N);let C;return t[63]!==y||t[64]!==b||t[65]!==x||t[66]!==L||t[67]!==z||t[68]!==$?(C={create:y,update:$,remove:x,removeMany:L,link:b,rerun:z},t[63]=y,t[64]=b,t[65]=x,t[66]=L,t[67]=z,t[68]=$,t[69]=C):C=t[69],C}function it(t){return t.status==="rejected"}export{gt as R,nt as a,yt as b,At as c,It as d,St as e,Tt as f,Dt as g,Et as h,ht as r,ft as s,mt as t,ot as u};
@@ -1 +1 @@
1
- import{c as $,b as D,m as z,j as o,a4 as q,L as Z,ar as ee,d as te,r as U,h9 as se,B as ae,t as oe,aj as V,K as F,i as ne,q as Y,e as le}from"./index-CpKrWBFM.js";import{s as W}from"./Plus-CXFgI-7S.js";import{s as re}from"./XClose-Ba9vOcHg.js";import{i as ie}from"./Zap-CGLJP1Pm.js";import{B as K}from"./badge-Dmw39gk8.js";import{f as ce,a as ue,c as de,C as me,e as fe,b as pe}from"./command-D_vABNVv.js";import{I as xe}from"./icon-button-cmhhff3C.js";import{c as ge,a as he,b as je,S as ve}from"./sheet-DRzohuTq.js";import{j as ke}from"./use-org-fs-noLXcqcI.js";import{a as Ne}from"./use-project-scope-BXftze_e.js";import{u as J,a as _e}from"./use-automations-CotbuTIN.js";import{C as ye}from"./task-board-CwSJI_Nh.js";import{b as be}from"./watch-sse-pool-C6-OWpzA.js";const Be={triage:"taskBoard.columnGuide.triage",todo:"taskBoard.columnGuide.todo",in_progress:"taskBoard.columnGuide.inProgress",in_review:"taskBoard.columnGuide.inReview",qa:"taskBoard.columnGuide.qa",customer_approval:"taskBoard.columnGuide.customerApproval",ready_for_deployment:"taskBoard.columnGuide.readyForDeployment",post_deploy_validation:"taskBoard.columnGuide.postDeployValidation",done:null,archived:null};function Se(t){const e=ye.find(a=>a===t);return e?Be[e]:null}function He(t){const e=$.c(7),{data:a}=J();let s;e[0]!==a?(s=a??[],e[0]=a,e[1]=s):s=e[1];let n;if(e[2]!==t||e[3]!==s){let l;e[5]!==t?(l=r=>r.board_triggers.some(c=>c.type==="board_column_transition"&&c.column_key===t),e[5]=t,e[6]=l):l=e[6],n=s.filter(l),e[2]=t,e[3]=s,e[4]=n}else n=e[4];return n}function Q(t){switch(t){case"board_column_transition":return 0;case"board_pr_ready":return 1;case"board_pr_merged":return 2;default:return t}}function Ce(t){switch(t){case"board_column_transition":return"taskBoard.columnRules.starter.board_column_transition";case"board_pr_ready":return"taskBoard.columnRules.starter.board_pr_ready";case"board_pr_merged":return"taskBoard.columnRules.starter.board_pr_merged";default:return t}}function Re(t){const e=$.c(5),{data:a}=J();let s;if(e[0]!==t||e[1]!==a){let n;e[3]!==t?(n=l=>{const r=l.board_triggers.find(c=>c.column_key===t);return r?[{automation:l,starter:r.type}]:[]},e[3]=t,e[4]=n):n=e[4],s=(a??[]).flatMap(n).sort(Ae),e[0]=t,e[1]=a,e[2]=s}else s=e[2];return s}function Ae(t,e){return Number(e.automation.active)-Number(t.automation.active)||Q(t.starter)-Q(e.starter)}function Ue(t){const e=$.c(37),{columnKey:a,label:s,icon:n,iconClassName:l,open:r,onOpenChange:c}=t,i=D(),{org:u}=q(),g=Se(a),d=Re(a);let h;e[0]!==c?(h=()=>c(!1),e[0]=c,e[1]=h):h=e[1];const x=h,R=je,_=he,O="w-full gap-0 sm:max-w-md",y=void 0,b=Te,B=ge,A="gap-1 pb-0";let m;e[2]!==n||e[3]!==l?(m=n&&o.jsx(n,{size:16,className:l}),e[2]=n,e[3]=l,e[4]=m):m=e[4];let j;e[5]!==s||e[6]!==m?(j=o.jsxs(ve,{className:"flex items-center gap-2",children:[m,s]}),e[5]=s,e[6]=m,e[7]=j):j=e[7];const T=g&&o.jsx("p",{className:"surface-inset mt-2 rounded-xl px-3.5 py-3 text-sm leading-relaxed text-foreground",children:i(g)});let v;e[8]!==B||e[9]!==j||e[10]!==T?(v=o.jsxs(B,{className:A,children:[j,T]}),e[8]=B,e[9]=j,e[10]=T,e[11]=v):v=e[11];let k;e[12]!==i?(k=i("taskBoard.columnRules.runsHere"),e[12]=i,e[13]=k):k=e[13];let S;e[14]!==k?(S=o.jsx("h3",{className:"text-meta",children:k}),e[14]=k,e[15]=S):S=e[15];let f;e[16]!==d||e[17]!==a||e[18]!==s||e[19]!==x||e[20]!==u||e[21]!==i?(f=d.length===0?o.jsx(we,{columnKey:a,label:s,onLeave:x}):o.jsx("div",{className:"surface divide-y divide-border",children:d.map(L=>{const{automation:N,starter:E}=L;return o.jsxs(Z,{to:"/$org/projects/$agentId/automations/$automationId",params:{org:u.slug,agentId:N.virtual_mcp_id,automationId:N.id},onClick:x,className:"group flex items-center gap-3 px-3 py-2.5 transition-colors hover:bg-accent/50",children:[o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("span",{className:z("truncate text-sm",N.active?"text-foreground":"text-muted-foreground"),children:N.name}),o.jsx("span",{className:"text-meta",children:N.active?i(Ce(E)):i("taskBoard.columnRules.off")})]}),o.jsx(ee,{size:14,className:"shrink-0 text-muted-foreground transition-colors group-hover:text-foreground"})]},N.id)})}),e[16]=d,e[17]=a,e[18]=s,e[19]=x,e[20]=u,e[21]=i,e[22]=f):f=e[22];let w;e[23]!==S||e[24]!==f?(w=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4 pt-6 pb-6",children:[S,f]}),e[23]=S,e[24]=f,e[25]=w):w=e[25];let I;e[26]!==_||e[27]!==w||e[28]!==y||e[29]!==b||e[30]!==v?(I=o.jsxs(_,{className:O,"aria-describedby":y,onOpenAutoFocus:b,children:[v,w]}),e[26]=_,e[27]=w,e[28]=y,e[29]=b,e[30]=v,e[31]=I):I=e[31];let C;return e[32]!==R||e[33]!==r||e[34]!==c||e[35]!==I?(C=o.jsx(R,{open:r,onOpenChange:c,children:I}),e[32]=R,e[33]=r,e[34]=c,e[35]=I,e[36]=C):C=e[36],C}function Te(t){return t.preventDefault()}function we({columnKey:t,label:e,onLeave:a}){const s=D(),{org:n}=q(),{project:l}=Ne(),r=te(),{create:c,triggerAdd:i}=_e(),[u,g]=U.useState(!1),d=l?.id??se(n.id),h=async()=>{g(!0);try{const x=await c.mutateAsync({name:s("taskBoard.columnRules.newAutomationName",{column:e}),messages:[],models:{tier:"smart"},active:!1,virtual_mcp_id:d});await i.mutateAsync({automation_id:x.id,type:"board_column_transition",column_key:t}),a(),r({to:"/$org/projects/$agentId/automations/$automationId",params:{org:n.slug,agentId:d,automationId:x.id}})}catch{oe.error(s("taskBoard.columnRules.newAutomationFailed"))}finally{g(!1)}};return o.jsxs("div",{className:"surface flex flex-col items-center gap-3 px-6 py-8 text-center",children:[o.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:o.jsx(ie,{size:16})}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("taskBoard.columnRules.noAutomations")}),o.jsxs(ae,{variant:"outline",size:"sm",className:"gap-1.5",disabled:u,onClick:h,children:[o.jsx(W,{size:14}),s("taskBoard.columnRules.newAutomation")]})]})}const Ie=[];function Ve(t){const e=$.c(71),{value:a,onChange:s,inherited:n,fill:l}=t,r=n===void 0?Ie:n,c=l===void 0?!1:l,i=D(),u=ke();let g;e[0]!==u.data?(g=f=>u.data?.find(w=>w.id===f)?.name??f,e[0]=u.data,e[1]=g):g=e[1];const d=g;let h,x,R,_,O,y,b,B,A,m;if(e[2]!==u.data||e[3]!==c||e[4]!==r||e[5]!==d||e[6]!==s||e[7]!==i||e[8]!==a){let f;e[19]!==r||e[20]!==a?(f=p=>!p.disableModelInvocation&&!a.includes(p.id)&&!r.includes(p.id),e[19]=r,e[20]=a,e[21]=f):f=e[21];const w=(u.data??[]).filter(f);if(e[22]!==c||e[23]!==r||e[24]!==d||e[25]!==s||e[26]!==i||e[27]!==a){let p;e[30]!==r?(p=P=>!r.includes(P),e[30]=r,e[31]=p):p=e[31];const M=a.filter(p),G=c&&"min-h-0 flex-1";e[32]!==G?(m=z("flex flex-col gap-2",G),e[32]=G,e[33]=m):m=e[33],_=M.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:M.map(P=>o.jsxs(K,{variant:"outline",className:"py-0 pr-0 pl-2",children:[d(P),o.jsx(xe,{label:i("taskBoard.columnRules.removeSkill",{skill:d(P)}),onClick:()=>s(a.filter(X=>X!==P)),className:"size-5 text-muted-foreground",children:o.jsx(re,{size:12})})]},P))}),e[22]=c,e[23]=r,e[24]=d,e[25]=s,e[26]=i,e[27]=a,e[28]=_,e[29]=m}else _=e[28],m=e[29];R=ce;const I=c&&"min-h-0 flex-1";e[34]!==I?(B=z("h-auto border",I),e[34]=I,e[35]=B):B=e[35];let C;e[36]!==i?(C=i("taskBoard.columnRules.searchSkills"),e[36]=i,e[37]=C):C=e[37],e[38]!==C?(A=o.jsx(ue,{placeholder:C,className:"h-9"}),e[38]=C,e[39]=A):A=e[39],x=de;const L=c?"max-h-none flex-1":"max-h-56";e[40]!==L?(y=z(L),e[40]=L,e[41]=y):y=e[41];let N;e[42]!==i?(N=i("taskBoard.columnRules.noSkills"),e[42]=i,e[43]=N):N=e[43],e[44]!==N?(b=o.jsx(me,{children:N}),e[44]=N,e[45]=b):b=e[45],h=fe;let E;e[46]!==s||e[47]!==a?(E=p=>o.jsxs(pe,{value:`${p.name} ${p.id}`,onSelect:()=>s([...a,p.id]),children:[o.jsx(W,{size:14,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate text-sm",children:p.name}),p.description&&o.jsx("span",{className:"text-meta line-clamp-1",children:p.description})]})]},p.id),e[46]=s,e[47]=a,e[48]=E):E=e[48],O=w.map(E),e[2]=u.data,e[3]=c,e[4]=r,e[5]=d,e[6]=s,e[7]=i,e[8]=a,e[9]=h,e[10]=x,e[11]=R,e[12]=_,e[13]=O,e[14]=y,e[15]=b,e[16]=B,e[17]=A,e[18]=m}else h=e[9],x=e[10],R=e[11],_=e[12],O=e[13],y=e[14],b=e[15],B=e[16],A=e[17],m=e[18];let j;e[49]!==h||e[50]!==O?(j=o.jsx(h,{children:O}),e[49]=h,e[50]=O,e[51]=j):j=e[51];let T;e[52]!==x||e[53]!==j||e[54]!==y||e[55]!==b?(T=o.jsxs(x,{className:y,children:[b,j]}),e[52]=x,e[53]=j,e[54]=y,e[55]=b,e[56]=T):T=e[56];let v;e[57]!==R||e[58]!==T||e[59]!==B||e[60]!==A?(v=o.jsxs(R,{className:B,children:[A,T]}),e[57]=R,e[58]=T,e[59]=B,e[60]=A,e[61]=v):v=e[61];let k;e[62]!==r||e[63]!==d||e[64]!==i?(k=r.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-meta",children:i("taskBoard.columnRules.inheritedHint")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(f=>o.jsx(K,{variant:"muted",children:d(f)},f))})]}),e[62]=r,e[63]=d,e[64]=i,e[65]=k):k=e[65];let S;return e[66]!==_||e[67]!==v||e[68]!==k||e[69]!==m?(S=o.jsxs("div",{className:m,children:[_,v,k]}),e[66]=_,e[67]=v,e[68]=k,e[69]=m,e[70]=S):S=e[70],S}function Ye(){const t=$.c(7),{org:e}=q(),a=V();let s;t[0]!==e.id?(s=F.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==a?(n=async()=>(await a.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=a,t[3]=n):n=t[3];let l;return t[4]!==s||t[5]!==n?(l={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=l):l=t[6],ne(l)}function We(){const t=$.c(8),{org:e}=q(),a=V(),s=Y();let n;t[0]!==a?(n=async c=>{const{columnKey:i,rules:u}=c;if(u){const g=u.prompt.trim();await(g||u.skills.length?a.call("TASK_BOARD_PROMPT_UPSERT",{columnKey:i,prompt:g,skills:u.skills}):a.call("TASK_BOARD_PROMPT_DELETE",{columnKey:i}))}},t[0]=a,t[1]=n):n=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:F.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==n||t[6]!==l?(r={mutationFn:n,onSettled:l},t[5]=n,t[6]=l,t[7]=r):r=t[7],le(r)}const H=()=>0;function Je(){const t=$.c(6),{org:e}=q(),a=Y();let s;t[0]!==e.id||t[1]!==a?(s=()=>a.invalidateQueries({queryKey:F.taskBoardPrompts(e.id)}),t[0]=e.id,t[1]=a,t[2]=s):s=t[2];const n=s;let l;t[3]!==e.slug||t[4]!==n?(l=()=>be.subscribe(e.slug,n,n),t[3]=e.slug,t[4]=n,t[5]=l):l=t[5];const r=l;U.useSyncExternalStore(r,H,H)}export{Ue as C,Ve as S,He as a,Ye as b,Se as c,We as d,Je as u};
1
+ import{c as $,b as D,m as z,j as o,a4 as q,L as Z,ar as ee,d as te,r as U,h9 as se,B as ae,t as oe,aj as V,K as F,i as ne,q as Y,e as le}from"./index-C5rKbfQX.js";import{s as W}from"./Plus-D9BJQ8Ip.js";import{s as re}from"./XClose-D8nV11Fp.js";import{i as ie}from"./Zap-BNFgHEeM.js";import{B as K}from"./badge-DkZUyuLE.js";import{f as ce,a as ue,c as de,C as me,e as fe,b as pe}from"./command-S6wl_N-A.js";import{I as xe}from"./icon-button-B0NgHaBw.js";import{c as ge,a as he,b as je,S as ve}from"./sheet-IIyyroSY.js";import{j as ke}from"./use-org-fs-BR5xSOAD.js";import{a as Ne}from"./use-project-scope-BytjCxz5.js";import{u as J,a as _e}from"./use-automations-CarYUcnW.js";import{C as ye}from"./task-board-BRiMfa1H.js";import{b as be}from"./watch-sse-pool-GnUwxcY-.js";const Be={triage:"taskBoard.columnGuide.triage",todo:"taskBoard.columnGuide.todo",in_progress:"taskBoard.columnGuide.inProgress",in_review:"taskBoard.columnGuide.inReview",qa:"taskBoard.columnGuide.qa",customer_approval:"taskBoard.columnGuide.customerApproval",ready_for_deployment:"taskBoard.columnGuide.readyForDeployment",post_deploy_validation:"taskBoard.columnGuide.postDeployValidation",done:null,archived:null};function Se(t){const e=ye.find(a=>a===t);return e?Be[e]:null}function He(t){const e=$.c(7),{data:a}=J();let s;e[0]!==a?(s=a??[],e[0]=a,e[1]=s):s=e[1];let n;if(e[2]!==t||e[3]!==s){let l;e[5]!==t?(l=r=>r.board_triggers.some(c=>c.type==="board_column_transition"&&c.column_key===t),e[5]=t,e[6]=l):l=e[6],n=s.filter(l),e[2]=t,e[3]=s,e[4]=n}else n=e[4];return n}function Q(t){switch(t){case"board_column_transition":return 0;case"board_pr_ready":return 1;case"board_pr_merged":return 2;default:return t}}function Ce(t){switch(t){case"board_column_transition":return"taskBoard.columnRules.starter.board_column_transition";case"board_pr_ready":return"taskBoard.columnRules.starter.board_pr_ready";case"board_pr_merged":return"taskBoard.columnRules.starter.board_pr_merged";default:return t}}function Re(t){const e=$.c(5),{data:a}=J();let s;if(e[0]!==t||e[1]!==a){let n;e[3]!==t?(n=l=>{const r=l.board_triggers.find(c=>c.column_key===t);return r?[{automation:l,starter:r.type}]:[]},e[3]=t,e[4]=n):n=e[4],s=(a??[]).flatMap(n).sort(Ae),e[0]=t,e[1]=a,e[2]=s}else s=e[2];return s}function Ae(t,e){return Number(e.automation.active)-Number(t.automation.active)||Q(t.starter)-Q(e.starter)}function Ue(t){const e=$.c(37),{columnKey:a,label:s,icon:n,iconClassName:l,open:r,onOpenChange:c}=t,i=D(),{org:u}=q(),g=Se(a),d=Re(a);let h;e[0]!==c?(h=()=>c(!1),e[0]=c,e[1]=h):h=e[1];const x=h,R=je,_=he,O="w-full gap-0 sm:max-w-md",y=void 0,b=Te,B=ge,A="gap-1 pb-0";let m;e[2]!==n||e[3]!==l?(m=n&&o.jsx(n,{size:16,className:l}),e[2]=n,e[3]=l,e[4]=m):m=e[4];let j;e[5]!==s||e[6]!==m?(j=o.jsxs(ve,{className:"flex items-center gap-2",children:[m,s]}),e[5]=s,e[6]=m,e[7]=j):j=e[7];const T=g&&o.jsx("p",{className:"surface-inset mt-2 rounded-xl px-3.5 py-3 text-sm leading-relaxed text-foreground",children:i(g)});let v;e[8]!==B||e[9]!==j||e[10]!==T?(v=o.jsxs(B,{className:A,children:[j,T]}),e[8]=B,e[9]=j,e[10]=T,e[11]=v):v=e[11];let k;e[12]!==i?(k=i("taskBoard.columnRules.runsHere"),e[12]=i,e[13]=k):k=e[13];let S;e[14]!==k?(S=o.jsx("h3",{className:"text-meta",children:k}),e[14]=k,e[15]=S):S=e[15];let f;e[16]!==d||e[17]!==a||e[18]!==s||e[19]!==x||e[20]!==u||e[21]!==i?(f=d.length===0?o.jsx(we,{columnKey:a,label:s,onLeave:x}):o.jsx("div",{className:"surface divide-y divide-border",children:d.map(L=>{const{automation:N,starter:E}=L;return o.jsxs(Z,{to:"/$org/projects/$agentId/automations/$automationId",params:{org:u.slug,agentId:N.virtual_mcp_id,automationId:N.id},onClick:x,className:"group flex items-center gap-3 px-3 py-2.5 transition-colors hover:bg-accent/50",children:[o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("span",{className:z("truncate text-sm",N.active?"text-foreground":"text-muted-foreground"),children:N.name}),o.jsx("span",{className:"text-meta",children:N.active?i(Ce(E)):i("taskBoard.columnRules.off")})]}),o.jsx(ee,{size:14,className:"shrink-0 text-muted-foreground transition-colors group-hover:text-foreground"})]},N.id)})}),e[16]=d,e[17]=a,e[18]=s,e[19]=x,e[20]=u,e[21]=i,e[22]=f):f=e[22];let w;e[23]!==S||e[24]!==f?(w=o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4 pt-6 pb-6",children:[S,f]}),e[23]=S,e[24]=f,e[25]=w):w=e[25];let I;e[26]!==_||e[27]!==w||e[28]!==y||e[29]!==b||e[30]!==v?(I=o.jsxs(_,{className:O,"aria-describedby":y,onOpenAutoFocus:b,children:[v,w]}),e[26]=_,e[27]=w,e[28]=y,e[29]=b,e[30]=v,e[31]=I):I=e[31];let C;return e[32]!==R||e[33]!==r||e[34]!==c||e[35]!==I?(C=o.jsx(R,{open:r,onOpenChange:c,children:I}),e[32]=R,e[33]=r,e[34]=c,e[35]=I,e[36]=C):C=e[36],C}function Te(t){return t.preventDefault()}function we({columnKey:t,label:e,onLeave:a}){const s=D(),{org:n}=q(),{project:l}=Ne(),r=te(),{create:c,triggerAdd:i}=_e(),[u,g]=U.useState(!1),d=l?.id??se(n.id),h=async()=>{g(!0);try{const x=await c.mutateAsync({name:s("taskBoard.columnRules.newAutomationName",{column:e}),messages:[],models:{tier:"smart"},active:!1,virtual_mcp_id:d});await i.mutateAsync({automation_id:x.id,type:"board_column_transition",column_key:t}),a(),r({to:"/$org/projects/$agentId/automations/$automationId",params:{org:n.slug,agentId:d,automationId:x.id}})}catch{oe.error(s("taskBoard.columnRules.newAutomationFailed"))}finally{g(!1)}};return o.jsxs("div",{className:"surface flex flex-col items-center gap-3 px-6 py-8 text-center",children:[o.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:o.jsx(ie,{size:16})}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:s("taskBoard.columnRules.noAutomations")}),o.jsxs(ae,{variant:"outline",size:"sm",className:"gap-1.5",disabled:u,onClick:h,children:[o.jsx(W,{size:14}),s("taskBoard.columnRules.newAutomation")]})]})}const Ie=[];function Ve(t){const e=$.c(71),{value:a,onChange:s,inherited:n,fill:l}=t,r=n===void 0?Ie:n,c=l===void 0?!1:l,i=D(),u=ke();let g;e[0]!==u.data?(g=f=>u.data?.find(w=>w.id===f)?.name??f,e[0]=u.data,e[1]=g):g=e[1];const d=g;let h,x,R,_,O,y,b,B,A,m;if(e[2]!==u.data||e[3]!==c||e[4]!==r||e[5]!==d||e[6]!==s||e[7]!==i||e[8]!==a){let f;e[19]!==r||e[20]!==a?(f=p=>!p.disableModelInvocation&&!a.includes(p.id)&&!r.includes(p.id),e[19]=r,e[20]=a,e[21]=f):f=e[21];const w=(u.data??[]).filter(f);if(e[22]!==c||e[23]!==r||e[24]!==d||e[25]!==s||e[26]!==i||e[27]!==a){let p;e[30]!==r?(p=P=>!r.includes(P),e[30]=r,e[31]=p):p=e[31];const M=a.filter(p),G=c&&"min-h-0 flex-1";e[32]!==G?(m=z("flex flex-col gap-2",G),e[32]=G,e[33]=m):m=e[33],_=M.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:M.map(P=>o.jsxs(K,{variant:"outline",className:"py-0 pr-0 pl-2",children:[d(P),o.jsx(xe,{label:i("taskBoard.columnRules.removeSkill",{skill:d(P)}),onClick:()=>s(a.filter(X=>X!==P)),className:"size-5 text-muted-foreground",children:o.jsx(re,{size:12})})]},P))}),e[22]=c,e[23]=r,e[24]=d,e[25]=s,e[26]=i,e[27]=a,e[28]=_,e[29]=m}else _=e[28],m=e[29];R=ce;const I=c&&"min-h-0 flex-1";e[34]!==I?(B=z("h-auto border",I),e[34]=I,e[35]=B):B=e[35];let C;e[36]!==i?(C=i("taskBoard.columnRules.searchSkills"),e[36]=i,e[37]=C):C=e[37],e[38]!==C?(A=o.jsx(ue,{placeholder:C,className:"h-9"}),e[38]=C,e[39]=A):A=e[39],x=de;const L=c?"max-h-none flex-1":"max-h-56";e[40]!==L?(y=z(L),e[40]=L,e[41]=y):y=e[41];let N;e[42]!==i?(N=i("taskBoard.columnRules.noSkills"),e[42]=i,e[43]=N):N=e[43],e[44]!==N?(b=o.jsx(me,{children:N}),e[44]=N,e[45]=b):b=e[45],h=fe;let E;e[46]!==s||e[47]!==a?(E=p=>o.jsxs(pe,{value:`${p.name} ${p.id}`,onSelect:()=>s([...a,p.id]),children:[o.jsx(W,{size:14,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate text-sm",children:p.name}),p.description&&o.jsx("span",{className:"text-meta line-clamp-1",children:p.description})]})]},p.id),e[46]=s,e[47]=a,e[48]=E):E=e[48],O=w.map(E),e[2]=u.data,e[3]=c,e[4]=r,e[5]=d,e[6]=s,e[7]=i,e[8]=a,e[9]=h,e[10]=x,e[11]=R,e[12]=_,e[13]=O,e[14]=y,e[15]=b,e[16]=B,e[17]=A,e[18]=m}else h=e[9],x=e[10],R=e[11],_=e[12],O=e[13],y=e[14],b=e[15],B=e[16],A=e[17],m=e[18];let j;e[49]!==h||e[50]!==O?(j=o.jsx(h,{children:O}),e[49]=h,e[50]=O,e[51]=j):j=e[51];let T;e[52]!==x||e[53]!==j||e[54]!==y||e[55]!==b?(T=o.jsxs(x,{className:y,children:[b,j]}),e[52]=x,e[53]=j,e[54]=y,e[55]=b,e[56]=T):T=e[56];let v;e[57]!==R||e[58]!==T||e[59]!==B||e[60]!==A?(v=o.jsxs(R,{className:B,children:[A,T]}),e[57]=R,e[58]=T,e[59]=B,e[60]=A,e[61]=v):v=e[61];let k;e[62]!==r||e[63]!==d||e[64]!==i?(k=r.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-meta",children:i("taskBoard.columnRules.inheritedHint")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map(f=>o.jsx(K,{variant:"muted",children:d(f)},f))})]}),e[62]=r,e[63]=d,e[64]=i,e[65]=k):k=e[65];let S;return e[66]!==_||e[67]!==v||e[68]!==k||e[69]!==m?(S=o.jsxs("div",{className:m,children:[_,v,k]}),e[66]=_,e[67]=v,e[68]=k,e[69]=m,e[70]=S):S=e[70],S}function Ye(){const t=$.c(7),{org:e}=q(),a=V();let s;t[0]!==e.id?(s=F.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==a?(n=async()=>(await a.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=a,t[3]=n):n=t[3];let l;return t[4]!==s||t[5]!==n?(l={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=l):l=t[6],ne(l)}function We(){const t=$.c(8),{org:e}=q(),a=V(),s=Y();let n;t[0]!==a?(n=async c=>{const{columnKey:i,rules:u}=c;if(u){const g=u.prompt.trim();await(g||u.skills.length?a.call("TASK_BOARD_PROMPT_UPSERT",{columnKey:i,prompt:g,skills:u.skills}):a.call("TASK_BOARD_PROMPT_DELETE",{columnKey:i}))}},t[0]=a,t[1]=n):n=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:F.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==n||t[6]!==l?(r={mutationFn:n,onSettled:l},t[5]=n,t[6]=l,t[7]=r):r=t[7],le(r)}const H=()=>0;function Je(){const t=$.c(6),{org:e}=q(),a=Y();let s;t[0]!==e.id||t[1]!==a?(s=()=>a.invalidateQueries({queryKey:F.taskBoardPrompts(e.id)}),t[0]=e.id,t[1]=a,t[2]=s):s=t[2];const n=s;let l;t[3]!==e.slug||t[4]!==n?(l=()=>be.subscribe(e.slug,n,n),t[3]=e.slug,t[4]=n,t[5]=l):l=t[5];const r=l;U.useSyncExternalStore(r,H,H)}export{Ue as C,Ve as S,He as a,Ye as b,Se as c,We as d,Je as u};
@@ -1 +1 @@
1
- import{a4 as l,aj as c,r as i,V as d,K as T}from"./index-CpKrWBFM.js";import{u as m}from"./thread-intent-CaOco8G4.js";const p=[],S=()=>()=>{},h=()=>p;function f(t){const{org:s}=l(),r=c(),n=m(),o=i.useSyncExternalStore(n?.threads.subscribe??S,n?.threads.get??h),e=t===null?null:o.find(a=>a.id===t)??null,{data:u}=d({queryKey:T.ensureTask(s.id,t),queryFn:async()=>{if(t===null)return null;try{const{item:a}=await r.call("COLLECTION_THREADS_GET",{id:t});return a??null}catch{return null}},initialData:e&&!e.partial?e:void 0,select:a=>a?.metadata??null,staleTime:3e4});return e?.metadata??u??null}export{f as u};
1
+ import{a4 as l,aj as c,r as i,V as d,K as T}from"./index-C5rKbfQX.js";import{u as m}from"./thread-intent-WcxoFFz-.js";const p=[],S=()=>()=>{},h=()=>p;function f(t){const{org:s}=l(),r=c(),n=m(),o=i.useSyncExternalStore(n?.threads.subscribe??S,n?.threads.get??h),e=t===null?null:o.find(a=>a.id===t)??null,{data:u}=d({queryKey:T.ensureTask(s.id,t),queryFn:async()=>{if(t===null)return null;try{const{item:a}=await r.call("COLLECTION_THREADS_GET",{id:t});return a??null}catch{return null}},initialData:e&&!e.partial?e:void 0,select:a=>a?.metadata??null,staleTime:3e4});return e?.metadata??u??null}export{f as u};
@@ -1 +1 @@
1
- import{c,a4 as i,i as l,K as p}from"./index-CpKrWBFM.js";import{f}from"./chat-context-CkHIxm7-.js";async function m(e,s){const t=await fetch(`/api/${s}/threads/${encodeURIComponent(e)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function $(){const e=c.c(2),s=f()?.messages??[];let t;return e[0]!==s?(t=s.some(y),e[0]=s,e[1]=t):t=e[1],t}function y(e){return e.parts?.some(b)}function b(e){const s=e;return(s.type==="tool-bash"||s.type==="tool-write")&&s.state==="output-available"}function g(e,s){const t=c.c(9),{org:u}=i();let o;t[0]!==e?(o=p.threadOutputs(e??""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==u||t[3]!==e?(n=()=>m(e??"",u.slug),t[2]=u,t[3]=e,t[4]=n):n=t[4];const r=!!e&&(s?.enabled??!0);let a;return t[5]!==o||t[6]!==n||t[7]!==r?(a={queryKey:o,queryFn:n,enabled:r,staleTime:0},t[5]=o,t[6]=n,t[7]=r,t[8]=a):a=t[8],l(a)}export{g as a,$ as u};
1
+ import{c,a4 as i,i as l,K as p}from"./index-C5rKbfQX.js";import{f}from"./chat-context-CgzRmLj9.js";async function m(e,s){const t=await fetch(`/api/${s}/threads/${encodeURIComponent(e)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function $(){const e=c.c(2),s=f()?.messages??[];let t;return e[0]!==s?(t=s.some(y),e[0]=s,e[1]=t):t=e[1],t}function y(e){return e.parts?.some(b)}function b(e){const s=e;return(s.type==="tool-bash"||s.type==="tool-write")&&s.state==="output-available"}function g(e,s){const t=c.c(9),{org:u}=i();let o;t[0]!==e?(o=p.threadOutputs(e??""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==u||t[3]!==e?(n=()=>m(e??"",u.slug),t[2]=u,t[3]=e,t[4]=n):n=t[4];const r=!!e&&(s?.enabled??!0);let a;return t[5]!==o||t[6]!==n||t[7]!==r?(a={queryKey:o,queryFn:n,enabled:r,staleTime:0},t[5]=o,t[6]=n,t[7]=r,t[8]=a):a=t[8],l(a)}export{g as a,$ as u};
@@ -1 +1 @@
1
- import{c as L,b as V,r as N,j as r,m as q,B as Z,by as ee}from"./index-CpKrWBFM.js";import{j as te,d as re,r as se,p as ne}from"./thread-intent-CaOco8G4.js";import{u as H,j as oe,d as le,k as ie,m as ce,n as ae}from"./chat-context-CkHIxm7-.js";import{u as ue}from"./repository-binding-FcrTKkLc.js";import{a as Q,b as Y,P as G}from"./popover-DsnoY7gE.js";import{d as de,b as fe,a as me,D as he}from"./drawer-B-H4hfQm.js";import{T as pe,a as xe,c as ge}from"./tooltip-BN1ul0v0.js";import{u as ve}from"./use-mobile-Ca0mzlkS.js";import{g as ye,au as Se,l as be}from"./agent-icon-De2MEsoK.js";import{t as je}from"./ChevronUp-CypYcouh.js";import{t as Te}from"./Tool01-3EDhR0eh.js";import{d as Re}from"./use-organization-settings-DEeoFtSz.js";import{u as J,c as Me,d as ke}from"./use-ai-providers-DMerS0dR.js";import{M as Ce,a as Ie}from"./index-DfCff2zl.js";import{d as we,e as Ne,b as _e}from"./use-entitlements-Bn1lpTMW.js";function ft(t){const e=L.c(14),o=ue(t),S=H(),s=o?.metadata,a=S?.activeTask,n=a?.metadata?.runtime;let u;e[0]!==n?(u=ne(n),e[0]=n,e[1]=u):u=e[1];const x=u,b=!!a&&!a.partial,l=a?.metadata;let j;e[2]!==s||e[3]!==l?(j=te(l,s),e[2]=s,e[3]=l,e[4]=j):j=e[4];const g=!!x||b&&!!o;let f;e[5]!==s?(f=re(s),e[5]=s,e[6]=f):f=e[6];let i;e[7]!==s?(i=se(s),e[7]=s,e[8]=i):i=e[8];let v;return e[9]!==j||e[10]!==g||e[11]!==f||e[12]!==i?(v={runtime:j,resolved:g,projectDefault:f,previewServerUrl:i},e[9]=j,e[10]=g,e[11]=f,e[12]=i,e[13]=v):v=e[13],v}function Pe(t){return["openai-compatible","openrouter","deco"].includes(t)}function De(t,e){return Pe(t)&&$e(e)!==null}function $e(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const Ee={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function Fe(t,e){return Ee[t]?.test(e)??!1}function Ae(t){return Me(t)&&Fe(t.providerId,t.modelId)}function ze(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const Le={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Ue(t){const e=L.c(32),{tier:o,orgSlot:S,userSlot:s,autoSlot:a,filterModels:n,onPick:u,onReset:x,onClose:b}=t,l=V(),j=J(),g=new Set(j.map(Be)),f=oe([s,S,a],g),i=f?.keyId??null,[v,m]=N.useState(i??j[0]?.id??null),c=j.some(P=>P.id===v)?v:i??j[0]?.id??null,k=c?j.find(P=>P.id===c):null,M="flex h-[70vh] max-h-[460px] w-full flex-col",T=Le[o];let h;e[0]!==l||e[1]!==T?(h=l(T),e[0]=l,e[1]=T,e[2]=h):h=e[2];let p;e[3]!==h?(p=r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:h}),e[3]=h,e[4]=p):p=e[4];let y;e[5]!==x||e[6]!==l||e[7]!==s?(y=s&&r.jsx("button",{type:"button",onClick:x,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:l("chat.modelPreferences.reset")}),e[5]=x,e[6]=l,e[7]=s,e[8]=y):y=e[8];let R;e[9]!==p||e[10]!==y?(R=r.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[p,y]}),e[9]=p,e[10]=y,e[11]=R):R=e[11];const d="flex-1 min-h-0",C=N.Suspense;let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsx(Ie,{}),e[12]=_):_=e[12];const z=Ce,A=!0,E=ze(i?f:null,k?.providerId??"deco");let D;e[13]!==c||e[14]!==u||e[15]!==m?(D=P=>{const F=P.keyId??c??"";m(F),u({keyId:F,modelId:P.modelId,title:P.title})},e[13]=c,e[14]=u,e[15]=m,e[16]=D):D=e[16];let I;e[17]!==z||e[18]!==c||e[19]!==n||e[20]!==b||e[21]!==m||e[22]!==E||e[23]!==D?(I=r.jsx(z,{compact:A,filterModels:n,onClose:b,credentialId:c,onCredentialChange:m,selectedModel:E,onModelChange:D}),e[17]=z,e[18]=c,e[19]=n,e[20]=b,e[21]=m,e[22]=E,e[23]=D,e[24]=I):I=e[24];let w;e[25]!==C||e[26]!==I||e[27]!==_?(w=r.jsx("div",{className:d,children:r.jsx(C,{fallback:_,children:I})}),e[25]=C,e[26]=I,e[27]=_,e[28]=w):w=e[28];let $;return e[29]!==w||e[30]!==R?($=r.jsxs("div",{className:M,children:[R,w]}),e[29]=w,e[30]=R,e[31]=$):$=e[31],$}function Be(t){return t.id}const Ke=["fast","smart","thinking"];function X(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const O={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function qe(t){const e=L.c(28),{tier:o,pillIcon:S,groups:s}=t,a=V();let n;e[0]!==a?(n=X(a),e[0]=a,e[1]=n):n=e[1];const u=n,[x,b]=N.useState(!1);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=R=>{R.onSelect(),b(!1)},e[2]=l):l=e[2];const j=l,g=u[o];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=q("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=q("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=i):i=e[4];const v=u[o];let m;e[5]!==v?(m=r.jsx("span",{className:i,children:v}),e[5]=v,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(je,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=c):c=e[7];let k;e[8]!==S||e[9]!==g||e[10]!==m?(k=r.jsx(pe,{asChild:!0,children:r.jsx("span",{className:"inline-flex min-w-0 shrink",children:r.jsx(Q,{asChild:!0,children:r.jsxs(Z,{type:"button",variant:"ghost",size:"default","aria-label":g,className:f,children:[S,m,c]})})})}),e[8]=S,e[9]=g,e[10]=m,e[11]=k):k=e[11];let M;e[12]!==g?(M=r.jsx(xe,{children:g}),e[12]=g,e[13]=M):M=e[13];let T;e[14]!==k||e[15]!==M?(T=r.jsxs(ge,{children:[k,M]}),e[14]=k,e[15]=M,e[16]=T):T=e[16];let h;if(e[17]!==s||e[18]!==a){let R;e[20]!==a?(R=d=>r.jsx("div",{className:"flex flex-col",children:d.rows.map(C=>r.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-accent",children:[r.jsxs("button",{type:"button",role:"menuitem","aria-label":C.title,onClick:()=>j(C),className:q("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",C.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[C.icon&&r.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:C.icon}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm",children:C.title}),C.subtitle&&r.jsx("div",{className:"text-xs text-muted-foreground",children:C.subtitle})]}),C.active&&r.jsx("span",{title:a("chat.tierTrigger.selected"),children:r.jsx(ee,{size:14,className:"text-foreground mt-0.5"})})]}),C.modelOverride&&r.jsx(Oe,{label:C.title,render:C.modelOverride})]},C.key))},d.key),e[20]=a,e[21]=R):R=e[21],h=s.map(R),e[17]=s,e[18]=a,e[19]=h}else h=e[19];let p;e[22]!==h?(p=r.jsx(Y,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Ve,children:r.jsx("div",{role:"menu",className:"flex flex-col",children:h})}),e[22]=h,e[23]=p):p=e[23];let y;return e[24]!==x||e[25]!==T||e[26]!==p?(y=r.jsxs(G,{open:x,onOpenChange:b,children:[T,p]}),e[24]=x,e[25]=T,e[26]=p,e[27]=y):y=e[27],y}function Ve(t){return t.preventDefault()}function Oe(t){const e=L.c(38),{label:o,render:S}=t,s=V(),a=ve(),[n,u]=N.useState(!1);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>u(!1),e[0]=x):x=e[0];const b=x;let l;e[1]!==o||e[2]!==s?(l=s("chat.modelPreferences.customizeModel",{tier:o}),e[1]=o,e[2]=s,e[3]=l):l=e[3];const j=n&&"opacity-100";let g;e[4]!==j?(g=q("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background shadow-edge","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",j),e[4]=j,e[5]=g):g=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(be,{size:14}),e[6]=f):f=e[6];let i;e[7]!==l||e[8]!==g?(i=r.jsx("button",{type:"button","aria-label":l,className:g,children:f}),e[7]=l,e[8]=g,e[9]=i):i=e[9];const v=i;if(a){let T;e[10]!==v?(T=r.jsx(de,{asChild:!0,children:v}),e[10]=v,e[11]=T):T=e[11];let h;e[12]!==o||e[13]!==s?(h=s("chat.modelPreferences.customizeModel",{tier:o}),e[12]=o,e[13]=s,e[14]=h):h=e[14];let p;e[15]!==h?(p=r.jsx(fe,{className:"sr-only",children:h}),e[15]=h,e[16]=p):p=e[16];let y;e[17]!==n||e[18]!==S?(y=n&&S(b),e[17]=n,e[18]=S,e[19]=y):y=e[19];let R;e[20]!==y||e[21]!==p?(R=r.jsxs(me,{className:"p-0 flex flex-col max-h-[95vh]",children:[p,y]}),e[20]=y,e[21]=p,e[22]=R):R=e[22];let d;return e[23]!==n||e[24]!==R||e[25]!==T?(d=r.jsxs(he,{open:n,onOpenChange:u,children:[T,R]}),e[23]=n,e[24]=R,e[25]=T,e[26]=d):d=e[26],d}let m;e[27]!==v?(m=r.jsx(Q,{asChild:!0,children:v}),e[27]=v,e[28]=m):m=e[28];let c;e[29]!==n||e[30]!==S?(c=n&&S(b),e[29]=n,e[30]=S,e[31]=c):c=e[31];let k;e[32]!==c?(k=r.jsx(Y,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:c}),e[32]=c,e[33]=k):k=e[33];let M;return e[34]!==n||e[35]!==m||e[36]!==k?(M=r.jsxs(G,{open:n,onOpenChange:u,children:[m,k]}),e[34]=n,e[35]=m,e[36]=k,e[37]=M):M=e[37],M}function W(t){return t==="fast"?r.jsx(ye,{size:16}):t==="thinking"?r.jsx(Se,{size:16}):r.jsx(Te,{size:16})}function We(t){const e=L.c(13),o=ae();let S;e[0]!==t||e[1]!==o.tiers?(S=b=>{const l=o.tiers[b];return l?l.title??l.modelId:t.chat[b]?.title},e[0]=t,e[1]=o.tiers,e[2]=S):S=e[2];const s=S;let a;e[3]!==s?(a=s("fast"),e[3]=s,e[4]=a):a=e[4];let n;e[5]!==s?(n=s("smart"),e[5]=s,e[6]=n):n=e[6];let u;e[7]!==s?(u=s("thinking"),e[7]=s,e[8]=u):u=e[8];let x;return e[9]!==a||e[10]!==n||e[11]!==u?(x={fast:a,smart:n,thinking:u},e[9]=a,e[10]=n,e[11]=u,e[12]=x):x=e[12],x}function mt(){const t=L.c(25),e=V(),{simpleModeTier:o,setSimpleModeTier:S}=le(),s=Re(),a=J(),n=ke(a),u=We(n),{data:x,error:b}=ie();let l;t[0]!==x?(l=x===void 0?{tiers:{}}:x,t[0]=x,t[1]=l):l=t[1];const j=l,g=ce(),f=H()?.lockedHarness,i=f==="claude-code",v=we("model_choice"),m=Ne(),c=_e();if(!m||!v)return null;let k,M;if(t[2]!==n||t[3]!==c||t[4]!==i||t[5]!==f||t[6]!==s||t[7]!==S||t[8]!==e||t[9]!==o||t[10]!==u||t[11]!==g||t[12]!==j||t[13]!==b){const R=X(e);k="decopilot",M=Ke.map(d=>{const C=u[d],_=j.tiers[d];return{key:`decopilot-${d}`,icon:W(d),title:R[d],subtitle:c?C??e(O[d]):e(O[d]),active:o===d,onSelect:()=>S(d),modelOverride:c?z=>r.jsxs(r.Fragment,{children:[b&&r.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),r.jsx(Ue,{tier:d,orgSlot:s.tiers[d],userSlot:_,autoSlot:n.chat[d],filterModels:f==="codex"?He:i?Ae:void 0,onClose:z,onPick:A=>g.mutate({tier:d,slot:A}),onReset:()=>g.mutate({tier:d,slot:null})},`${d}:${_?.keyId??"org"}:${_?.modelId??""}`)]}):void 0}}),t[2]=n,t[3]=c,t[4]=i,t[5]=f,t[6]=s,t[7]=S,t[8]=e,t[9]=o,t[10]=u,t[11]=g,t[12]=j,t[13]=b,t[14]=k,t[15]=M}else k=t[14],M=t[15];let T;t[16]!==k||t[17]!==M?(T=[{key:k,rows:M}],t[16]=k,t[17]=M,t[18]=T):T=t[18];const h=T;let p;t[19]!==o?(p=W(o),t[19]=o,t[20]=p):p=t[20];let y;return t[21]!==h||t[22]!==p||t[23]!==o?(y=r.jsx(qe,{tier:o,pillIcon:p,groups:h}),t[21]=h,t[22]=p,t[23]=o,t[24]=y):y=t[24],y}function He(t){return De(t.providerId,t.modelId)}const B=48;function ht(){const t=L.c(12),[e,o]=N.useState("idle"),[S,s]=N.useState(""),[a,n]=N.useState(""),[u,x]=N.useState(Ge),b=N.useRef(null),l=N.useRef(null),j=N.useRef(null),g=N.useRef(null),f=N.useRef(0),i=N.useRef(!1),v=N.useRef(""),m=N.useRef(""),c=N.useRef(!1),k=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let M;t[0]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),l.current?.close().catch(Ye),g.current?.getTracks().forEach(Qe),j.current=null,l.current=null,g.current=null},t[0]=M):M=t[0];const T=M;let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=E=>{g.current=E;const D=new AudioContext;l.current=D;const I=D.createMediaStreamSource(E),w=D.createAnalyser();w.fftSize=128,w.smoothingTimeConstant=.8,I.connect(w),j.current=w;const $=new Uint8Array(w.frequencyBinCount),P=()=>{if(!j.current)return;j.current.getByteFrequencyData($);const F=[];for(let U=0;U<B;U++){const K=Math.floor(U/B*$.length);F.push(Math.max(.04,($[K]??0)/255))}x(F),f.current=requestAnimationFrame(P)};P()},t[1]=h):h=t[1];const p=h;let y;t[2]!==e?(y=async()=>{if(c.current||i.current)return e;c.current=!0;const E=window.SpeechRecognition||window.webkitSpeechRecognition;if(!E)return c.current=!1,o("unsupported"),"unsupported";let D;try{D=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return c.current=!1,o("permission-denied"),"permission-denied"}c.current=!1,s(""),n(""),m.current="",v.current="",i.current=!0,o("recording"),p(D);const I=new E;b.current=I,I.interimResults=!0,I.continuous=!0,I.lang=navigator.language||"en-US",I.onresult=w=>{if(b.current!==I)return;let $="",P="";for(let F=w.resultIndex;F<w.results.length;F++){const U=w.results[F],K=U?.[0]?.transcript??"";U?.isFinal?P=P+K:$=$+K}P&&(v.current=v.current+P,s(v.current)),m.current=$,n($)},I.onerror=w=>{b.current===I&&w.error!=="no-speech"&&(i.current=!1,b.current=null,T(),o(w.error==="not-allowed"?"permission-denied":"idle"))},I.onend=()=>{if(b.current===I&&i.current)try{I.start()}catch{}};try{I.start()}catch{return i.current=!1,b.current=null,T(),o("idle"),"idle"}return"recording"},t[2]=e,t[3]=y):y=t[3];const R=y;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{i.current=!1,b.current?.stop(),T(),o("idle"),x(Array(B).fill(.05)),n("");const E=(v.current+(m.current?" "+m.current:"")).trim();return s(""),v.current="",m.current="",E},t[4]=d):d=t[4];const C=d;let _;t[5]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{i.current=!1,b.current?.abort(),T(),o("idle"),s(""),n(""),x(Array(B).fill(.05)),v.current="",m.current=""},t[5]=_):_=t[5];const z=_;let A;return t[6]!==a||t[7]!==R||t[8]!==e||t[9]!==S||t[10]!==u?(A={status:e,transcript:S,interimTranscript:a,waveformData:u,isSupported:k,startRecording:R,stopRecording:C,cancelRecording:z},t[6]=a,t[7]=R,t[8]=e,t[9]=S,t[10]=u,t[11]=A):A=t[11],A}function Qe(t){return t.stop()}function Ye(){}function Ge(){return Array(B).fill(.05)}export{mt as T,ht as a,Pe as s,ft as u};
1
+ import{c as L,b as V,r as N,j as r,m as q,B as Z,by as ee}from"./index-C5rKbfQX.js";import{j as te,d as re,r as se,p as ne}from"./thread-intent-WcxoFFz-.js";import{u as H,j as oe,d as le,k as ie,m as ce,n as ae}from"./chat-context-CgzRmLj9.js";import{u as ue}from"./repository-binding-DUEv5f7z.js";import{a as Q,b as Y,P as G}from"./popover-CqBUgUd4.js";import{d as de,b as fe,a as me,D as he}from"./drawer-CeL3iOe9.js";import{T as pe,a as xe,c as ge}from"./tooltip-DfoRFUTt.js";import{u as ve}from"./use-mobile-BRC3jJYG.js";import{g as ye,av as Se,l as be}from"./agent-icon-CIk0WHPf.js";import{t as je}from"./ChevronUp-CjYakPcO.js";import{t as Te}from"./Tool01-lye9w7uq.js";import{d as Re}from"./use-organization-settings-CFMK78d5.js";import{u as J,c as Me,d as ke}from"./use-ai-providers-FchZM1mi.js";import{M as Ce,a as Ie}from"./index-htBIzPBo.js";import{d as we,e as Ne,b as _e}from"./use-entitlements-D_MPAaiQ.js";function ft(t){const e=L.c(14),o=ue(t),S=H(),s=o?.metadata,a=S?.activeTask,n=a?.metadata?.runtime;let u;e[0]!==n?(u=ne(n),e[0]=n,e[1]=u):u=e[1];const x=u,b=!!a&&!a.partial,l=a?.metadata;let j;e[2]!==s||e[3]!==l?(j=te(l,s),e[2]=s,e[3]=l,e[4]=j):j=e[4];const g=!!x||b&&!!o;let f;e[5]!==s?(f=re(s),e[5]=s,e[6]=f):f=e[6];let i;e[7]!==s?(i=se(s),e[7]=s,e[8]=i):i=e[8];let v;return e[9]!==j||e[10]!==g||e[11]!==f||e[12]!==i?(v={runtime:j,resolved:g,projectDefault:f,previewServerUrl:i},e[9]=j,e[10]=g,e[11]=f,e[12]=i,e[13]=v):v=e[13],v}function Pe(t){return["openai-compatible","openrouter","deco"].includes(t)}function De(t,e){return Pe(t)&&$e(e)!==null}function $e(t){const e=t.replace(/^openai\//,"");return/^(gpt-\d|o[134](?:-|$))/.test(e)?e:null}const Ee={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function Fe(t,e){return Ee[t]?.test(e)??!1}function Ae(t){return Me(t)&&Fe(t.providerId,t.modelId)}function ze(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const Le={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Ue(t){const e=L.c(32),{tier:o,orgSlot:S,userSlot:s,autoSlot:a,filterModels:n,onPick:u,onReset:x,onClose:b}=t,l=V(),j=J(),g=new Set(j.map(Be)),f=oe([s,S,a],g),i=f?.keyId??null,[v,m]=N.useState(i??j[0]?.id??null),c=j.some(P=>P.id===v)?v:i??j[0]?.id??null,k=c?j.find(P=>P.id===c):null,M="flex h-[70vh] max-h-[460px] w-full flex-col",T=Le[o];let h;e[0]!==l||e[1]!==T?(h=l(T),e[0]=l,e[1]=T,e[2]=h):h=e[2];let p;e[3]!==h?(p=r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:h}),e[3]=h,e[4]=p):p=e[4];let y;e[5]!==x||e[6]!==l||e[7]!==s?(y=s&&r.jsx("button",{type:"button",onClick:x,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:l("chat.modelPreferences.reset")}),e[5]=x,e[6]=l,e[7]=s,e[8]=y):y=e[8];let R;e[9]!==p||e[10]!==y?(R=r.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[p,y]}),e[9]=p,e[10]=y,e[11]=R):R=e[11];const d="flex-1 min-h-0",C=N.Suspense;let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsx(Ie,{}),e[12]=_):_=e[12];const z=Ce,A=!0,E=ze(i?f:null,k?.providerId??"deco");let D;e[13]!==c||e[14]!==u||e[15]!==m?(D=P=>{const F=P.keyId??c??"";m(F),u({keyId:F,modelId:P.modelId,title:P.title})},e[13]=c,e[14]=u,e[15]=m,e[16]=D):D=e[16];let I;e[17]!==z||e[18]!==c||e[19]!==n||e[20]!==b||e[21]!==m||e[22]!==E||e[23]!==D?(I=r.jsx(z,{compact:A,filterModels:n,onClose:b,credentialId:c,onCredentialChange:m,selectedModel:E,onModelChange:D}),e[17]=z,e[18]=c,e[19]=n,e[20]=b,e[21]=m,e[22]=E,e[23]=D,e[24]=I):I=e[24];let w;e[25]!==C||e[26]!==I||e[27]!==_?(w=r.jsx("div",{className:d,children:r.jsx(C,{fallback:_,children:I})}),e[25]=C,e[26]=I,e[27]=_,e[28]=w):w=e[28];let $;return e[29]!==w||e[30]!==R?($=r.jsxs("div",{className:M,children:[R,w]}),e[29]=w,e[30]=R,e[31]=$):$=e[31],$}function Be(t){return t.id}const Ke=["fast","smart","thinking"];function X(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const O={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function qe(t){const e=L.c(28),{tier:o,pillIcon:S,groups:s}=t,a=V();let n;e[0]!==a?(n=X(a),e[0]=a,e[1]=n):n=e[1];const u=n,[x,b]=N.useState(!1);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=R=>{R.onSelect(),b(!1)},e[2]=l):l=e[2];const j=l,g=u[o];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=q("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=q("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=i):i=e[4];const v=u[o];let m;e[5]!==v?(m=r.jsx("span",{className:i,children:v}),e[5]=v,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(je,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=c):c=e[7];let k;e[8]!==S||e[9]!==g||e[10]!==m?(k=r.jsx(pe,{asChild:!0,children:r.jsx("span",{className:"inline-flex min-w-0 shrink",children:r.jsx(Q,{asChild:!0,children:r.jsxs(Z,{type:"button",variant:"ghost",size:"default","aria-label":g,className:f,children:[S,m,c]})})})}),e[8]=S,e[9]=g,e[10]=m,e[11]=k):k=e[11];let M;e[12]!==g?(M=r.jsx(xe,{children:g}),e[12]=g,e[13]=M):M=e[13];let T;e[14]!==k||e[15]!==M?(T=r.jsxs(ge,{children:[k,M]}),e[14]=k,e[15]=M,e[16]=T):T=e[16];let h;if(e[17]!==s||e[18]!==a){let R;e[20]!==a?(R=d=>r.jsx("div",{className:"flex flex-col",children:d.rows.map(C=>r.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-accent",children:[r.jsxs("button",{type:"button",role:"menuitem","aria-label":C.title,onClick:()=>j(C),className:q("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",C.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[C.icon&&r.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:C.icon}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm",children:C.title}),C.subtitle&&r.jsx("div",{className:"text-xs text-muted-foreground",children:C.subtitle})]}),C.active&&r.jsx("span",{title:a("chat.tierTrigger.selected"),children:r.jsx(ee,{size:14,className:"text-foreground mt-0.5"})})]}),C.modelOverride&&r.jsx(Oe,{label:C.title,render:C.modelOverride})]},C.key))},d.key),e[20]=a,e[21]=R):R=e[21],h=s.map(R),e[17]=s,e[18]=a,e[19]=h}else h=e[19];let p;e[22]!==h?(p=r.jsx(Y,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Ve,children:r.jsx("div",{role:"menu",className:"flex flex-col",children:h})}),e[22]=h,e[23]=p):p=e[23];let y;return e[24]!==x||e[25]!==T||e[26]!==p?(y=r.jsxs(G,{open:x,onOpenChange:b,children:[T,p]}),e[24]=x,e[25]=T,e[26]=p,e[27]=y):y=e[27],y}function Ve(t){return t.preventDefault()}function Oe(t){const e=L.c(38),{label:o,render:S}=t,s=V(),a=ve(),[n,u]=N.useState(!1);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>u(!1),e[0]=x):x=e[0];const b=x;let l;e[1]!==o||e[2]!==s?(l=s("chat.modelPreferences.customizeModel",{tier:o}),e[1]=o,e[2]=s,e[3]=l):l=e[3];const j=n&&"opacity-100";let g;e[4]!==j?(g=q("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 rounded-lg bg-background shadow-edge","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",j),e[4]=j,e[5]=g):g=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(be,{size:14}),e[6]=f):f=e[6];let i;e[7]!==l||e[8]!==g?(i=r.jsx("button",{type:"button","aria-label":l,className:g,children:f}),e[7]=l,e[8]=g,e[9]=i):i=e[9];const v=i;if(a){let T;e[10]!==v?(T=r.jsx(de,{asChild:!0,children:v}),e[10]=v,e[11]=T):T=e[11];let h;e[12]!==o||e[13]!==s?(h=s("chat.modelPreferences.customizeModel",{tier:o}),e[12]=o,e[13]=s,e[14]=h):h=e[14];let p;e[15]!==h?(p=r.jsx(fe,{className:"sr-only",children:h}),e[15]=h,e[16]=p):p=e[16];let y;e[17]!==n||e[18]!==S?(y=n&&S(b),e[17]=n,e[18]=S,e[19]=y):y=e[19];let R;e[20]!==y||e[21]!==p?(R=r.jsxs(me,{className:"p-0 flex flex-col max-h-[95vh]",children:[p,y]}),e[20]=y,e[21]=p,e[22]=R):R=e[22];let d;return e[23]!==n||e[24]!==R||e[25]!==T?(d=r.jsxs(he,{open:n,onOpenChange:u,children:[T,R]}),e[23]=n,e[24]=R,e[25]=T,e[26]=d):d=e[26],d}let m;e[27]!==v?(m=r.jsx(Q,{asChild:!0,children:v}),e[27]=v,e[28]=m):m=e[28];let c;e[29]!==n||e[30]!==S?(c=n&&S(b),e[29]=n,e[30]=S,e[31]=c):c=e[31];let k;e[32]!==c?(k=r.jsx(Y,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:c}),e[32]=c,e[33]=k):k=e[33];let M;return e[34]!==n||e[35]!==m||e[36]!==k?(M=r.jsxs(G,{open:n,onOpenChange:u,children:[m,k]}),e[34]=n,e[35]=m,e[36]=k,e[37]=M):M=e[37],M}function W(t){return t==="fast"?r.jsx(ye,{size:16}):t==="thinking"?r.jsx(Se,{size:16}):r.jsx(Te,{size:16})}function We(t){const e=L.c(13),o=ae();let S;e[0]!==t||e[1]!==o.tiers?(S=b=>{const l=o.tiers[b];return l?l.title??l.modelId:t.chat[b]?.title},e[0]=t,e[1]=o.tiers,e[2]=S):S=e[2];const s=S;let a;e[3]!==s?(a=s("fast"),e[3]=s,e[4]=a):a=e[4];let n;e[5]!==s?(n=s("smart"),e[5]=s,e[6]=n):n=e[6];let u;e[7]!==s?(u=s("thinking"),e[7]=s,e[8]=u):u=e[8];let x;return e[9]!==a||e[10]!==n||e[11]!==u?(x={fast:a,smart:n,thinking:u},e[9]=a,e[10]=n,e[11]=u,e[12]=x):x=e[12],x}function mt(){const t=L.c(25),e=V(),{simpleModeTier:o,setSimpleModeTier:S}=le(),s=Re(),a=J(),n=ke(a),u=We(n),{data:x,error:b}=ie();let l;t[0]!==x?(l=x===void 0?{tiers:{}}:x,t[0]=x,t[1]=l):l=t[1];const j=l,g=ce(),f=H()?.lockedHarness,i=f==="claude-code",v=we("model_choice"),m=Ne(),c=_e();if(!m||!v)return null;let k,M;if(t[2]!==n||t[3]!==c||t[4]!==i||t[5]!==f||t[6]!==s||t[7]!==S||t[8]!==e||t[9]!==o||t[10]!==u||t[11]!==g||t[12]!==j||t[13]!==b){const R=X(e);k="decopilot",M=Ke.map(d=>{const C=u[d],_=j.tiers[d];return{key:`decopilot-${d}`,icon:W(d),title:R[d],subtitle:c?C??e(O[d]):e(O[d]),active:o===d,onSelect:()=>S(d),modelOverride:c?z=>r.jsxs(r.Fragment,{children:[b&&r.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),r.jsx(Ue,{tier:d,orgSlot:s.tiers[d],userSlot:_,autoSlot:n.chat[d],filterModels:f==="codex"?He:i?Ae:void 0,onClose:z,onPick:A=>g.mutate({tier:d,slot:A}),onReset:()=>g.mutate({tier:d,slot:null})},`${d}:${_?.keyId??"org"}:${_?.modelId??""}`)]}):void 0}}),t[2]=n,t[3]=c,t[4]=i,t[5]=f,t[6]=s,t[7]=S,t[8]=e,t[9]=o,t[10]=u,t[11]=g,t[12]=j,t[13]=b,t[14]=k,t[15]=M}else k=t[14],M=t[15];let T;t[16]!==k||t[17]!==M?(T=[{key:k,rows:M}],t[16]=k,t[17]=M,t[18]=T):T=t[18];const h=T;let p;t[19]!==o?(p=W(o),t[19]=o,t[20]=p):p=t[20];let y;return t[21]!==h||t[22]!==p||t[23]!==o?(y=r.jsx(qe,{tier:o,pillIcon:p,groups:h}),t[21]=h,t[22]=p,t[23]=o,t[24]=y):y=t[24],y}function He(t){return De(t.providerId,t.modelId)}const B=48;function ht(){const t=L.c(12),[e,o]=N.useState("idle"),[S,s]=N.useState(""),[a,n]=N.useState(""),[u,x]=N.useState(Ge),b=N.useRef(null),l=N.useRef(null),j=N.useRef(null),g=N.useRef(null),f=N.useRef(0),i=N.useRef(!1),v=N.useRef(""),m=N.useRef(""),c=N.useRef(!1),k=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let M;t[0]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),l.current?.close().catch(Ye),g.current?.getTracks().forEach(Qe),j.current=null,l.current=null,g.current=null},t[0]=M):M=t[0];const T=M;let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=E=>{g.current=E;const D=new AudioContext;l.current=D;const I=D.createMediaStreamSource(E),w=D.createAnalyser();w.fftSize=128,w.smoothingTimeConstant=.8,I.connect(w),j.current=w;const $=new Uint8Array(w.frequencyBinCount),P=()=>{if(!j.current)return;j.current.getByteFrequencyData($);const F=[];for(let U=0;U<B;U++){const K=Math.floor(U/B*$.length);F.push(Math.max(.04,($[K]??0)/255))}x(F),f.current=requestAnimationFrame(P)};P()},t[1]=h):h=t[1];const p=h;let y;t[2]!==e?(y=async()=>{if(c.current||i.current)return e;c.current=!0;const E=window.SpeechRecognition||window.webkitSpeechRecognition;if(!E)return c.current=!1,o("unsupported"),"unsupported";let D;try{D=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return c.current=!1,o("permission-denied"),"permission-denied"}c.current=!1,s(""),n(""),m.current="",v.current="",i.current=!0,o("recording"),p(D);const I=new E;b.current=I,I.interimResults=!0,I.continuous=!0,I.lang=navigator.language||"en-US",I.onresult=w=>{if(b.current!==I)return;let $="",P="";for(let F=w.resultIndex;F<w.results.length;F++){const U=w.results[F],K=U?.[0]?.transcript??"";U?.isFinal?P=P+K:$=$+K}P&&(v.current=v.current+P,s(v.current)),m.current=$,n($)},I.onerror=w=>{b.current===I&&w.error!=="no-speech"&&(i.current=!1,b.current=null,T(),o(w.error==="not-allowed"?"permission-denied":"idle"))},I.onend=()=>{if(b.current===I&&i.current)try{I.start()}catch{}};try{I.start()}catch{return i.current=!1,b.current=null,T(),o("idle"),"idle"}return"recording"},t[2]=e,t[3]=y):y=t[3];const R=y;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{i.current=!1,b.current?.stop(),T(),o("idle"),x(Array(B).fill(.05)),n("");const E=(v.current+(m.current?" "+m.current:"")).trim();return s(""),v.current="",m.current="",E},t[4]=d):d=t[4];const C=d;let _;t[5]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{i.current=!1,b.current?.abort(),T(),o("idle"),s(""),n(""),x(Array(B).fill(.05)),v.current="",m.current=""},t[5]=_):_=t[5];const z=_;let A;return t[6]!==a||t[7]!==R||t[8]!==e||t[9]!==S||t[10]!==u?(A={status:e,transcript:S,interimTranscript:a,waveformData:u,isSupported:k,startRecording:R,stopRecording:C,cancelRecording:z},t[6]=a,t[7]=R,t[8]=e,t[9]=S,t[10]=u,t[11]=A):A=t[11],A}function Qe(t){return t.stop()}function Ye(){}function Ge(){return Array(B).fill(.05)}export{mt as T,ht as a,Pe as s,ft as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./infiniteQueryObserver-YWHwwvoP.js";import{ex as i}from"./index-C5rKbfQX.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{eF as E,bo as y,eG as S,eH as w,ey as Q,q as k,eI as M,eJ as q,r as p,eK as x,eL as H,eM as L,eN as P,eO as v,eP as B,eQ as A}from"./index-CpKrWBFM.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function I(r,e,s){const t=r.slice(0);return t[e]=s,t}var T=class extends E{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,c=i.some((o,d)=>o!==s[d]),f=u||c,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#c(t,s)]}#c(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new Q(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=I(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#e,this.#a),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function U({queries:r,...e},s){const t=k(s),i=M(),n=q(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{x(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new T(t,u,e)),[f,b,o]=c.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?c.subscribe(y.batchCalls(h)):P,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=f.some((h,a)=>v(u[a],h))?f.flatMap((h,a)=>{const l=u[a];if(l&&v(l,h)){const C=new Q(t,l);return B(l,C,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=f.find((h,a)=>{const l=u[a];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return b(o())}export{U as u};
1
+ import{eF as E,bo as y,eG as S,eH as w,ey as Q,q as k,eI as M,eJ as q,r as p,eK as x,eL as H,eM as L,eN as P,eO as v,eP as B,eQ as A}from"./index-C5rKbfQX.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function I(r,e,s){const t=r.slice(0);return t[e]=s,t}var T=class extends E{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,c=i.some((o,d)=>o!==s[d]),f=u||c,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#c(t,s)]}#c(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new Q(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=I(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#e,this.#a),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function U({queries:r,...e},s){const t=k(s),i=M(),n=q(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{x(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new T(t,u,e)),[f,b,o]=c.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?c.subscribe(y.batchCalls(h)):P,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=f.some((h,a)=>v(u[a],h))?f.flatMap((h,a)=>{const l=u[a];if(l&&v(l,h)){const C=new Q(t,l);return B(l,C,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const O=f.find((h,a)=>{const l=u[a];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(O?.error)throw O.error;return b(o())}export{U as u};