decocms 4.150.21 → 4.150.22

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 (221) hide show
  1. package/dist/client/assets/{AlertCircle-BaA3X0Vc.js → AlertCircle-BHNP9rUU.js} +1 -1
  2. package/dist/client/assets/{AreaChart-B4pcuH23.js → AreaChart-Dix8LhoJ.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Df4rbgne.js → ArrowUp-CYmWic6A.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-fq20wgvL.js → ArrowUpRight-BQZOilTG.js} +1 -1
  5. package/dist/client/assets/{Check-DdyKCl8O.js → Check-D3kjZMFv.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-IiUO6eKZ.js → CheckCircle-myRIyunA.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BSVV4L9A.js → ChevronDown-Dn2piZ2G.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CSgj0z6i.js → ChevronRight-CwImj32A.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-GR0-Yt4d.js → ChevronUp-N9Uneycs.js} +1 -1
  10. package/dist/client/assets/{Copy01-Cv0Vuqbe.js → Copy01-CFdaASyO.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-UMJdnf1a.js → CpuChip01-W_PpJOQC.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-OBlENp_a.js → DotsVertical-CrKPB-rb.js} +1 -1
  13. package/dist/client/assets/{Eye-CkjEvMwH.js → Eye-DJcOc9Zw.js} +1 -1
  14. package/dist/client/assets/{FilterLines-Ca7W3tHb.js → FilterLines-BFYjIaR9.js} +1 -1
  15. package/dist/client/assets/{HardDrive-B91rzidb.js → HardDrive-B2_Ula85.js} +1 -1
  16. package/dist/client/assets/{Key01-DVGzNfoY.js → Key01-BU6DEShZ.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Ciug-ep8.js → LayoutLeft-YSlG5Bjd.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CbfqV87q.js → LinkExternal01-C6Bmw0m6.js} +1 -1
  19. package/dist/client/assets/{LogOut01-B0JVxGo4.js → LogOut01-Cc5p345m.js} +1 -1
  20. package/dist/client/assets/{Monitor01-CEdUOtdj.js → Monitor01-Car-ubqN.js} +1 -1
  21. package/dist/client/assets/{Palette-DgmLnO_l.js → Palette-iwM8hSr_.js} +1 -1
  22. package/dist/client/assets/{Play-DcSuTxiG.js → Play-BOQvMkTV.js} +1 -1
  23. package/dist/client/assets/{Plus-DUvbS-Yy.js → Plus-CPMXdWiF.js} +1 -1
  24. package/dist/client/assets/{SearchLg-CSWY8viA.js → SearchLg-Ccga3kHp.js} +1 -1
  25. package/dist/client/assets/{SearchMd-D0poZQV_.js → SearchMd-kaVQ2swy.js} +1 -1
  26. package/dist/client/assets/{Settings02-Sy5kNpSu.js → Settings02-D2WBE2j5.js} +1 -1
  27. package/dist/client/assets/{Shield01-Bcql6hT4.js → Shield01-BrHF2Qbg.js} +1 -1
  28. package/dist/client/assets/{Star01-2mO5G0Xw.js → Star01-CduFPScO.js} +1 -1
  29. package/dist/client/assets/{Stars01-DqIThrOc.js → Stars01-BpwKVOpQ.js} +1 -1
  30. package/dist/client/assets/{Stars02-cKtwD-F2.js → Stars02-C-JOVi71.js} +1 -1
  31. package/dist/client/assets/{Sun-DsnsEGXF.js → Sun-C2hxlxHa.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-BwAs_KcG.js → SwitchHorizontal01-Cm3MVkwA.js} +1 -1
  33. package/dist/client/assets/{Tool01-D2fd-Mg5.js → Tool01-pHGWkh_u.js} +1 -1
  34. package/dist/client/assets/{Tool02-C17Y4pBP.js → Tool02-C5toOJ2s.js} +1 -1
  35. package/dist/client/assets/{Trash01-BiVOd2DS.js → Trash01-BT5A-gEY.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-D1GkdBOV.js → TrendUp01-ByibXYAc.js} +1 -1
  37. package/dist/client/assets/{Upload01-k2Sn0RXQ.js → Upload01-wyU_c8og.js} +1 -1
  38. package/dist/client/assets/{User01-cC3unvvx.js → User01-BgOg9cVa.js} +1 -1
  39. package/dist/client/assets/{Users01-BdNSg6CC.js → Users01-CXIce8sr.js} +1 -1
  40. package/dist/client/assets/{Users03-CqyDxwt6.js → Users03-TIXCT7Lp.js} +1 -1
  41. package/dist/client/assets/{X-Baqkpp1k.js → X-CbfkAYzJ.js} +1 -1
  42. package/dist/client/assets/{XCircle-8Wd2-AR5.js → XCircle-DsHpzoj1.js} +1 -1
  43. package/dist/client/assets/{XClose-CBFLmbVP.js → XClose-Dg24hRTQ.js} +1 -1
  44. package/dist/client/assets/{Zap-C4qF8Cn-.js → Zap-CRace4eX.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-BH7ie7zg.js → ZapSquare-Bz1NVv_t.js} +1 -1
  46. package/dist/client/assets/{access-gate-CxXZPkIw.js → access-gate-B8ke5V9B.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-C7ktQCug.js → add-section-modal-R6NgXhJA.js} +1 -1
  48. package/dist/client/assets/{agent-icon-q4cV7U67.js → agent-icon-OqQTNFsC.js} +1 -1
  49. package/dist/client/assets/{agents-list-UZwnNOjT.js → agents-list-_5s5JeHd.js} +1 -1
  50. package/dist/client/assets/{ai-providers-Cput0kVL.js → ai-providers-D5nYmfZB.js} +1 -1
  51. package/dist/client/assets/{alert-DjeIAXMV.js → alert-BsZRUEM2.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DIwINRgW.js → alert-dialog-iPj1kFsb.js} +1 -1
  53. package/dist/client/assets/{app-editor-DdSH3pAD.js → app-editor-Cqg3A1oU.js} +1 -1
  54. package/dist/client/assets/{auth-FouChJbb.js → auth-CU9nh5v5.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-6cph4qce.js → auth-catchall-BkoM7GHE.js} +1 -1
  56. package/dist/client/assets/{auth-entry-i0rNcujn.js → auth-entry-Cnd5Yyo4.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-3qPwGE8Z.js → auth-split-layout-DEObuTt5.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-Dx2DT3YD.js → authenticate-and-persist-oauth-Y0eAm4-d.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-Brn7k31U.js → automation-list-row-Bs0wFLr_.js} +1 -1
  60. package/dist/client/assets/{automation-runs-CP1cxXFo.js → automation-runs-D7N1vsav.js} +1 -1
  61. package/dist/client/assets/{automations-BlJndOBe.js → automations-CfIG5b76.js} +1 -1
  62. package/dist/client/assets/{avatar-Du8HEobV.js → avatar-npAOJTNv.js} +1 -1
  63. package/dist/client/assets/{badge-swCoKQnC.js → badge-B7QGFlT2.js} +1 -1
  64. package/dist/client/assets/{block-document-DiB0SOp5.js → block-document-Sh0V11uT.js} +1 -1
  65. package/dist/client/assets/{brand-context-C8l7XNKr.js → brand-context-OfFgyNNa.js} +1 -1
  66. package/dist/client/assets/{buckets-Bs0sTGAu.js → buckets-sL5kUY2t.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-DE5pUVzi.js → bulk-category-panel-DejEHEKu.js} +1 -1
  68. package/dist/client/assets/{calendar-BZcldUNV.js → calendar-BKP3pISc.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-CqwI-nav.js → capability-load-error-sN01EV-h.js} +1 -1
  70. package/dist/client/assets/{card-9OUE6Bzl.js → card-C6G1ZbAT.js} +1 -1
  71. package/dist/client/assets/{category-editor-JK7DojfI.js → category-editor-Co38yZEY.js} +1 -1
  72. package/dist/client/assets/{chat-context-DYO1ODPB.js → chat-context-Bkf3Y_YW.js} +1 -1
  73. package/dist/client/assets/{checkbox-Dd_rqLvT.js → checkbox-B9JLC7kz.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-CFsjKhGa.js → cli-auth-success-CsEIMeSH.js} +1 -1
  75. package/dist/client/assets/{collection-detail-D0rtc2gf.js → collection-detail-zqQkeNgt.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-iD10GGdW.js → collection-display-button-CUXNxY_5.js} +1 -1
  77. package/dist/client/assets/{collection-search-5SFjfCC8.js → collection-search-Oul6UFfq.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-fW-dsmLE.js → collection-table-wrapper-CDNw08E3.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-DnykrgWW.js → collection-tabs-DfUm6FcP.js} +1 -1
  80. package/dist/client/assets/{command-CDVbjOi5.js → command-CFi_nxAL.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-CAOuADZ6.js → commerce-onboarding-D4pJOG7X.js} +1 -1
  82. package/dist/client/assets/{companions-core-6m5dy3es.js → companions-core-DBaOS2yz.js} +1 -1
  83. package/dist/client/assets/{connect-B_K53Vaa.js → connect-qY6nUUFn.js} +1 -1
  84. package/dist/client/assets/{connection-DhlrJlFw.js → connection-_j4DuEiI.js} +1 -1
  85. package/dist/client/assets/{connection-card-CzF-xjYn.js → connection-card-CuJ2QFEt.js} +1 -1
  86. package/dist/client/assets/{connection-detail-DmWTCewb.js → connection-detail-C52r4r_5.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-DRviH-Au.js → connection-form-helpers-Bmw91fnM.js} +1 -1
  88. package/dist/client/assets/{connections-DGvaZBx3.js → connections-CMPdUO57.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-BXMXu1gQ.js → decopilot-sse-pool-CmuV2kHg.js} +1 -1
  90. package/dist/client/assets/{dialog-C82H2S70.js → dialog-K6gwa7A3.js} +1 -1
  91. package/dist/client/assets/{domain-settings-DPn_9rd3.js → domain-settings-BPhwVIl_.js} +1 -1
  92. package/dist/client/assets/{drawer-lnIGl-vb.js → drawer-B_XFR2lX.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-CRGAwBji.js → dropdown-menu-DUU_gv0n.js} +1 -1
  94. package/dist/client/assets/{empty-state-BKzUesA7.js → empty-state-Cp0ZI-r6.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-B9TIJ0UC.js → extract-connection-data-2A6KAT-f.js} +1 -1
  96. package/dist/client/assets/{file-explorer-tNI79jXo.js → file-explorer-Ua7ytqbC.js} +1 -1
  97. package/dist/client/assets/{form-DAiRK0vx.js → form-CGaw2YpJ.js} +1 -1
  98. package/dist/client/assets/{general-CXtIEOrf.js → general-DUtn268r.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-DUNQ1oJW.js → github-repo-picker-DtakWI4J.js} +1 -1
  100. package/dist/client/assets/{hooks-Bom1QoTc.js → hooks-D6e52Y4T.js} +1 -1
  101. package/dist/client/assets/{index-Dv8k1EHh.js → index-BMkqNEv8.js} +1 -1
  102. package/dist/client/assets/{index-Df7LGqDK.js → index-BcaeODv9.js} +1 -1
  103. package/dist/client/assets/{index-Z4CG7jJp.js → index-BvRZaTt9.js} +1 -1
  104. package/dist/client/assets/{index-BDQ6Ogmu.js → index-CpUxmDng.js} +5 -5
  105. package/dist/client/assets/{index-oBYlsJ_o.js → index-DBLw6mkp.js} +1 -1
  106. package/dist/client/assets/{index-D7cNsGmf.js → index-DDsGzWAW.js} +3 -3
  107. package/dist/client/assets/{index-DK8HHLRp.js → index-DI6Brofo.js} +1 -1
  108. package/dist/client/assets/{index-2KxPRjw5.js → index-DqXmpRSX.js} +3 -3
  109. package/dist/client/assets/{index-C_5SQGG6.js → index-Dqep-uNC.js} +1 -1
  110. package/dist/client/assets/{index-B_kqSbsO.js → index-Dy8kFJxu.js} +1 -1
  111. package/dist/client/assets/{index-C-JAJ-o5.js → index-rTnRAZMH.js} +1 -1
  112. package/dist/client/assets/{index-redirect-Cj-NIgvU.js → index-redirect-6k6UhjHL.js} +1 -1
  113. package/dist/client/assets/{input-BAuCATqg.js → input-Bp56QPzT.js} +1 -1
  114. package/dist/client/assets/{integration-icon-DKBuU8Fr.js → integration-icon-MouDA4V6.js} +1 -1
  115. package/dist/client/assets/{invite-member-dialog-BiHY2r7m.js → invite-member-dialog-CiJy3P9w.js} +1 -1
  116. package/dist/client/assets/{label-onkw7wrh.js → label-CXwRlswr.js} +1 -1
  117. package/dist/client/assets/{layout-D8O9_Poo.js → layout-B3j_gVFj.js} +1 -1
  118. package/dist/client/assets/{login-B0j1yr6w.js → login-Hjf4Zeii.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-95IH3VKT.js → mcp-oauth-BHDSTwSV.js} +1 -1
  120. package/dist/client/assets/{members-Y7A-UiF5.js → members-D2Ea76Rg.js} +1 -1
  121. package/dist/client/assets/{monaco-editor-CSUtCvVX.js → monaco-editor-C9o8bufU.js} +1 -1
  122. package/dist/client/assets/{monitoring-stats-row-Dcug_wR7.js → monitoring-stats-row-C9gp4i2P.js} +1 -1
  123. package/dist/client/assets/{multi-select-C68tqs9V.js → multi-select-Ch6zaVsE.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-CqH1tIve.js → oauth-callback-PpJTQQhm.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-C0UAY-58.js → oauth-callback-ai-provider-BCj-mtF9.js} +1 -1
  126. package/dist/client/assets/{onboarding-2ZJYmqTH.js → onboarding-CLYVE1a0.js} +1 -1
  127. package/dist/client/assets/{org-layout-qZcaYBLo.js → org-layout-CYEy29Ts.js} +1 -1
  128. package/dist/client/assets/{organization-choice-CduZOMP9.js → organization-choice-CWdxGykt.js} +1 -1
  129. package/dist/client/assets/{orgs-DU0BEJAc.js → orgs-B_4i8FPt.js} +1 -1
  130. package/dist/client/assets/{page-seo-form-nxKDUI-6.js → page-seo-form-DpY_sul3.js} +1 -1
  131. package/dist/client/assets/{popover-x1qHvmwD.js → popover-CVg35MYX.js} +1 -1
  132. package/dist/client/assets/{post-editor-BhfI7Odx.js → post-editor-Bpp2OmpX.js} +1 -1
  133. package/dist/client/assets/{primitives-DITXbj-2.js → primitives-Br2UT5Vf.js} +1 -1
  134. package/dist/client/assets/{profile-Dl3k4wub.js → profile-6ivG90Z_.js} +1 -1
  135. package/dist/client/assets/project-app-view-B3f5qhaT.js +1 -0
  136. package/dist/client/assets/record-editor-B0thyxFw.js +1 -0
  137. package/dist/client/assets/{redirect-editor-BamLe0Vb.js → redirect-editor-BOSsbfNh.js} +1 -1
  138. package/dist/client/assets/{registry-layout-Cfgh3Q9S.js → registry-layout-48QA7RsV.js} +1 -1
  139. package/dist/client/assets/registry-wAhFzL5P.js +2 -0
  140. package/dist/client/assets/{reports-2omVoMUm.js → reports-gCTgU_9n.js} +1 -1
  141. package/dist/client/assets/{require-capability-B1pg4EtO.js → require-capability-CCuG3VBt.js} +1 -1
  142. package/dist/client/assets/{required-auth-layout-wB2bMMGI.js → required-auth-layout-BU1eh7Wn.js} +1 -1
  143. package/dist/client/assets/{reset-password-BmxFRY37.js → reset-password-b8TsB2X9.js} +1 -1
  144. package/dist/client/assets/{roles-ClU1umGx.js → roles-bUKS9vRr.js} +1 -1
  145. package/dist/client/assets/{search-input-DtCL1YcZ.js → search-input-B0jSz39p.js} +1 -1
  146. package/dist/client/assets/{secrets-B-dmTgLw.js → secrets-DBVJEtoI.js} +1 -1
  147. package/dist/client/assets/{sections-editor-DqY5dzLX.js → sections-editor-WmcIIpkR.js} +1 -1
  148. package/dist/client/assets/{select-DfQiZ-4J.js → select-Cb3tiSDw.js} +1 -1
  149. package/dist/client/assets/{select-model-Clf7Hlwn.js → select-model-Bl2KSVsJ.js} +1 -1
  150. package/dist/client/assets/{self-tool-result-BCgUr0ik.js → self-tool-result-qixGUHHp.js} +1 -1
  151. package/dist/client/assets/{seo-editor-CEUCMyKF.js → seo-editor-CUQXJ1Cd.js} +1 -1
  152. package/dist/client/assets/{settings-layout-DJLSOlbv.js → settings-layout-D-dv9Bvf.js} +1 -1
  153. package/dist/client/assets/{settings-section-BaFcIjo5.js → settings-section-awXbfRFI.js} +1 -1
  154. package/dist/client/assets/{shell-controls-DIMDYHkk.js → shell-controls-wrDqoZ9L.js} +1 -1
  155. package/dist/client/assets/{shell-layout-B56j-p5N.js → shell-layout-BX0EOEmo.js} +1 -1
  156. package/dist/client/assets/{sidebar-DpVJgBAa.js → sidebar-BiPc8cWL.js} +1 -1
  157. package/dist/client/assets/{skeleton-BtiEyhAl.js → skeleton-CT6LmWQk.js} +1 -1
  158. package/dist/client/assets/{spinner-DPfrt4Tp.js → spinner-5nEupkU1.js} +1 -1
  159. package/dist/client/assets/{sso-CICOFYfX.js → sso-BH0Yk1RU.js} +1 -1
  160. package/dist/client/assets/{store-BJgQ6scG.js → store-DwUNbOmZ.js} +1 -1
  161. package/dist/client/assets/store-registry-Ci03spyl.js +2 -0
  162. package/dist/client/assets/{studio-tools-CTJuN7Yy.js → studio-tools-DvotCHSX.js} +1 -1
  163. package/dist/client/assets/{switch-DIwoxI1y.js → switch-C4EXURzI.js} +1 -1
  164. package/dist/client/assets/{tab-id-DJIms9m1.js → tab-id-CCUuJuHg.js} +1 -1
  165. package/dist/client/assets/{table-BbRTH9fF.js → table-BrY2fIko.js} +1 -1
  166. package/dist/client/assets/{tabs-DKyQ4Qe1.js → tabs-o5z4F4nX.js} +1 -1
  167. package/dist/client/assets/{textarea-Y242n44c.js → textarea-KF0bc7ey.js} +1 -1
  168. package/dist/client/assets/{toggle-group-BBsmjOfV.js → toggle-group-ImSBP57j.js} +1 -1
  169. package/dist/client/assets/{toolbar-BaZp82JP.js → toolbar-HbcGIVfO.js} +1 -1
  170. package/dist/client/assets/{tooltip-CEu_we5y.js → tooltip-DJ0CJ4nu.js} +1 -1
  171. package/dist/client/assets/{use-ai-providers-B2nAOoUO.js → use-ai-providers-BlXZ8OS9.js} +1 -1
  172. package/dist/client/assets/{use-automations-irLGHKpI.js → use-automations-D97aWna-.js} +1 -1
  173. package/dist/client/assets/{use-autosave-BAjK3u8R.js → use-autosave-BuWdMqxb.js} +1 -1
  174. package/dist/client/assets/{use-capability-Y4a4cK2y.js → use-capability-DjWP4c_V.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-kQx_nmDK.js → use-clock-tick-D08rNiex.js} +1 -1
  176. package/dist/client/assets/{use-connection-CvBcj0iA.js → use-connection-CV5pilpz.js} +1 -1
  177. package/dist/client/assets/{use-copy-POYUhIaM.js → use-copy-D8Z2epUY.js} +1 -1
  178. package/dist/client/assets/{use-create-virtual-mcp-Df8fpCi4.js → use-create-virtual-mcp-DYyiqJWf.js} +1 -1
  179. package/dist/client/assets/{use-debounced-autosave-EvVOUA6S.js → use-debounced-autosave-BYO2w-tQ.js} +1 -1
  180. package/dist/client/assets/{use-debounced-value-IOz7dnNR.js → use-debounced-value-Pwi9o0RN.js} +1 -1
  181. package/dist/client/assets/{use-deco-credits-CBOWsaT-.js → use-deco-credits-DwGKxBj1.js} +1 -1
  182. package/dist/client/assets/{use-decopilot-events-Dc8-pFMU.js → use-decopilot-events-cGJArGLt.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-CxX7cCR_.js → use-delete-connection-Cnp4lOk4.js} +1 -1
  184. package/dist/client/assets/{use-deployment-admin-ucDRDdNR.js → use-deployment-admin-BGRYyg5T.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-BsCj6gUu.js → use-file-configs-mdE9JcAP.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-ccrh4_KW.js → use-infinite-scroll-C92EJ-_j.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-DjYbXyL8.js → use-join-requests-Da6i-it5.js} +1 -1
  188. package/dist/client/assets/{use-mcp-auth-status-vzmxIRHi.js → use-mcp-auth-status-DJKtOtTD.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-DRwUSZdO.js → use-mcp-client-DwJl6WIN.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-PCSBjtNq.js → use-mcp-tools-BDghoqz7.js} +1 -1
  191. package/dist/client/assets/{use-members-DjRi0Onl.js → use-members-Evj2zR-F.js} +1 -1
  192. package/dist/client/assets/{use-mobile-CLE626Yq.js → use-mobile-lAVE_tNN.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-CXMG3HNZ.js → use-navigate-to-agent-CvMJ7nhQ.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-BxtVWNiI.js → use-org-auth-client-DXsqXIB3.js} +1 -1
  195. package/dist/client/assets/{use-org-sso-DBExuOVV.js → use-org-sso-BWke9nQX.js} +1 -1
  196. package/dist/client/assets/{use-organization-roles-DFLLP3Qo.js → use-organization-roles-C3KJEjHx.js} +1 -1
  197. package/dist/client/assets/{use-organization-settings-DKSNQ1_z.js → use-organization-settings-D9dl8fjV.js} +1 -1
  198. package/dist/client/assets/{use-registry-connections-BRZCHKHD.js → use-registry-connections-DyTDBh31.js} +1 -1
  199. package/dist/client/assets/{use-secrets-DfGoccAw.js → use-secrets-DxzABMbU.js} +1 -1
  200. package/dist/client/assets/{use-status-sounds-DcgHuUFX.js → use-status-sounds-Nup_Tqx4.js} +1 -1
  201. package/dist/client/assets/{use-tags-DRM6xsgU.js → use-tags-CghR51-0.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-DvgBYhz6.js → use-view-mode-C9K2zt6M.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-D7SVi-2E.js → use-virtual-mcp-Co2Gxa_g.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-W7NcHma4.js +1 -0
  205. package/dist/client/assets/{useQueries-DVb_HjzV.js → useQueries-DQT-5ztu.js} +1 -1
  206. package/dist/client/assets/{useRouterState-CJ97gzOK.js → useRouterState-CfpQuL30.js} +1 -1
  207. package/dist/client/assets/useSuspenseInfiniteQuery-r5q75ddS.js +1 -0
  208. package/dist/client/assets/{users-CX6W_kiO.js → users-B34XbaLL.js} +1 -1
  209. package/dist/client/assets/{variant-calendar-BSUlgs-W.js → variant-calendar-DtyO8s_C.js} +1 -1
  210. package/dist/client/assets/{view-mode-toggle-DULJqLEB.js → view-mode-toggle-Be9Tyce0.js} +1 -1
  211. package/dist/client/index.html +1 -1
  212. package/dist/server/cli.js +178 -177
  213. package/dist/server/migrate.js +7 -7
  214. package/dist/server/server.js +145 -145
  215. package/package.json +1 -1
  216. package/dist/client/assets/project-app-view-CrBgtatz.js +0 -1
  217. package/dist/client/assets/record-editor-DUGdKTe8.js +0 -1
  218. package/dist/client/assets/registry-B4ci0gM-.js +0 -2
  219. package/dist/client/assets/store-registry-Di0pCo7I.js +0 -2
  220. package/dist/client/assets/useInfiniteQuery-BWd6o-wh.js +0 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-DPyRMURT.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as V,j as s,b as ie,r as U,B as de,m as ce,af as yt,X as Ye,Y as je,F as be,o as _e,Z as Qe,_ as Je,e as ke,K as fe,t as me,p as ue,D as jt,n as St,d as Nt,E as kt,z as wt}from"./index-2KxPRjw5.js";import{e as Me,d as Ee,a as Ze,b as Oe,h as et,c as tt,D as Ct}from"./dialog-C82H2S70.js";import{d as It,b as _t,a as Mt,D as Et}from"./drawer-lnIGl-vb.js";import{u as Ot}from"./use-mobile-CLE626Yq.js";import{c as st,D as Lt,u as Le}from"./chat-context-DYO1ODPB.js";import{C as At}from"./checkbox-Dd_rqLvT.js";import{I as xe}from"./input-BAuCATqg.js";import{S as Tt,a as Dt,b as Pt,c as zt,d as Rt}from"./select-DfQiZ-4J.js";import{S as se}from"./skeleton-BtiEyhAl.js";import{i as it,b as lt,c as Kt,a as Ft,s as $t}from"./Settings02-Sy5kNpSu.js";import{d as Ut,a as Bt,b as Wt,i as Vt}from"./Tool01-D2fd-Mg5.js";import{i as Ht}from"./Key01-DVGzNfoY.js";import{i as nt}from"./SearchMd-D0poZQV_.js";import{d as Ae,u as qt,b as Gt}from"./use-ai-providers-B2nAOoUO.js";import{g as Te}from"./ai-providers-logos-DD3qZ33J.js";import{i as Xt}from"./Monitor01-CEdUOtdj.js";import{i as Yt}from"./AlertCircle-BaA3X0Vc.js";import{S as Ie}from"./spinner-DPfrt4Tp.js";import{u as Ce}from"./studio-tools-CTJuN7Yy.js";import{i as Qt}from"./ChevronRight-CSgj0z6i.js";import{A as Jt}from"./avatar-Du8HEobV.js";import{S as ze,a as Re,b as ot}from"./settings-section-BaFcIjo5.js";import{s as rt}from"./Eye-CkjEvMwH.js";import{s as Zt,D as es}from"./tab-id-DJIms9m1.js";import{u as ts}from"./use-is-desktop-app-BNujXJc_.js";import{i as ss}from"./Check-DdyKCl8O.js";import{a as is}from"./Copy01-Cv0Vuqbe.js";import{t as Ke}from"./ChevronDown-BSVV4L9A.js";import{t as ls}from"./Stars01-DqIThrOc.js";function ge(l){const e=V.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}function ve(l){const e=V.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}const ns={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:ge},codex:{labelKey:"chat.agentIcons.codex",Icon:ve}};function nl(l){return(l&&ns[l])??null}const Fe="bunx decocms@latest link",os=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:s.jsx(ge,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:s.jsx(ve,{size:18})}];function rs(l){const e=V.c(46),{open:t,onOpenChange:i}=l,n=ie();let o;e[0]!==t?(o={fast:t},e[0]=t,e[1]=o):o=e[1];const r=st(o),[c,u]=U.useState(!1);let d,a,h,p,m,f,b,N;if(e[2]!==r.hostname||e[3]!==r.machineId||e[4]!==r.online||e[5]!==i||e[6]!==t||e[7]!==n){const w=r.hostname??r.machineId??n("chat.connectDesktopDialog.yourDesktop");p=Me,b=t,N=i,h=Ee,f="sm:max-w-md",a=Ze,d=Oe,m=r.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:w}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=r.hostname,e[3]=r.machineId,e[4]=r.online,e[5]=i,e[6]=t,e[7]=n,e[8]=d,e[9]=a,e[10]=h,e[11]=p,e[12]=m,e[13]=f,e[14]=b,e[15]=N}else d=e[8],a=e[9],h=e[10],p=e[11],m=e[12],f=e[13],b=e[14],N=e[15];let y;e[16]!==d||e[17]!==m?(y=s.jsx(d,{children:m}),e[16]=d,e[17]=m,e[18]=y):y=e[18];let j;e[19]!==r.online||e[20]!==n?(j=r.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=r.online,e[20]=n,e[21]=j):j=e[21];let C;e[22]!==j?(C=s.jsx(et,{children:j}),e[22]=j,e[23]=C):C=e[23];let E;e[24]!==a||e[25]!==y||e[26]!==C?(E=s.jsxs(a,{children:[y,C]}),e[24]=a,e[25]=y,e[26]=C,e[27]=E):E=e[27];let M;e[28]!==c||e[29]!==r.online?(M=!r.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:Fe}),s.jsx(de,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(Fe).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},children:c?s.jsx(ss,{size:14}):s.jsx(is,{size:14})})]}),e[28]=c,e[29]=r.online,e[30]=M):M=e[30];let I;e[31]!==r.capabilities||e[32]!==r.online||e[33]!==n?(I=r.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:os.map(w=>{const _=r.capabilities.includes(w.capability);return s.jsxs("div",{className:ce("flex items-center gap-3 rounded-md border px-3 py-2",_?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:ce("flex size-6 items-center justify-center",_?"text-foreground":"text-muted-foreground"),children:w.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:n(w.labelKey)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n(_?w.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),s.jsx("span",{className:ce("size-2 rounded-full",_?"bg-success":"bg-muted-foreground/30")})]},w.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ie,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=r.capabilities,e[32]=r.online,e[33]=n,e[34]=I):I=e[34];let x;e[35]!==h||e[36]!==M||e[37]!==I||e[38]!==f||e[39]!==E?(x=s.jsxs(h,{className:f,children:[E,M,I]}),e[35]=h,e[36]=M,e[37]=I,e[38]=f,e[39]=E,e[40]=x):x=e[40];let k;return e[41]!==p||e[42]!==x||e[43]!==b||e[44]!==N?(k=s.jsx(p,{open:b,onOpenChange:N,children:x}),e[41]=p,e[42]=x,e[43]=b,e[44]=N,e[45]=k):k=e[45],k}function pe(l,e,t){let i=t.initialDeps??[],n,o=!0;function r(){var c,u,d;let a;t.key&&((c=t.debug)!=null&&c.call(t))&&(a=Date.now());const h=l();if(!(h.length!==i.length||h.some((f,b)=>i[b]!==f)))return n;i=h;let m;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(m=Date.now()),n=e(...h),t.key&&((d=t.debug)!=null&&d.call(t))){const f=Math.round((Date.now()-a)*100)/100,b=Math.round((Date.now()-m)*100)/100,N=b/16,y=(j,C)=>{for(j=String(j);j.length<C;)j=" "+j;return j};console.info(`%c⏱ ${y(b,5)} /${y(f,5)} ms`,`
1
+ import{c as V,j as s,b as ie,r as U,B as de,m as ce,af as yt,X as Ye,Y as je,F as be,o as _e,Z as Qe,_ as Je,e as ke,K as fe,t as me,p as ue,D as jt,n as St,d as Nt,E as kt,z as wt}from"./index-DqXmpRSX.js";import{e as Me,d as Ee,a as Ze,b as Oe,h as et,c as tt,D as Ct}from"./dialog-K6gwa7A3.js";import{d as It,b as _t,a as Mt,D as Et}from"./drawer-B_XFR2lX.js";import{u as Ot}from"./use-mobile-lAVE_tNN.js";import{c as st,D as Lt,u as Le}from"./chat-context-Bkf3Y_YW.js";import{C as At}from"./checkbox-B9JLC7kz.js";import{I as xe}from"./input-Bp56QPzT.js";import{S as Tt,a as Dt,b as Pt,c as zt,d as Rt}from"./select-Cb3tiSDw.js";import{S as se}from"./skeleton-CT6LmWQk.js";import{i as it,b as lt,c as Kt,a as Ft,s as $t}from"./Settings02-D2WBE2j5.js";import{d as Ut,a as Bt,b as Wt,i as Vt}from"./Tool01-pHGWkh_u.js";import{i as Ht}from"./Key01-BU6DEShZ.js";import{i as nt}from"./SearchMd-kaVQ2swy.js";import{d as Ae,u as qt,b as Gt}from"./use-ai-providers-BlXZ8OS9.js";import{g as Te}from"./ai-providers-logos-DD3qZ33J.js";import{i as Xt}from"./Monitor01-Car-ubqN.js";import{i as Yt}from"./AlertCircle-BHNP9rUU.js";import{S as Ie}from"./spinner-5nEupkU1.js";import{u as Ce}from"./studio-tools-DvotCHSX.js";import{i as Qt}from"./ChevronRight-CwImj32A.js";import{A as Jt}from"./avatar-npAOJTNv.js";import{S as ze,a as Re,b as ot}from"./settings-section-awXbfRFI.js";import{s as rt}from"./Eye-DJcOc9Zw.js";import{s as Zt,D as es}from"./tab-id-CCUuJuHg.js";import{u as ts}from"./use-is-desktop-app-BNujXJc_.js";import{i as ss}from"./Check-D3kjZMFv.js";import{a as is}from"./Copy01-CFdaASyO.js";import{t as Ke}from"./ChevronDown-Dn2piZ2G.js";import{t as ls}from"./Stars01-BpwKVOpQ.js";function ge(l){const e=V.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}function ve(l){const e=V.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}const ns={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:ge},codex:{labelKey:"chat.agentIcons.codex",Icon:ve}};function nl(l){return(l&&ns[l])??null}const Fe="bunx decocms@latest link",os=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:s.jsx(ge,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:s.jsx(ve,{size:18})}];function rs(l){const e=V.c(46),{open:t,onOpenChange:i}=l,n=ie();let o;e[0]!==t?(o={fast:t},e[0]=t,e[1]=o):o=e[1];const r=st(o),[c,u]=U.useState(!1);let d,a,h,p,m,f,b,N;if(e[2]!==r.hostname||e[3]!==r.machineId||e[4]!==r.online||e[5]!==i||e[6]!==t||e[7]!==n){const w=r.hostname??r.machineId??n("chat.connectDesktopDialog.yourDesktop");p=Me,b=t,N=i,h=Ee,f="sm:max-w-md",a=Ze,d=Oe,m=r.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:w}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=r.hostname,e[3]=r.machineId,e[4]=r.online,e[5]=i,e[6]=t,e[7]=n,e[8]=d,e[9]=a,e[10]=h,e[11]=p,e[12]=m,e[13]=f,e[14]=b,e[15]=N}else d=e[8],a=e[9],h=e[10],p=e[11],m=e[12],f=e[13],b=e[14],N=e[15];let y;e[16]!==d||e[17]!==m?(y=s.jsx(d,{children:m}),e[16]=d,e[17]=m,e[18]=y):y=e[18];let j;e[19]!==r.online||e[20]!==n?(j=r.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=r.online,e[20]=n,e[21]=j):j=e[21];let C;e[22]!==j?(C=s.jsx(et,{children:j}),e[22]=j,e[23]=C):C=e[23];let E;e[24]!==a||e[25]!==y||e[26]!==C?(E=s.jsxs(a,{children:[y,C]}),e[24]=a,e[25]=y,e[26]=C,e[27]=E):E=e[27];let M;e[28]!==c||e[29]!==r.online?(M=!r.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:Fe}),s.jsx(de,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(Fe).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},children:c?s.jsx(ss,{size:14}):s.jsx(is,{size:14})})]}),e[28]=c,e[29]=r.online,e[30]=M):M=e[30];let I;e[31]!==r.capabilities||e[32]!==r.online||e[33]!==n?(I=r.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:os.map(w=>{const _=r.capabilities.includes(w.capability);return s.jsxs("div",{className:ce("flex items-center gap-3 rounded-md border px-3 py-2",_?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:ce("flex size-6 items-center justify-center",_?"text-foreground":"text-muted-foreground"),children:w.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:n(w.labelKey)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n(_?w.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),s.jsx("span",{className:ce("size-2 rounded-full",_?"bg-success":"bg-muted-foreground/30")})]},w.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ie,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=r.capabilities,e[32]=r.online,e[33]=n,e[34]=I):I=e[34];let x;e[35]!==h||e[36]!==M||e[37]!==I||e[38]!==f||e[39]!==E?(x=s.jsxs(h,{className:f,children:[E,M,I]}),e[35]=h,e[36]=M,e[37]=I,e[38]=f,e[39]=E,e[40]=x):x=e[40];let k;return e[41]!==p||e[42]!==x||e[43]!==b||e[44]!==N?(k=s.jsx(p,{open:b,onOpenChange:N,children:x}),e[41]=p,e[42]=x,e[43]=b,e[44]=N,e[45]=k):k=e[45],k}function pe(l,e,t){let i=t.initialDeps??[],n,o=!0;function r(){var c,u,d;let a;t.key&&((c=t.debug)!=null&&c.call(t))&&(a=Date.now());const h=l();if(!(h.length!==i.length||h.some((f,b)=>i[b]!==f)))return n;i=h;let m;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(m=Date.now()),n=e(...h),t.key&&((d=t.debug)!=null&&d.call(t))){const f=Math.round((Date.now()-a)*100)/100,b=Math.round((Date.now()-m)*100)/100,N=b/16,y=(j,C)=>{for(j=String(j);j.length<C;)j=" "+j;return j};console.info(`%c⏱ ${y(b,5)} /${y(f,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*N,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=c=>{i=c},r}function $e(l,e){if(l===void 0)throw new Error("Unexpected undefined");return l}const as=(l,e)=>Math.abs(l-e)<1.01,cs=(l,e,t)=>{let i;return function(...n){l.clearTimeout(i),i=l.setTimeout(()=>e.apply(this,n),t)}},Ue=l=>{const{offsetWidth:e,offsetHeight:t}=l;return{width:e,height:t}},ds=l=>l,us=l=>{const e=Math.max(l.startIndex-l.overscan,0),t=Math.min(l.endIndex+l.overscan,l.count-1),i=[];for(let n=e;n<=t;n++)i.push(n);return i},ms=(l,e)=>{const t=l.scrollElement;if(!t)return;const i=l.targetWindow;if(!i)return;const n=r=>{const{width:c,height:u}=r;e({width:Math.round(c),height:Math.round(u)})};if(n(Ue(t)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(r=>{const c=()=>{const u=r[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Ue(t))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Be={passive:!0},We=typeof window>"u"?!0:"onscrollend"in window,hs=(l,e)=>{const t=l.scrollElement;if(!t)return;const i=l.targetWindow;if(!i)return;let n=0;const o=l.options.useScrollendEvent&&We?()=>{}:cs(i,()=>{e(n,!1)},l.options.isScrollingResetDelay),r=a=>()=>{const{horizontal:h,isRtl:p}=l.options;n=h?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(n,a)},c=r(!0),u=r(!1);t.addEventListener("scroll",c,Be);const d=l.options.useScrollendEvent&&We;return d&&t.addEventListener("scrollend",u,Be),()=>{t.removeEventListener("scroll",c),d&&t.removeEventListener("scrollend",u)}},fs=(l,e,t)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},ps=(l,{adjustments:e=0,behavior:t},i)=>{var n,o;const r=l+e;(o=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[i.options.horizontal?"left":"top"]:r,behavior:t})};class xs{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,i,n;return((n=(i=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:i.now)==null?void 0:n.call(i))??Date.now()},this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const c=o.target,u=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=i())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=i())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,n])=>{typeof n>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ds,rangeExtractor:us,onChange:()=>{},measureElement:fs,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 i,n;(n=(i=this.options).onChange)==null||n.call(i,this,t)},this.maybeNotify=pe(()=>(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 i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,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,i)=>{const n=new Map,o=new Map;for(let r=i-1;r>=0;r--){const c=t[r];if(n.has(c.lane))continue;const u=o.get(c.lane);if(u==null||c.end>u.end?o.set(c.lane,c):c.end<u.end&&n.set(c.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,c)=>r.end===c.end?r.index-c.index:r.end-c.end)[0]:void 0},this.getMeasurementOptions=pe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,i,n,o,r,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u}),{key:!1}),this.getMeasurements=pe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);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(m=>{this.itemSizeCache.set(m.key,m.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const h=this.measurementsCache.slice(0,a),p=new Array(c).fill(void 0);for(let m=0;m<a;m++){const f=h[m];f&&(p[f.lane]=m)}for(let m=a;m<t;m++){const f=o(m),b=this.laneAssignments.get(m);let N,y;const j=u==="estimate"||d.has(f);if(b!==void 0&&this.options.lanes>1){N=b;const I=p[N],x=I!==void 0?h[I]:void 0;y=x?x.end+this.options.gap:i+n}else{const I=this.options.lanes===1?h[m-1]:this.getFurthestMeasurement(h,m);y=I?I.end+this.options.gap:i+n,N=I?I.lane:m%this.options.lanes,this.options.lanes>1&&j&&this.laneAssignments.set(m,N)}const C=d.get(f),E=typeof C=="number"?C:this.options.estimateSize(m),M=y+E;h[m]={index:m,start:y,size:E,end:M,key:f,lane:N},p[N]=m}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,n,o)=>this.range=t.length>0&&i>0?gs({measurements:t,outerSize:i,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pe(()=>{let t=null,i=null;const n=this.calculateRange();return n&&(t=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,n=t.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.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),c=Math.min(this.options.count-1,n+o);return t>=r&&t<=c}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,c)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(c))});return}const i=this.indexFromElement(t),n=this.options.getItemKey(i),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(i)&&this.resizeItem(i,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,i)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,c=i-r;c!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,c,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,i)),this.notify(!1))},this.getVirtualItems=pe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const c=t[o],u=i[c];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return $e(i[at(0,i.length-1,n=>$e(i[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,i,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();i==="auto"&&(i=t>=r+o?"end":"start"),i==="center"?t+=(n-o)/2:i==="end"&&(t-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,i="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(i==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)i="end";else if(r.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,r.size),i]},this.scrollToOffset=(t,{align:i="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,i),r=this.now();this.scrollState={index:null,align:i,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:i="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,i);if(!o)return;const[r,c]=o,u=this.now();this.scrollState={index:t,align:c,behavior:n,startedAt:u,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:i="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=i[i.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=i.length-1;for(;r>=0&&o.some(c=>c===null);){const c=i[r];o[c.lane]===null&&(o[c.lane]=c.end),r--}n=Math.max(...o.filter(c=>c!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:i},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 i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=i?i[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&as(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 at=(l,e,t,i)=>{for(;l<=e;){const n=(l+e)/2|0,o=t(n);if(o<i)l=n+1;else if(o>i)e=n-1;else return n}return l>0?l-1:0};function gs({measurements:l,outerSize:e,scrollOffset:t,lanes:i}){const n=l.length-1,o=u=>l[u].start;if(l.length<=i)return{startIndex:0,endIndex:n};let r=at(0,n,o,t),c=r;if(i===1)for(;c<n&&l[c].end<t+e;)c++;else if(i>1){const u=Array(i).fill(0);for(;c<n&&u.some(a=>a<t+e);){const a=l[c];u[a.lane]=a.end,c++}const d=Array(i).fill(t+e);for(;r>=0&&d.some(a=>a>=t);){const a=l[r];d[a.lane]=a.start,r--}r=Math.max(0,r-r%i),c=Math.min(n,c+(i-1-c%i))}return{startIndex:r,endIndex:c}}const Ve=typeof document<"u"?U.useLayoutEffect:U.useEffect;function vs({useFlushSync:l=!0,...e}){const t=U.useReducer(()=>({}),{})[1],i={...e,onChange:(o,r)=>{var c;l&&r?yt.flushSync(t):t(),(c=e.onChange)==null||c.call(e,o,r)}},[n]=U.useState(()=>new xs(i));return n.setOptions(i),Ve(()=>n._didMount(),[]),Ve(()=>n._willUpdate()),n}function bs(l){return vs({observeElementRect:ms,observeElementOffset:hs,scrollToFn:ps,...l})}const ct=[{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 Se(l){if(l)return ct.find(e=>e.id===l)}const He=4;function ye(l){const e=V.c(8),{logo:t,name:i,description:n,onClick:o}=l;let r;e[0]!==t||e[1]!==i?(r=t?s.jsx("img",{src:t,alt:i,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Jt,{fallback:i.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=i,e[2]=r):r=e[2];let c;return e[3]!==n||e[4]!==i||e[5]!==o||e[6]!==r?(c=s.jsx(ot,{onClick:o,icon:r,title:i,description:n}),e[3]=n,e[4]=i,e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function dt(l){const e=V.c(38),{providers:t,onSelect:i,onShowAll:n}=l,o=ie();let r;e[0]!==t?(r=t.find(Ns),e[0]=t,e[1]=r):r=e[1];const c=r;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=u):u=e[2];const d=u;let a;if(e[3]!==i||e[4]!==t||e[5]!==o){let E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=(S,O)=>{const D=d[S.id]??Number.MAX_SAFE_INTEGER,T=d[O.id]??Number.MAX_SAFE_INTEGER;return D-T},e[7]=E):E=e[7];const M=t.filter(Ss).sort(E);let I;e[8]!==t?(I=t.find(js),e[8]=t,e[9]=I):I=e[9];const x=I;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=Se("openai"),e[10]=k):k=e[10];const w=k;let _;e[11]!==i?(_=S=>s.jsx(ye,{logo:S.logo,name:S.name,description:S.description,onClick:()=>i({kind:"provider",provider:S})},S.id),e[11]=i,e[12]=_):_=e[12];let v;e[13]!==i||e[14]!==x?(v=x&&w?[s.jsx(ye,{logo:w.logo,name:w.name,description:w.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:w})},w.id)]:[],e[13]=i,e[14]=x,e[15]=v):v=e[15];let g;e[16]!==i||e[17]!==x||e[18]!==o?(g=x?[...ct.filter(ys).map(S=>s.jsx(ye,{logo:S.logo,name:S.name,description:S.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:S})},S.id)),s.jsx(ye,{logo:x.logo,name:o("settings.aiProviders.customOpenAiCompatible"),description:o("settings.aiProviders.customOpenAiDescription"),onClick:()=>i({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[16]=i,e[17]=x,e[18]=o,e[19]=g):g=e[19],a=[...M.map(_),...v,...g],e[3]=i,e[4]=t,e[5]=o,e[6]=a}else a=e[6];const h=a,p=h.length-He,m=!!n&&p>0;let f;e[20]!==h||e[21]!==m?(f=m?h.slice(0,He):h,e[20]=h,e[21]=m,e[22]=f):f=e[22];const b=f;let N;e[23]!==c||e[24]!==i||e[25]!==o?(N=c&&s.jsx(ze,{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:o("settings.aiProviders.recommended")}),s.jsx(Re,{className:"relative",children:s.jsx(ye,{logo:c.logo,name:c.name,description:c.description,onClick:()=>i({kind:"provider",provider:c})})})]})}),e[23]=c,e[24]=i,e[25]=o,e[26]=N):N=e[26];let y;e[27]!==p||e[28]!==n||e[29]!==m||e[30]!==o?(y=m&&s.jsx(ot,{onClick:n,title:o("settings.aiProviders.moreProviders",{count:p,plural:p===1?"":"s"}),action:s.jsx(Qt,{size:16,className:"text-muted-foreground"})}),e[27]=p,e[28]=n,e[29]=m,e[30]=o,e[31]=y):y=e[31];let j;e[32]!==y||e[33]!==b?(j=s.jsx(ze,{children:s.jsxs(Re,{children:[b,y]})}),e[32]=y,e[33]=b,e[34]=j):j=e[34];let C;return e[35]!==N||e[36]!==j?(C=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,j]}),e[35]=N,e[36]=j,e[37]=C):C=e[37],C}function ys(l){return l.id!=="openai"}function js(l){return l.id==="openai-compatible"}function Ss(l){return l.id!=="deco"&&l.id!=="openai-compatible"}function Ns(l){return l.id==="deco"}const ks=Ye({label:je().optional(),apiKey:je().min(1,"API key is required")});function ws(l){const e=V.c(87),{providerId:t,onCancel:i,onSuccess:n}=l,{org:o}=be(),r=Ce(),c=_e(),[u,d]=U.useState(!1),a=ie();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={resolver:Qe(ks),defaultValues:{label:"",apiKey:""}},e[0]=h):h=e[0];const{register:p,handleSubmit:m,formState:f}=Je(h),{errors:b}=f;let N;e[1]!==t||e[2]!==r||e[3]!==a?(N=async B=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:B.label||a("settings.connectForms.defaultKeyLabel"),apiKey:B.apiKey})},e[1]=t,e[2]=r,e[3]=a,e[4]=N):N=e[4];let y;e[5]!==n||e[6]!==o||e[7]!==c||e[8]!==a?(y=()=>{c.invalidateQueries({queryKey:fe.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:fe.aiProviders(o.id)}),me.success(a("settings.connectForms.keySavedSuccess")),n()},e[5]=n,e[6]=o,e[7]=c,e[8]=a,e[9]=y):y=e[9];let j;e[10]!==a?(j=B=>{me.error(a("settings.connectForms.failedSaveKey",{error:B.message}))},e[10]=a,e[11]=j):j=e[11];let C;e[12]!==N||e[13]!==y||e[14]!==j?(C={mutationFn:N,onSuccess:y,onError:j},e[12]=N,e[13]=y,e[14]=j,e[15]=C):C=e[15];const{mutate:E,isPending:M,error:I}=ke(C);let x;e[16]!==E?(x=B=>E(B),e[16]=E,e[17]=x):x=e[17];let k;e[18]!==m||e[19]!==x?(k=m(x),e[18]=m,e[19]=x,e[20]=k):k=e[20];let w;e[21]!==a?(w=a("settings.connectForms.labelField"),e[21]=a,e[22]=w):w=e[22];let _;e[23]!==w?(_=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),e[23]=w,e[24]=_):_=e[24];let v;e[25]!==a?(v=a("settings.connectForms.labelPlaceholder"),e[25]=a,e[26]=v):v=e[26];let g;e[27]!==p?(g=p("label"),e[27]=p,e[28]=g):g=e[28];let S;e[29]!==v||e[30]!==g?(S=s.jsx(xe,{placeholder:v,...g,className:"h-8 text-sm"}),e[29]=v,e[30]=g,e[31]=S):S=e[31];let O;e[32]!==_||e[33]!==S?(O=s.jsxs("div",{className:"space-y-1",children:[_,S]}),e[32]=_,e[33]=S,e[34]=O):O=e[34];let D;e[35]!==a?(D=a("settings.connectForms.apiKeyField"),e[35]=a,e[36]=D):D=e[36];let T;e[37]!==D?(T=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:D}),e[37]=D,e[38]=T):T=e[38];const L=u?"text":"password";let P;e[39]!==p?(P=p("apiKey"),e[39]=p,e[40]=P):P=e[40];let z;e[41]!==L||e[42]!==P?(z=s.jsx(xe,{type:L,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[41]=L,e[42]=P,e[43]=z):z=e[43];let R;e[44]!==u?(R=()=>d(!u),e[44]=u,e[45]=R):R=e[45];let K;e[46]!==u||e[47]!==a?(K=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[46]=u,e[47]=a,e[48]=K):K=e[48];let W;e[49]!==u?(W=u?s.jsx(it,{size:14}):s.jsx(rt,{size:14}),e[49]=u,e[50]=W):W=e[50];let H;e[51]!==R||e[52]!==K||e[53]!==W?(H=s.jsx("button",{type:"button",onClick:R,"aria-label":K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:W}),e[51]=R,e[52]=K,e[53]=W,e[54]=H):H=e[54];let Q;e[55]!==z||e[56]!==H?(Q=s.jsxs("div",{className:"relative",children:[z,H]}),e[55]=z,e[56]=H,e[57]=Q):Q=e[57];let J;e[58]!==b.apiKey?(J=b.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[58]=b.apiKey,e[59]=J):J=e[59];let X;e[60]!==T||e[61]!==Q||e[62]!==J?(X=s.jsxs("div",{className:"space-y-1",children:[T,Q,J]}),e[60]=T,e[61]=Q,e[62]=J,e[63]=X):X=e[63];let F;e[64]!==I?(F=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[64]=I,e[65]=F):F=e[65];let q;e[66]!==a?(q=a("settings.connectForms.cancel"),e[66]=a,e[67]=q):q=e[67];let Y;e[68]!==M||e[69]!==i||e[70]!==q?(Y=s.jsx(de,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:M,children:q}),e[68]=M,e[69]=i,e[70]=q,e[71]=Y):Y=e[71];let Z;e[72]!==M||e[73]!==a?(Z=a(M?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[72]=M,e[73]=a,e[74]=Z):Z=e[74];let A;e[75]!==M||e[76]!==Z?(A=s.jsx(de,{type:"submit",size:"sm",disabled:M,children:Z}),e[75]=M,e[76]=Z,e[77]=A):A=e[77];let $;e[78]!==Y||e[79]!==A?($=s.jsxs(tt,{children:[Y,A]}),e[78]=Y,e[79]=A,e[80]=$):$=e[80];let G;return e[81]!==O||e[82]!==X||e[83]!==F||e[84]!==$||e[85]!==k?(G=s.jsxs("form",{onSubmit:k,className:"space-y-3",children:[O,X,F,$]}),e[81]=O,e[82]=X,e[83]=F,e[84]=$,e[85]=k,e[86]=G):G=e[86],G}const Cs=Ye({label:je().optional(),baseUrl:je().min(1,"Base URL is required"),apiKey:je().optional()});function Is(l){const e=V.c(105),{preset:t,onCancel:i,onSuccess:n}=l,{org:o}=be(),r=Ce(),c=_e(),[u,d]=U.useState(!1),a=ie();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=Qe(Cs),e[0]=h):h=e[0];const p=t?.defaultBaseUrl??"";let m;e[1]!==p?(m={resolver:h,defaultValues:{label:"",baseUrl:p,apiKey:""}},e[1]=p,e[2]=m):m=e[2];const{register:f,handleSubmit:b,formState:N}=Je(m),{errors:y}=N;let j;e[3]!==t||e[4]!==r?(j=async he=>{const bt=JSON.stringify({baseUrl:he.baseUrl,apiKey:he.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:he.label||t?.name||he.baseUrl,apiKey:bt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let C;e[6]!==n||e[7]!==o||e[8]!==c||e[9]!==a?(C=()=>{c.invalidateQueries({queryKey:fe.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:fe.aiProviders(o.id)}),me.success(a("settings.connectForms.connectionSavedSuccess")),n()},e[6]=n,e[7]=o,e[8]=c,e[9]=a,e[10]=C):C=e[10];let E;e[11]!==a?(E=he=>{me.error(a("settings.connectForms.failedSaveConnection",{error:he.message}))},e[11]=a,e[12]=E):E=e[12];let M;e[13]!==j||e[14]!==C||e[15]!==E?(M={mutationFn:j,onSuccess:C,onError:E},e[13]=j,e[14]=C,e[15]=E,e[16]=M):M=e[16];const{mutate:I,isPending:x,error:k}=ke(M);let w;e[17]!==t||e[18]!==a?(w=t?a("settings.connectForms.labelPlaceholderPreset",{name:t.name}):a("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[17]=t,e[18]=a,e[19]=w):w=e[19];const _=w;let v;e[20]!==t?.baseUrlPlaceholder||e[21]!==a?(v=t?.baseUrlPlaceholder??a("settings.connectForms.baseUrlPlaceholder"),e[20]=t?.baseUrlPlaceholder,e[21]=a,e[22]=v):v=e[22];const g=v;let S;e[23]!==I?(S=he=>I(he),e[23]=I,e[24]=S):S=e[24];let O;e[25]!==b||e[26]!==S?(O=b(S),e[25]=b,e[26]=S,e[27]=O):O=e[27];let D;e[28]!==a?(D=a("settings.connectForms.labelField"),e[28]=a,e[29]=D):D=e[29];let T;e[30]!==D?(T=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:D}),e[30]=D,e[31]=T):T=e[31];let L;e[32]!==f?(L=f("label"),e[32]=f,e[33]=L):L=e[33];let P;e[34]!==_||e[35]!==L?(P=s.jsx(xe,{placeholder:_,...L,className:"h-8 text-sm"}),e[34]=_,e[35]=L,e[36]=P):P=e[36];let z;e[37]!==T||e[38]!==P?(z=s.jsxs("div",{className:"space-y-1",children:[T,P]}),e[37]=T,e[38]=P,e[39]=z):z=e[39];let R;e[40]!==g||e[41]!==y||e[42]!==t?.defaultBaseUrl||e[43]!==f||e[44]!==a?(R=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:a("settings.connectForms.baseUrlField")}),s.jsx(xe,{type:"url",placeholder:g,...f("baseUrl"),className:"h-8 text-sm"}),y.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:y.baseUrl.message})]}),e[40]=g,e[41]=y,e[42]=t?.defaultBaseUrl,e[43]=f,e[44]=a,e[45]=R):R=e[45];let K;e[46]!==a?(K=a("settings.connectForms.apiKeyField"),e[46]=a,e[47]=K):K=e[47];let W;e[48]!==t?.apiKeyRecommended||e[49]!==a?(W=t?.apiKeyRecommended?a("settings.connectForms.recommended"):a("settings.connectForms.optional"),e[48]=t?.apiKeyRecommended,e[49]=a,e[50]=W):W=e[50];let H;e[51]!==W?(H=s.jsxs("span",{className:"text-muted-foreground/60",children:["(",W,")"]}),e[51]=W,e[52]=H):H=e[52];let Q;e[53]!==K||e[54]!==H?(Q=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[K," ",H]}),e[53]=K,e[54]=H,e[55]=Q):Q=e[55];const J=u?"text":"password";let X;e[56]!==f?(X=f("apiKey"),e[56]=f,e[57]=X):X=e[57];let F;e[58]!==J||e[59]!==X?(F=s.jsx(xe,{type:J,placeholder:"sk-...",...X,className:"ph-no-capture h-8 text-sm pr-8"}),e[58]=J,e[59]=X,e[60]=F):F=e[60];let q;e[61]!==u?(q=()=>d(!u),e[61]=u,e[62]=q):q=e[62];let Y;e[63]!==u||e[64]!==a?(Y=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[63]=u,e[64]=a,e[65]=Y):Y=e[65];let Z;e[66]!==u?(Z=u?s.jsx(it,{size:14}):s.jsx(rt,{size:14}),e[66]=u,e[67]=Z):Z=e[67];let A;e[68]!==q||e[69]!==Y||e[70]!==Z?(A=s.jsx("button",{type:"button",onClick:q,"aria-label":Y,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Z}),e[68]=q,e[69]=Y,e[70]=Z,e[71]=A):A=e[71];let $;e[72]!==F||e[73]!==A?($=s.jsxs("div",{className:"relative",children:[F,A]}),e[72]=F,e[73]=A,e[74]=$):$=e[74];let G;e[75]!==Q||e[76]!==$?(G=s.jsxs("div",{className:"space-y-1",children:[Q,$]}),e[75]=Q,e[76]=$,e[77]=G):G=e[77];let B;e[78]!==t?(B=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[78]=t,e[79]=B):B=e[79];let te;e[80]!==k?(te=k&&s.jsx("p",{className:"text-xs text-destructive",children:k.message}),e[80]=k,e[81]=te):te=e[81];let le;e[82]!==a?(le=a("settings.connectForms.cancel"),e[82]=a,e[83]=le):le=e[83];let ne;e[84]!==x||e[85]!==i||e[86]!==le?(ne=s.jsx(de,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:x,children:le}),e[84]=x,e[85]=i,e[86]=le,e[87]=ne):ne=e[87];let oe;e[88]!==x||e[89]!==a?(oe=a(x?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[88]=x,e[89]=a,e[90]=oe):oe=e[90];let re;e[91]!==x||e[92]!==oe?(re=s.jsx(de,{type:"submit",size:"sm",disabled:x,children:oe}),e[91]=x,e[92]=oe,e[93]=re):re=e[93];let ae;e[94]!==ne||e[95]!==re?(ae=s.jsxs(tt,{children:[ne,re]}),e[94]=ne,e[95]=re,e[96]=ae):ae=e[96];let ee;return e[97]!==O||e[98]!==z||e[99]!==R||e[100]!==G||e[101]!==B||e[102]!==te||e[103]!==ae?(ee=s.jsxs("form",{onSubmit:O,className:"space-y-3",children:[z,R,G,B,te,ae]}),e[97]=O,e[98]=z,e[99]=R,e[100]=G,e[101]=B,e[102]=te,e[103]=ae,e[104]=ee):ee=e[104],ee}const _s={kind:"closed"};function Ms(l,e){switch(e.type){case"open":return l.kind==="closed"?{kind:"grid"}:l;case"close":return{kind:"closed"};case"back":switch(l.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return l}case"select-form":return l.kind!=="grid"?l:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return l.kind!=="grid"?l:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return l.kind==="oauth-pending"?{kind:"grid"}:l;case"select-provision":return l.kind!=="grid"?l:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return l.kind!=="provision-pending"?l:{kind:"provision-error",providerId:l.providerId,error:e.error};case"retry-provision":return l.kind!=="provision-error"?l:{kind:"provision-pending",providerId:l.providerId}}}function Es(l){switch(l.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return l.providerId;default:return null}}function Os({open:l,onOpenChange:e,initialProvider:t}){const i=ie(),o=Ae()?.providers??[],{org:r}=be(),c=Ce(),u=_e(),[d,a]=U.useReducer(Ms,_s),h=U.useRef(!1);U.useEffect(()=>{l&&d.kind==="closed"?a({type:"open"}):!l&&d.kind!=="closed"&&a({type:"close"})},[l,d.kind]);const p=()=>{h.current=!1,a({type:"close"}),e(!1)},m=()=>{u.invalidateQueries({queryKey:fe.aiProviderKeys(r.id)}),u.invalidateQueries({queryKey:fe.aiProviders(r.id)})},{mutate:f}=ke({mutationFn:async({providerId:v,code:g,stateToken:S,label:O})=>(await c.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:v,code:g,stateToken:S,label:O}),v),onSuccess:v=>{ue("ai_provider_oauth_succeeded",{provider_id:v}),m();const g=o.find(S=>S.id===v);me.success(i("settings.connectProviderDialog.oauthSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(v,g)=>{ue("ai_provider_oauth_failed",{provider_id:g.providerId,error:v.message}),me.error(i("settings.connectProviderDialog.oauthFailedMessage",{error:v.message})),a({type:"oauth-failed"})}}),{mutate:b}=ke({mutationFn:async v=>(await c.call("AI_PROVIDER_PROVISION_KEY",{providerId:v}),v),onSuccess:v=>{ue("ai_provider_provision_succeeded",{provider_id:v}),m();const g=o.find(S=>S.id===v);me.success(i("settings.connectProviderDialog.provisionSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(v,g)=>{ue("ai_provider_provision_failed",{provider_id:g,error:v.message}),a({type:"provision-error",error:v.message})}}),N=async v=>{const{provider:g}=v,S=v.kind==="openai-compatible"?v.preset?.id??null:null,O=g.supportedMethods.includes("oauth-pkce"),D=g.supportedMethods.includes("api-key");if(g.supportsProvision===!0){ue("ai_provider_connect_clicked",{provider_id:g.id,method:"provision"}),a({type:"select-provision",providerId:g.id}),b(g.id);return}if(O){ue("ai_provider_connect_clicked",{provider_id:g.id,method:"oauth-pkce"});try{const L=await c.call("AI_PROVIDER_OAUTH_URL",{providerId:g.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!L?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");a({type:"select-oauth",providerId:g.id,stateToken:L.stateToken}),window.open(L.url,"AiProviderOAuth","width=600,height=700")}catch(L){me.error(i("settings.connectProviderDialog.startOAuthFailedMessage",{error:L instanceof Error?L.message:String(L)}))}return}D&&(ue("ai_provider_connect_clicked",{provider_id:g.id,...S!==null?{preset_id:S}:{},method:"api-key"}),a({type:"select-form",providerId:g.id,presetId:S}))},y=U.useRef(N);y.current=N;const j=U.useRef(t);j.current=t,U.useEffect(()=>{!j.current||d.kind!=="grid"||h.current||(h.current=!0,y.current(j.current))},[d.kind]);const C=d.kind==="oauth-pending"?d.stateToken:null,E=d.kind==="oauth-pending"?d.providerId:null;U.useEffect(()=>{if(d.kind!=="oauth-pending")return;let v=!1;const g=d.stateToken,S=d.providerId,O=T=>{if(T.origin!==window.location.origin||T.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:L,stateToken:P}=T.data;if(P!==g){me.error(i("settings.connectProviderDialog.securityCheckFailedMessage")),a({type:"oauth-failed"});return}v=!0;const z=o.find(R=>R.id===S);f({providerId:S,code:L,stateToken:g,label:z?.name??S})};window.addEventListener("message",O);const D=setTimeout(()=>{v||(ue("ai_provider_oauth_timeout",{provider_id:S}),a({type:"oauth-failed"}),me.error(i("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(D)}},[d.kind,C,E,f]);const M=Es(d),I=M?o.find(v=>v.id===M):null,k=(d.kind==="form"&&d.presetId?Se(d.presetId):null)?.name??I?.name??i("settings.connectProviderDialog.defaultTitle"),w=d.kind!=="grid"&&d.kind!=="closed",_=()=>{t?p():a({type:"back"})};return s.jsx(Me,{open:d.kind!=="closed",onOpenChange:v=>!v&&p(),children:s.jsxs(Ee,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ze,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[w&&s.jsx(de,{variant:"ghost",size:"icon","aria-label":i("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:_,children:s.jsx(lt,{size:16})}),s.jsx(Oe,{children:k})]}),d.kind==="grid"&&!t&&s.jsx(et,{children:i("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&s.jsx(dt,{providers:o,onSelect:N}),d.kind==="form"&&(d.providerId==="openai-compatible"?s.jsx(Is,{preset:d.presetId?Se(d.presetId):void 0,onCancel:()=>a({type:"back"}),onSuccess:()=>{m(),p()}}):s.jsx(ws,{providerId:d.providerId,onCancel:()=>a({type:"back"}),onSuccess:()=>{m(),p()}})),d.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ie,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:i("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ie,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Yt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(de,{variant:"outline",size:"sm",onClick:()=>a({type:"back"}),children:i("settings.connectProviderDialog.backButton")}),s.jsx(de,{size:"sm",onClick:()=>{a({type:"retry-provision"}),b(d.providerId)},children:i("settings.connectProviderDialog.retryButton")})]})]})]})})}function Ls(){const l=V.c(7),{org:e}=be(),t=Ce();let i;l[0]!==e.id?(i=fe.defaultBrand(e.id),l[0]=e.id,l[1]=i):i=l[1];let n;l[2]!==t?(n=async()=>{const{items:c}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(c)?c:[]).find(As)??null},l[2]=t,l[3]=n):n=l[3];let o;l[4]!==i||l[5]!==n?(o={queryKey:i,queryFn:n},l[4]=i,l[5]=n,l[6]=o):o=l[6];const{data:r}=St(o);return r??null}function As(l){return l.isDefault&&!l.archivedAt}function Ts(l){const e=l.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)),i=t?t.value:e[0]?.value;return typeof i=="string"?i:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function Ds(l){const e=V.c(74);let t;e[0]!==l?(t=l===void 0?{}:l,e[0]=l,e[1]=t):t=e[1];const{title:i,description:n,onLocalRuntimePicked:o}=t,r=ie(),{org:c}=be(),{localMode:u}=jt(),d=Ls(),a=st(),h=Lt(),[p,m]=U.useState(null),[f,b]=U.useState(!1),[N,y]=U.useState(!1),[j,C]=U.useState(!1),E=ts();let M;e[2]!==E||e[3]!==a.online?(M=Zt()&&!E&&!a.online,e[2]=E,e[3]=a.online,e[4]=M):M=e[4];const I=M,x=Ae();let k;e[5]!==x?.providers?(k=x?.providers??[],e[5]=x?.providers,e[6]=k):k=e[6];const w=k;let _,v,g;if(e[7]!==d||e[8]!==h||e[9]!==n||e[10]!==a.capabilities||e[11]!==a.online||e[12]!==u||e[13]!==I||e[14]!==o||e[15]!==c.name||e[16]!==r||e[17]!==i){const H=[];if(a.online){if(a.capabilities.includes("claude-code")){let ee;e[21]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(ge,{size:16}),e[21]=ee):ee=e[21],H.push({option:"claude-code-desktop",label:"Claude Code",icon:ee})}if(a.capabilities.includes("codex")){let ee;e[22]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(ve,{size:16}),e[22]=ee):ee=e[22],H.push({option:"codex-desktop",label:"Codex",icon:ee})}}const Q=H.length>0&&h!==null,J=c.name;let X;e[23]!==d?(X=d?Ts(d):null,e[23]=d,e[24]=X):X=e[24];const F=X,q=d?.favicon??d?.logo??null;let Y;e[25]!==J||e[26]!==r||e[27]!==i?(Y=i??(J?r("chat.noAiProviderEmptyState.headingWithOrg",{org:J}):r("chat.noAiProviderEmptyState.headingDefault")),e[25]=J,e[26]=r,e[27]=i,e[28]=Y):Y=e[28];const Z=Y;let A;e[29]!==n||e[30]!==Q||e[31]!==u||e[32]!==r?(A=n??r(Q?"chat.noAiProviderEmptyState.subtitleWithDesktop":u?"chat.noAiProviderEmptyState.subtitleLocalMode":"chat.noAiProviderEmptyState.subtitleDefault"),e[29]=n,e[30]=Q,e[31]=u,e[32]=r,e[33]=A):A=e[33];const $=A,G=!!(q||F);let B;e[34]!==F?(B=F?{backgroundColor:`${F}18`,borderColor:`${F}30`}:void 0,e[34]=F,e[35]=B):B=e[35];const te=B,le=G?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";_="flex flex-col items-center gap-8 w-full max-w-3xl px-4";let ne;e[36]!==le||e[37]!==te||e[38]!==q||e[39]!==a.online||e[40]!==I||e[41]!==F||e[42]!==r?(ne=q?s.jsx("div",{className:le,style:te,children:s.jsx("img",{src:q,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>I?C(!0):y(!0),"aria-label":I?r("downloadApp.openLabel"):a.online?r("chat.noAiProviderEmptyState.desktopLinkedLabel"):r("chat.noAiProviderEmptyState.connectDesktopLabel"),className:ce(le,"cursor-pointer transition-colors hover:bg-accent"),style:te,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Xt,{size:24,style:F?{color:F}:void 0,className:ce(!F&&"text-muted-foreground")}),a.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[36]=le,e[37]=te,e[38]=q,e[39]=a.online,e[40]=I,e[41]=F,e[42]=r,e[43]=ne):ne=e[43];let oe;e[44]!==Z?(oe=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:Z}),e[44]=Z,e[45]=oe):oe=e[45];let re;e[46]!==$?(re=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:$}),e[46]=$,e[47]=re):re=e[47];let ae;e[48]!==oe||e[49]!==re?(ae=s.jsxs("div",{className:"space-y-2",children:[oe,re]}),e[48]=oe,e[49]=re,e[50]=ae):ae=e[50],e[51]!==ne||e[52]!==ae?(v=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[ne,ae]}),e[51]=ne,e[52]=ae,e[53]=v):v=e[53],g=Q&&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:H.map(ee=>s.jsxs(de,{variant:"default",className:"gap-2",onClick:()=>{h?.setPendingAgentOption(ee.option),o?.(ee.option)},children:[ee.icon,r("chat.noAiProviderEmptyState.useLabel",{label:ee.label})]},ee.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"}),r("chat.noAiProviderEmptyState.orConnectProvider"),s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[7]=d,e[8]=h,e[9]=n,e[10]=a.capabilities,e[11]=a.online,e[12]=u,e[13]=I,e[14]=o,e[15]=c.name,e[16]=r,e[17]=i,e[18]=_,e[19]=v,e[20]=g}else _=e[18],v=e[19],g=e[20];let S,O;e[54]===Symbol.for("react.memo_cache_sentinel")?(S=H=>m(H),O=()=>b(!0),e[54]=S,e[55]=O):(S=e[54],O=e[55]);let D;e[56]!==w?(D=s.jsx("div",{className:"w-full",children:s.jsx(dt,{providers:w,onSelect:S,onShowAll:O})}),e[56]=w,e[57]=D):D=e[57];const T=p!==null||f;let L;e[58]===Symbol.for("react.memo_cache_sentinel")?(L=H=>{H||(m(null),b(!1))},e[58]=L):L=e[58];const P=p??void 0;let z;e[59]!==T||e[60]!==P?(z=s.jsx(Os,{open:T,onOpenChange:L,initialProvider:P}),e[59]=T,e[60]=P,e[61]=z):z=e[61];let R;e[62]!==N?(R=s.jsx(rs,{open:N,onOpenChange:y}),e[62]=N,e[63]=R):R=e[63];let K;e[64]!==j?(K=s.jsx(es,{open:j,onOpenChange:C}),e[64]=j,e[65]=K):K=e[65];let W;return e[66]!==z||e[67]!==R||e[68]!==K||e[69]!==_||e[70]!==v||e[71]!==g||e[72]!==D?(W=s.jsxs("div",{className:_,children:[v,g,D,z,R,K]}),e[66]=z,e[67]=R,e[68]=K,e[69]=_,e[70]=v,e[71]=g,e[72]=D,e[73]=W):W=e[73],W}function De(l){const e=l.title.includes(": ");return{provider:e?l.title.split(": ")[0]??"":l.modelId.split("/")[0]??"",displayName:e?l.title.split(": ").slice(1).join(": "):l.title}}function Ps(l){return l<32e3?{level:1,labelKey:"chat.shared.contextLevelSmall",descriptionKey:"chat.shared.contextLevelSmallDesc"}:l<2e5?{level:2,labelKey:"chat.shared.contextLevelMedium",descriptionKey:"chat.shared.contextLevelMediumDesc"}:l<5e5?{level:3,labelKey:"chat.shared.contextLevelLarge",descriptionKey:"chat.shared.contextLevelLargeDesc"}:{level:4,labelKey:"chat.shared.contextLevelVeryLarge",descriptionKey:"chat.shared.contextLevelVeryLargeDesc"}}const zs=["bg-destructive","bg-warning","bg-success","bg-success"],Rs=["text-success","text-warning","text-warning","text-destructive"];function Ks(l,e){const t=Math.round(l*.75/1e3),i=t>=1?`${t}K`:`${Math.round(l*.75)}`;return e("chat.shared.approxWords",{wordCount:i})}function Fs(l){return l<1?{level:1,labelKey:"chat.shared.costLevelCheap"}:l<5?{level:2,labelKey:"chat.shared.costLevelModerate"}:l<15?{level:3,labelKey:"chat.shared.costLevelHigh"}:{level:4,labelKey:"chat.shared.costLevelExpensive"}}const $s={text:{icon:s.jsx(Wt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityText"},vision:{icon:s.jsx(Bt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityVision"},image:{icon:s.jsx(Kt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityImage"},tools:{icon:s.jsx(Ut,{className:"size-3.5"}),labelKey:"chat.shared.capabilityTools"},reasoning:{icon:s.jsx(ls,{className:"size-3.5"}),labelKey:"chat.shared.capabilityReasoning"},"web-search":{icon:s.jsx(nt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityWebSearch"}};function Us(l){const e=V.c(10),{capability:t}=l,i=ie(),n=$s[t];if(n){const u=n.icon;let d;e[0]!==n.labelKey||e[1]!==i?(d=i(n.labelKey),e[0]=n.labelKey,e[1]=i,e[2]=d):d=e[2];let a;return e[3]!==n.icon||e[4]!==d?(a=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:[u,d]}),e[3]=n.icon,e[4]=d,e[5]=a):a=e[5],a}let o;e[6]!==t?(o=t.charAt(0).toUpperCase(),e[6]=t,e[7]=o):o=e[7];const r=o+t.slice(1);let c;return e[8]!==r?(c=s.jsx("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:r}),e[8]=r,e[9]=c):c=e[9],c}function Bs(l){const e=V.c(59),{model:t,compact:i}=l,n=i===void 0?!1:i,o=ie();if(!t){let x;e[0]!==o?(x=o("chat.shared.hoverToPreview"),e[0]=o,e[1]=x):x=e[1];let k;return e[2]!==x?(k=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:x}),e[2]=x,e[3]=k):k=e[3],k}const r=t.costs?.input!=null?t.costs.input*1e6:null,c=t.costs?.output!=null?t.costs.output*1e6:null;let u;e[4]!==t?(u=De(t),e[4]=t,e[5]=u):u=e[5];const{provider:d,displayName:a}=u;if(n){let x;e[6]!==t.limits||e[7]!==o?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.context")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," ",o("chat.shared.tokens")]})]}),e[6]=t.limits,e[7]=o,e[8]=x):x=e[8];let k;e[9]!==r||e[10]!==o?(k=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.input")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[9]=r,e[10]=o,e[11]=k):k=e[11];let w;e[12]!==c||e[13]!==o?(w=c!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.output")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",c.toFixed(2)," / 1M"]})]}),e[12]=c,e[13]=o,e[14]=w):w=e[14];let _;e[15]!==t.limits||e[16]!==o?(_=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.outputLimit")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," ",o("chat.shared.tokens")]})]}),e[15]=t.limits,e[16]=o,e[17]=_):_=e[17];let v;return e[18]!==x||e[19]!==k||e[20]!==w||e[21]!==_?(v=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,k,w,_]}),e[18]=x,e[19]=k,e[20]=w,e[21]=_,e[22]=v):v=e[22],v}let h;e[23]!==d?(h=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[23]=d,e[24]=h):h=e[24];let p;e[25]!==t.logo||e[26]!==t.title?(p=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[25]=t.logo,e[26]=t.title,e[27]=p):p=e[27];let m;e[28]!==a?(m=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:a}),e[28]=a,e[29]=m):m=e[29];let f;e[30]!==p||e[31]!==m?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,m]}),e[30]=p,e[31]=m,e[32]=f):f=e[32];let b;e[33]!==t.modelId?(b=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[33]=t.modelId,e[34]=b):b=e[34];let N;e[35]!==h||e[36]!==f||e[37]!==b?(N=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[h,f,b]}),e[35]=h,e[36]=f,e[37]=b,e[38]=N):N=e[38];let y;e[39]!==t.capabilities?(y=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(Ws)}),e[39]=t.capabilities,e[40]=y):y=e[40];let j;e[41]!==t.limits||e[42]!==o?(j=t.limits?.contextWindow&&(()=>{const{level:x,labelKey:k,descriptionKey:w}=Ps(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:o("chat.shared.contextWindow")}),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(_=>s.jsx("div",{className:ce("w-2 h-2 rounded-full",_<=x?zs[x-1]:"bg-muted")},_))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:o(k)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",o(w)]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," ",o("chat.shared.tokens")]})]})})(),e[41]=t.limits,e[42]=o,e[43]=j):j=e[43];let C;e[44]!==t.limits||e[45]!==o?(C=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:o("chat.shared.outputLimit")}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," ",o("chat.shared.tokens")]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:Ks(t.limits.maxOutputTokens,o)})]})]}),e[44]=t.limits,e[45]=o,e[46]=C):C=e[46];let E;e[47]!==r||e[48]!==c||e[49]!==o?(E=(r!=null||c!=null)&&(()=>{const{level:x,labelKey:k}=r!=null?Fs(r):{level:0,labelKey:null};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.pricing")}),r!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(w=>s.jsx("span",{className:ce("text-sm font-bold leading-none",w<=x?Rs[x-1]:"text-muted-foreground/20"),children:"$"},w))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k?o(k):""})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.shared.input")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M"," ",o("chat.shared.tokens")]})]}),c!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.shared.output")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",c.toFixed(2)," / 1M"," ",o("chat.shared.tokens")]})]})]})]})})(),e[47]=r,e[48]=c,e[49]=o,e[50]=E):E=e[50];let M;e[51]!==j||e[52]!==C||e[53]!==E?(M=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,C,E]}),e[51]=j,e[52]=C,e[53]=E,e[54]=M):M=e[54];let I;return e[55]!==M||e[56]!==N||e[57]!==y?(I=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[N,y,M]}),e[55]=M,e[56]=N,e[57]=y,e[58]=I):I=e[58],I}function Ws(l){return s.jsx(Us,{capability:l},l)}function ut(l){const e=V.c(22),{model:t,placeholder:i,isLoading:n}=l,o=n===void 0?!1:n,r=ie();let c;e[0]!==i||e[1]!==r?(c=i??r("chat.shared.selectModel"),e[0]=i,e[1]=r,e[2]=c):c=e[2];const u=c;if(o){let y;return e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(se,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(se,{className:"w-16 h-3 hidden md:block"})]}),e[3]=y):y=e[3],y}if(!t){let y;e[4]!==u?(y=s.jsx("span",{className:"text-sm text-muted-foreground",children:u}),e[4]=u,e[5]=y):y=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ke,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[6]=j):j=e[6];let C;return e[7]!==y?(C=s.jsxs("div",{className:"flex items-center gap-1.5",children:[y,j]}),e[7]=y,e[8]=C):C=e[8],C}let d;e[9]!==t?(d=De(t),e[9]=t,e[10]=d):d=e[10];const{displayName:a}=d;let h;e[11]!==t?(h=Te(t),e[11]=t,e[12]=h):h=e[12];const p=h;let m;e[13]!==t.title||e[14]!==p?(m=s.jsx("img",{src:p,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[13]=t.title,e[14]=p,e[15]=m):m=e[15];let f;e[16]!==a?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:a}),e[16]=a,e[17]=f):f=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ke,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[18]=b):b=e[18];let N;return e[19]!==m||e[20]!==f?(N=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,f,b]}),e[19]=m,e[20]=f,e[21]=N):N=e[21],N}const Vs=["vision","image","file","audio","video"],mt=["image/png","image/jpeg","image/gif","image/webp"],ht=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function Pe(l){const e=l?.capabilities;return e?Vs.some(t=>e.includes(t)):!1}function ol(l,e){if(!l)return!1;if(l.startsWith("text/"))return!0;const t=e?.capabilities??[],i=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(i&&mt.includes(l)||n&&l==="application/pdf"||o&&l.startsWith("audio/")||r&&l.startsWith("video/")||Pe(e)&&ht.includes(l))}function rl(l){const e=l?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...mt),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),Pe(l)&&t.push(...ht),t.join(",")}function al(l){const e=l?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("chat.shared.fileTypeImages"),e.includes("file")&&t.push("chat.shared.fileTypePdfs"),e.includes("audio")&&t.push("chat.shared.fileTypeAudio"),e.includes("video")&&t.push("chat.shared.fileTypeVideo"),Pe(l)&&t.push("chat.shared.fileTypeOffice"),{parts:t,count:t.length}}const ft=["smarter","faster","cheaper"],Hs={smarter:"chat.decopilot.tierSmarter",faster:"chat.decopilot.tierFaster",cheaper:"chat.decopilot.tierCheaper"},qs=[{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"]}],Gs=qs.flatMap(({tier:l,prefixes:e})=>e.map(t=>({tier:l,prefix:t}))).sort((l,e)=>e.prefix.length-l.prefix.length),Xs="google/gemini-2.5-pro",qe=new Map;function Ys(l){const e=qe.get(l);if(e!==void 0)return e;let t=null;if(l.endsWith(":free"))t="cheaper";else for(const{tier:i,prefix:n}of Gs)if(l.startsWith(n)){if(n===Xs&&l.length>n.length&&l[n.length]==="-"){const r=l[n.length+1];if(!r||!/\d/.test(r))continue}t=i;break}return qe.set(l,t),t}function Ge(l){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of l){const i=Ys(t.modelId);e[i??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((i,n)=>i.title.localeCompare(n.title));return e}const pt="studio:model-shortlist:",Qs=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 Js(l){try{const e=localStorage.getItem(pt+l);return e?new Set(JSON.parse(e)):null}catch{return null}}function Zs(l,e){localStorage.setItem(pt+l,JSON.stringify([...e]))}function ei(l){const e=V.c(21),{model:t,onHover:i}=l;let n;e[0]!==t?(n=De(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let c;e[2]!==t?(c=Te(t),e[2]=t,e[3]=c):c=e[3];const u=c;let d;e[4]!==t||e[5]!==i?(d=()=>i(t),e[4]=t,e[5]=i,e[6]=d):d=e[6];let a;e[7]!==t.title||e[8]!==u?(a=s.jsx("img",{src:u,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]=u,e[9]=a):a=e[9];let h;e[10]!==o?(h=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=h):h=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 m;e[14]!==h||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[h,p]}),e[14]=h,e[15]=p,e[16]=m):m=e[16];let f;return e[17]!==d||e[18]!==a||e[19]!==m?(f=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[a,m]}),e[17]=d,e[18]=a,e[19]=m,e[20]=f):f=e[20],f}function ti(l){const e=V.c(16),{error:t,onRetry:i}=l,n=ie();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(wt,{className:"size-5 text-destructive"})}),e[0]=o):o=e[0];const r=n("chat.decopilot.failedToLoadModels");let c;e[1]!==r?(c=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),e[1]=r,e[2]=c):c=e[2];const u=t?.message||n("chat.decopilot.couldNotFetchModels"),d=" "+n("chat.decopilot.tryAnotherProviderOrRetry");let a;e[3]!==u||e[4]!==d?(a=s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[u,d]}),e[3]=u,e[4]=d,e[5]=a):a=e[5];let h;e[6]!==c||e[7]!==a?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[c,a]}),e[6]=c,e[7]=a,e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx($t,{className:"size-3.5"}),e[9]=p):p=e[9];const m=n("chat.decopilot.retry");let f;e[10]!==i||e[11]!==m?(f=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(de,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[p,m]})}),e[10]=i,e[11]=m,e[12]=f):f=e[12];let b;return e[13]!==f||e[14]!==h?(b=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[o,h,f]}),e[13]=f,e[14]=h,e[15]=b):b=e[15],b}function si(){const l=V.c(1);let e;return l[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(ii)}),l[0]=e):e=l[0],e}function ii(l,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(se,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(se,{className:"flex-1 h-4"}),s.jsx(se,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Xe(l){const e=V.c(12),{label:t,models:i,onSelect:n,onHover:o}=l;if(i.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 c;if(e[2]!==i||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=a=>s.jsx("div",{onClick:()=>n(a),className:"cursor-pointer",children:s.jsx(ei,{model:a,onHover:o})},a.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],c=i.map(d),e[2]=i,e[3]=o,e[4]=n,e[5]=c}else c=e[5];let u;return e[9]!==r||e[10]!==c?(u=s.jsxs("div",{children:[r,c]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function we(l,e){return e(l==="other"?"chat.decopilot.tierOther":Hs[l])}function li(l){const e=V.c(21),{model:t,isChecked:i,onToggle:n,onHover:o}=l,[r,c]=U.useState(i);r!==i&&c(i);let u;e[0]!==t?(u=Te(t),e[0]=t,e[1]=u):u=e[1];const d=u;let a;e[2]!==t||e[3]!==o?(a=()=>o(t),e[2]=t,e[3]=o,e[4]=a):a=e[4];let h;e[5]!==t.modelId||e[6]!==n?(h=()=>{c(ni),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=h):h=e[7];let p;e[8]!==r||e[9]!==h?(p=s.jsx(At,{checked:r,onCheckedChange:h}),e[8]=r,e[9]=h,e[10]=p):p=e[10];let m;e[11]!==d||e[12]!==t.title?(m=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]=m):m=e[13];let f;e[14]!==t.title?(f=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]=f):f=e[15];let b;return e[16]!==a||e[17]!==p||e[18]!==m||e[19]!==f?(b=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:a,children:[p,m,f]}),e[16]=a,e[17]=p,e[18]=m,e[19]=f,e[20]=b):b=e[20],b}function ni(l){return!l}function oi(l,e){const t=[];for(const i of ft)if(l[i].length>0){t.push({type:"header",label:we(i,e)});for(const n of l[i])t.push({type:"model",model:n})}if(l.other.length>0){t.push({type:"header",label:we("other",e)});for(const i of l.other)t.push({type:"model",model:i})}return t}function ri({items:l,shortlistSet:e,onToggle:t,onHover:i}){const n=U.useRef(null),o=bs({count:l.length,getScrollElement:()=>n.current,estimateSize:r=>l[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 c=l[r.index];return c?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:c.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:c.label}):s.jsx(li,{model:c.model,isChecked:e.has(c.model.modelId),onToggle:t,onHover:i})},r.key):null})})})}function ai(l){const e=V.c(30),{keyId:t,searchTerm:i,onHover:n,onModelSelect:o,managing:r,onToggleManage:c,filterModels:u}=l,d=ie(),{models:a}=Gt(t),h=u?a.filter(u):a.filter(ci);let p;e[0]!==t?(p=()=>(t?Js(t):null)??Qs,e[0]=t,e[1]=p):p=e[1];const[m,f]=U.useState(p),[,b]=U.useTransition();let N;e[2]!==t||e[3]!==b?(N=g=>{t&&b(()=>{f(S=>{const O=new Set(S);return O.has(g)?O.delete(g):O.add(g),Zs(t,O),O})})},e[2]=t,e[3]=b,e[4]=N):N=e[4];const y=N,j=i.toLowerCase().trim(),C=g=>j?g.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):g;if(r){const g=Ge(C(h)),S=oi(g,d);let O;e[5]!==m?(O=z=>m.has(z.modelId),e[5]=m,e[6]=O):O=e[6];const D=h.filter(O).length;let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(lt,{size:14}),e[7]=T):T=e[7];let L;e[8]!==d?(L=d("chat.decopilot.back"),e[8]=d,e[9]=L):L=e[9];let P;return e[10]!==c||e[11]!==L?(P=s.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[T,L]}),e[10]=c,e[11]=L,e[12]=P):P=e[12],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:[P,s.jsx("span",{className:"text-xs text-muted-foreground",children:d("chat.decopilot.selectedCount",{count:D})})]}),s.jsx(ri,{items:S,shortlistSet:m,onToggle:y,onHover:n})]})}let E;e[13]!==m?(E=g=>m.has(g.modelId),e[13]=m,e[14]=E):E=e[14];const M=h.filter(E),I=M.length>0?M:h,x=Ge(C(I));let k;e[15]!==x||e[16]!==n||e[17]!==o||e[18]!==d?(k=ft.map(g=>s.jsx(Xe,{label:we(g,d),models:x[g],onSelect:o,onHover:n},g)),e[15]=x,e[16]=n,e[17]=o,e[18]=d,e[19]=k):k=e[19];let w;e[20]!==d?(w=we("other",d),e[20]=d,e[21]=w):w=e[21];let _;e[22]!==x.other||e[23]!==n||e[24]!==o||e[25]!==w?(_=s.jsx(Xe,{label:w,models:x.other,onSelect:o,onHover:n}),e[22]=x.other,e[23]=n,e[24]=o,e[25]=w,e[26]=_):_=e[26];let v;return e[27]!==k||e[28]!==_?(v=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,_]}),e[27]=k,e[28]=_,e[29]=v):v=e[29],v}function ci(l){return l.asyncResearch!==!0}function di(){const l=V.c(6);let e;l[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(se,{className:"size-4 shrink-0"}),s.jsx(se,{className:"flex-1 h-6"}),s.jsx(se,{className:"w-[140px] h-8 shrink-0"})]})}),l[0]=e):e=l[0];let t;l[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(ui)})]}),l[1]=t):t=l[1];let i;l[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(se,{className:"size-6 shrink-0"}),s.jsx(se,{className:"h-6 w-32"})]}),l[2]=i):i=l[2];let n;l[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[i,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{className:"h-6 w-20 rounded-md"}),s.jsx(se,{className:"h-6 w-24 rounded-md"})]})]}),l[3]=n):n=l[3];let o;l[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(se,{className:"h-4 w-24"}),s.jsx(se,{className:"h-4 w-32"})]}),l[4]=o):o=l[4];let r;return l[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(se,{className:"h-4 w-16"}),s.jsx(se,{className:"h-4 w-40"})]})]})]})})]}),l[5]=r):r=l[5],r}function ui(l,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(se,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(se,{className:"flex-1 h-4"}),s.jsx(se,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function xt(l){const e=V.c(66),{onClose:t,credentialId:i,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:c,compact:u}=l,d=ie(),[a,h]=U.useState(null),[p,m]=U.useState(""),[f,b]=U.useState(!1),N=U.useRef(null),y=Ae(),j=qt();let C;e[0]!==y?.providers?(C=Object.fromEntries((y?.providers??[]).map(fi)),e[0]=y?.providers,e[1]=C):C=e[1];const E=C,M=Nt(),{org:I}=be();let x;e[2]!==n?(x=A=>{n(A),h(null)},e[2]=n,e[3]=x):x=e[3];const k=x;let w;e[4]!==i||e[5]!==t||e[6]!==r?(w=A=>{i&&(r(A),m(""),t())},e[4]=i,e[5]=t,e[6]=r,e[7]=w):w=e[7];const _=w;if(j.length===0){const A=!u&&"sm:w-[740px]";let $;e[8]!==A?($=ce("flex items-center justify-center p-8 w-full",A),e[8]=A,e[9]=$):$=e[9];let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Ds,{}),e[10]=G):G=e[10];let B;return e[11]!==$?(B=s.jsx("div",{className:$,children:G}),e[11]=$,e[12]=B):B=e[12],B}const v=u?"sm:h-[420px]":"sm:h-[460px]";let g;e[13]!==v?(g=ce("flex flex-col md:flex-row h-full min-h-0",v),e[13]=v,e[14]=g):g=e[14];const S=u?"w-full":"md:border-r md:w-[420px] md:min-w-[420px]";let O;e[15]!==S?(O=ce("flex-1 flex flex-col min-h-0 overflow-hidden",S),e[15]=S,e[16]=O):O=e[16];let D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(nt,{size:16,className:"text-muted-foreground shrink-0"}),e[17]=D):D=e[17];let T;e[18]!==f||e[19]!==d?(T=d(f?"chat.decopilot.searchAllModels":"chat.decopilot.searchForModel"),e[18]=f,e[19]=d,e[20]=T):T=e[20];let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=A=>m(A.target.value),e[21]=L):L=e[21];let P;e[22]!==p||e[23]!==T?(P=s.jsx(xe,{ref:N,type:"text",placeholder:T,value:p,onChange:L,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[22]=p,e[23]=T,e[24]=P):P=e[24];let z;e[25]!==i||e[26]!==k||e[27]!==j||e[28]!==E||e[29]!==d?(z=j.length>0&&s.jsxs(Tt,{value:i??"",onValueChange:k,children:[s.jsxs(Dt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:hi,children:[s.jsx(Pt,{placeholder:d("chat.decopilot.key"),children:(()=>{const A=j.find(le=>le.id===i),$=A?E[A.providerId]:void 0,G=Se(A?.presetId),B=G?.logo??$?.logo,te=G?.name??$?.name??A?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[B?s.jsx("img",{src:B,alt:te,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:te.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:te})]})})()}),s.jsx(Vt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(zt,{children:j.map(A=>{const $=E[A.providerId],G=Se(A.presetId),B=G?.logo??$?.logo,te=G?.name??$?.name??A.providerId;return s.jsx(Rt,{value:A.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[B?s.jsx("img",{src:B,alt:te,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:te.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[te," — ",A.label]})]})},A.id)})})]}),e[25]=i,e[26]=k,e[27]=j,e[28]=E,e[29]=d,e[30]=z):z=e[30];let R;e[31]!==P||e[32]!==z?(R=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:[D,P,z]})}),e[31]=P,e[32]=z,e[33]=R):R=e[33];let K;e[34]!==i?(K=A=>{const{error:$,resetError:G}=A;return s.jsx(ti,{error:$,onRetry:G,credentialId:i??void 0})},e[34]=i,e[35]=K):K=e[35];let W;e[36]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(si,{}),e[36]=W):W=e[36];const H=i??void 0;let Q;e[37]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>b(mi),e[37]=Q):Q=e[37];let J;e[38]!==c||e[39]!==_||e[40]!==f||e[41]!==p||e[42]!==H?(J=s.jsx(U.Suspense,{fallback:W,children:s.jsx(ai,{keyId:H,searchTerm:p,onHover:h,onModelSelect:_,managing:f,onToggleManage:Q,filterModels:c})}),e[38]=c,e[39]=_,e[40]=f,e[41]=p,e[42]=H,e[43]=J):J=e[43];let X;e[44]!==i||e[45]!==K||e[46]!==J?(X=s.jsx(kt,{fallback:K,children:J},i),e[44]=i,e[45]=K,e[46]=J,e[47]=X):X=e[47];let F;e[48]!==f||e[49]!==M||e[50]!==I||e[51]!==d?(F=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>U.startTransition(()=>b(!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(Ft,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageModels")]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>M({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(Ht,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageApiKeys")]})]}),e[48]=f,e[49]=M,e[50]=I,e[51]=d,e[52]=F):F=e[52];let q;e[53]!==R||e[54]!==X||e[55]!==F||e[56]!==O?(q=s.jsxs("div",{className:O,children:[R,X,F]}),e[53]=R,e[54]=X,e[55]=F,e[56]=O,e[57]=q):q=e[57];let Y;e[58]!==u||e[59]!==a||e[60]!==o?(Y=!u&&s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Bs,{model:a??o??null})}),e[58]=u,e[59]=a,e[60]=o,e[61]=Y):Y=e[61];let Z;return e[62]!==q||e[63]!==Y||e[64]!==g?(Z=s.jsxs("div",{className:g,children:[q,Y]}),e[62]=q,e[63]=Y,e[64]=g,e[65]=Z):Z=e[65],Z}function mi(l){return!l}function hi(l){return l.stopPropagation()}function fi(l){return[l.id,l]}function pi(l){const e=V.c(12),{onClose:t}=l,{credentialId:i,setCredentialId:n,selectedModel:o,setModel:r}=Le();let c;e[0]!==n?(c=a=>{ue("chat_credential_changed",{credential_id:a}),n(a)},e[0]=n,e[1]=c):c=e[1];let u;e[2]!==i||e[3]!==o?.modelId||e[4]!==r?(u=a=>{i&&(ue("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:a.modelId,to_model_provider:a.providerId??null,credential_id:i}),r({...a,keyId:i}))},e[2]=i,e[3]=o?.modelId,e[4]=r,e[5]=u):u=e[5];let d;return e[6]!==i||e[7]!==t||e[8]!==o||e[9]!==c||e[10]!==u?(d=s.jsx(xt,{onClose:t,credentialId:i,onCredentialChange:c,selectedModel:o,onModelChange:u}),e[6]=i,e[7]=t,e[8]=o,e[9]=c,e[10]=u,e[11]=d):d=e[11],d}function xi(l){const e=V.c(2),{onClose:t}=l;let i;return e[0]!==t?(i=s.jsx(pi,{onClose:t}),e[0]=t,e[1]=i):i=e[1],i}function gi(l){const e=V.c(2);let t;return e[0]!==l?(t=s.jsx(xt,{...l}),e[0]=l,e[1]=t):t=e[1],t}const vi=[{tier:"fast",labelKey:"chat.desktopCli.tierFastDescription"},{tier:"smart",labelKey:"chat.desktopCli.tierSmartDescription"},{tier:"thinking",labelKey:"chat.desktopCli.tierThinkingDescription"}];function gt(l){const e=V.c(11),{modelSet:t,selectedModelId:i,onSelect:n}=l,o=ie();let r,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==i||e[5]!==o){const d=Object.fromEntries(t.models.map(bi));r="flex flex-col p-2 w-[320px]",c=vi.map(a=>{const{tier:h,labelKey:p}=a,m=t.tiers[h];if(!m.modelId)return null;const f=d[m.modelId];if(!f)return null;const b=i===m.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ce("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",b&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:m.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:m.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:o(p)})]})]},h)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=i,e[5]=o,e[6]=r,e[7]=c}else r=e[6],c=e[7];let u;return e[8]!==r||e[9]!==c?(u=s.jsx("div",{className:r,children:c}),e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function bi(l){return[l.modelId,l]}const yi=[{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 5 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],Ne="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ji=[{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:Ne,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:Ne,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:Ne,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:Ne,limits:null,costs:null}],Si="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",Ni="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg";function ki(l){return{fast:{modelId:"claude-code:haiku",label:l("chat.agentModels.haikuLabel"),description:l("chat.agentModels.quickerResponses"),iconNode:s.jsx(ge,{size:16})},smart:{modelId:"claude-code:sonnet",label:l("chat.agentModels.sonnetLabel"),description:l("chat.agentModels.balancedQuality"),iconNode:s.jsx(ge,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:l("chat.agentModels.opusLabel"),description:l("chat.agentModels.deeperReasoning"),iconNode:s.jsx(ge,{size:16})}}}function wi(l){return{fast:{modelId:"codex:gpt-5.6-luna",label:l("chat.agentModels.gptLunaLabel"),description:l("chat.agentModels.quickerResponses"),iconNode:s.jsx(ve,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:l("chat.agentModels.gptTerraLabel"),description:l("chat.agentModels.balancedQuality"),iconNode:s.jsx(ve,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:l("chat.agentModels.gptSolLabel"),description:l("chat.agentModels.deeperReasoning"),iconNode:s.jsx(ve,{size:16})}}}function vt(l,e){return l==="claude-code"?{logo:Si,tiers:ki(e),models:yi}:l==="codex"?{logo:Ni,tiers:wi(e),models:ji}:null}function Ci(l){const e=V.c(12),{onClose:t,agent:i}=l,n=ie(),o=Le(),r=i??o.pendingHarnessId??"decopilot";let c;e[0]!==r||e[1]!==n?(c=vt(r,n),e[0]=r,e[1]=n,e[2]=c):c=e[2];const u=c;if(!u){let p;return e[3]!==t?(p=s.jsx(xi,{onClose:t}),e[3]=t,e[4]=p):p=e[4],p}const d=o.selectedModel?.modelId??u.tiers[o.simpleModeTier].modelId;let a;e[5]!==t||e[6]!==o?(a=p=>{o.setModel({...p,keyId:void 0}),t()},e[5]=t,e[6]=o,e[7]=a):a=e[7];let h;return e[8]!==u||e[9]!==d||e[10]!==a?(h=s.jsx(gt,{modelSet:u,selectedModelId:d,onSelect:a}),e[8]=u,e[9]=d,e[10]=a,e[11]=h):h=e[11],h}function Ii(l){const e=V.c(14);let t,i;e[0]!==l?({agent:t,...i}=l,e[0]=l,e[1]=t,e[2]=i):(t=e[1],i=e[2]);const n=ie();let o;e[3]!==t||e[4]!==n?(o=t?vt(t,n):null,e[3]=t,e[4]=n,e[5]=o):o=e[5];const r=o;if(!r){let a;return e[6]!==i?(a=s.jsx(gi,{...i}),e[6]=i,e[7]=a):a=e[7],a}const c=i.selectedModel?.modelId??r.tiers.smart.modelId;let u;e[8]!==i?(u=a=>{i.onModelChange(a),i.onClose()},e[8]=i,e[9]=u):u=e[9];let d;return e[10]!==r||e[11]!==c||e[12]!==u?(d=s.jsx(gt,{modelSet:r,selectedModelId:c,onSelect:u}),e[10]=r,e[11]=c,e[12]=u,e[13]=d):d=e[13],d}function cl(l){const e=V.c(49),{variant:t,className:i,placeholder:n,model:o,isLoading:r,credentialId:c,onCredentialChange:u,onModelChange:d,filterModels:a,agent:h}=l,p=t===void 0?"borderless":t,m=n===void 0?"Select model":n,f=ie(),[b,N]=U.useState(!1),y=d!==void 0,j=Ot(),C=p==="borderless"?"ghost":"outline",E=p==="borderless"&&"md:border-none";let M;e[0]!==i||e[1]!==E?(M=ce("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",E,i),e[0]=i,e[1]=E,e[2]=M):M=e[2];let I;e[3]!==r||e[4]!==o||e[5]!==m||e[6]!==y?(I=y?s.jsx(ut,{model:o??null,placeholder:m,isLoading:r}):s.jsx(Mi,{placeholder:m}),e[3]=r,e[4]=o,e[5]=m,e[6]=y,e[7]=I):I=e[7];let x;e[8]!==C||e[9]!==M||e[10]!==I?(x=s.jsx(de,{variant:C,size:"sm",className:M,children:I}),e[8]=C,e[9]=M,e[10]=I,e[11]=x):x=e[11];const k=x;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(di,{}),e[12]=w):w=e[12];let _;e[13]!==h||e[14]!==c||e[15]!==a||e[16]!==o||e[17]!==u||e[18]!==d||e[19]!==y?(_=s.jsx(U.Suspense,{fallback:w,children:y?s.jsx(Ii,{onClose:()=>N(!1),agent:h,credentialId:c??null,onCredentialChange:u??_i,selectedModel:o??null,onModelChange:d,filterModels:a}):s.jsx(Ci,{onClose:()=>N(!1),agent:h})}),e[13]=h,e[14]=c,e[15]=a,e[16]=o,e[17]=u,e[18]=d,e[19]=y,e[20]=_):_=e[20];const v=_;if(j){let L;e[21]!==k?(L=s.jsx(It,{asChild:!0,children:k}),e[21]=k,e[22]=L):L=e[22];let P;e[23]!==f?(P=f("chat.selectModel.selectModel"),e[23]=f,e[24]=P):P=e[24];let z;e[25]!==P?(z=s.jsx(_t,{className:"sr-only",children:P}),e[25]=P,e[26]=z):z=e[26];let R;e[27]!==v?(R=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:v}),e[27]=v,e[28]=R):R=e[28];let K;e[29]!==z||e[30]!==R?(K=s.jsxs(Mt,{className:"p-0 flex flex-col max-h-[95vh]",children:[z,R]}),e[29]=z,e[30]=R,e[31]=K):K=e[31];let W;return e[32]!==b||e[33]!==L||e[34]!==K?(W=s.jsxs(Et,{open:b,onOpenChange:N,children:[L,K]}),e[32]=b,e[33]=L,e[34]=K,e[35]=W):W=e[35],W}let g;e[36]!==k?(g=s.jsx(Ct,{asChild:!0,children:k}),e[36]=k,e[37]=g):g=e[37];let S;e[38]!==f?(S=f("chat.selectModel.selectModel"),e[38]=f,e[39]=S):S=e[39];let O;e[40]!==S?(O=s.jsx(Oe,{className:"sr-only",children:S}),e[40]=S,e[41]=O):O=e[41];let D;e[42]!==v||e[43]!==O?(D=s.jsxs(Ee,{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:[O,v]}),e[42]=v,e[43]=O,e[44]=D):D=e[44];let T;return e[45]!==b||e[46]!==g||e[47]!==D?(T=s.jsxs(Me,{open:b,onOpenChange:N,children:[g,D]}),e[45]=b,e[46]=g,e[47]=D,e[48]=T):T=e[48],T}function _i(){}function Mi(l){const e=V.c(4),{placeholder:t}=l,{selectedModel:i,isModelsLoading:n}=Le();let o;return e[0]!==n||e[1]!==i||e[2]!==t?(o=s.jsx(ut,{model:i,placeholder:t,isLoading:n}),e[0]=n,e[1]=i,e[2]=t,e[3]=o):o=e[3],o}export{rs as C,di as M,Ds as N,dt as P,Ii as a,ge as b,ve as c,rl as d,cl as e,Se as f,al as g,Os as h,ol as i,nl as l,Pe as m};