decocms 4.32.0 → 4.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/client/assets/{AlertCircle-Db_5w_pO.js → AlertCircle-2s5kOZgj.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-B2VxdxbH.js → ArrowUpRight-B0lt2R6O.js} +1 -1
  3. package/dist/client/assets/{Check-VVh423TU.js → Check-B0N6s4EL.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-auAoHYRc.js → CheckCircle-CIPdmx9R.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-mDFyCzyV.js → ChevronDown-bR9-OAOH.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-Ceh-WF7H.js → ChevronRight-BSSGG1g5.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-D03XJ0vS.js → ChevronUp-Fslp9Fpy.js} +1 -1
  8. package/dist/client/assets/{Circle-DNMct17O.js → Circle-BPZeoRCx.js} +1 -1
  9. package/dist/client/assets/{Copy01-CuSfBG1R.js → Copy01-Cz1rKXRy.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Cr4sUrn_.js → DotsVertical-15z7dV29.js} +1 -1
  11. package/dist/client/assets/{Eye-aR-oC6dj.js → Eye-DcJnhbvA.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Cr2IL8ug.js → FilterLines-cTy8iFZe.js} +1 -1
  13. package/dist/client/assets/{Globe01-DkdmhUM8.js → Globe01-DIfUBpGL.js} +1 -1
  14. package/dist/client/assets/{Globe04-TuZvt3ov.js → Globe04-mbYkrh9z.js} +1 -1
  15. package/dist/client/assets/{HardDrive-CrxPr3va.js → HardDrive-j5KCJ6XY.js} +1 -1
  16. package/dist/client/assets/{Key01-CfvrTjDF.js → Key01-f-QyjpHL.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Cog6SqwZ.js → LayoutLeft-DWh3M4u4.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BYpL3ACE.js → LinkExternal01-BGZKsGqI.js} +1 -1
  19. package/dist/client/assets/{List-D5svP-6k.js → List-BWsSMZPj.js} +1 -1
  20. package/dist/client/assets/{Loading02-D2Hh17zb.js → Loading02-DlI7_e_g.js} +1 -1
  21. package/dist/client/assets/{Monitor01-cNkbuWdj.js → Monitor01-C0S2ni9X.js} +1 -1
  22. package/dist/client/assets/{Palette-Dz_ldMx7.js → Palette-Dvhw-PUQ.js} +1 -1
  23. package/dist/client/assets/{Play-CVarwVeR.js → Play-DC8NP2kr.js} +1 -1
  24. package/dist/client/assets/{Plus-DNCXili3.js → Plus-CtK3Oiw2.js} +1 -1
  25. package/dist/client/assets/{SearchLg-DvsDitCO.js → SearchLg-Bnks7xJg.js} +1 -1
  26. package/dist/client/assets/{SearchMd-87dvi4KF.js → SearchMd-DyX5r8jM.js} +1 -1
  27. package/dist/client/assets/{Settings02-D7asukv0.js → Settings02-H_IB225h.js} +1 -1
  28. package/dist/client/assets/{Shield01-BT2HQXan.js → Shield01-BC699jIY.js} +1 -1
  29. package/dist/client/assets/{Star01-B90wIaBV.js → Star01-BbsQJ_sS.js} +1 -1
  30. package/dist/client/assets/{Stars01-D1lDEQh2.js → Stars01-CR3bUaN7.js} +1 -1
  31. package/dist/client/assets/{Stars02-LnA0-zz4.js → Stars02-BK7UYCtg.js} +1 -1
  32. package/dist/client/assets/{Sun-DLqplG3r.js → Sun-uxTaoEYF.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-C9ua90Hw.js → SwitchHorizontal01-CB2NLb2L.js} +1 -1
  34. package/dist/client/assets/{Tool01-dGPltLKJ.js → Tool01-C0uN9zWM.js} +1 -1
  35. package/dist/client/assets/{Trash01-BJe3gUZc.js → Trash01-Ua8N5kjP.js} +1 -1
  36. package/dist/client/assets/{Upload01-DIYVb8n9.js → Upload01-hPJNmduj.js} +1 -1
  37. package/dist/client/assets/{User01-DcNAHFa-.js → User01-BxMdEKOJ.js} +1 -1
  38. package/dist/client/assets/{Users01-q9IKnEsX.js → Users01-BAVKi7TL.js} +1 -1
  39. package/dist/client/assets/{Users03-BMw5o14D.js → Users03-BFPLupFq.js} +1 -1
  40. package/dist/client/assets/{X-CYIGv8wX.js → X-DEwIfp2g.js} +1 -1
  41. package/dist/client/assets/{XCircle-29rFa-09.js → XCircle-CIONSbDG.js} +1 -1
  42. package/dist/client/assets/{XClose-DT64mUwh.js → XClose-C6H98gBi.js} +1 -1
  43. package/dist/client/assets/{Zap-Br_Hg1wB.js → Zap-BIltjucc.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-0BsdXZY9.js → ZapSquare-C8hQ9jTF.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-Dqj1q_yU.js → ZoomOut-PMoRB_Bg.js} +1 -1
  46. package/dist/client/assets/{access-gate-033kBvzX.js → access-gate-DOeBybsR.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-DRg-YhLT.js → add-section-modal-CCUIjz6m.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-CRvnIg9m.js → agent-capabilities-kcySA6Rm.js} +1 -1
  49. package/dist/client/assets/{agent-icon-EdtPDJXM.js → agent-icon-CbBVbeed.js} +1 -1
  50. package/dist/client/assets/{agents-list-COIOrWTd.js → agents-list-xvCGZ9XI.js} +1 -1
  51. package/dist/client/assets/{ai-providers--C84J8bO.js → ai-providers-Bo_gc-mT.js} +1 -1
  52. package/dist/client/assets/{alert-BG1upMQ5.js → alert-D3io7I88.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BbHr6pLd.js → alert-dialog-B0nYWSj5.js} +1 -1
  54. package/dist/client/assets/app-editor-CkNgnA56.js +1 -0
  55. package/dist/client/assets/{auth-BEQgA40y.js → auth-D5wBpl7f.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-CfZrCH1R.js → auth-catchall-DF5Q_pqe.js} +1 -1
  57. package/dist/client/assets/{auth-entry-Cr25LD_X.js → auth-entry-CCaGhNGQ.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-DSPfwaoV.js → auth-split-layout-w0JcTw7T.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-nkmQY5vG.js → authenticate-and-persist-oauth-Chvo_Jes.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-xAynmOqb.js → automation-list-row-Cbdiek4K.js} +1 -1
  61. package/dist/client/assets/{automation-runs-D98OdVC5.js → automation-runs-CGER5GBv.js} +1 -1
  62. package/dist/client/assets/automations-D0NTvKnQ.js +1 -0
  63. package/dist/client/assets/{autosend-REHFoRRR.js → autosend-CmGYW3q_.js} +1 -1
  64. package/dist/client/assets/{avatar-B2d04wRu.js → avatar-CDXoUCLJ.js} +1 -1
  65. package/dist/client/assets/{badge-DiKw8RbW.js → badge-Ctcfruzq.js} +1 -1
  66. package/dist/client/assets/{block-document-CPFtVEpa.js → block-document-sswZnu5y.js} +1 -1
  67. package/dist/client/assets/{brand-context-DHN-dSvf.js → brand-context-DM1UEpwM.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-CC9Gfd5p.js → breadcrumb-DAdC6SnD.js} +1 -1
  69. package/dist/client/assets/{buckets-CKM582z_.js → buckets-Ctfn_0G2.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-B4j7bMVg.js → bulk-category-panel-D8tuJJzY.js} +1 -1
  71. package/dist/client/assets/{calendar-Dh7ySVQi.js → calendar-CeqPOUkw.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-Dg3eOVDS.js → capability-load-error-DtbGeAKW.js} +1 -1
  73. package/dist/client/assets/{card-D5CauofV.js → card-DQi9rgCg.js} +1 -1
  74. package/dist/client/assets/category-editor-hoS8HpqO.js +1 -0
  75. package/dist/client/assets/{chat-context-BsRUICZs.js → chat-context-IHOJkkXf.js} +7 -7
  76. package/dist/client/assets/{checkbox-DhHH_mmR.js → checkbox-BURTh-Sz.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-NNi-TvQO.js → cli-auth-success-_TBsui5t.js} +1 -1
  78. package/dist/client/assets/{collection-detail-L5hLAtjn.js → collection-detail-DaSVHCzi.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-D5THp447.js → collection-display-button-XYmA1Q40.js} +1 -1
  80. package/dist/client/assets/{collection-search-BgFXdSC0.js → collection-search-BNR-_kgt.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-328T8nSg.js → collection-table-wrapper-DmpUOM4F.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-Cxl16cFM.js → collection-tabs-DapcRZt3.js} +1 -1
  83. package/dist/client/assets/{command-Cx8bKs7m.js → command-C1J-e-lQ.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-DmVh_p0A.js → commerce-onboarding-Tn_GYu6Z.js} +1 -1
  85. package/dist/client/assets/{connect-desktop-dialog-BWEylyh-.js → connect-desktop-dialog-CiAszx6Y.js} +1 -1
  86. package/dist/client/assets/{connection-card-CmLZ3i0M.js → connection-card-Cz90MoMh.js} +1 -1
  87. package/dist/client/assets/{connection-detail-tk24zTUu.js → connection-detail-C0v5B3ex.js} +1 -1
  88. package/dist/client/assets/{connection-form-helpers-C1s-KSGU.js → connection-form-helpers-0tgODnl3.js} +1 -1
  89. package/dist/client/assets/{connections-qp5myPzL.js → connections-DdugII7h.js} +1 -1
  90. package/dist/client/assets/{decopilot-sse-pool-CiyJzTNT.js → decopilot-sse-pool-CQTNPxQf.js} +1 -1
  91. package/dist/client/assets/{dialog-BFPr54WG.js → dialog-BrzV8etc.js} +1 -1
  92. package/dist/client/assets/{domain-settings-DHynySRj.js → domain-settings-m2vjPoAZ.js} +1 -1
  93. package/dist/client/assets/{drawer-DcfPm_vi.js → drawer-gV6ZWrch.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-BlfYJTRx.js → dropdown-menu-BddT-o91.js} +1 -1
  95. package/dist/client/assets/{empty-state-CeXPb2VU.js → empty-state-BWAXUEsn.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-5BWVDciX.js → extract-connection-data-D7-1aZ_S.js} +1 -1
  97. package/dist/client/assets/file-explorer-SPwatRtZ.js +2 -0
  98. package/dist/client/assets/{file-type-icon-D2xX1xnm.js → file-type-icon-Bjl2ymkp.js} +1 -1
  99. package/dist/client/assets/{files-Bzd-uxW7.js → files-WWFluIiz.js} +1 -1
  100. package/dist/client/assets/{form-Trt6kqr0.js → form-BRUQyl6J.js} +1 -1
  101. package/dist/client/assets/{general-C_FzX3UD.js → general-CTJEme6U.js} +1 -1
  102. package/dist/client/assets/{github-repo-picker-CTMAbHxR.js → github-repo-picker-Do5QoiKl.js} +1 -1
  103. package/dist/client/assets/{hooks-BSiz_AKB.js → hooks-BZdqB8Qy.js} +1 -1
  104. package/dist/client/assets/index-9TeU21xo.js +1 -0
  105. package/dist/client/assets/{index-GJfKnZn_.js → index-BDZEdWj1.js} +1 -1
  106. package/dist/client/assets/{index-C8Vaq4GI.js → index-BNLg4KKP.js} +1 -1
  107. package/dist/client/assets/{index-BMxNGICG.js → index-BoSB3Za-.js} +1 -1
  108. package/dist/client/assets/{index-CLj_5r89.js → index-C7I160AA.js} +3 -3
  109. package/dist/client/assets/{index-DtEv5T2k.js → index-CKS3i0IK.js} +1 -1
  110. package/dist/client/assets/{index-CsAnNpRc.js → index-CWK3z81c.js} +1 -1
  111. package/dist/client/assets/{index-gz1tAOXr.js → index-CZEILacv.js} +28 -28
  112. package/dist/client/assets/{index-uAuiYVKB.js → index-Cn1sj9aZ.js} +5 -5
  113. package/dist/client/assets/{index-35Tak7qk.js → index-D2gueFhN.js} +1 -1
  114. package/dist/client/assets/{index-CqLJnBFj.js → index-D2onA9qc.js} +1 -1
  115. package/dist/client/assets/index-DU7aSFO-.js +1 -0
  116. package/dist/client/assets/{index-CPelPFhM.js → index-kon1iupd.js} +1 -1
  117. package/dist/client/assets/{index-redirect-DDeVol4f.js → index-redirect-C5XTPHMs.js} +1 -1
  118. package/dist/client/assets/{index-CfigvylE.js → index-wSXh3klb.js} +1 -1
  119. package/dist/client/assets/{input-BdpM0TEL.js → input-DH_VnByH.js} +1 -1
  120. package/dist/client/assets/{integration-icon-Bf1Nt7-n.js → integration-icon-D0K1bih8.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-BPpBeslC.js → invite-member-dialog-ClFLROQn.js} +2 -2
  122. package/dist/client/assets/{label-DjarSga4.js → label-e6rWM2hU.js} +1 -1
  123. package/dist/client/assets/{login-DoEfLmln.js → login-DtuNg2zJ.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-DWePFULn.js → mcp-oauth-BCaCUxes.js} +1 -1
  125. package/dist/client/assets/{members-B3B7IloN.js → members-Ba9Rlcr-.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-D4hwKq5W.js → monaco-editor-C_AEiYQZ.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-B7f4HN3G.js → monitoring-stats-row-CYKbRIBk.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-BoH2P_bn.js → oauth-callback-B-Obhqp0.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-CuMMS3lP.js → oauth-callback-ai-provider-Ba_FEG1I.js} +1 -1
  130. package/dist/client/assets/{onboarding-wUH-DGeU.js → onboarding-CQkojCLg.js} +1 -1
  131. package/dist/client/assets/{org-install-DXT9J0I8.js → org-install-CZscDtN4.js} +1 -1
  132. package/dist/client/assets/{org-layout-BrLrP4eq.js → org-layout-BA5rlSp0.js} +1 -1
  133. package/dist/client/assets/{organization-choice-C6lztIt3.js → organization-choice-Cz7kgb2K.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-DQA0wg3R.js → page-seo-form-pa11jA1G.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-BsxyjdmC.js +1 -0
  136. package/dist/client/assets/{popover-CKlhZKOG.js → popover-B0KbxhEe.js} +1 -1
  137. package/dist/client/assets/post-editor-DK313FK0.js +1 -0
  138. package/dist/client/assets/{primitives-CAgzIvjA.js → primitives-Cc0JBmYV.js} +1 -1
  139. package/dist/client/assets/{profile-CY7AQM7b.js → profile-BCIfg20R.js} +1 -1
  140. package/dist/client/assets/project-app-view-BoVLQZ3E.js +1 -0
  141. package/dist/client/assets/record-editor-BnxxykzH.js +1 -0
  142. package/dist/client/assets/registry-CxXpBXKD.js +2 -0
  143. package/dist/client/assets/{registry-layout-D25VdidL.js → registry-layout-D_d52MHW.js} +1 -1
  144. package/dist/client/assets/{require-capability-CYDVRBkW.js → require-capability-Bck21HDw.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-DGQr874S.js → required-auth-layout-DF__PTv1.js} +1 -1
  146. package/dist/client/assets/{reset-password-Ci3XAz4n.js → reset-password-DZD1v0KD.js} +1 -1
  147. package/dist/client/assets/{roles-oTvdi6Hw.js → roles-BfLpKNWG.js} +1 -1
  148. package/dist/client/assets/{search-input-DJ05ViVl.js → search-input-D8sB5-Ny.js} +1 -1
  149. package/dist/client/assets/{secrets-HOer9kv3.js → secrets-BCprY6aP.js} +1 -1
  150. package/dist/client/assets/{sections-editor-5ju1cxyx.js → sections-editor-D_hyAIGN.js} +2 -2
  151. package/dist/client/assets/{select-CeXH3gjW.js → select-DN-2P4pj.js} +1 -1
  152. package/dist/client/assets/{select-model-DYpThBVD.js → select-model-B2UNE9H0.js} +1 -1
  153. package/dist/client/assets/seo-editor-CfDwbt3_.js +1 -0
  154. package/dist/client/assets/{settings-layout-kdDgoGQC.js → settings-layout-v5WgWzIt.js} +1 -1
  155. package/dist/client/assets/{settings-section-CyBwf4qC.js → settings-section-DkyvVCpj.js} +1 -1
  156. package/dist/client/assets/{shell-controls-CD6bdY9w.js → shell-controls-CLwAtNRs.js} +1 -1
  157. package/dist/client/assets/{shell-layout-IYwmwgpp.js → shell-layout-KPAYSy0b.js} +1 -1
  158. package/dist/client/assets/{sidebar-B_c4VYke.js → sidebar-CTn5usMP.js} +1 -1
  159. package/dist/client/assets/{skeleton-Dl1AhqdL.js → skeleton-D4gGgavd.js} +1 -1
  160. package/dist/client/assets/{sso-1rsjb8hb.js → sso-DPp9OlNK.js} +1 -1
  161. package/dist/client/assets/{store-BHrgdJmn.js → store-Dw0CvhII.js} +1 -1
  162. package/dist/client/assets/store-registry-DNboZUWm.js +2 -0
  163. package/dist/client/assets/{studio-tools-F5G0urN7.js → studio-tools-PotpJQ3D.js} +1 -1
  164. package/dist/client/assets/{switch-B9wSH4oe.js → switch-Cmmmt6PD.js} +1 -1
  165. package/dist/client/assets/{table-C2Aqsz0m.js → table-DTgM4O4Z.js} +1 -1
  166. package/dist/client/assets/{tabs-W14caGou.js → tabs-t0q9T5Fa.js} +1 -1
  167. package/dist/client/assets/{textarea-ConjZ7fN.js → textarea-BYIN4Jzx.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CYFywiUW.js → toggle-group-DYrBrZmA.js} +1 -1
  169. package/dist/client/assets/{toolbar-DR2I0_KA.js → toolbar-BdWX93yt.js} +1 -1
  170. package/dist/client/assets/{toolbar-icon-button-Cf6OwFTU.js → toolbar-icon-button-Cxc_k7ol.js} +1 -1
  171. package/dist/client/assets/{tools-list-DL49NRaT.js → tools-list-BGKY_7Nz.js} +1 -1
  172. package/dist/client/assets/{tooltip-C51X6QKO.js → tooltip-Df6PcMNU.js} +1 -1
  173. package/dist/client/assets/{types-C0d4Ohpx.js → types-B8loWUG_.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-BqQDQsEQ.js → use-ai-providers-DoUITmq_.js} +1 -1
  175. package/dist/client/assets/{use-automations-tqGwPES0.js → use-automations-TLSZt6TY.js} +1 -1
  176. package/dist/client/assets/{use-capability-CqEMs0z_.js → use-capability-1pbErDsM.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-Bz8Z9860.js → use-clock-tick-BTJdRGzd.js} +1 -1
  178. package/dist/client/assets/{use-collections-Y12o4qWE.js → use-collections-u9zczYmq.js} +1 -1
  179. package/dist/client/assets/{use-connection-D5Vs5qOp.js → use-connection-D2zKUXMW.js} +1 -1
  180. package/dist/client/assets/{use-copy-Dc9VZjfD.js → use-copy-DyeDOflU.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-fbAeF2Sf.js → use-create-virtual-mcp-BWPnYTVH.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-BPwP00mx.js → use-debounced-autosave-DpZx2Woz.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-DfUpwXh9.js → use-debounced-value-Din3ks-5.js} +1 -1
  184. package/dist/client/assets/{use-decopilot-events-C70DCxcq.js → use-decopilot-events-c_F3xZZq.js} +1 -1
  185. package/dist/client/assets/{use-delete-connection-BBFdYZGQ.js → use-delete-connection-DMAQk9_a.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-DGZxsbJi.js → use-file-configs-C5vV28ov.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-BU44dmI-.js → use-infinite-scroll-D4CUGMlc.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-DyX59dkl.js → use-join-requests-DUokiFjq.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-3hG4jk-y.js → use-mcp-client-Q0KtyZCi.js} +1 -1
  190. package/dist/client/assets/{use-mcp-prompts-K_jp9fAb.js → use-mcp-prompts-BmiZpXIz.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-DkI8MzuJ.js → use-mcp-tools-CZX0T0Gj.js} +1 -1
  192. package/dist/client/assets/{use-members-CcCdz_hQ.js → use-members-CKOvIbDB.js} +1 -1
  193. package/dist/client/assets/{use-mobile-BJ6No951.js → use-mobile-DMF4iRSr.js} +1 -1
  194. package/dist/client/assets/use-navigate-to-agent-B6McR-Jr.js +1 -0
  195. package/dist/client/assets/{use-org-auth-client-B7yAA88H.js → use-org-auth-client-rtyqEqJT.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DcXTIOxB.js → use-org-sso-CyoKQ5KE.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-C6Eyg5qk.js → use-organization-roles-N3nyzKDF.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-BzhOQtxD.js → use-organization-settings-CKQ7HE6e.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-DnT_Dh3O.js → use-registry-connections-D9xYxJqe.js} +1 -1
  200. package/dist/client/assets/{use-secrets-BBj5PT7D.js → use-secrets-DQ0uwPps.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-B0huGKlG.js → use-status-sounds-o42lSNJw.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-BL1OAyYV.js → use-view-mode-BExxXwj9.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-D3UxifiP.js → use-virtual-mcp-7ayI9UXm.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-BsgsE7HF.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DrOgYVoj.js +1 -0
  206. package/dist/client/assets/{variant-calendar-Dx_VP5De.js → variant-calendar-H6YqPrcv.js} +1 -1
  207. package/dist/client/assets/{view-mode-toggle-DFM8ec78.js → view-mode-toggle-DFfA-LaB.js} +1 -1
  208. package/dist/client/index.html +1 -1
  209. package/dist/server/cli.js +1 -1
  210. package/dist/server/server.js +1 -1
  211. package/package.json +1 -1
  212. package/dist/client/assets/app-editor-DFt6eACm.js +0 -1
  213. package/dist/client/assets/automations-DVf2_2C_.js +0 -1
  214. package/dist/client/assets/category-editor-SUwhv1rI.js +0 -1
  215. package/dist/client/assets/config-ByOdiANb.js +0 -1
  216. package/dist/client/assets/file-explorer-CwWWlUiZ.js +0 -2
  217. package/dist/client/assets/index-Cwk7SIrW.js +0 -1
  218. package/dist/client/assets/index-g8i--Kvx.js +0 -1
  219. package/dist/client/assets/page-seo-sheet-DurRfIZb.js +0 -1
  220. package/dist/client/assets/post-editor--rN0Vw5m.js +0 -1
  221. package/dist/client/assets/project-app-view-CHytmdja.js +0 -1
  222. package/dist/client/assets/record-editor-CNuCZ1ZI.js +0 -1
  223. package/dist/client/assets/registry-BZBmEaE-.js +0 -2
  224. package/dist/client/assets/seo-editor-BIKFI9Fl.js +0 -1
  225. package/dist/client/assets/store-registry-B0GhK-Yr.js +0 -2
  226. package/dist/client/assets/use-navigate-to-agent-CZiiGkPG.js +0 -1
  227. package/dist/client/assets/useInfiniteQuery-8DjDwhQn.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-BYjapKbe.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as $,aq as nt,c as B,j as s,G as Re,H as ae,Z as oe,p as pe,I as Le,J as Pe,d as fe,K as te,t as Z,B as ee,M as J,W as ot,l as ne,k as rt,b as at,P as ct,ag as dt}from"./index-CLj_5r89.js";import{D as $e,e as De,d as Fe,c as ut,a as Ke,b as mt,i as ft}from"./dialog-BFPr54WG.js";import{g as ht,b as pt,a as xt,D as gt}from"./drawer-DcfPm_vi.js";import{u as vt}from"./use-mobile-BJ6No951.js";import{S as ye,l as bt,u as xe}from"./chat-context-BsRUICZs.js";import{C as jt}from"./checkbox-DhHH_mmR.js";import{I as le}from"./input-BdpM0TEL.js";import{a as yt,c as St,d as kt,S as Nt,b as Ct}from"./select-CeXH3gjW.js";import{S as X}from"./skeleton-Dl1AhqdL.js";import{i as Ue,b as Be,c as wt,a as _t,s as It}from"./Settings02-D7asukv0.js";import{d as Mt,a as Ot,b as Et,i as Tt}from"./Tool01-dGPltLKJ.js";import{i as At}from"./Key01-CfvrTjDF.js";import{i as We}from"./SearchMd-87dvi4KF.js";import{b as ge,u as zt,a as Rt}from"./use-ai-providers-BqQDQsEQ.js";import{g as ve}from"./ai-providers-logos-DD3qZ33J.js";import{i as Lt}from"./Monitor01-cNkbuWdj.js";import{i as Pt}from"./AlertCircle-Db_5w_pO.js";import{u as he}from"./studio-tools-F5G0urN7.js";import{i as $t}from"./ChevronRight-Ceh-WF7H.js";import{A as Dt}from"./avatar-B2d04wRu.js";import{S as Se,a as ke,b as He}from"./settings-section-CyBwf4qC.js";import{s as Ve}from"./Eye-aR-oC6dj.js";import{u as Ft,b as ue,a as me,C as Kt}from"./connect-desktop-dialog-BWEylyh-.js";import{t as Ne}from"./ChevronDown-mDFyCzyV.js";import{t as Ut}from"./Stars01-D1lDEQh2.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
1
+ import{r as $,aq as nt,c as B,j as s,G as Re,H as ae,$ as oe,p as pe,I as Le,J as Pe,d as fe,K as te,t as Z,B as ee,M as J,W as ot,l as ne,k as rt,b as at,P as ct,ag as dt}from"./index-C7I160AA.js";import{D as $e,e as De,d as Fe,c as ut,a as Ke,b as mt,i as ft}from"./dialog-BrzV8etc.js";import{g as ht,b as pt,a as xt,D as gt}from"./drawer-gV6ZWrch.js";import{u as vt}from"./use-mobile-DMF4iRSr.js";import{S as ye,l as bt,u as xe}from"./chat-context-IHOJkkXf.js";import{C as jt}from"./checkbox-BURTh-Sz.js";import{I as le}from"./input-DH_VnByH.js";import{a as yt,c as St,d as kt,S as Nt,b as Ct}from"./select-DN-2P4pj.js";import{S as X}from"./skeleton-D4gGgavd.js";import{i as Ue,b as Be,c as wt,a as _t,s as It}from"./Settings02-H_IB225h.js";import{d as Mt,a as Ot,b as Et,i as Tt}from"./Tool01-C0uN9zWM.js";import{i as At}from"./Key01-f-QyjpHL.js";import{i as We}from"./SearchMd-DyX5r8jM.js";import{b as ge,u as zt,a as Rt}from"./use-ai-providers-DoUITmq_.js";import{g as ve}from"./ai-providers-logos-DD3qZ33J.js";import{i as Lt}from"./Monitor01-C0S2ni9X.js";import{i as Pt}from"./AlertCircle-2s5kOZgj.js";import{u as he}from"./studio-tools-PotpJQ3D.js";import{i as $t}from"./ChevronRight-BSSGG1g5.js";import{A as Dt}from"./avatar-CDXoUCLJ.js";import{S as Se,a as ke,b as He}from"./settings-section-DkyvVCpj.js";import{s as Ve}from"./Eye-DcJnhbvA.js";import{u as Ft,b as ue,a as me,C as Kt}from"./connect-desktop-dialog-CiAszx6Y.js";import{t as Ne}from"./ChevronDown-bR9-OAOH.js";import{t as Ut}from"./Stars01-CR3bUaN7.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=a=>{l=a},r}function Ce(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Bt=(i,e)=>Math.abs(i-e)<1.01,Wt=(i,e,t)=>{let l;return function(...n){i.clearTimeout(l),l=i.setTimeout(()=>e.apply(this,n),t)}},we=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Ht=i=>i,Vt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),l=[];for(let n=e;n<=t;n++)l.push(n);return l},qt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;const n=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(n(we(t)),!l.ResizeObserver)return()=>{};const o=new l.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(we(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},_e={passive:!0},Ie=typeof window>"u"?!0:"onscrollend"in window,Gt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;let n=0;const o=i.options.useScrollendEvent&&Ie?()=>{}:Wt(l,()=>{e(n,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:m,isRtl:p}=i.options;n=m?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(n,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,_e);const d=i.options.useScrollendEvent&&Ie;return d&&t.addEventListener("scrollend",c,_e),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Xt=(i,e,t)=>{if(e?.borderBoxSize){const l=e.borderBoxSize[0];if(l)return Math.round(l[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Yt=(i,{adjustments:e=0,behavior:t},l)=>{var n,o;const r=i+e;(o=(n=l.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[l.options.horizontal?"left":"top"]:r,behavior:t})};class Qt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,l,n;return((n=(l=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:l.now)==null?void 0:n.call(l))??Date.now()},this.observer=(()=>{let t=null;const l=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=l())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=l())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=l())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([l,n])=>{typeof n>"u"&&delete t[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ht,rangeExtractor:Vt,onChange:()=>{},measureElement:Xt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var l,n;(n=(l=this.options).onChange)==null||n.call(l,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.maybeNotify();return}this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,l)=>{const n=new Map,o=new Map;for(let r=l-1;r>=0;r--){const a=t[r];if(n.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,l,n,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,u),p=new Array(a).fill(void 0);for(let f=0;f<u;f++){const g=m[f];g&&(p[g.lane]=f)}for(let f=u;f<t;f++){const g=o(f),x=this.laneAssignments.get(f);let j,k;const w=c==="estimate"||d.has(g);if(x!==void 0&&this.options.lanes>1){j=x;const b=p[j],N=b!==void 0?m[b]:void 0;k=N?N.end+this.options.gap:l+n}else{const b=this.options.lanes===1?m[f-1]:this.getFurthestMeasurement(m,f);k=b?b.end+this.options.gap:l+n,j=b?b.lane:f%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(f,j)}const _=d.get(g),I=typeof _=="number"?_:this.options.estimateSize(f),M=k+I;m[f]={index:f,start:k,size:I,end:M,key:g,lane:j},p[j]=f}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,l,n,o)=>this.range=t.length>0&&l>0?Jt({measurements:t,outerSize:l,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,l=null;const n=this.calculateRange();return n&&(t=n.startIndex,l=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,l]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,l]},(t,l,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:l,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const l=this.options.indexAttribute,n=t.getAttribute(l);return n?parseInt(n,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var l;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((l=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:l.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),a=Math.min(this.options.count-1,n+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const l=this.indexFromElement(t),n=this.options.getItemKey(l),o=this.elementsCache.get(n);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,l)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=l-r;a!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,l)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,l)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=l[a];n.push(c)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const l=this.getMeasurements();if(l.length!==0)return Ce(l[qe(0,l.length-1,n=>Ce(l[n]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,l,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();l==="auto"&&(l=t>=r+o?"end":"start"),l==="center"?t+=(n-o)/2:l==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,l="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(l==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)l="end";else if(r.start<=o+this.options.scrollPaddingStart)l="start";else return[o,l];if(l==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),l];const a=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,l,r.size),l]},this.scrollToOffset=(t,{align:l="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,l),r=this.now();this.scrollState={index:null,align:l,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:l="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,l);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:l="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:l,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const l=this.getMeasurements();let n;if(l.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=l[l.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=l.length-1;for(;r>=0&&o.some(a=>a===null);){const a=l[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:l,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:l},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const l=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=l?l[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&Bt(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const qe=(i,e,t,l)=>{for(;i<=e;){const n=(i+e)/2|0,o=t(n);if(o<l)i=n+1;else if(o>l)e=n-1;else return n}return i>0?i-1:0};function Jt({measurements:i,outerSize:e,scrollOffset:t,lanes:l}){const n=i.length-1,o=c=>i[c].start;if(i.length<=l)return{startIndex:0,endIndex:n};let r=qe(0,n,o,t),a=r;if(l===1)for(;a<n&&i[a].end<t+e;)a++;else if(l>1){const c=Array(l).fill(0);for(;a<n&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(l).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%l),a=Math.min(n,a+(l-1-a%l))}return{startIndex:r,endIndex:a}}const Me=typeof document<"u"?$.useLayoutEffect:$.useEffect;function Zt({useFlushSync:i=!0,...e}){const t=$.useReducer(()=>({}),{})[1],l={...e,onChange:(o,r)=>{var a;i&&r?nt.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[n]=$.useState(()=>new Qt(l));return n.setOptions(l),Me(()=>n._didMount(),[]),Me(()=>n._willUpdate()),n}function es(i){return Zt({observeElementRect:qt,observeElementOffset:Gt,scrollToFn:Yt,...i})}const ce=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Oe(i){if(i)return ce.find(e=>e.id===i)}const Ee=4;function re(i){const e=B.c(8),{logo:t,name:l,description:n,onClick:o}=i;let r;e[0]!==t||e[1]!==l?(r=t?s.jsx("img",{src:t,alt:l,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Dt,{fallback:l.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=l,e[2]=r):r=e[2];let a;return e[3]!==n||e[4]!==l||e[5]!==o||e[6]!==r?(a=s.jsx(He,{onClick:o,icon:r,title:l,description:n}),e[3]=n,e[4]=l,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Ge(i){const e=B.c(32),{providers:t,onSelect:l,onShowAll:n}=i;let o;e[0]!==t?(o=t.find(ns),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==l||e[4]!==t){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(v,O)=>{const T=c[v.id]??Number.MAX_SAFE_INTEGER,A=c[O.id]??Number.MAX_SAFE_INTEGER;return T-A},e[6]=_):_=e[6];const I=t.filter(ls).sort(_);let M;e[7]!==t?(M=t.find(is),e[7]=t,e[8]=M):M=e[8];const b=M;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ce.find(ss),e[9]=N):N=e[9];const S=N;let C;e[10]!==l?(C=v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"provider",provider:v})},v.id),e[10]=l,e[11]=C):C=e[11];let h,y;e[12]!==l||e[13]!==b?(h=b&&S?[s.jsx(re,{logo:S.logo,name:S.name,description:S.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:S})},S.id)]:[],y=b?[...ce.filter(ts).map(v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:v})},v.id)),s.jsx(re,{logo:b.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>l({kind:"openai-compatible",provider:b,preset:null})},"custom")]:[],e[12]=l,e[13]=b,e[14]=h,e[15]=y):(h=e[14],y=e[15]),d=[...I.map(C),...h,...y],e[3]=l,e[4]=t,e[5]=d}else d=e[5];const u=d,m=u.length-Ee,p=!!n&&m>0;let f;e[16]!==u||e[17]!==p?(f=p?u.slice(0,Ee):u,e[16]=u,e[17]=p,e[18]=f):f=e[18];const g=f;let x;e[19]!==r||e[20]!==l?(x=r&&s.jsx(Se,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(ke,{className:"relative",children:s.jsx(re,{logo:r.logo,name:r.name,description:r.description,onClick:()=>l({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=l,e[21]=x):x=e[21];let j;e[22]!==m||e[23]!==n||e[24]!==p?(j=p&&s.jsx(He,{onClick:n,title:`${m} more provider${m===1?"":"s"}`,action:s.jsx($t,{size:16,className:"text-muted-foreground"})}),e[22]=m,e[23]=n,e[24]=p,e[25]=j):j=e[25];let k;e[26]!==j||e[27]!==g?(k=s.jsx(Se,{children:s.jsxs(ke,{children:[g,j]})}),e[26]=j,e[27]=g,e[28]=k):k=e[28];let w;return e[29]!==x||e[30]!==k?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[x,k]}),e[29]=x,e[30]=k,e[31]=w):w=e[31],w}function ts(i){return i.id!=="openai"}function ss(i){return i.id==="openai"}function is(i){return i.id==="openai-compatible"}function ls(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function ns(i){return i.id==="deco"}const os=Re({label:ae().optional(),apiKey:ae().min(1,"API key is required")});function rs(i){const e=B.c(59),{providerId:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={resolver:Le(os),defaultValues:{label:"",apiKey:""}},e[0]=u):u=e[0];const{register:m,handleSubmit:p,formState:f}=Pe(u),{errors:g}=f;let x;e[1]!==t||e[2]!==r?(x=async z=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:z.label||"Personal key",apiKey:z.apiKey})},e[1]=t,e[2]=r,e[3]=x):x=e[3];let j;e[4]!==n||e[5]!==o||e[6]!==a?(j=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Key saved successfully"),n()},e[4]=n,e[5]=o,e[6]=a,e[7]=j):j=e[7];let k;e[8]!==x||e[9]!==j?(k={mutationFn:x,onSuccess:j,onError:as},e[8]=x,e[9]=j,e[10]=k):k=e[10];const{mutate:w,isPending:_,error:I}=fe(k);let M;e[11]!==w?(M=z=>w(z),e[11]=w,e[12]=M):M=e[12];let b;e[13]!==p||e[14]!==M?(b=p(M),e[13]=p,e[14]=M,e[15]=b):b=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=N):N=e[16];let S;e[17]!==m?(S=m("label"),e[17]=m,e[18]=S):S=e[18];let C;e[19]!==S?(C=s.jsxs("div",{className:"space-y-1",children:[N,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[19]=S,e[20]=C):C=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const y=c?"text":"password";let v;e[22]!==m?(v=m("apiKey"),e[22]=m,e[23]=v):v=e[23];let O;e[24]!==y||e[25]!==v?(O=s.jsx(le,{type:y,placeholder:"sk-...",...v,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=y,e[25]=v,e[26]=O):O=e[26];let T;e[27]!==c?(T=()=>d(!c),e[27]=c,e[28]=T):T=e[28];let A;e[29]!==c?(A=c?s.jsx(Ue,{size:14}):s.jsx(Ve,{size:14}),e[29]=c,e[30]=A):A=e[30];let E;e[31]!==T||e[32]!==A?(E=s.jsx("button",{type:"button",onClick:T,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:A}),e[31]=T,e[32]=A,e[33]=E):E=e[33];let L;e[34]!==O||e[35]!==E?(L=s.jsxs("div",{className:"relative",children:[O,E]}),e[34]=O,e[35]=E,e[36]=L):L=e[36];let R;e[37]!==g.apiKey?(R=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[37]=g.apiKey,e[38]=R):R=e[38];let P;e[39]!==L||e[40]!==R?(P=s.jsxs("div",{className:"space-y-1",children:[h,L,R]}),e[39]=L,e[40]=R,e[41]=P):P=e[41];let D;e[42]!==I?(D=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=D):D=e[43];let F;e[44]!==_||e[45]!==l?(F=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:_,children:"Cancel"}),e[44]=_,e[45]=l,e[46]=F):F=e[46];const W=_?"Saving...":"Save Key";let H;e[47]!==_||e[48]!==W?(H=s.jsx(ee,{type:"submit",size:"sm",disabled:_,children:W}),e[47]=_,e[48]=W,e[49]=H):H=e[49];let K;e[50]!==F||e[51]!==H?(K=s.jsxs($e,{children:[F,H]}),e[50]=F,e[51]=H,e[52]=K):K=e[52];let V;return e[53]!==C||e[54]!==P||e[55]!==D||e[56]!==K||e[57]!==b?(V=s.jsxs("form",{onSubmit:b,className:"space-y-3",children:[C,P,D,K]}),e[53]=C,e[54]=P,e[55]=D,e[56]=K,e[57]=b,e[58]=V):V=e[58],V}function as(i){Z.error(`Failed to save key: ${i.message}`)}const cs=Re({label:ae().optional(),baseUrl:ae().min(1,"Base URL is required"),apiKey:ae().optional()});function ds(i){const e=B.c(70),{preset:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Le(cs),e[0]=u):u=e[0];const m=t?.defaultBaseUrl??"";let p;e[1]!==m?(p={resolver:u,defaultValues:{label:"",baseUrl:m,apiKey:""}},e[1]=m,e[2]=p):p=e[2];const{register:f,handleSubmit:g,formState:x}=Pe(p),{errors:j}=x;let k;e[3]!==t||e[4]!==r?(k=async se=>{const lt=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:lt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=k):k=e[5];let w;e[6]!==n||e[7]!==o||e[8]!==a?(w=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Connection saved successfully"),n()},e[6]=n,e[7]=o,e[8]=a,e[9]=w):w=e[9];let _;e[10]!==k||e[11]!==w?(_={mutationFn:k,onSuccess:w,onError:us},e[10]=k,e[11]=w,e[12]=_):_=e[12];const{mutate:I,isPending:M,error:b}=fe(_),N=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let C;e[13]!==I?(C=se=>I(se),e[13]=I,e[14]=C):C=e[14];let h;e[15]!==g||e[16]!==C?(h=g(C),e[15]=g,e[16]=C,e[17]=h):h=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=y):y=e[18];let v;e[19]!==f?(v=f("label"),e[19]=f,e[20]=v):v=e[20];let O;e[21]!==N||e[22]!==v?(O=s.jsxs("div",{className:"space-y-1",children:[y,s.jsx(le,{placeholder:N,...v,className:"h-8 text-sm"})]}),e[21]=N,e[22]=v,e[23]=O):O=e[23];let T;e[24]!==S||e[25]!==j||e[26]!==t?.defaultBaseUrl||e[27]!==f?(T=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...f("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...f("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[24]=S,e[25]=j,e[26]=t?.defaultBaseUrl,e[27]=f,e[28]=T):T=e[28];const A=t?.apiKeyRecommended?"recommended":"optional";let E;e[29]!==A?(E=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",A,")"]})]}),e[29]=A,e[30]=E):E=e[30];const L=c?"text":"password";let R;e[31]!==f?(R=f("apiKey"),e[31]=f,e[32]=R):R=e[32];let P;e[33]!==L||e[34]!==R?(P=s.jsx(le,{type:L,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=L,e[34]=R,e[35]=P):P=e[35];let D;e[36]!==c?(D=()=>d(!c),e[36]=c,e[37]=D):D=e[37];let F;e[38]!==c?(F=c?s.jsx(Ue,{size:14}):s.jsx(Ve,{size:14}),e[38]=c,e[39]=F):F=e[39];let W;e[40]!==D||e[41]!==F?(W=s.jsx("button",{type:"button",onClick:D,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=D,e[41]=F,e[42]=W):W=e[42];let H;e[43]!==P||e[44]!==W?(H=s.jsxs("div",{className:"relative",children:[P,W]}),e[43]=P,e[44]=W,e[45]=H):H=e[45];let K;e[46]!==E||e[47]!==H?(K=s.jsxs("div",{className:"space-y-1",children:[E,H]}),e[46]=E,e[47]=H,e[48]=K):K=e[48];let V;e[49]!==t?(V=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=V):V=e[50];let z;e[51]!==b?(z=b&&s.jsx("p",{className:"text-xs text-destructive",children:b.message}),e[51]=b,e[52]=z):z=e[52];let Y;e[53]!==M||e[54]!==l?(Y=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:M,children:"Cancel"}),e[53]=M,e[54]=l,e[55]=Y):Y=e[55];const Q=M?"Saving...":"Save Connection";let q;e[56]!==M||e[57]!==Q?(q=s.jsx(ee,{type:"submit",size:"sm",disabled:M,children:Q}),e[56]=M,e[57]=Q,e[58]=q):q=e[58];let G;e[59]!==Y||e[60]!==q?(G=s.jsxs($e,{children:[Y,q]}),e[59]=Y,e[60]=q,e[61]=G):G=e[61];let U;return e[62]!==O||e[63]!==T||e[64]!==K||e[65]!==V||e[66]!==z||e[67]!==G||e[68]!==h?(U=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,T,K,V,z,G]}),e[62]=O,e[63]=T,e[64]=K,e[65]=V,e[66]=z,e[67]=G,e[68]=h,e[69]=U):U=e[69],U}function us(i){Z.error(`Failed to save connection: ${i.message}`)}const ms={kind:"closed"};function fs(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function hs(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ps({open:i,onOpenChange:e,initialProvider:t}){const n=ge()?.providers??[],{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useReducer(fs,ms),u=$.useRef(!1);$.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const m=()=>{u.current=!1,d({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:f}=fe({mutationFn:async({providerId:h,code:y,stateToken:v,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:y,stateToken:v,label:O}),h),onSuccess:h=>{J("ai_provider_oauth_succeeded",{provider_id:h}),p();const y=n.find(v=>v.id===h);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(h,y)=>{J("ai_provider_oauth_failed",{provider_id:y.providerId,error:h.message}),Z.error(`OAuth connection failed: ${h.message}`),d({type:"oauth-failed"})}}),{mutate:g}=fe({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{J("ai_provider_provision_succeeded",{provider_id:h}),p();const y=n.find(v=>v.id===h);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(h,y)=>{J("ai_provider_provision_failed",{provider_id:y,error:h.message}),d({type:"provision-error",error:h.message})}}),x=async h=>{const{provider:y}=h,v=h.kind==="openai-compatible"?h.preset?.id??null:null,O=y.supportedMethods.includes("oauth-pkce"),T=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){J("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),g(y.id);return}if(O){J("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const E=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!E?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:E.stateToken}),window.open(E.url,"AiProviderOAuth","width=600,height=700")}catch(E){Z.error(`Failed to start OAuth: ${E instanceof Error?E.message:String(E)}`)}return}T&&(J("ai_provider_connect_clicked",{provider_id:y.id,...v!==null?{preset_id:v}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:v}))},j=$.useRef(x);j.current=x;const k=$.useRef(t);k.current=t,$.useEffect(()=>{!k.current||c.kind!=="grid"||u.current||(u.current=!0,j.current(k.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,_=c.kind==="oauth-pending"?c.providerId:null;$.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const y=c.stateToken,v=c.providerId,O=A=>{if(A.origin!==window.location.origin||A.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:E,stateToken:L}=A.data;if(L!==y){Z.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}h=!0;const R=n.find(P=>P.id===v);f({providerId:v,code:E,stateToken:y,label:R?.name??v})};window.addEventListener("message",O);const T=setTimeout(()=>{h||(J("ai_provider_oauth_timeout",{provider_id:v}),d({type:"oauth-failed"}),Z.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(T)}},[c.kind,w,_,f]);const I=hs(c),M=I?n.find(h=>h.id===I):null,N=(c.kind==="form"&&c.presetId?ce.find(h=>h.id===c.presetId):null)?.name??M?.name??"Connect an AI provider",S=c.kind!=="grid"&&c.kind!=="closed",C=()=>{t?m():d({type:"back"})};return s.jsx(De,{open:c.kind!=="closed",onOpenChange:h=>!h&&m(),children:s.jsxs(Fe,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(ut,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[S&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,children:s.jsx(Be,{size:16})}),s.jsx(Ke,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(mt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Ge,{providers:n,onSelect:x}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(ds,{preset:c.presetId?ce.find(h=>h.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{p(),m()}}):s.jsx(rs,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{p(),m()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ye,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ye,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Pt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),g(c.providerId)},children:"Retry"})]})]})]})})}function xs(){const i=B.c(7),{org:e}=oe(),t=he();let l;i[0]!==e.id?(l=te.defaultBrand(e.id),i[0]=e.id,i[1]=l):l=i[1];let n;i[2]!==t?(n=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(gs)??null},i[2]=t,i[3]=n):n=i[3];let o;i[4]!==l||i[5]!==n?(o={queryKey:l,queryFn:n},i[4]=l,i[5]=n,i[6]=o):o=i[6];const{data:r}=rt(o);return r??null}function gs(i){return i.isDefault&&!i.archivedAt}function vs(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),l=t?t.value:e[0]?.value;return typeof l=="string"?l:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function bs(i){const e=B.c(50);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:l,description:n,onLocalRuntimePicked:o}=t,{org:r}=oe(),{localMode:a}=ot(),c=xs(),d=Ft(),u=bt(),[m,p]=$.useState(null),[f,g]=$.useState(!1),[x,j]=$.useState(!1),k=ge();let w;e[2]!==k?.providers?(w=k?.providers??[],e[2]=k?.providers,e[3]=w):w=e[3];const _=w;let I;if(e[4]!==d.capabilities||e[5]!==d.online){if(I=[],d.online){if(d.capabilities.includes("claude-code")){let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U={option:"claude-code-desktop",label:"Claude Code",icon:s.jsx(ue,{size:16})},e[7]=U):U=e[7],I.push(U)}if(d.capabilities.includes("codex")){let U;e[8]===Symbol.for("react.memo_cache_sentinel")?(U={option:"codex-desktop",label:"Codex",icon:s.jsx(me,{size:16})},e[8]=U):U=e[8],I.push(U)}}e[4]=d.capabilities,e[5]=d.online,e[6]=I}else I=e[6];const M=I.length>0&&u!==null,b=r.name;let N;e[9]!==c?(N=c?vs(c):null,e[9]=c,e[10]=N):N=e[10];const S=N,C=c?.favicon??c?.logo??null,h=l??(b?`${b} is ready for agents`:"Your agents are almost ready"),y=n??(M?"Your desktop is linked — start now with a local coding agent, or connect a cloud provider for hosted models.":a?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),v=!!(C||S);let O;e[11]!==S?(O=S?{backgroundColor:`${S}18`,borderColor:`${S}30`}:void 0,e[11]=S,e[12]=O):O=e[12];const T=O,A=v?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let E;e[13]!==A||e[14]!==T||e[15]!==C||e[16]!==d.online||e[17]!==S?(E=C?s.jsx("div",{className:A,style:T,children:s.jsx("img",{src:C,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>j(!0),"aria-label":d.online?"Desktop linked":"Connect your desktop",className:ne(A,"cursor-pointer transition-colors hover:bg-accent"),style:T,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Lt,{size:24,style:S?{color:S}:void 0,className:ne(!S&&"text-muted-foreground")}),d.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[13]=A,e[14]=T,e[15]=C,e[16]=d.online,e[17]=S,e[18]=E):E=e[18];let L;e[19]!==h?(L=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:h}),e[19]=h,e[20]=L):L=e[20];let R;e[21]!==y?(R=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:y}),e[21]=y,e[22]=R):R=e[22];let P;e[23]!==L||e[24]!==R?(P=s.jsxs("div",{className:"space-y-2",children:[L,R]}),e[23]=L,e[24]=R,e[25]=P):P=e[25];let D;e[26]!==E||e[27]!==P?(D=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[E,P]}),e[26]=E,e[27]=P,e[28]=D):D=e[28];let F;e[29]!==u||e[30]!==M||e[31]!==I||e[32]!==o?(F=M&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:I.map(U=>s.jsxs(ee,{variant:"default",className:"gap-2",onClick:()=>{u?.setPendingAgentOption(U.option),o?.(U.option)},children:[U.icon,"Use ",U.label]},U.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),"or connect a cloud provider",s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[29]=u,e[30]=M,e[31]=I,e[32]=o,e[33]=F):F=e[33];let W,H;e[34]===Symbol.for("react.memo_cache_sentinel")?(W=U=>p(U),H=()=>g(!0),e[34]=W,e[35]=H):(W=e[34],H=e[35]);let K;e[36]!==_?(K=s.jsx("div",{className:"w-full",children:s.jsx(Ge,{providers:_,onSelect:W,onShowAll:H})}),e[36]=_,e[37]=K):K=e[37];const V=m!==null||f;let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=U=>{U||(p(null),g(!1))},e[38]=z):z=e[38];const Y=m??void 0;let Q;e[39]!==V||e[40]!==Y?(Q=s.jsx(ps,{open:V,onOpenChange:z,initialProvider:Y}),e[39]=V,e[40]=Y,e[41]=Q):Q=e[41];let q;e[42]!==x?(q=s.jsx(Kt,{open:x,onOpenChange:j}),e[42]=x,e[43]=q):q=e[43];let G;return e[44]!==F||e[45]!==K||e[46]!==Q||e[47]!==q||e[48]!==D?(G=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[D,F,K,Q,q]}),e[44]=F,e[45]=K,e[46]=Q,e[47]=q,e[48]=D,e[49]=G):G=e[49],G}function be(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const ys=["bg-destructive","bg-warning","bg-success","bg-success"],Ss=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function Ns(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const Cs={text:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(Ot,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(wt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(Mt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Ut,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(We,{className:"size-3.5"}),label:"Web search"}};function ws(i){const e=B.c(5),{capability:t}=i;let l;e[0]!==t?(l=Cs[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=l):l=e[1];const n=l;let o;return e[2]!==n.icon||e[3]!==n.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[n.icon,n.label]}),e[2]=n.icon,e[3]=n.label,e[4]=o):o=e[4],o}function _s(i){const e=B.c(49),{model:t,compact:l}=i,n=l===void 0?!1:l;if(!t){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=b):b=e[0],b}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=be(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(n){let b;e[3]!==t.limits?(b=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=b):b=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let S;e[7]!==r?(S=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=S):S=e[8];let C;e[9]!==t.limits?(C=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=C):C=e[10];let h;return e[11]!==b||e[12]!==N||e[13]!==S||e[14]!==C?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[b,N,S,C]}),e[11]=b,e[12]=N,e[13]=S,e[14]=C,e[15]=h):h=e[15],h}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let m;e[18]!==t.logo||e[19]!==t.title?(m=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=m):m=e[20];let p;e[21]!==d?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=p):p=e[22];let f;e[23]!==m||e[24]!==p?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[m,p]}),e[23]=m,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let x;e[28]!==u||e[29]!==f||e[30]!==g?(x=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=x):x=e[31];let j;e[32]!==t.capabilities?(j=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Is)}),e[32]=t.capabilities,e[33]=j):j=e[33];let k;e[34]!==t.limits?(k=t.limits?.contextWindow&&(()=>{const{level:b,label:N,description:S}=js(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(C=>s.jsx("div",{className:ne("w-2 h-2 rounded-full",C<=b?ys[b-1]:"bg-muted")},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",S]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=k):k=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let _;e[38]!==o||e[39]!==r?(_=(o!=null||r!=null)&&(()=>{const{level:b,label:N}=o!=null?Ns(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(S=>s.jsx("span",{className:ne("text-sm font-bold leading-none",S<=b?Ss[b-1]:"text-muted-foreground/20"),children:"$"},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=_):_=e[40];let I;e[41]!==k||e[42]!==w||e[43]!==_?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[k,w,_]}),e[41]=k,e[42]=w,e[43]=_,e[44]=I):I=e[44];let M;return e[45]!==I||e[46]!==x||e[47]!==j?(M=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[x,j,I]}),e[45]=I,e[46]=x,e[47]=j,e[48]=M):M=e[48],M}function Is(i){return s.jsx(ws,{capability:i},i)}function Xe(i){const e=B.c(19),{model:t,placeholder:l,isLoading:n}=i,o=l===void 0?"Select model":l;if(n===void 0?!1:n){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(X,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(X,{className:"w-16 h-3 hidden md:block"})]}),e[0]=x):x=e[0],x}if(!t){let x;e[1]!==o?(x=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=x):x=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ne,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=j):j=e[3];let k;return e[4]!==x?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,j]}),e[4]=x,e[5]=k):k=e[5],k}let a;e[6]!==t?(a=be(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=ve(t),e[8]=t,e[9]=d):d=e[9];const u=d;let m;e[10]!==t.title||e[11]!==u?(m=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=m):m=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ne,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==m||e[17]!==p?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,p,f]}),e[16]=m,e[17]=p,e[18]=g):g=e[18],g}const Ms=["vision","image","file","audio","video"],Ye=["image/png","image/jpeg","image/gif","image/webp"],Qe=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function je(i){const e=i?.capabilities;return e?Ms.some(t=>e.includes(t)):!1}function $i(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],l=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(l&&Ye.includes(i)||n&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||je(e)&&Qe.includes(i))}function Di(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ye),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),je(i)&&t.push(...Qe),t.join(",")}function Fi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),je(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const Je=["smarter","faster","cheaper"],Ze={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Os=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Es=Os.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ts="google/gemini-2.5-pro",Te=new Map;function As(i){const e=Te.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:l,prefix:n}of Es)if(i.startsWith(n)){if(n===Ts&&i.length>n.length&&i[n.length]==="-"){const r=i[n.length+1];if(!r||!/\d/.test(r))continue}t=l;break}return Te.set(i,t),t}function Ae(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const l=As(t.modelId);e[l??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((l,n)=>l.title.localeCompare(n.title));return e}const et="mesh:model-shortlist:",zs=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Rs(i){try{const e=localStorage.getItem(et+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ls(i,e){localStorage.setItem(et+i,JSON.stringify([...e]))}function Ps(i){const e=B.c(21),{model:t,onHover:l}=i;let n;e[0]!==t?(n=be(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let a;e[2]!==t?(a=ve(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==l?(d=()=>l(t),e[4]=t,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let m;e[10]!==o?(m=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=m):m=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let f;e[14]!==m||e[15]!==p?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,p]}),e[14]=m,e[15]=p,e[16]=f):f=e[16];let g;return e[17]!==d||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,f]}),e[17]=d,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function $s(i){const e=B.c(10),{error:t,onRetry:l}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(dt,{className:"size-5 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(It,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:l,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=l,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ds(){const i=B.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Fs)}),i[0]=e):e=i[0],e}function Fs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(X,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(X,{className:"flex-1 h-4"}),s.jsx(X,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ze(i){const e=B.c(12),{label:t,models:l,onSelect:n,onHover:o}=i;if(l.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==l||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=u=>s.jsx("div",{onClick:()=>n(u),className:"cursor-pointer",children:s.jsx(Ps,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],a=l.map(d),e[2]=l,e[3]=o,e[4]=n,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Ks(i){const e=B.c(21),{model:t,isChecked:l,onToggle:n,onHover:o}=i,[r,a]=$.useState(l);r!==l&&a(l);let c;e[0]!==t?(c=ve(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let m;e[5]!==t.modelId||e[6]!==n?(m=()=>{a(Us),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=m):m=e[7];let p;e[8]!==r||e[9]!==m?(p=s.jsx(jt,{checked:r,onCheckedChange:m}),e[8]=r,e[9]=m,e[10]=p):p=e[10];let f;e[11]!==d||e[12]!==t.title?(f=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=f):f=e[13];let g;e[14]!==t.title?(g=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==p||e[18]!==f||e[19]!==g?(x=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[p,f,g]}),e[16]=u,e[17]=p,e[18]=f,e[19]=g,e[20]=x):x=e[20],x}function Us(i){return!i}function Bs(i){const e=[];for(const t of Je)if(i[t].length>0){e.push({type:"header",label:Ze[t]});for(const l of i[t])e.push({type:"model",model:l})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ws({items:i,shortlistSet:e,onToggle:t,onHover:l}){const n=$.useRef(null),o=es({count:i.length,getScrollElement:()=>n.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Ks,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:l})},r.key):null})})})}function Hs(i){const e=B.c(23),{keyId:t,searchTerm:l,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=Rt(t),u=c?d.filter(c):d.filter(Vs);let m;e[0]!==t?(m=()=>(t?Rs(t):null)??zs,e[0]=t,e[1]=m):m=e[1];const[p,f]=$.useState(m),[,g]=$.useTransition();let x;e[2]!==t||e[3]!==g?(x=h=>{t&&g(()=>{f(y=>{const v=new Set(y);return v.has(h)?v.delete(h):v.add(h),Ls(t,v),v})})},e[2]=t,e[3]=g,e[4]=x):x=e[4];const j=x,k=l.toLowerCase().trim(),w=h=>k?h.filter(y=>y.title.toLowerCase().includes(k)||y.modelId.toLowerCase().includes(k)):h;if(r){const h=Ae(w(u)),y=Bs(h);let v;e[5]!==p?(v=E=>p.has(E.modelId),e[5]=p,e[6]=v):v=e[6];const O=u.filter(v).length;let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Be,{size:14}),e[7]=T):T=e[7];let A;return e[8]!==a?(A=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[T,"Back"]}),e[8]=a,e[9]=A):A=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[A,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Ws,{items:y,shortlistSet:p,onToggle:j,onHover:n})]})}let _;e[10]!==p?(_=h=>p.has(h.modelId),e[10]=p,e[11]=_):_=e[11];const I=u.filter(_),M=I.length>0?I:u,b=Ae(w(M));let N;e[12]!==b||e[13]!==n||e[14]!==o?(N=Je.map(h=>s.jsx(ze,{label:Ze[h],models:b[h],onSelect:o,onHover:n},h)),e[12]=b,e[13]=n,e[14]=o,e[15]=N):N=e[15];let S;e[16]!==b.other||e[17]!==n||e[18]!==o?(S=s.jsx(ze,{label:"Other",models:b.other,onSelect:o,onHover:n}),e[16]=b.other,e[17]=n,e[18]=o,e[19]=S):S=e[19];let C;return e[20]!==N||e[21]!==S?(C=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,S]}),e[20]=N,e[21]=S,e[22]=C):C=e[22],C}function Vs(i){return i.asyncResearch!==!0}function qs(){const i=B.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(X,{className:"size-4 shrink-0"}),s.jsx(X,{className:"flex-1 h-6"}),s.jsx(X,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Gs)})]}),i[1]=t):t=i[1];let l;i[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(X,{className:"size-6 shrink-0"}),s.jsx(X,{className:"h-6 w-32"})]}),i[2]=l):l=i[2];let n;i[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(X,{className:"h-6 w-20 rounded-md"}),s.jsx(X,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=n):n=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(X,{className:"h-4 w-24"}),s.jsx(X,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(X,{className:"h-4 w-16"}),s.jsx(X,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Gs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(X,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(X,{className:"flex-1 h-4"}),s.jsx(X,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function tt(i){const e=B.c(49),{onClose:t,credentialId:l,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=$.useState(null),[u,m]=$.useState(""),[p,f]=$.useState(!1),g=$.useRef(null),x=ge(),j=zt();let k;e[0]!==x?.providers?(k=Object.fromEntries((x?.providers??[]).map(Qs)),e[0]=x?.providers,e[1]=k):k=e[1];const w=k,_=at(),{org:I}=oe();let M;e[2]!==n?(M=z=>{n(z),d(null)},e[2]=n,e[3]=M):M=e[3];const b=M;let N;e[4]!==l||e[5]!==t||e[6]!==r?(N=z=>{l&&(r(z),m(""),t())},e[4]=l,e[5]=t,e[6]=r,e[7]=N):N=e[7];const S=N;if(j.length===0){let z;return e[8]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(bs,{})}),e[8]=z):z=e[8],z}let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=C):C=e[9];const h=p?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=z=>m(z.target.value),e[10]=y):y=e[10];let v;e[11]!==u||e[12]!==h?(v=s.jsx(le,{ref:g,type:"text",placeholder:h,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=h,e[13]=v):v=e[13];let O;e[14]!==l||e[15]!==b||e[16]!==j||e[17]!==w?(O=j.length>0&&s.jsxs(yt,{value:l??"",onValueChange:b,children:[s.jsxs(St,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ys,children:[s.jsx(kt,{placeholder:"Key",children:(()=>{const z=j.find(U=>U.id===l),Y=z?w[z.providerId]:void 0,Q=Oe(z?.presetId),q=Q?.logo??Y?.logo,G=Q?.name??Y?.name??z?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[q?s.jsx("img",{src:q,alt:G,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(Tt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(Nt,{children:j.map(z=>{const Y=w[z.providerId],Q=Oe(z.presetId),q=Q?.logo??Y?.logo,G=Q?.name??Y?.name??z.providerId;return s.jsx(Ct,{value:z.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[q?s.jsx("img",{src:q,alt:G,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",z.label]})]})},z.id)})})]}),e[14]=l,e[15]=b,e[16]=j,e[17]=w,e[18]=O):O=e[18];let T;e[19]!==v||e[20]!==O?(T=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[C,v,O]})}),e[19]=v,e[20]=O,e[21]=T):T=e[21];let A;e[22]!==l?(A=z=>{const{error:Y,resetError:Q}=z;return s.jsx($s,{error:Y,onRetry:Q,credentialId:l??void 0})},e[22]=l,e[23]=A):A=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Ds,{}),e[24]=E):E=e[24];const L=l??void 0;let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(Xs),e[25]=R):R=e[25];let P;e[26]!==a||e[27]!==S||e[28]!==p||e[29]!==u||e[30]!==L?(P=s.jsx($.Suspense,{fallback:E,children:s.jsx(Hs,{keyId:L,searchTerm:u,onHover:d,onModelSelect:S,managing:p,onToggleManage:R,filterModels:a})}),e[26]=a,e[27]=S,e[28]=p,e[29]=u,e[30]=L,e[31]=P):P=e[31];let D;e[32]!==l||e[33]!==A||e[34]!==P?(D=s.jsx(ct,{fallback:A,children:P},l),e[32]=l,e[33]=A,e[34]=P,e[35]=D):D=e[35];let F;e[36]!==p||e[37]!==_||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>$.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(_t,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(At,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=_,e[38]=I,e[39]=F):F=e[39];let W;e[40]!==D||e[41]!==F||e[42]!==T?(W=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[T,D,F]}),e[40]=D,e[41]=F,e[42]=T,e[43]=W):W=e[43];const H=c??o??null;let K;e[44]!==H?(K=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(_s,{model:H})}),e[44]=H,e[45]=K):K=e[45];let V;return e[46]!==W||e[47]!==K?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[W,K]}),e[46]=W,e[47]=K,e[48]=V):V=e[48],V}function Xs(i){return!i}function Ys(i){return i.stopPropagation()}function Qs(i){return[i.id,i]}function Js(i){const e=B.c(12),{onClose:t}=i,{credentialId:l,setCredentialId:n,selectedModel:o,setModel:r}=xe();let a;e[0]!==n?(a=u=>{J("chat_credential_changed",{credential_id:u}),n(u)},e[0]=n,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==o?.modelId||e[4]!==r?(c=u=>{l&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:l}),r({...u,keyId:l}))},e[2]=l,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(tt,{onClose:t,credentialId:l,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=l,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Zs(i){const e=B.c(2),{onClose:t}=i;let l;return e[0]!==t?(l=s.jsx(Js,{onClose:t}),e[0]=t,e[1]=l):l=e[1],l}function ei(i){const e=B.c(2);let t;return e[0]!==i?(t=s.jsx(tt,{...i}),e[0]=i,e[1]=t):t=e[1],t}const ti=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function st(i){const e=B.c(10),{modelSet:t,selectedModelId:l,onSelect:n}=i;let o,r;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==l){const c=Object.fromEntries(t.models.map(si));o="flex flex-col p-2 w-[320px]",r=ti.map(d=>{const{tier:u,description:m}=d,p=t.tiers[u];if(!p.modelId)return null;const f=c[p.modelId];if(!f)return null;const g=l===p.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ne("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",g&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:p.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:p.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},u)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=l,e[5]=o,e[6]=r}else o=e[5],r=e[6];let a;return e[7]!==o||e[8]!==r?(a=s.jsx("div",{className:o,children:r}),e[7]=o,e[8]=r,e[9]=a):a=e[9],a}function si(i){return[i.modelId,i]}const ii=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],de="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",li=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:de,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:de,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:de,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:de,limits:null,costs:null}],ni="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",oi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",ri={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:s.jsx(ue,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:s.jsx(ue,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:s.jsx(ue,{size:16})}},ai={fast:{modelId:"codex:gpt-5.6-luna",label:"GPT-5.6 Luna",description:"Quicker responses",iconNode:s.jsx(me,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:"GPT-5.6 Terra",description:"Balanced quality",iconNode:s.jsx(me,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:"GPT-5.6 Sol",description:"Deeper reasoning",iconNode:s.jsx(me,{size:16})}};function it(i){return i==="claude-code"?{logo:ni,tiers:ri,models:ii}:i==="codex"?{logo:oi,tiers:ai,models:li}:null}function ci(i){const e=B.c(11),{onClose:t,agent:l}=i,n=xe(),o=l??n.pendingHarnessId??"decopilot";let r;e[0]!==o?(r=it(o),e[0]=o,e[1]=r):r=e[1];const a=r;if(!a){let m;return e[2]!==t?(m=s.jsx(Zs,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const c=n.selectedModel?.modelId??a.tiers[n.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==n?(d=m=>{n.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==c||e[9]!==d?(u=s.jsx(st,{modelSet:a,selectedModelId:c,onSelect:d}),e[7]=a,e[8]=c,e[9]=d,e[10]=u):u=e[10],u}function di(i){const e=B.c(13);let t,l;e[0]!==i?({agent:t,...l}=i,e[0]=i,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let n;e[3]!==t?(n=t?it(t):null,e[3]=t,e[4]=n):n=e[4];const o=n;if(!o){let d;return e[5]!==l?(d=s.jsx(ei,{...l}),e[5]=l,e[6]=d):d=e[6],d}const r=l.selectedModel?.modelId??o.tiers.smart.modelId;let a;e[7]!==l?(a=d=>{l.onModelChange(d),l.onClose()},e[7]=l,e[8]=a):a=e[8];let c;return e[9]!==o||e[10]!==r||e[11]!==a?(c=s.jsx(st,{modelSet:o,selectedModelId:r,onSelect:a}),e[9]=o,e[10]=r,e[11]=a,e[12]=c):c=e[12],c}function Ki(i){const e=B.c(39),{variant:t,className:l,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:c,onModelChange:d,filterModels:u,agent:m}=i,p=t===void 0?"borderless":t,f=n===void 0?"Select model":n,[g,x]=$.useState(!1),j=d!==void 0,k=vt(),w=p==="borderless"?"ghost":"outline",_=p==="borderless"&&"md:border-none";let I;e[0]!==l||e[1]!==_?(I=ne("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,l),e[0]=l,e[1]=_,e[2]=I):I=e[2];let M;e[3]!==r||e[4]!==o||e[5]!==f||e[6]!==j?(M=j?s.jsx(Xe,{model:o??null,placeholder:f,isLoading:r}):s.jsx(mi,{placeholder:f}),e[3]=r,e[4]=o,e[5]=f,e[6]=j,e[7]=M):M=e[7];let b;e[8]!==w||e[9]!==I||e[10]!==M?(b=s.jsx(ee,{variant:w,size:"sm",className:I,children:M}),e[8]=w,e[9]=I,e[10]=M,e[11]=b):b=e[11];const N=b;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(qs,{}),e[12]=S):S=e[12];let C;e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==o||e[17]!==c||e[18]!==d||e[19]!==j?(C=s.jsx($.Suspense,{fallback:S,children:j?s.jsx(di,{onClose:()=>x(!1),agent:m,credentialId:a??null,onCredentialChange:c??ui,selectedModel:o??null,onModelChange:d,filterModels:u}):s.jsx(ci,{onClose:()=>x(!1),agent:m})}),e[13]=m,e[14]=a,e[15]=u,e[16]=o,e[17]=c,e[18]=d,e[19]=j,e[20]=C):C=e[20];const h=C;if(k){let A;e[21]!==N?(A=s.jsx(ht,{asChild:!0,children:N}),e[21]=N,e[22]=A):A=e[22];let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(pt,{className:"sr-only",children:"Select model"}),e[23]=E):E=e[23];let L;e[24]!==h?(L=s.jsxs(xt,{className:"p-0 flex flex-col max-h-[95vh]",children:[E,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:h})]}),e[24]=h,e[25]=L):L=e[25];let R;return e[26]!==g||e[27]!==A||e[28]!==L?(R=s.jsxs(gt,{open:g,onOpenChange:x,children:[A,L]}),e[26]=g,e[27]=A,e[28]=L,e[29]=R):R=e[29],R}let y;e[30]!==N?(y=s.jsx(ft,{asChild:!0,children:N}),e[30]=N,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ke,{className:"sr-only",children:"Select model"}),e[32]=v):v=e[32];let O;e[33]!==h?(O=s.jsxs(Fe,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[v,h]}),e[33]=h,e[34]=O):O=e[34];let T;return e[35]!==g||e[36]!==y||e[37]!==O?(T=s.jsxs(De,{open:g,onOpenChange:x,children:[y,O]}),e[35]=g,e[36]=y,e[37]=O,e[38]=T):T=e[38],T}function ui(){}function mi(i){const e=B.c(4),{placeholder:t}=i,{selectedModel:l,isModelsLoading:n}=xe();let o;return e[0]!==n||e[1]!==l||e[2]!==t?(o=s.jsx(Xe,{model:l,placeholder:t,isLoading:n}),e[0]=n,e[1]=l,e[2]=t,e[3]=o):o=e[3],o}export{ps as C,Ki as M,bs as N,ce as O,Ge as P,Di as a,Fi as g,$i as i,je as m};
@@ -0,0 +1 @@
1
+ import{c as F,j as t,r as Q,B as je,i as be}from"./index-C7I160AA.js";import{i as Se}from"./ChevronRight-BSSGG1g5.js";import{V as fe}from"./agent-icon-CbBVbeed.js";import{A as ue}from"./automation-runs-CGER5GBv.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Fe,f as Te,P as Re,S as Ee}from"./page-seo-form-pa11jA1G.js";import{c as xe,F as ze}from"./index-CZEILacv.js";import{a as ge}from"./Tool01-C0uN9zWM.js";import"./AlertCircle-2s5kOZgj.js";import"./SwitchHorizontal01-CB2NLb2L.js";import"./Settings02-H_IB225h.js";import"./XCircle-CIONSbDG.js";import"./ArrowUpRight-B0lt2R6O.js";import"./ZapSquare-C8hQ9jTF.js";import"./Users03-BFPLupFq.js";import"./Loading02-DlI7_e_g.js";import"./CheckCircle-CIPdmx9R.js";import"./Check-B0N6s4EL.js";import"./ChevronDown-bR9-OAOH.js";import"./ChevronUp-Fslp9Fpy.js";import"./Circle-BPZeoRCx.js";import"./Stars02-BK7UYCtg.js";import"./Copy01-Cz1rKXRy.js";import"./ZoomOut-PMoRB_Bg.js";import"./DotsVertical-15z7dV29.js";import"./Globe01-DIfUBpGL.js";import"./Eye-DcJnhbvA.js";import"./FilterLines-cTy8iFZe.js";import"./Star01-BbsQJ_sS.js";import"./Globe04-mbYkrh9z.js";import"./HardDrive-j5KCJ6XY.js";import"./Key01-f-QyjpHL.js";import"./LayoutLeft-DWh3M4u4.js";import"./LinkExternal01-BGZKsGqI.js";import"./List-BWsSMZPj.js";import"./Monitor01-C0S2ni9X.js";import"./Sun-uxTaoEYF.js";import"./Palette-Dvhw-PUQ.js";import"./Play-DC8NP2kr.js";import"./Plus-CtK3Oiw2.js";import"./SearchLg-Bnks7xJg.js";import"./SearchMd-DyX5r8jM.js";import"./Shield01-BC699jIY.js";import"./Stars01-CR3bUaN7.js";import"./Trash01-Ua8N5kjP.js";import"./Upload01-hPJNmduj.js";import"./User01-BxMdEKOJ.js";import"./Users01-BAVKi7TL.js";import"./XClose-C6H98gBi.js";import"./X-DEwIfp2g.js";import"./Zap-BIltjucc.js";import"./select-DN-2P4pj.js";import"./tooltip-Df6PcMNU.js";import"./useInfiniteQuery-BsgsE7HF.js";import"./use-infinite-scroll-D4CUGMlc.js";import"./use-connection-D2zKUXMW.js";import"./use-collections-u9zczYmq.js";import"./use-mcp-client-Q0KtyZCi.js";import"./constants-B72Xmt_K.js";import"./auth-D5wBpl7f.js";import"./use-virtual-mcp-7ayI9UXm.js";import"./card-DQi9rgCg.js";import"./sidebar-CTn5usMP.js";import"./use-mobile-DMF4iRSr.js";import"./table-DTgM4O4Z.js";import"./empty-state-BWAXUEsn.js";import"./use-members-CKOvIbDB.js";import"./use-org-auth-client-rtyqEqJT.js";import"./use-clock-tick-BTJdRGzd.js";import"./use-automations-TLSZt6TY.js";import"./studio-tools-PotpJQ3D.js";import"./useSuspenseInfiniteQuery-DrOgYVoj.js";import"./badge-Ctcfruzq.js";import"./checkbox-BURTh-Sz.js";import"./command-C1J-e-lQ.js";import"./index-kon1iupd.js";import"./dialog-BrzV8etc.js";import"./popover-B0KbxhEe.js";import"./avatar-CDXoUCLJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DyeDOflU.js";import"./file-type-icon-Bjl2ymkp.js";import"./tab-id-DznSzCvK.js";import"./monaco-editor-C_AEiYQZ.js";import"./index-wSXh3klb.js";import"./chat-context-IHOJkkXf.js";import"./autosend-CmGYW3q_.js";import"./hooks-BZdqB8Qy.js";import"./decopilot-sse-pool-CQTNPxQf.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-DoUITmq_.js";import"./use-decopilot-events-c_F3xZZq.js";import"./use-organization-settings-CKQ7HE6e.js";import"./types-B8loWUG_.js";import"./shell-layout-KPAYSy0b.js";import"./alert-dialog-B0nYWSj5.js";import"./required-auth-layout-DF__PTv1.js";import"./use-org-sso-CyoKQ5KE.js";import"./integration-icon-D0K1bih8.js";import"./use-navigate-to-agent-B6McR-Jr.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-BmiZpXIz.js";import"./form-BRUQyl6J.js";import"./label-e6rWM2hU.js";import"./input-DH_VnByH.js";import"./switch-Cmmmt6PD.js";import"./drawer-gV6ZWrch.js";import"./collection-search-BNR-_kgt.js";import"./tabs-t0q9T5Fa.js";import"./toggle-group-DYrBrZmA.js";import"./agent-capabilities-kcySA6Rm.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cz90MoMh.js";import"./use-registry-connections-D9xYxJqe.js";import"./extract-connection-data-D7-1aZ_S.js";import"./collection-tabs-DapcRZt3.js";import"./textarea-BYIN4Jzx.js";import"./connection-form-helpers-0tgODnl3.js";import"./authenticate-and-persist-oauth-Chvo_Jes.js";import"./mcp-oauth-BCaCUxes.js";import"./connect-desktop-dialog-CiAszx6Y.js";import"./select-model-B2UNE9H0.js";import"./skeleton-D4gGgavd.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DkyvVCpj.js";import"./dropdown-menu-BddT-o91.js";import"./index-CWK3z81c.js";import"./toolbar-BdWX93yt.js";import"./use-debounced-value-Din3ks-5.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-o42lSNJw.js";import"./use-mcp-tools-CZX0T0Gj.js";import"./use-capability-1pbErDsM.js";import"./tools-list-BGKY_7Nz.js";import"./use-debounced-autosave-DpZx2Woz.js";import"./index-BoSB3Za-.js";import"./search-input-D8sB5-Ny.js";import"./github-repo-picker-Do5QoiKl.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-DQ0uwPps.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-DU7aSFO-.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CeqPOUkw.js";import"./toolbar-icon-button-Cxc_k7ol.js";import"./use-file-configs-C5vV28ov.js";import"./automation-list-row-Cbdiek4K.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=F.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=F.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let b;return e[23]!==u||e[24]!==y||e[25]!==g?(b=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=b):b=e[26],b}function De(n){const e=F.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=F.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=F.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const b=i.description??ee;let _;e[17]!==y||e[18]!==b?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:b}),e[17]=y,e[18]=b,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let S;e[24]!==i.image?(S=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=S):S=e[25];let k;e[26]!==N||e[27]!==S||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,S]}),e[26]=N,e[27]=S,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=F.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=F.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Pi(n){const e=F.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,b]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),b(Me));const{persistSeo:S,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},T=c?we(w,c):null,z=T&&(!K||Ce(B))?ze(T,s):null;let M;e[0]!==s?(M=Fe(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,V;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Te(a,s)?.seoData??{}:{},V=o.kind==="page"?Ge(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=V):(R=e[6],V=e[7]);const ie=V;let G;e[8]!==S||e[9]!==c||e[10]!==v?(G=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=G):G=e[11];const se=G;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==b?(H=()=>b(Ke),e[14]=b,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ve(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(Se,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==T||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==S||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:T,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),S(E)},onClearForm:le,onBumpFormKey:re})]}):z&&T&&t.jsx(Ee,{schema:z,resolveType:T,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=T,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=S,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ve(n,e){try{return new URL(n,e).href}catch{return e}}function Ge(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Pi as SeoEditor};
@@ -1 +1 @@
1
- import{aW as H,r as A,aX as J,aY as Q,c as S,e as L,j as s,Z as Y,l as k,ak as Z,a6 as B,M as I,a3 as E,a as G,i as F,X as K}from"./index-CLj_5r89.js";import{j as U,k as V,l as ee,S as q,a as w,b as M,d as P,c as R,f as se,g as te}from"./sidebar-B_c4VYke.js";import{a as re}from"./index-BMxNGICG.js";import{n as le,c as ie,a as oe,d as ne,b as ae,i as T}from"./ZapSquare-0BsdXZY9.js";import{t as ce,a as O}from"./Users03-BMw5o14D.js";import{i as me}from"./HardDrive-CrxPr3va.js";import{i as fe}from"./Key01-CfvrTjDF.js";import{i as de}from"./Shield01-BT2HQXan.js";import{s as ue}from"./User01-DcNAHFa-.js";import{i as xe}from"./Zap-Br_Hg1wB.js";import{a as be}from"./use-capability-CqEMs0z_.js";import{u as he}from"./use-join-requests-DyX59dkl.js";import{u as W}from"./use-mobile-BJ6No951.js";import{u as pe}from"./use-status-sounds-B0huGKlG.js";import{T as y}from"./toolbar-DR2I0_KA.js";import{S as ge,M as je}from"./shell-controls-CD6bdY9w.js";import"./LayoutLeft-Cog6SqwZ.js";import"./X-CYIGv8wX.js";import"./tooltip-C51X6QKO.js";import"./studio-tools-F5G0urN7.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-C70DCxcq.js";import"./decopilot-sse-pool-CiyJzTNT.js";import"./backoff-CrEUbyZT.js";import"./toolbar-icon-button-Cf6OwFTU.js";function X(e){const t=H({warn:e?.router===void 0}),n=e?.router||t,r=A.useRef(void 0);return J(n.stores.__store,l=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Q(r.current,e.select(l));return r.current=i,i}return e.select(l)}return l})}function D(){const e=S.c(21),{capabilities:t,isPrivileged:n,loading:r,error:l}=be(),i=he().length;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ce,{size:14}),e[0]=a):a=e[0];let o,c;if(e[1]!==t||e[2]!==l||e[3]!==n||e[4]!==i||e[5]!==r){c=Symbol.for("react.early_return_sentinel");e:{let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(le,{size:14}),e[8]=f):f=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ie,{size:14}),e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(fe,{size:14}),e[10]=m):m=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(me,{size:14}),e[11]=u):u=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(oe,{size:14}),e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(O,{size:14}),e[13]=p):p=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xe,{size:14}),e[14]=h):h=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ne,{size:14}),e[15]=g):g=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ae,{size:14}),e[16]=b):b=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(O,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(de,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Z,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{size:14}),e[20]=N):N=e[20];const z=[{label:"Organization",items:[{key:"general",label:"General",icon:a,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:f,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:d,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:m,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:u,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:x,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:p,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:h,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:b,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:i},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(r||l){c=z;break e}o=z.map(C=>({...C,items:C.items.filter($=>$.privilegedOnly?n:$.requires?n||t[$.requires]:!0)})).filter(_e)}e[1]=t,e[2]=l,e[3]=n,e[4]=i,e[5]=r,e[6]=o,e[7]=c}else o=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:o}function _e(e){return e.items.length>0}function ye(){const e=S.c(19),t=D();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:r}=L(n);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={select:ve},e[1]=l):l=e[1];const i=X(l);let a;e[2]!==r||e[3]!==i?(a=p=>{const h=p.replace("$org",r);return i.startsWith(h)},e[2]=r,e[3]=i,e[4]=a):a=e[4];const o=a;let c;if(e[5]!==t||e[6]!==o||e[7]!==r){let p;e[9]!==o||e[10]!==r?(p=(h,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[h.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:h.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:h.items.map(b=>s.jsx(P,{children:s.jsx(R,{asChild:!0,isActive:o(b.to),children:s.jsxs(B,{to:b.to,params:{org:r},onClick:()=>I("settings_nav_clicked",{section_key:b.key,section_label:b.label,group_label:h.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[b.icon,b.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:b.label})]})})},b.key))})})]},`${h.label}-${g}`),e[9]=o,e[10]=r,e[11]=p):p=e[11],c=t.map(p),e[5]=t,e[6]=o,e[7]=r,e[8]=c}else c=e[8];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=f):f=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[f,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(R,{onClick:Se,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=d):d=e[13];let m;e[14]!==c?(m=s.jsxs(se,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[c,d]}),e[14]=c,e[15]=m):m=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.32.0"]})}),e[16]=u):u=e[16];let x;return e[17]!==m?(x=s.jsxs(te,{variant:"sidebar",children:[m,u]}),e[17]=m,e[18]=x):x=e[18],x}function Se(){I("signed_out",{source:"settings_sidebar"}),E(),G.signOut()}function ve(e){return e.location.pathname}function Ne(e){const t=S.c(21),{onClose:n}=e,r=D();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org"},t[0]=l):l=t[0];const{org:i}=L(l);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:$e},t[1]=a):a=t[1];const o=X(a);let c;t[2]!==i||t[3]!==o?(c=g=>{const b=g.replace("$org",i);return o.startsWith(b)},t[2]=i,t[3]=o,t[4]=c):c=t[4];const f=c;let d;if(t[5]!==r||t[6]!==f||t[7]!==n||t[8]!==i){let g;t[10]!==f||t[11]!==n||t[12]!==i?(g=(b,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:b.label}),b.items.map(j=>s.jsxs(B,{to:j.to,params:{org:i},onClick:n,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",f(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${b.label}-${_}`),t[10]=f,t[11]=n,t[12]=i,t[13]=g):g=t[13],d=r.map(g),t[5]=r,t[6]=f,t[7]=n,t[8]=i,t[9]=d}else d=t[9];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=m):m=t[14];let u;t[15]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[m,s.jsxs("button",{type:"button",onClick:ke,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=u):u=t[15];let x;t[16]!==d?(x=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[d,u]}),t[16]=d,t[17]=x):x=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.32.0"]})}),t[18]=p):p=t[18];let h;return t[19]!==x?(h=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[x,p]}),t[19]=x,t[20]=h):h=t[20],h}function ke(){E(),G.signOut()}function $e(e){return e.location.pathname}function ze(){const e=S.c(4),t=W(),{org:n}=Y();pe(n.slug);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(F,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(A.Suspense,{fallback:r,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(re,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(K,{})})})})}),e[1]=l):l=e[1];const i=l;if(t){let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:i}),e[2]=o):o=e[2],o}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:i})}),e[3]=a):a=e[3],a}function es(){const e=S.c(21),t=W();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.LogoLink,{}),e[0]=n):n=e[0];let r;e[1]!==t?(r=t&&s.jsx(ge,{}),e[1]=t,e[2]=r):r=e[2];let l;e[3]!==r?(l=s.jsxs(y.LeftColumn,{children:[n,r]}),e[3]=r,e[4]=l):l=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(y.CenterSlot,{}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[6]=a):a=e[6];let o;e[7]!==l?(o=s.jsxs(y.Header,{children:[l,i,a]}),e[7]=l,e[8]=o):o=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width-icon":"3.5rem"},e[9]=c):c=e[9];let f;e[10]!==t?(f=!t&&s.jsx(ye,{}),e[10]=t,e[11]=f):f=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(U,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(ze,{})}),e[12]=d):d=e[12];let m;e[13]!==f?(m=s.jsxs(V,{className:"flex-1 bg-sidebar min-h-0",style:c,children:[f,d]}),e[13]=f,e[14]=m):m=e[14];let u;e[15]!==t?(u=t&&s.jsx(je,{renderSidebar:Ce}),e[15]=t,e[16]=u):u=e[16];let x;return e[17]!==u||e[18]!==o||e[19]!==m?(x=s.jsx(y.Provider,{children:s.jsx(ee,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[o,m,u]})})}),e[17]=u,e[18]=o,e[19]=m,e[20]=x):x=e[20],x}function Ce(e){const{onClose:t}=e;return s.jsx(Ne,{onClose:t})}export{ye as SettingsSidebar,Ne as SettingsSidebarMobile,es as default};
1
+ import{aW as H,r as A,aX as J,aY as Q,c as S,e as L,j as s,$ as Y,l as k,ak as F,a6 as B,M as I,a3 as E,a as G,i as K,X as U}from"./index-C7I160AA.js";import{j as V,k as Z,l as ee,S as q,a as w,b as M,d as P,c as R,f as se,g as te}from"./sidebar-CTn5usMP.js";import{a as re}from"./index-BoSB3Za-.js";import{n as le,c as ie,a as oe,d as ne,b as ae,i as T}from"./ZapSquare-C8hQ9jTF.js";import{t as ce,a as O}from"./Users03-BFPLupFq.js";import{i as me}from"./HardDrive-j5KCJ6XY.js";import{i as fe}from"./Key01-f-QyjpHL.js";import{i as de}from"./Shield01-BC699jIY.js";import{s as ue}from"./User01-BxMdEKOJ.js";import{i as xe}from"./Zap-BIltjucc.js";import{a as be}from"./use-capability-1pbErDsM.js";import{u as he}from"./use-join-requests-DUokiFjq.js";import{u as W}from"./use-mobile-DMF4iRSr.js";import{u as pe}from"./use-status-sounds-o42lSNJw.js";import{T as y}from"./toolbar-BdWX93yt.js";import{S as ge,M as je}from"./shell-controls-CLwAtNRs.js";import"./LayoutLeft-DWh3M4u4.js";import"./X-DEwIfp2g.js";import"./tooltip-Df6PcMNU.js";import"./studio-tools-PotpJQ3D.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-c_F3xZZq.js";import"./decopilot-sse-pool-CQTNPxQf.js";import"./backoff-CrEUbyZT.js";import"./toolbar-icon-button-Cxc_k7ol.js";function X(e){const t=H({warn:e?.router===void 0}),n=e?.router||t,r=A.useRef(void 0);return J(n.stores.__store,l=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const i=Q(r.current,e.select(l));return r.current=i,i}return e.select(l)}return l})}function D(){const e=S.c(21),{capabilities:t,isPrivileged:n,loading:r,error:l}=be(),i=he().length;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ce,{size:14}),e[0]=a):a=e[0];let o,c;if(e[1]!==t||e[2]!==l||e[3]!==n||e[4]!==i||e[5]!==r){c=Symbol.for("react.early_return_sentinel");e:{let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(le,{size:14}),e[8]=f):f=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ie,{size:14}),e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(fe,{size:14}),e[10]=m):m=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(me,{size:14}),e[11]=u):u=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(oe,{size:14}),e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(O,{size:14}),e[13]=p):p=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xe,{size:14}),e[14]=h):h=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ne,{size:14}),e[15]=g):g=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ae,{size:14}),e[16]=b):b=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(O,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(de,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(F,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{size:14}),e[20]=N):N=e[20];const z=[{label:"Organization",items:[{key:"general",label:"General",icon:a,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:f,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:d,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:m,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:u,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:x,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:p,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:h,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:b,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:i},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(r||l){c=z;break e}o=z.map(C=>({...C,items:C.items.filter($=>$.privilegedOnly?n:$.requires?n||t[$.requires]:!0)})).filter(_e)}e[1]=t,e[2]=l,e[3]=n,e[4]=i,e[5]=r,e[6]=o,e[7]=c}else o=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:o}function _e(e){return e.items.length>0}function ye(){const e=S.c(19),t=D();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:r}=L(n);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={select:ve},e[1]=l):l=e[1];const i=X(l);let a;e[2]!==r||e[3]!==i?(a=p=>{const h=p.replace("$org",r);return i.startsWith(h)},e[2]=r,e[3]=i,e[4]=a):a=e[4];const o=a;let c;if(e[5]!==t||e[6]!==o||e[7]!==r){let p;e[9]!==o||e[10]!==r?(p=(h,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[h.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:h.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:h.items.map(b=>s.jsx(P,{children:s.jsx(R,{asChild:!0,isActive:o(b.to),children:s.jsxs(B,{to:b.to,params:{org:r},onClick:()=>I("settings_nav_clicked",{section_key:b.key,section_label:b.label,group_label:h.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[b.icon,b.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:b.label})]})})},b.key))})})]},`${h.label}-${g}`),e[9]=o,e[10]=r,e[11]=p):p=e[11],c=t.map(p),e[5]=t,e[6]=o,e[7]=r,e[8]=c}else c=e[8];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=f):f=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[f,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(R,{onClick:Se,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=d):d=e[13];let m;e[14]!==c?(m=s.jsxs(se,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[c,d]}),e[14]=c,e[15]=m):m=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.34.0"]})}),e[16]=u):u=e[16];let x;return e[17]!==m?(x=s.jsxs(te,{variant:"sidebar",children:[m,u]}),e[17]=m,e[18]=x):x=e[18],x}function Se(){I("signed_out",{source:"settings_sidebar"}),E(),G.signOut()}function ve(e){return e.location.pathname}function Ne(e){const t=S.c(21),{onClose:n}=e,r=D();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org"},t[0]=l):l=t[0];const{org:i}=L(l);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:$e},t[1]=a):a=t[1];const o=X(a);let c;t[2]!==i||t[3]!==o?(c=g=>{const b=g.replace("$org",i);return o.startsWith(b)},t[2]=i,t[3]=o,t[4]=c):c=t[4];const f=c;let d;if(t[5]!==r||t[6]!==f||t[7]!==n||t[8]!==i){let g;t[10]!==f||t[11]!==n||t[12]!==i?(g=(b,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:b.label}),b.items.map(j=>s.jsxs(B,{to:j.to,params:{org:i},onClick:n,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",f(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${b.label}-${_}`),t[10]=f,t[11]=n,t[12]=i,t[13]=g):g=t[13],d=r.map(g),t[5]=r,t[6]=f,t[7]=n,t[8]=i,t[9]=d}else d=t[9];let m;t[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=m):m=t[14];let u;t[15]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[m,s.jsxs("button",{type:"button",onClick:ke,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=u):u=t[15];let x;t[16]!==d?(x=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[d,u]}),t[16]=d,t[17]=x):x=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.34.0"]})}),t[18]=p):p=t[18];let h;return t[19]!==x?(h=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[x,p]}),t[19]=x,t[20]=h):h=t[20],h}function ke(){E(),G.signOut()}function $e(e){return e.location.pathname}function ze(){const e=S.c(4),t=W(),{org:n}=Y();pe(n.slug);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(K,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(A.Suspense,{fallback:r,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(re,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(U,{})})})})}),e[1]=l):l=e[1];const i=l;if(t){let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:i}),e[2]=o):o=e[2],o}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:i})}),e[3]=a):a=e[3],a}function es(){const e=S.c(21),t=W();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.LogoLink,{}),e[0]=n):n=e[0];let r;e[1]!==t?(r=t&&s.jsx(ge,{}),e[1]=t,e[2]=r):r=e[2];let l;e[3]!==r?(l=s.jsxs(y.LeftColumn,{children:[n,r]}),e[3]=r,e[4]=l):l=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(y.CenterSlot,{}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[6]=a):a=e[6];let o;e[7]!==l?(o=s.jsxs(y.Header,{children:[l,i,a]}),e[7]=l,e[8]=o):o=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width-icon":"3.5rem"},e[9]=c):c=e[9];let f;e[10]!==t?(f=!t&&s.jsx(ye,{}),e[10]=t,e[11]=f):f=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(ze,{})}),e[12]=d):d=e[12];let m;e[13]!==f?(m=s.jsxs(Z,{className:"flex-1 bg-sidebar min-h-0",style:c,children:[f,d]}),e[13]=f,e[14]=m):m=e[14];let u;e[15]!==t?(u=t&&s.jsx(je,{renderSidebar:Ce}),e[15]=t,e[16]=u):u=e[16];let x;return e[17]!==u||e[18]!==o||e[19]!==m?(x=s.jsx(y.Provider,{children:s.jsx(ee,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[o,m,u]})})}),e[17]=u,e[18]=o,e[19]=m,e[20]=x):x=e[20],x}function Ce(e){const{onClose:t}=e;return s.jsx(Ne,{onClose:t})}export{ye as SettingsSidebar,Ne as SettingsSidebarMobile,es as default};
@@ -1 +1 @@
1
- import{c as v,l as N,j as r,r as S}from"./index-CLj_5r89.js";import{C as w}from"./card-D5CauofV.js";import{i as E}from"./ArrowUpRight-B2VxdxbH.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,K as c,H as d};
1
+ import{c as v,l as N,j as r,r as S}from"./index-C7I160AA.js";import{C as w}from"./card-DQi9rgCg.js";import{i as E}from"./ArrowUpRight-B0lt2R6O.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,K as c,H as d};
@@ -1 +1 @@
1
- import{c as f,j as a}from"./index-CLj_5r89.js";import{u as p,m as b,p as d,q as h}from"./sidebar-B_c4VYke.js";import{i as u}from"./LayoutLeft-Cog6SqwZ.js";import{T as S}from"./toolbar-icon-button-Cf6OwFTU.js";function T(){const t=f.c(3),{toggleSidebar:e}=p();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16}),t[0]=o):o=t[0];let s;return t[1]!==e?(s=a.jsx(S,{onClick:e,"aria-label":"Toggle sidebar",children:o}),t[1]=e,t[2]=s):s=t[2],s}function M(t){const e=f.c(12),{renderSidebar:o}=t,{openMobile:s,setOpenMobile:i}=p();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(b,{className:"sr-only",children:"Navigation"}),e[0]=c):c=e[0];let n;e[1]!==i?(n=()=>i(!1),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==o||e[4]!==n?(l=o({onClose:n}),e[3]=o,e[4]=n,e[5]=l):l=e[5];let r;e[6]!==l?(r=a.jsxs(d,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[c,l]}),e[6]=l,e[7]=r):r=e[7];let m;return e[8]!==s||e[9]!==i||e[10]!==r?(m=a.jsx(h,{open:s,onOpenChange:i,children:r}),e[8]=s,e[9]=i,e[10]=r,e[11]=m):m=e[11],m}export{M,T as S};
1
+ import{c as f,j as a}from"./index-C7I160AA.js";import{u as p,m as b,p as d,q as h}from"./sidebar-CTn5usMP.js";import{i as u}from"./LayoutLeft-DWh3M4u4.js";import{T as S}from"./toolbar-icon-button-Cxc_k7ol.js";function T(){const t=f.c(3),{toggleSidebar:e}=p();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16}),t[0]=o):o=t[0];let s;return t[1]!==e?(s=a.jsx(S,{onClick:e,"aria-label":"Toggle sidebar",children:o}),t[1]=e,t[2]=s):s=t[2],s}function M(t){const e=f.c(12),{renderSidebar:o}=t,{openMobile:s,setOpenMobile:i}=p();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(b,{className:"sr-only",children:"Navigation"}),e[0]=c):c=e[0];let n;e[1]!==i?(n=()=>i(!1),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==o||e[4]!==n?(l=o({onClose:n}),e[3]=o,e[4]=n,e[5]=l):l=e[5];let r;e[6]!==l?(r=a.jsxs(d,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[c,l]}),e[6]=l,e[7]=r):r=e[7];let m;return e[8]!==s||e[9]!==i||e[10]!==r?(m=a.jsx(h,{open:s,onOpenChange:i,children:r}),e[8]=s,e[9]=i,e[10]=r,e[11]=m):m=e[11],m}export{M,T as S};
@@ -1 +1 @@
1
- import{c as N,d as ee,j as n,B as C,bR as H,t as Y,ak as ye,a as W,U as Ne,L as be,K as se,bS as _e,bT as Ae,V as B,r as K,k as te,bU as Ce,bV as Oe,b as Te,Z as Ee,e as xe,u as $e,a0 as ze,aW as De,bW as Ie,bX as ue,bY as Le,bZ as Me,S as Pe,X as Fe,b_ as Re}from"./index-CLj_5r89.js";import{A as oe}from"./avatar-B2d04wRu.js";import{t as we,a as qe}from"./Users03-BMw5o14D.js";import{i as Ue}from"./SearchLg-DvsDitCO.js";import{i as Ge,s as Ke,a as D,n as He}from"./Stars02-LnA0-zz4.js";import{s as Be}from"./XClose-DT64mUwh.js";import{i as L}from"./CheckCircle-auAoHYRc.js";import{i as me}from"./FilterLines-Cr2IL8ug.js";import{i as G}from"./Zap-Br_Hg1wB.js";import{d as We,c as Ye,a as Je,e as Ve}from"./dialog-BFPr54WG.js";import{b as Qe,c as Xe,d as Ze,a as et,e as tt,g as nt,f as st}from"./alert-dialog-BbHr6pLd.js";import{R as ot}from"./required-auth-layout-DGQr874S.js";import{A as it}from"./autosend-REHFoRRR.js";import{m as at}from"./use-mcp-client-3hG4jk-y.js";import{a as fe,S as rt}from"./constants-B72Xmt_K.js";import{g as lt,c as ct}from"./hooks-BSiz_AKB.js";import{q as dt}from"./tab-id-DznSzCvK.js";import{d as ut}from"./use-organization-settings-BzhOQtxD.js";import{u as mt}from"./use-org-sso-DcXTIOxB.js";function ft(t){const e=N.c(27),{orgName:s,orgSlug:o,orgLogo:a,domain:r}=t;let i;e[0]!==o?(i={mutationFn:async()=>{const w=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),v=await w.json();if(!w.ok||!v.success)throw new Error(v.error??"Failed to join organization");return v},onSuccess:w=>{window.location.href=`/${w.slug??o}`},onError:ht},e[0]=o,e[1]=i):i=e[1];const l=ee(i),d=gt;let c;e[2]!==a||e[3]!==s?(c=a?n.jsx(oe,{url:a,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(we,{className:"h-6 w-6 text-primary"})}),e[2]=a,e[3]=s,e[4]=c):c=e[4];let u;e[5]!==s?(u=n.jsxs("h3",{className:"text-lg font-medium",children:["Join ",s,"?"]}),e[5]=s,e[6]=u):u=e[6];let m;e[7]!==r?(m=n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Anyone with an ",n.jsxs("strong",{children:["@",r]})," email can join this organization."]}),e[7]=r,e[8]=m):m=e[8];let f;e[9]!==u||e[10]!==m?(f=n.jsxs("div",{className:"space-y-2",children:[u,m]}),e[9]=u,e[10]=m,e[11]=f):f=e[11];let y;e[12]!==l?(y=()=>l.mutate(),e[12]=l,e[13]=y):y=e[13];const p=l.isPending?"Joining…":`Enter ${s}`;let g;e[14]!==l.isPending||e[15]!==y||e[16]!==p?(g=n.jsx(C,{onClick:y,disabled:l.isPending,children:p}),e[14]=l.isPending,e[15]=y,e[16]=p,e[17]=g):g=e[17];let h;e[18]!==l.isPending?(h=n.jsx(C,{variant:"ghost",onClick:d,disabled:l.isPending,children:"Go to home"}),e[18]=l.isPending,e[19]=h):h=e[19];let b;e[20]!==g||e[21]!==h?(b=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[g,h]}),e[20]=g,e[21]=h,e[22]=b):b=e[22];let S;return e[23]!==b||e[24]!==c||e[25]!==f?(S=n.jsxs(H,{children:[c,f,b]}),e[23]=b,e[24]=c,e[25]=f,e[26]=S):S=e[26],S}function gt(){window.location.href="/"}function ht(t){Y.error(t instanceof Error?t.message:"Failed to join organization")}function ge(t){const e=N.c(17),{orgSlug:s,orgName:o,reason:a}=t,r=pt,i=a==="not-found",l=i?Ue:ye,d=i?"Organization not found":"No access";let c;e[0]!==i||e[1]!==o||e[2]!==s?(c=i?n.jsxs(n.Fragment,{children:["We couldn't find an organization called ",n.jsx("strong",{children:s}),"."]}):n.jsxs(n.Fragment,{children:["You don't have access to ",n.jsx("strong",{children:o??s}),".",n.jsx("br",{}),"Ask an admin to invite you."]}),e[0]=i,e[1]=o,e[2]=s,e[3]=c):c=e[3];const u=c;let m;e[4]!==l?(m=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(l,{className:"h-6 w-6 text-muted-foreground"})}),e[4]=l,e[5]=m):m=e[5];let f;e[6]!==d?(f=n.jsx("h3",{className:"text-lg font-medium",children:d}),e[6]=d,e[7]=f):f=e[7];let y;e[8]!==u?(y=n.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[8]=u,e[9]=y):y=e[9];let p;e[10]!==f||e[11]!==y?(p=n.jsxs("div",{className:"space-y-2",children:[f,y]}),e[10]=f,e[11]=y,e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(C,{onClick:r,children:"Go to home"}),e[13]=g):g=e[13];let h;return e[14]!==m||e[15]!==p?(h=n.jsxs(H,{children:[m,p,g]}),e[14]=m,e[15]=p,e[16]=h):h=e[16],h}function pt(){window.location.href="/"}function yt(t){const e=N.c(39),{invitationId:s,orgName:o,orgSlug:a,orgLogo:r}=t;let i;e[0]!==s?(i=async()=>{const _=await W.organization.acceptInvitation({invitationId:s});if(_.error)throw new Error(_.error.message);return _.data},e[0]=s,e[1]=i):i=e[1];let l;e[2]!==a?(l=()=>{Ne(),window.location.href=`/${a}`},e[2]=a,e[3]=l):l=e[3];let d;e[4]!==i||e[5]!==l?(d={mutationFn:i,onSuccess:l,onError:wt},e[4]=i,e[5]=l,e[6]=d):d=e[6];const c=ee(d);let u;e[7]!==s?(u=async()=>{const _=await W.organization.rejectInvitation({invitationId:s});if(_.error)throw new Error(_.error.message);return _.data},e[7]=s,e[8]=u):u=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=xt,e[9]=m):m=e[9];let f;e[10]!==u?(f={mutationFn:u,onSuccess:m,onError:bt},e[10]=u,e[11]=f):f=e[11];const y=ee(f),p=c.isPending||y.isPending;let g;e[12]!==r||e[13]!==o?(g=r?n.jsx(oe,{url:r,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ge,{className:"h-6 w-6 text-primary"})}),e[12]=r,e[13]=o,e[14]=g):g=e[14];let h;e[15]!==o?(h=n.jsxs("h3",{className:"text-lg font-medium",children:["You've been invited to ",n.jsx("strong",{children:o})]}),e[15]=o,e[16]=h):h=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept the invitation to join this organization."}),e[17]=b):b=e[17];let S;e[18]!==h?(S=n.jsxs("div",{className:"space-y-2",children:[h,b]}),e[18]=h,e[19]=S):S=e[19];let w;e[20]!==c?(w=()=>c.mutate(),e[20]=c,e[21]=w):w=e[21];const v=c.isPending?"Accepting…":"Accept invitation";let k;e[22]!==p||e[23]!==w||e[24]!==v?(k=n.jsx(C,{onClick:w,disabled:p,children:v}),e[22]=p,e[23]=w,e[24]=v,e[25]=k):k=e[25];let O;e[26]!==y?(O=()=>y.mutate(),e[26]=y,e[27]=O):O=e[27];const E=y.isPending?"Declining…":"Decline";let x;e[28]!==p||e[29]!==O||e[30]!==E?(x=n.jsx(C,{variant:"ghost",onClick:O,disabled:p,children:E}),e[28]=p,e[29]=O,e[30]=E,e[31]=x):x=e[31];let $;e[32]!==k||e[33]!==x?($=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[k,x]}),e[32]=k,e[33]=x,e[34]=$):$=e[34];let z;return e[35]!==S||e[36]!==$||e[37]!==g?(z=n.jsxs(H,{children:[g,S,$]}),e[35]=S,e[36]=$,e[37]=g,e[38]=z):z=e[38],z}function bt(t){Y.error(t instanceof Error?t.message:"Failed to decline invitation")}function xt(){Y.success("Invitation declined"),window.location.href="/"}function wt(t){Y.error(t instanceof Error?t.message:"Failed to accept invitation")}function St(t){const e=N.c(10),{orgName:s,orgLogo:o}=t;let a;e[0]!==o||e[1]!==s?(a=o?n.jsx(oe,{url:o,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ke,{className:"h-6 w-6 text-primary"})}),e[0]=o,e[1]=s,e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("h3",{className:"text-lg font-medium",children:"Request pending"}),e[3]=r):r=e[3];let i;e[4]!==s?(i=n.jsxs("div",{className:"space-y-2",children:[r,n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your request to join ",n.jsx("strong",{children:s})," is waiting for an admin to approve it. You'll get access once it's approved."]})]}),e[4]=s,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(C,{variant:"ghost",onClick:jt,children:"Go to home"}),e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==i?(d=n.jsxs(H,{children:[a,i,l]}),e[7]=a,e[8]=i,e[9]=d):d=e[9],d}function jt(){window.location.href="/"}function vt(t){const e=N.c(30),{orgName:s,orgSlug:o,orgLogo:a,domain:r}=t;let i;e[0]!==o?(i=async()=>{const v=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),k=await v.json();if(!v.ok||!k.success)throw new Error(k.error??"Failed to request access");return k},e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=_t,e[2]=l):l=e[2];let d;e[3]!==i?(d={mutationFn:i,onSuccess:l,onError:Nt},e[3]=i,e[4]=d):d=e[4];const c=ee(d);let u;e[5]!==a||e[6]!==s?(u=a?n.jsx(oe,{url:a,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(we,{className:"h-6 w-6 text-primary"})}),e[5]=a,e[6]=s,e[7]=u):u=e[7];let m;e[8]!==s?(m=n.jsxs("h3",{className:"text-lg font-medium",children:["Request to join ",s,"?"]}),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==r?(f=n.jsxs("p",{className:"text-sm text-muted-foreground",children:["An admin must approve requests from ",n.jsxs("strong",{children:["@",r]})," emails before you can join."]}),e[10]=r,e[11]=f):f=e[11];let y;e[12]!==m||e[13]!==f?(y=n.jsxs("div",{className:"space-y-2",children:[m,f]}),e[12]=m,e[13]=f,e[14]=y):y=e[14];let p;e[15]!==c?(p=()=>c.mutate(),e[15]=c,e[16]=p):p=e[16];const g=c.isPending?"Requesting…":"Request to join";let h;e[17]!==c.isPending||e[18]!==p||e[19]!==g?(h=n.jsx(C,{onClick:p,disabled:c.isPending,children:g}),e[17]=c.isPending,e[18]=p,e[19]=g,e[20]=h):h=e[20];let b;e[21]!==c.isPending?(b=n.jsx(C,{variant:"ghost",onClick:kt,disabled:c.isPending,children:"Go to home"}),e[21]=c.isPending,e[22]=b):b=e[22];let S;e[23]!==h||e[24]!==b?(S=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,b]}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let w;return e[26]!==S||e[27]!==u||e[28]!==y?(w=n.jsxs(H,{children:[u,y,S]}),e[26]=S,e[27]=u,e[28]=y,e[29]=w):w=e[29],w}function kt(){window.location.href="/"}function Nt(t){Y.error(t instanceof Error?t.message:"Failed to request access")}function _t(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function At(t){const e=N.c(7);let s;e[0]!==t?(s=se.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==t?(o=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==o?(a={queryKey:s,queryFn:o,refetchOnWindowFocus:!1},e[4]=s,e[5]=o,e[6]=a):a=e[6],be(a)}function Ct({orgSlug:t}){const{data:e}=At(t);if(e.status!=="member"){_e()?.org===t&&Ae();const s=localStorage.getItem(B.lastOrgSlug())===t;if(s&&localStorage.removeItem(B.lastOrgSlug()),s&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(ge,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(yt,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(ft,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(vt,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(St,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(ge,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Ot(t){const e=N.c(20),{release:s,onCtaClick:o,onLearnMoreClick:a}=t;let r;e[0]!==s.eyebrow?(r=s.eyebrow&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.eyebrow}),e[0]=s.eyebrow,e[1]=r):r=e[1];let i;e[2]!==s.title?(i=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:s.title}),e[2]=s.title,e[3]=i):i=e[3];let l;e[4]!==r||e[5]!==i?(l=n.jsxs("div",{children:[r,i]}),e[4]=r,e[5]=i,e[6]=l):l=e[6];let d;e[7]!==s.bullets?(d=s.bullets.map(Tt),e[7]=s.bullets,e[8]=d):d=e[8];let c;e[9]!==d?(c=n.jsx("ul",{className:"flex flex-col gap-3",children:d}),e[9]=d,e[10]=c):c=e[10];let u;e[11]!==o||e[12]!==a||e[13]!==s.cta||e[14]!==s.learnMoreHref?(u=(s.cta||s.learnMoreHref)&&n.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.learnMoreHref?n.jsx("a",{href:s.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:a,className:"text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",children:"Learn More"}):n.jsx("span",{}),s.cta&&n.jsx(C,{asChild:!0,size:"sm",onClick:o,children:n.jsx("a",{href:s.cta.href,children:s.cta.label})})]}),e[11]=o,e[12]=a,e[13]=s.cta,e[14]=s.learnMoreHref,e[15]=u):u=e[15];let m;return e[16]!==l||e[17]!==c||e[18]!==u?(m=n.jsxs("div",{className:"flex flex-col gap-3",children:[l,c,u]}),e[16]=l,e[17]=c,e[18]=u,e[19]=m):m=e[19],m}function Tt(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"text-muted-foreground mt-0.5 shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Se=[{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:D,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:L,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:G,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:D,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:L,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:G,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:L,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:D,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:G,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:D,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:L,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:G,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:D,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:L,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:G,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:D,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:me,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:L,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:qe,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:G,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:L,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:D,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:me,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:D,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:He,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ne="studio.release-feed.v1",ce=new Set;let M="",P={},de=!1;function Et(){if(de)return M||"{}";try{return localStorage.getItem(ne)??"{}"}catch{return M||"{}"}}function je(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function he(){const t=Et();return t!==M&&(M=t,P=je(t)),P}function $t(t){ce.add(t);const e=s=>{if(!(s.key!==ne&&s.key!==null)){try{const o=localStorage.getItem(ne)??"{}",r={...je(o),...P};P=r,M=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{ce.delete(t),window.removeEventListener("storage",e)}}function zt(t){P=t,M=JSON.stringify(t);try{localStorage.setItem(ne,M),de=!1}catch{de=!0}ce.forEach(e=>e())}function Dt(){const t=N.c(7),e=K.useSyncExternalStore($t,he,he);let s;t[0]!==e?(s=d=>!!e[d],t[0]=e,t[1]=s):s=t[1];const o=s,a=It;let r;t[2]!==e?(r=Se.reduce((d,c)=>e[c.id]?d:d+1,0),t[2]=e,t[3]=r):r=t[3];const i=r;let l;return t[4]!==o||t[5]!==i?(l={isSeen:o,markSeen:a,unseenCount:i},t[4]=o,t[5]=i,t[6]=l):l=t[6],l}function It(t){P[t]||zt({...P,[t]:{seenAt:new Date().toISOString()}})}const Lt=720*60*60*1e3,Mt=10080*60*1e3;function Pt(t){const[e,s,o]=t.split("-").map(Number);return!e||!s||!o?new Date(t).getTime():new Date(e,s-1,o).getTime()}function Ft(t){const e=Se[0];if(!e)return null;const s=Pt(e.date),o=t-s;return o<0||o>Lt?null:e}function Rt(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function qt(t,e){const s=Rt(t);return s===null?!1:e-s>=Mt}function Ut(){const t=N.c(22),{data:e}=W.useSession(),{isSeen:s,markSeen:o}=Dt();let a,r,i;if(t[0]!==s||t[1]!==e?.user?.createdAt){i=Symbol.for("react.early_return_sentinel");e:{const p=Date.now();if(a=Ft(p),!a){i=null;break e}if(!qt(e?.user?.createdAt,p)){i=null;break e}r=s(a.id)}t[0]=s,t[1]=e?.user?.createdAt,t[2]=a,t[3]=r,t[4]=i}else a=t[2],r=t[3],i=t[4];if(i!==Symbol.for("react.early_return_sentinel"))return i;if(r)return null;let l;t[5]!==a.id||t[6]!==o?(l=()=>o(a.id),t[5]=a.id,t[6]=o,t[7]=l):l=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Be,{size:14}),t[8]=d):d=t[8];let c;t[9]!==l?(c=n.jsx(C,{size:"icon",variant:"ghost","aria-label":"Dismiss release announcement",className:"absolute right-2 top-2 size-7 text-muted-foreground",onClick:l,children:d}),t[9]=l,t[10]=c):c=t[10];let u,m;t[11]!==a.id||t[12]!==o?(u=()=>o(a.id),m=()=>o(a.id),t[11]=a.id,t[12]=o,t[13]=u,t[14]=m):(u=t[13],m=t[14]);let f;t[15]!==a||t[16]!==u||t[17]!==m?(f=n.jsx(Ot,{release:a,onCtaClick:u,onLearnMoreClick:m}),t[15]=a,t[16]=u,t[17]=m,t[18]=f):f=t[18];let y;return t[19]!==c||t[20]!==f?(y=n.jsxs("div",{role:"dialog","aria-label":"Release announcement",className:"fixed bottom-6 right-6 z-50 w-[min(360px,calc(100vw-3rem))] rounded-lg border border-border bg-background p-4 shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[c,f]}),t[19]=c,t[20]=f,t[21]=y):y=t[21],y}const ve=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),I=ve?"⌘":"Ctrl",T={keyboardShortcuts:{keys:[I,"K"],description:"Keyboard shortcuts"},back:{keys:[I,"["],description:"Back to previous"},focusChatInput:{keys:[I,"L"],description:"Focus chat input"},saveAndFormat:{keys:[I,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[I,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[I,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",I,"S"],description:"New task"},toggleDaemon:{keys:[I,"D"],description:"Toggle daemon logs"}},Gt=[{label:"General",shortcuts:[T.keyboardShortcuts,T.back,T.newTask,T.toggleDaemon]},{label:"Editor",shortcuts:[T.saveAndFormat]},{label:"Chat",shortcuts:[T.focusChatInput,T.togglePlanMode,T.sendMessage,T.newLine]},{label:"Questions",shortcuts:[T.selectOption]},{label:"Monitoring",shortcuts:[T.applyFilter]}];function pe(t){return ve?t.metaKey:t.ctrlKey}function Kt(t){const e=N.c(5),{open:s,onOpenChange:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ye,{children:n.jsx(Je,{children:"Keyboard Shortcuts"})}),e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs(We,{className:"sm:max-w-md",children:[a,n.jsx("div",{className:"flex flex-col gap-4",children:Gt.map(Ht)})]}),e[1]=r):r=e[1];let i;return e[2]!==o||e[3]!==s?(i=n.jsx(Ve,{open:s,onOpenChange:o,children:r}),e[2]=o,e[3]=s,e[4]=i):i=e[4],i}function Ht(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Bt)})]},t.label)}function Bt(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Wt)})]},t.description)}function Wt(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const Yt=300*1e3,Jt=2;function Vt(t,e,s){return!e||e===s?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function Qt(){const t=N.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={queryKey:se.appVersionCheck(),queryFn:Zt,refetchInterval:Yt,refetchIntervalInBackground:!0,staleTime:0},t[0]=e):e=t[0];const{data:s,dataUpdatedAt:o}=te(e),[a,r]=K.useState(0);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={version:null,count:0},t[1]=i):i=t[1];const[l,d]=K.useState(i);o!==a&&(r(o),d(y=>Vt(y,s,"4.32.0")));const c=l.count>=Jt;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs(Qe,{children:[n.jsx(Xe,{children:"A new version is available"}),n.jsx(Ze,{children:"You're viewing an outdated version of this page. Refresh to get the latest updates."})]}),t[2]=u):u=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(et,{children:[u,n.jsx(tt,{children:n.jsx(nt,{onClick:Xt,children:"Refresh"})})]}),t[3]=m):m=t[3];let f;return t[4]!==c?(f=n.jsx(st,{open:c,children:m}),t[4]=c,t[5]=f):f=t[5],f}function Xt(){return window.location.reload()}async function Zt(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function en({activeOrg:t}){return t&&(Ce(t.id,{name:t.name??void 0,slug:t.slug??void 0}),Oe()),null}function tn(t,e,s){if(!s)return null;const o=lt(t,e);return o?o.threads.get().find(r=>r.id===s)?.branch??null:null}function ke(t){return{queryKey:se.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function Tn(t){const e=N.c(10);let s;e[0]!==t?(s=ke(t),e[0]=t,e[1]=s):s=e[1];const o=te(s);let a;e[2]!==o.data?.prompts?(a=o.data?.prompts??[],e[2]=o.data?.prompts,e[3]=a):a=e[3];let r;e[4]!==o.data?.tiles?(r=o.data?.tiles??[],e[4]=o.data?.tiles,e[5]=r):r=e[5];let i;return e[6]!==o.isLoading||e[7]!==a||e[8]!==r?(i={isLoading:o.isLoading,prompts:a,tiles:r},e[6]=o.isLoading,e[7]=a,e[8]=r,e[9]=i):i=e[9],i}function nn(t){const e=N.c(17),{orgSlug:s,orgName:o,domain:a}=t;let r;e[0]!==s?(r=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=r):r=e[1];const i=r,l=sn;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(ye,{className:"h-6 w-6 text-primary"})}),e[2]=d):d=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=c):c=e[3];let u;e[4]!==a||e[5]!==o?(u=o?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:o})," requires SSO authentication",a?` via ${a}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=a,e[5]=o,e[6]=u):u=e[6];let m;e[7]!==u?(m=n.jsxs("div",{className:"space-y-2",children:[c,n.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),e[7]=u,e[8]=m):m=e[8];let f;e[9]!==i?(f=n.jsx(C,{onClick:i,children:"Sign in with SSO"}),e[9]=i,e[10]=f):f=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(C,{variant:"ghost",onClick:l,children:"Go back"}),e[11]=y):y=e[11];let p;e[12]!==f?(p=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[f,y]}),e[12]=f,e[13]=p):p=e[13];let g;return e[14]!==m||e[15]!==p?(g=n.jsxs(H,{children:[d,m,p]}),e[14]=m,e[15]=p,e[16]=g):g=e[16],g}function sn(){window.location.href="/"}function on(t){const e=N.c(8),{org:s,children:o}=t,r=ut(s.id,s.slug)?.enabled_plugins??null;let i;e[0]!==s.id||e[1]!==s.name||e[2]!==r?(i={id:s.id,organizationId:s.id,slug:"_org",name:s.name,enabledPlugins:r,ui:null},e[0]=s.id,e[1]=s.name,e[2]=r,e[3]=i):i=e[3];const l=i;let d;return e[4]!==o||e[5]!==s||e[6]!==l?(d=n.jsx(Re,{org:s,project:l,children:o}),e[4]=o,e[5]=s,e[6]=l,e[7]=d):d=e[7],d}function an(){const t=Te(),e=ct(),{org:s,locator:o}=Ee(),a=xe({strict:!1}),r=$e({strict:!1}),i=a.org??"",l=a.taskId??"",d=(g,h,b=!0)=>t({to:"/$org/$taskId",params:{org:i,taskId:g},search:h,replace:b}),c=(g,h=!0)=>d(l,g,h),u=g=>c(h=>({...h,chat:g?1:0})),m=(g,h,b)=>d(g,S=>{const w={chat:1};h?w.virtualmcpid=h:S.virtualmcpid&&(w.virtualmcpid=S.virtualmcpid);const v=fe(s.id).id,k=typeof S.virtualmcpid=="string"?S.virtualmcpid:v,E=(h??k)!==k;if(b?.main)w.main=b.main;else if(!E){const x=S.main;x&&typeof x=="string"&&!dt(x)&&(w.main=x)}return b?.autosend&&(w.autosend=it),w},!1);return{setChatOpen:u,setTaskId:m,createNewTask:async g=>{const h=crypto.randomUUID(),b=g??r.virtualmcpid??fe(s.id).id,w=b===r.virtualmcpid?tn(s.slug,o,l):null;try{await e?.create({id:h,virtual_mcp_id:b,...w?{branch:w}:{}})}catch{}m(h,b)},openTab:g=>d(l||crypto.randomUUID(),h=>({...h,main:g})),toggleMain:()=>c(g=>{if(g.main!==void 0&&g.main!=="0")return{...g,main:"0"};const b={...g};return delete b.main,b})}}function rn(){const t=N.c(53);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=ze(e)?.params.org;let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const{taskId:r}=xe(a),[i,l]=K.useState(!1),d=De(),c=o??"";let u;t[2]!==c?(u=ke(c),t[2]=c,t[3]=u):u=t[3];const m=!!o&&!r;let f;t[4]!==u||t[5]!==m?(f={...u,enabled:m},t[4]=u,t[5]=m,t[6]=f):f=t[6],te(f);const{data:y}=W.useSession(),p=y?.user?.id;let g;t[7]!==o||t[8]!==p?(g=o&&p?Ie(p,o):null,t[7]=o,t[8]=p,t[9]=g):g=t[9];const h=g;let b,S;t[10]!==d?(b=()=>{const j=A=>{if(pe(A)&&A.code==="KeyK"){A.preventDefault(),l(!0);return}pe(A)&&A.code==="BracketLeft"&&d.history.canGoBack()&&(A.preventDefault(),d.history.back())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},S=[d],t[10]=d,t[11]=b,t[12]=S):(b=t[11],S=t[12]),K.useEffect(b,S);let w;t[13]!==o?(w=se.activeOrganization(o),t[13]=o,t[14]=w):w=t[14];let v;t[15]!==o||t[16]!==p?(v=async()=>{if(!o)return null;performance.mark("mesh:active-org-fetch:start");const{data:j}=await W.organization.getFullOrganization({query:{organizationSlug:o}}).finally(ln),A=ue(j);return j&&!A&&localStorage.setItem(B.lastOrgSlug(),o),p&&j&&Me(p,o,j),j},t[15]=o,t[16]=p,t[17]=v):v=t[17];const k=h?h.data:void 0,O=h?.updatedAt;let E;t[18]!==v||t[19]!==k||t[20]!==O||t[21]!==w?(E={queryKey:w,queryFn:v,initialData:k,initialDataUpdatedAt:O,gcTime:1/0,refetchOnWindowFocus:!1},t[18]=v,t[19]=k,t[20]=O,t[21]=w,t[22]=E):E=t[22];const{data:x}=be(E),$=x?.id,z=x?.slug,{data:_}=mt($,z),ie=$??"",ae=z??"";let F;t[23]!==ie||t[24]!==ae?(F=at({connectionId:rt,orgId:ie,orgSlug:ae}),t[23]=ie,t[24]=ae,t[25]=F):F=t[25];const re=!!$&&!!z;let J;if(t[26]!==F||t[27]!==re?(J={...F,enabled:re},t[26]=F,t[27]=re,t[28]=J):J=t[28],te(J),!x){let j;t[29]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Pe,{}),t[29]=j):j=t[29];let A;return t[30]!==o?(A=n.jsx(K.Suspense,{fallback:j,children:n.jsx(Ct,{orgSlug:o})}),t[30]=o,t[31]=A):A=t[31],A}if(ue(x)){localStorage.getItem(B.lastOrgSlug())===o&&localStorage.removeItem(B.lastOrgSlug());let j;return t[32]!==x.name?(j=n.jsx(Le,{orgName:x.name}),t[32]=x.name,t[33]=j):j=t[33],j}if(_?.ssoRequired&&!_.authenticated){let j;return t[34]!==x.id||t[35]!==x.name||t[36]!==x.slug||t[37]!==_.domain?(j=n.jsx(nn,{orgId:x.id,orgSlug:x.slug,orgName:x.name,domain:_.domain}),t[34]=x.id,t[35]=x.name,t[36]=x.slug,t[37]=_.domain,t[38]=j):j=t[38],j}const le=x.logo??null;let R;t[39]!==x||t[40]!==le?(R={...x,logo:le},t[39]=x,t[40]=le,t[41]=R):R=t[41];let q;t[42]!==x?(q=n.jsx(en,{activeOrg:x}),t[42]=x,t[43]=q):q=t[43];let V,Q;t[44]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Fe,{}),Q=n.jsx(Ut,{}),t[44]=V,t[45]=Q):(V=t[44],Q=t[45]);let U;t[46]!==i?(U=n.jsx(Kt,{open:i,onOpenChange:l}),t[46]=i,t[47]=U):U=t[47];let X;t[48]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Qt,{}),t[48]=X):X=t[48];let Z;return t[49]!==R||t[50]!==q||t[51]!==U?(Z=n.jsxs(on,{org:R,children:[q,V,Q,U,X]}),t[49]=R,t[50]=q,t[51]=U,t[52]=Z):Z=t[52],Z}function ln(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function cn(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ot,{children:n.jsx(rn,{})}),t[0]=e):e=t[0],e}const En=Object.freeze(Object.defineProperty({__proto__:null,default:cn,usePanelActions:an},Symbol.toStringTag,{value:"Module"}));export{T as K,Tn as a,pe as i,tn as r,En as s,an as u};
1
+ import{c as N,d as ee,j as n,B as C,bR as H,t as Y,ak as ye,a as W,U as Ne,L as be,K as se,bS as _e,bT as Ae,V as B,r as K,k as te,bU as Ce,bV as Oe,b as Te,$ as Ee,e as xe,u as $e,a0 as ze,aW as De,bW as Ie,bX as ue,bY as Le,bZ as Me,S as Pe,X as Fe,b_ as Re}from"./index-C7I160AA.js";import{A as oe}from"./avatar-CDXoUCLJ.js";import{t as we,a as qe}from"./Users03-BFPLupFq.js";import{i as Ue}from"./SearchLg-Bnks7xJg.js";import{i as Ge,s as Ke,a as D,n as He}from"./Stars02-BK7UYCtg.js";import{s as Be}from"./XClose-C6H98gBi.js";import{i as L}from"./CheckCircle-CIPdmx9R.js";import{i as me}from"./FilterLines-cTy8iFZe.js";import{i as G}from"./Zap-BIltjucc.js";import{d as We,c as Ye,a as Je,e as Ve}from"./dialog-BrzV8etc.js";import{b as Qe,c as Xe,d as Ze,a as et,e as tt,g as nt,f as st}from"./alert-dialog-B0nYWSj5.js";import{R as ot}from"./required-auth-layout-DF__PTv1.js";import{A as it}from"./autosend-CmGYW3q_.js";import{m as at}from"./use-mcp-client-Q0KtyZCi.js";import{a as fe,S as rt}from"./constants-B72Xmt_K.js";import{g as lt,c as ct}from"./hooks-BZdqB8Qy.js";import{q as dt}from"./tab-id-DznSzCvK.js";import{d as ut}from"./use-organization-settings-CKQ7HE6e.js";import{u as mt}from"./use-org-sso-CyoKQ5KE.js";function ft(t){const e=N.c(27),{orgName:s,orgSlug:o,orgLogo:a,domain:r}=t;let i;e[0]!==o?(i={mutationFn:async()=>{const w=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),v=await w.json();if(!w.ok||!v.success)throw new Error(v.error??"Failed to join organization");return v},onSuccess:w=>{window.location.href=`/${w.slug??o}`},onError:ht},e[0]=o,e[1]=i):i=e[1];const l=ee(i),d=gt;let c;e[2]!==a||e[3]!==s?(c=a?n.jsx(oe,{url:a,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(we,{className:"h-6 w-6 text-primary"})}),e[2]=a,e[3]=s,e[4]=c):c=e[4];let u;e[5]!==s?(u=n.jsxs("h3",{className:"text-lg font-medium",children:["Join ",s,"?"]}),e[5]=s,e[6]=u):u=e[6];let m;e[7]!==r?(m=n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Anyone with an ",n.jsxs("strong",{children:["@",r]})," email can join this organization."]}),e[7]=r,e[8]=m):m=e[8];let f;e[9]!==u||e[10]!==m?(f=n.jsxs("div",{className:"space-y-2",children:[u,m]}),e[9]=u,e[10]=m,e[11]=f):f=e[11];let y;e[12]!==l?(y=()=>l.mutate(),e[12]=l,e[13]=y):y=e[13];const p=l.isPending?"Joining…":`Enter ${s}`;let g;e[14]!==l.isPending||e[15]!==y||e[16]!==p?(g=n.jsx(C,{onClick:y,disabled:l.isPending,children:p}),e[14]=l.isPending,e[15]=y,e[16]=p,e[17]=g):g=e[17];let h;e[18]!==l.isPending?(h=n.jsx(C,{variant:"ghost",onClick:d,disabled:l.isPending,children:"Go to home"}),e[18]=l.isPending,e[19]=h):h=e[19];let b;e[20]!==g||e[21]!==h?(b=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[g,h]}),e[20]=g,e[21]=h,e[22]=b):b=e[22];let S;return e[23]!==b||e[24]!==c||e[25]!==f?(S=n.jsxs(H,{children:[c,f,b]}),e[23]=b,e[24]=c,e[25]=f,e[26]=S):S=e[26],S}function gt(){window.location.href="/"}function ht(t){Y.error(t instanceof Error?t.message:"Failed to join organization")}function ge(t){const e=N.c(17),{orgSlug:s,orgName:o,reason:a}=t,r=pt,i=a==="not-found",l=i?Ue:ye,d=i?"Organization not found":"No access";let c;e[0]!==i||e[1]!==o||e[2]!==s?(c=i?n.jsxs(n.Fragment,{children:["We couldn't find an organization called ",n.jsx("strong",{children:s}),"."]}):n.jsxs(n.Fragment,{children:["You don't have access to ",n.jsx("strong",{children:o??s}),".",n.jsx("br",{}),"Ask an admin to invite you."]}),e[0]=i,e[1]=o,e[2]=s,e[3]=c):c=e[3];const u=c;let m;e[4]!==l?(m=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(l,{className:"h-6 w-6 text-muted-foreground"})}),e[4]=l,e[5]=m):m=e[5];let f;e[6]!==d?(f=n.jsx("h3",{className:"text-lg font-medium",children:d}),e[6]=d,e[7]=f):f=e[7];let y;e[8]!==u?(y=n.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[8]=u,e[9]=y):y=e[9];let p;e[10]!==f||e[11]!==y?(p=n.jsxs("div",{className:"space-y-2",children:[f,y]}),e[10]=f,e[11]=y,e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(C,{onClick:r,children:"Go to home"}),e[13]=g):g=e[13];let h;return e[14]!==m||e[15]!==p?(h=n.jsxs(H,{children:[m,p,g]}),e[14]=m,e[15]=p,e[16]=h):h=e[16],h}function pt(){window.location.href="/"}function yt(t){const e=N.c(39),{invitationId:s,orgName:o,orgSlug:a,orgLogo:r}=t;let i;e[0]!==s?(i=async()=>{const _=await W.organization.acceptInvitation({invitationId:s});if(_.error)throw new Error(_.error.message);return _.data},e[0]=s,e[1]=i):i=e[1];let l;e[2]!==a?(l=()=>{Ne(),window.location.href=`/${a}`},e[2]=a,e[3]=l):l=e[3];let d;e[4]!==i||e[5]!==l?(d={mutationFn:i,onSuccess:l,onError:wt},e[4]=i,e[5]=l,e[6]=d):d=e[6];const c=ee(d);let u;e[7]!==s?(u=async()=>{const _=await W.organization.rejectInvitation({invitationId:s});if(_.error)throw new Error(_.error.message);return _.data},e[7]=s,e[8]=u):u=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=xt,e[9]=m):m=e[9];let f;e[10]!==u?(f={mutationFn:u,onSuccess:m,onError:bt},e[10]=u,e[11]=f):f=e[11];const y=ee(f),p=c.isPending||y.isPending;let g;e[12]!==r||e[13]!==o?(g=r?n.jsx(oe,{url:r,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ge,{className:"h-6 w-6 text-primary"})}),e[12]=r,e[13]=o,e[14]=g):g=e[14];let h;e[15]!==o?(h=n.jsxs("h3",{className:"text-lg font-medium",children:["You've been invited to ",n.jsx("strong",{children:o})]}),e[15]=o,e[16]=h):h=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept the invitation to join this organization."}),e[17]=b):b=e[17];let S;e[18]!==h?(S=n.jsxs("div",{className:"space-y-2",children:[h,b]}),e[18]=h,e[19]=S):S=e[19];let w;e[20]!==c?(w=()=>c.mutate(),e[20]=c,e[21]=w):w=e[21];const v=c.isPending?"Accepting…":"Accept invitation";let k;e[22]!==p||e[23]!==w||e[24]!==v?(k=n.jsx(C,{onClick:w,disabled:p,children:v}),e[22]=p,e[23]=w,e[24]=v,e[25]=k):k=e[25];let O;e[26]!==y?(O=()=>y.mutate(),e[26]=y,e[27]=O):O=e[27];const E=y.isPending?"Declining…":"Decline";let x;e[28]!==p||e[29]!==O||e[30]!==E?(x=n.jsx(C,{variant:"ghost",onClick:O,disabled:p,children:E}),e[28]=p,e[29]=O,e[30]=E,e[31]=x):x=e[31];let $;e[32]!==k||e[33]!==x?($=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[k,x]}),e[32]=k,e[33]=x,e[34]=$):$=e[34];let z;return e[35]!==S||e[36]!==$||e[37]!==g?(z=n.jsxs(H,{children:[g,S,$]}),e[35]=S,e[36]=$,e[37]=g,e[38]=z):z=e[38],z}function bt(t){Y.error(t instanceof Error?t.message:"Failed to decline invitation")}function xt(){Y.success("Invitation declined"),window.location.href="/"}function wt(t){Y.error(t instanceof Error?t.message:"Failed to accept invitation")}function St(t){const e=N.c(10),{orgName:s,orgLogo:o}=t;let a;e[0]!==o||e[1]!==s?(a=o?n.jsx(oe,{url:o,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ke,{className:"h-6 w-6 text-primary"})}),e[0]=o,e[1]=s,e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("h3",{className:"text-lg font-medium",children:"Request pending"}),e[3]=r):r=e[3];let i;e[4]!==s?(i=n.jsxs("div",{className:"space-y-2",children:[r,n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your request to join ",n.jsx("strong",{children:s})," is waiting for an admin to approve it. You'll get access once it's approved."]})]}),e[4]=s,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(C,{variant:"ghost",onClick:jt,children:"Go to home"}),e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==i?(d=n.jsxs(H,{children:[a,i,l]}),e[7]=a,e[8]=i,e[9]=d):d=e[9],d}function jt(){window.location.href="/"}function vt(t){const e=N.c(30),{orgName:s,orgSlug:o,orgLogo:a,domain:r}=t;let i;e[0]!==o?(i=async()=>{const v=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),k=await v.json();if(!v.ok||!k.success)throw new Error(k.error??"Failed to request access");return k},e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=_t,e[2]=l):l=e[2];let d;e[3]!==i?(d={mutationFn:i,onSuccess:l,onError:Nt},e[3]=i,e[4]=d):d=e[4];const c=ee(d);let u;e[5]!==a||e[6]!==s?(u=a?n.jsx(oe,{url:a,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(we,{className:"h-6 w-6 text-primary"})}),e[5]=a,e[6]=s,e[7]=u):u=e[7];let m;e[8]!==s?(m=n.jsxs("h3",{className:"text-lg font-medium",children:["Request to join ",s,"?"]}),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==r?(f=n.jsxs("p",{className:"text-sm text-muted-foreground",children:["An admin must approve requests from ",n.jsxs("strong",{children:["@",r]})," emails before you can join."]}),e[10]=r,e[11]=f):f=e[11];let y;e[12]!==m||e[13]!==f?(y=n.jsxs("div",{className:"space-y-2",children:[m,f]}),e[12]=m,e[13]=f,e[14]=y):y=e[14];let p;e[15]!==c?(p=()=>c.mutate(),e[15]=c,e[16]=p):p=e[16];const g=c.isPending?"Requesting…":"Request to join";let h;e[17]!==c.isPending||e[18]!==p||e[19]!==g?(h=n.jsx(C,{onClick:p,disabled:c.isPending,children:g}),e[17]=c.isPending,e[18]=p,e[19]=g,e[20]=h):h=e[20];let b;e[21]!==c.isPending?(b=n.jsx(C,{variant:"ghost",onClick:kt,disabled:c.isPending,children:"Go to home"}),e[21]=c.isPending,e[22]=b):b=e[22];let S;e[23]!==h||e[24]!==b?(S=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,b]}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let w;return e[26]!==S||e[27]!==u||e[28]!==y?(w=n.jsxs(H,{children:[u,y,S]}),e[26]=S,e[27]=u,e[28]=y,e[29]=w):w=e[29],w}function kt(){window.location.href="/"}function Nt(t){Y.error(t instanceof Error?t.message:"Failed to request access")}function _t(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function At(t){const e=N.c(7);let s;e[0]!==t?(s=se.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==t?(o=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==o?(a={queryKey:s,queryFn:o,refetchOnWindowFocus:!1},e[4]=s,e[5]=o,e[6]=a):a=e[6],be(a)}function Ct({orgSlug:t}){const{data:e}=At(t);if(e.status!=="member"){_e()?.org===t&&Ae();const s=localStorage.getItem(B.lastOrgSlug())===t;if(s&&localStorage.removeItem(B.lastOrgSlug()),s&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(ge,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(yt,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(ft,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(vt,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(St,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(ge,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Ot(t){const e=N.c(20),{release:s,onCtaClick:o,onLearnMoreClick:a}=t;let r;e[0]!==s.eyebrow?(r=s.eyebrow&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s.eyebrow}),e[0]=s.eyebrow,e[1]=r):r=e[1];let i;e[2]!==s.title?(i=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:s.title}),e[2]=s.title,e[3]=i):i=e[3];let l;e[4]!==r||e[5]!==i?(l=n.jsxs("div",{children:[r,i]}),e[4]=r,e[5]=i,e[6]=l):l=e[6];let d;e[7]!==s.bullets?(d=s.bullets.map(Tt),e[7]=s.bullets,e[8]=d):d=e[8];let c;e[9]!==d?(c=n.jsx("ul",{className:"flex flex-col gap-3",children:d}),e[9]=d,e[10]=c):c=e[10];let u;e[11]!==o||e[12]!==a||e[13]!==s.cta||e[14]!==s.learnMoreHref?(u=(s.cta||s.learnMoreHref)&&n.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.learnMoreHref?n.jsx("a",{href:s.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:a,className:"text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline",children:"Learn More"}):n.jsx("span",{}),s.cta&&n.jsx(C,{asChild:!0,size:"sm",onClick:o,children:n.jsx("a",{href:s.cta.href,children:s.cta.label})})]}),e[11]=o,e[12]=a,e[13]=s.cta,e[14]=s.learnMoreHref,e[15]=u):u=e[15];let m;return e[16]!==l||e[17]!==c||e[18]!==u?(m=n.jsxs("div",{className:"flex flex-col gap-3",children:[l,c,u]}),e[16]=l,e[17]=c,e[18]=u,e[19]=m):m=e[19],m}function Tt(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"text-muted-foreground mt-0.5 shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Se=[{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:D,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:L,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:G,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:D,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:L,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:G,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:L,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:D,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:G,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:D,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:L,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:G,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:D,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:L,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:G,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:D,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:me,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:L,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:qe,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:G,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:L,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:D,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:me,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:D,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:He,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ne="studio.release-feed.v1",ce=new Set;let M="",P={},de=!1;function Et(){if(de)return M||"{}";try{return localStorage.getItem(ne)??"{}"}catch{return M||"{}"}}function je(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function he(){const t=Et();return t!==M&&(M=t,P=je(t)),P}function $t(t){ce.add(t);const e=s=>{if(!(s.key!==ne&&s.key!==null)){try{const o=localStorage.getItem(ne)??"{}",r={...je(o),...P};P=r,M=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{ce.delete(t),window.removeEventListener("storage",e)}}function zt(t){P=t,M=JSON.stringify(t);try{localStorage.setItem(ne,M),de=!1}catch{de=!0}ce.forEach(e=>e())}function Dt(){const t=N.c(7),e=K.useSyncExternalStore($t,he,he);let s;t[0]!==e?(s=d=>!!e[d],t[0]=e,t[1]=s):s=t[1];const o=s,a=It;let r;t[2]!==e?(r=Se.reduce((d,c)=>e[c.id]?d:d+1,0),t[2]=e,t[3]=r):r=t[3];const i=r;let l;return t[4]!==o||t[5]!==i?(l={isSeen:o,markSeen:a,unseenCount:i},t[4]=o,t[5]=i,t[6]=l):l=t[6],l}function It(t){P[t]||zt({...P,[t]:{seenAt:new Date().toISOString()}})}const Lt=720*60*60*1e3,Mt=10080*60*1e3;function Pt(t){const[e,s,o]=t.split("-").map(Number);return!e||!s||!o?new Date(t).getTime():new Date(e,s-1,o).getTime()}function Ft(t){const e=Se[0];if(!e)return null;const s=Pt(e.date),o=t-s;return o<0||o>Lt?null:e}function Rt(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function qt(t,e){const s=Rt(t);return s===null?!1:e-s>=Mt}function Ut(){const t=N.c(22),{data:e}=W.useSession(),{isSeen:s,markSeen:o}=Dt();let a,r,i;if(t[0]!==s||t[1]!==e?.user?.createdAt){i=Symbol.for("react.early_return_sentinel");e:{const p=Date.now();if(a=Ft(p),!a){i=null;break e}if(!qt(e?.user?.createdAt,p)){i=null;break e}r=s(a.id)}t[0]=s,t[1]=e?.user?.createdAt,t[2]=a,t[3]=r,t[4]=i}else a=t[2],r=t[3],i=t[4];if(i!==Symbol.for("react.early_return_sentinel"))return i;if(r)return null;let l;t[5]!==a.id||t[6]!==o?(l=()=>o(a.id),t[5]=a.id,t[6]=o,t[7]=l):l=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Be,{size:14}),t[8]=d):d=t[8];let c;t[9]!==l?(c=n.jsx(C,{size:"icon",variant:"ghost","aria-label":"Dismiss release announcement",className:"absolute right-2 top-2 size-7 text-muted-foreground",onClick:l,children:d}),t[9]=l,t[10]=c):c=t[10];let u,m;t[11]!==a.id||t[12]!==o?(u=()=>o(a.id),m=()=>o(a.id),t[11]=a.id,t[12]=o,t[13]=u,t[14]=m):(u=t[13],m=t[14]);let f;t[15]!==a||t[16]!==u||t[17]!==m?(f=n.jsx(Ot,{release:a,onCtaClick:u,onLearnMoreClick:m}),t[15]=a,t[16]=u,t[17]=m,t[18]=f):f=t[18];let y;return t[19]!==c||t[20]!==f?(y=n.jsxs("div",{role:"dialog","aria-label":"Release announcement",className:"fixed bottom-6 right-6 z-50 w-[min(360px,calc(100vw-3rem))] rounded-lg border border-border bg-background p-4 shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[c,f]}),t[19]=c,t[20]=f,t[21]=y):y=t[21],y}const ve=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),I=ve?"⌘":"Ctrl",T={keyboardShortcuts:{keys:[I,"K"],description:"Keyboard shortcuts"},back:{keys:[I,"["],description:"Back to previous"},focusChatInput:{keys:[I,"L"],description:"Focus chat input"},saveAndFormat:{keys:[I,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[I,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[I,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",I,"S"],description:"New task"},toggleDaemon:{keys:[I,"D"],description:"Toggle daemon logs"}},Gt=[{label:"General",shortcuts:[T.keyboardShortcuts,T.back,T.newTask,T.toggleDaemon]},{label:"Editor",shortcuts:[T.saveAndFormat]},{label:"Chat",shortcuts:[T.focusChatInput,T.togglePlanMode,T.sendMessage,T.newLine]},{label:"Questions",shortcuts:[T.selectOption]},{label:"Monitoring",shortcuts:[T.applyFilter]}];function pe(t){return ve?t.metaKey:t.ctrlKey}function Kt(t){const e=N.c(5),{open:s,onOpenChange:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ye,{children:n.jsx(Je,{children:"Keyboard Shortcuts"})}),e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs(We,{className:"sm:max-w-md",children:[a,n.jsx("div",{className:"flex flex-col gap-4",children:Gt.map(Ht)})]}),e[1]=r):r=e[1];let i;return e[2]!==o||e[3]!==s?(i=n.jsx(Ve,{open:s,onOpenChange:o,children:r}),e[2]=o,e[3]=s,e[4]=i):i=e[4],i}function Ht(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Bt)})]},t.label)}function Bt(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Wt)})]},t.description)}function Wt(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const Yt=300*1e3,Jt=2;function Vt(t,e,s){return!e||e===s?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function Qt(){const t=N.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={queryKey:se.appVersionCheck(),queryFn:Zt,refetchInterval:Yt,refetchIntervalInBackground:!0,staleTime:0},t[0]=e):e=t[0];const{data:s,dataUpdatedAt:o}=te(e),[a,r]=K.useState(0);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={version:null,count:0},t[1]=i):i=t[1];const[l,d]=K.useState(i);o!==a&&(r(o),d(y=>Vt(y,s,"4.34.0")));const c=l.count>=Jt;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs(Qe,{children:[n.jsx(Xe,{children:"A new version is available"}),n.jsx(Ze,{children:"You're viewing an outdated version of this page. Refresh to get the latest updates."})]}),t[2]=u):u=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(et,{children:[u,n.jsx(tt,{children:n.jsx(nt,{onClick:Xt,children:"Refresh"})})]}),t[3]=m):m=t[3];let f;return t[4]!==c?(f=n.jsx(st,{open:c,children:m}),t[4]=c,t[5]=f):f=t[5],f}function Xt(){return window.location.reload()}async function Zt(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function en({activeOrg:t}){return t&&(Ce(t.id,{name:t.name??void 0,slug:t.slug??void 0}),Oe()),null}function tn(t,e,s){if(!s)return null;const o=lt(t,e);return o?o.threads.get().find(r=>r.id===s)?.branch??null:null}function ke(t){return{queryKey:se.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function Tn(t){const e=N.c(10);let s;e[0]!==t?(s=ke(t),e[0]=t,e[1]=s):s=e[1];const o=te(s);let a;e[2]!==o.data?.prompts?(a=o.data?.prompts??[],e[2]=o.data?.prompts,e[3]=a):a=e[3];let r;e[4]!==o.data?.tiles?(r=o.data?.tiles??[],e[4]=o.data?.tiles,e[5]=r):r=e[5];let i;return e[6]!==o.isLoading||e[7]!==a||e[8]!==r?(i={isLoading:o.isLoading,prompts:a,tiles:r},e[6]=o.isLoading,e[7]=a,e[8]=r,e[9]=i):i=e[9],i}function nn(t){const e=N.c(17),{orgSlug:s,orgName:o,domain:a}=t;let r;e[0]!==s?(r=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=r):r=e[1];const i=r,l=sn;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(ye,{className:"h-6 w-6 text-primary"})}),e[2]=d):d=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=c):c=e[3];let u;e[4]!==a||e[5]!==o?(u=o?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:o})," requires SSO authentication",a?` via ${a}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=a,e[5]=o,e[6]=u):u=e[6];let m;e[7]!==u?(m=n.jsxs("div",{className:"space-y-2",children:[c,n.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),e[7]=u,e[8]=m):m=e[8];let f;e[9]!==i?(f=n.jsx(C,{onClick:i,children:"Sign in with SSO"}),e[9]=i,e[10]=f):f=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(C,{variant:"ghost",onClick:l,children:"Go back"}),e[11]=y):y=e[11];let p;e[12]!==f?(p=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[f,y]}),e[12]=f,e[13]=p):p=e[13];let g;return e[14]!==m||e[15]!==p?(g=n.jsxs(H,{children:[d,m,p]}),e[14]=m,e[15]=p,e[16]=g):g=e[16],g}function sn(){window.location.href="/"}function on(t){const e=N.c(8),{org:s,children:o}=t,r=ut(s.id,s.slug)?.enabled_plugins??null;let i;e[0]!==s.id||e[1]!==s.name||e[2]!==r?(i={id:s.id,organizationId:s.id,slug:"_org",name:s.name,enabledPlugins:r,ui:null},e[0]=s.id,e[1]=s.name,e[2]=r,e[3]=i):i=e[3];const l=i;let d;return e[4]!==o||e[5]!==s||e[6]!==l?(d=n.jsx(Re,{org:s,project:l,children:o}),e[4]=o,e[5]=s,e[6]=l,e[7]=d):d=e[7],d}function an(){const t=Te(),e=ct(),{org:s,locator:o}=Ee(),a=xe({strict:!1}),r=$e({strict:!1}),i=a.org??"",l=a.taskId??"",d=(g,h,b=!0)=>t({to:"/$org/$taskId",params:{org:i,taskId:g},search:h,replace:b}),c=(g,h=!0)=>d(l,g,h),u=g=>c(h=>({...h,chat:g?1:0})),m=(g,h,b)=>d(g,S=>{const w={chat:1};h?w.virtualmcpid=h:S.virtualmcpid&&(w.virtualmcpid=S.virtualmcpid);const v=fe(s.id).id,k=typeof S.virtualmcpid=="string"?S.virtualmcpid:v,E=(h??k)!==k;if(b?.main)w.main=b.main;else if(!E){const x=S.main;x&&typeof x=="string"&&!dt(x)&&(w.main=x)}return b?.autosend&&(w.autosend=it),w},!1);return{setChatOpen:u,setTaskId:m,createNewTask:async g=>{const h=crypto.randomUUID(),b=g??r.virtualmcpid??fe(s.id).id,w=b===r.virtualmcpid?tn(s.slug,o,l):null;try{await e?.create({id:h,virtual_mcp_id:b,...w?{branch:w}:{}})}catch{}m(h,b)},openTab:g=>d(l||crypto.randomUUID(),h=>({...h,main:g})),toggleMain:()=>c(g=>{if(g.main!==void 0&&g.main!=="0")return{...g,main:"0"};const b={...g};return delete b.main,b})}}function rn(){const t=N.c(53);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=ze(e)?.params.org;let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const{taskId:r}=xe(a),[i,l]=K.useState(!1),d=De(),c=o??"";let u;t[2]!==c?(u=ke(c),t[2]=c,t[3]=u):u=t[3];const m=!!o&&!r;let f;t[4]!==u||t[5]!==m?(f={...u,enabled:m},t[4]=u,t[5]=m,t[6]=f):f=t[6],te(f);const{data:y}=W.useSession(),p=y?.user?.id;let g;t[7]!==o||t[8]!==p?(g=o&&p?Ie(p,o):null,t[7]=o,t[8]=p,t[9]=g):g=t[9];const h=g;let b,S;t[10]!==d?(b=()=>{const j=A=>{if(pe(A)&&A.code==="KeyK"){A.preventDefault(),l(!0);return}pe(A)&&A.code==="BracketLeft"&&d.history.canGoBack()&&(A.preventDefault(),d.history.back())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},S=[d],t[10]=d,t[11]=b,t[12]=S):(b=t[11],S=t[12]),K.useEffect(b,S);let w;t[13]!==o?(w=se.activeOrganization(o),t[13]=o,t[14]=w):w=t[14];let v;t[15]!==o||t[16]!==p?(v=async()=>{if(!o)return null;performance.mark("mesh:active-org-fetch:start");const{data:j}=await W.organization.getFullOrganization({query:{organizationSlug:o}}).finally(ln),A=ue(j);return j&&!A&&localStorage.setItem(B.lastOrgSlug(),o),p&&j&&Me(p,o,j),j},t[15]=o,t[16]=p,t[17]=v):v=t[17];const k=h?h.data:void 0,O=h?.updatedAt;let E;t[18]!==v||t[19]!==k||t[20]!==O||t[21]!==w?(E={queryKey:w,queryFn:v,initialData:k,initialDataUpdatedAt:O,gcTime:1/0,refetchOnWindowFocus:!1},t[18]=v,t[19]=k,t[20]=O,t[21]=w,t[22]=E):E=t[22];const{data:x}=be(E),$=x?.id,z=x?.slug,{data:_}=mt($,z),ie=$??"",ae=z??"";let F;t[23]!==ie||t[24]!==ae?(F=at({connectionId:rt,orgId:ie,orgSlug:ae}),t[23]=ie,t[24]=ae,t[25]=F):F=t[25];const re=!!$&&!!z;let J;if(t[26]!==F||t[27]!==re?(J={...F,enabled:re},t[26]=F,t[27]=re,t[28]=J):J=t[28],te(J),!x){let j;t[29]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Pe,{}),t[29]=j):j=t[29];let A;return t[30]!==o?(A=n.jsx(K.Suspense,{fallback:j,children:n.jsx(Ct,{orgSlug:o})}),t[30]=o,t[31]=A):A=t[31],A}if(ue(x)){localStorage.getItem(B.lastOrgSlug())===o&&localStorage.removeItem(B.lastOrgSlug());let j;return t[32]!==x.name?(j=n.jsx(Le,{orgName:x.name}),t[32]=x.name,t[33]=j):j=t[33],j}if(_?.ssoRequired&&!_.authenticated){let j;return t[34]!==x.id||t[35]!==x.name||t[36]!==x.slug||t[37]!==_.domain?(j=n.jsx(nn,{orgId:x.id,orgSlug:x.slug,orgName:x.name,domain:_.domain}),t[34]=x.id,t[35]=x.name,t[36]=x.slug,t[37]=_.domain,t[38]=j):j=t[38],j}const le=x.logo??null;let R;t[39]!==x||t[40]!==le?(R={...x,logo:le},t[39]=x,t[40]=le,t[41]=R):R=t[41];let q;t[42]!==x?(q=n.jsx(en,{activeOrg:x}),t[42]=x,t[43]=q):q=t[43];let V,Q;t[44]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Fe,{}),Q=n.jsx(Ut,{}),t[44]=V,t[45]=Q):(V=t[44],Q=t[45]);let U;t[46]!==i?(U=n.jsx(Kt,{open:i,onOpenChange:l}),t[46]=i,t[47]=U):U=t[47];let X;t[48]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Qt,{}),t[48]=X):X=t[48];let Z;return t[49]!==R||t[50]!==q||t[51]!==U?(Z=n.jsxs(on,{org:R,children:[q,V,Q,U,X]}),t[49]=R,t[50]=q,t[51]=U,t[52]=Z):Z=t[52],Z}function ln(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function cn(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ot,{children:n.jsx(rn,{})}),t[0]=e):e=t[0],e}const En=Object.freeze(Object.defineProperty({__proto__:null,default:cn,usePanelActions:an},Symbol.toStringTag,{value:"Module"}));export{T as K,Tn as a,pe as i,tn as r,En as s,an as u};