decocms 4.124.0 → 4.125.1

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 (244) hide show
  1. package/dist/client/assets/{AlertCircle-DK36ztTJ.js → AlertCircle-SVkdglM5.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CYSScDeq.js → AreaChart-Df1Li3kS.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-Z5nFVEHT.js → ArrowRight-BxqI3bui.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DxEnr7BD.js → ArrowUp-MLVAquzH.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-W5JdzCod.js → ArrowUpRight-DG0flMIc.js} +1 -1
  6. package/dist/client/assets/{Check-CpPKSRkX.js → Check-B4CLdvYI.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BmhZ-57X.js → CheckCircle-ClGa5zl8.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-CyntSUXM.js → ChevronDown-CNxoymO2.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Bv8EGIBz.js → ChevronRight-DwRt0L3b.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-CYn2F25s.js → ChevronUp-B-3hc4bz.js} +1 -1
  11. package/dist/client/assets/{Copy01-D3zSs5Vn.js → Copy01-CMvogd8K.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CGayVayP.js → DotsVertical-DZ0vOWt6.js} +1 -1
  13. package/dist/client/assets/{Eye-DGKc96aW.js → Eye-D_G5gb6c.js} +1 -1
  14. package/dist/client/assets/{FilterLines-DRJYP9NE.js → FilterLines-DEwr_1sT.js} +1 -1
  15. package/dist/client/assets/{Globe01-B8p3nT1B.js → Globe01-pEx_1GgK.js} +1 -1
  16. package/dist/client/assets/{Globe04-BW6xzL8N.js → Globe04-DR3EXf_Z.js} +1 -1
  17. package/dist/client/assets/{HardDrive-8I6axxCp.js → HardDrive-IZ1ZbZos.js} +1 -1
  18. package/dist/client/assets/{Image01-4_m0t2pp.js → Image01-hn4tRlSY.js} +1 -1
  19. package/dist/client/assets/{Key01-p27BeFd8.js → Key01-BYwr89Cq.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-L2Wkb8sz.js → LayoutLeft-D5OOMr76.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-CNGphFo5.js → LinkExternal01-CKBhcmnx.js} +1 -1
  22. package/dist/client/assets/{LogOut01-BCs3JKfH.js → LogOut01-FD1aivWo.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DCq5bru9.js → Monitor01-DglhG0d2.js} +1 -1
  24. package/dist/client/assets/{Package-mByXLxkK.js → Package-BrHBRlvV.js} +1 -1
  25. package/dist/client/assets/{Palette-DDmUGimU.js → Palette-DJJGWVQM.js} +1 -1
  26. package/dist/client/assets/{Play-BlMhRRlg.js → Play-BlW23Kw8.js} +1 -1
  27. package/dist/client/assets/{Plus-T77LDyNx.js → Plus-YNEa18MU.js} +1 -1
  28. package/dist/client/assets/{SearchLg-2JepXxV7.js → SearchLg-BJMZNLPz.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BrD-cd_r.js → SearchMd-Dvao3UqZ.js} +1 -1
  30. package/dist/client/assets/{Settings02-Dyjus0gy.js → Settings02-YmXuGUsK.js} +1 -1
  31. package/dist/client/assets/{Shield01-C4NxH3od.js → Shield01-AQo28rNc.js} +1 -1
  32. package/dist/client/assets/{Star01-CDksi-eQ.js → Star01-CwoWZQS4.js} +1 -1
  33. package/dist/client/assets/{Stars01-D29I-qHv.js → Stars01-DuankmF6.js} +1 -1
  34. package/dist/client/assets/{Stars02-CPPHKWKp.js → Stars02-Bj86wrgZ.js} +1 -1
  35. package/dist/client/assets/{Sun-wIdMy0Us.js → Sun-3gadZPMK.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-BaxIt1Sp.js → SwitchHorizontal01-BIUTZZZa.js} +1 -1
  37. package/dist/client/assets/{Tool01-BONzRe16.js → Tool01-DZGxkW_G.js} +1 -1
  38. package/dist/client/assets/{Tool02-T97eNFpQ.js → Tool02-BvZQP5qO.js} +1 -1
  39. package/dist/client/assets/{Trash01-BhzJMfz2.js → Trash01-DxLrtNwI.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-Kyz9iOyy.js → TrendUp01-D5IxhiTp.js} +1 -1
  41. package/dist/client/assets/{Upload01-CzzMLU44.js → Upload01-D4mHmAGn.js} +1 -1
  42. package/dist/client/assets/{User01-DvG56ZWG.js → User01-CVt5zMT9.js} +1 -1
  43. package/dist/client/assets/{Users01-BLP_h_4S.js → Users01-Df3jcVcT.js} +1 -1
  44. package/dist/client/assets/{Users03-CV6EE9UL.js → Users03-Bs7e93NA.js} +1 -1
  45. package/dist/client/assets/{X-LakbiULD.js → X-DNGu5XTw.js} +1 -1
  46. package/dist/client/assets/{XCircle-ChJH6NXh.js → XCircle-DcdOpEhZ.js} +1 -1
  47. package/dist/client/assets/{XClose-Dmn2e0v8.js → XClose-CB7esYA7.js} +1 -1
  48. package/dist/client/assets/{Zap-ijKdF_xx.js → Zap-1Ijgmues.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-HXIFpsrB.js → ZapSquare-CXyhxPYr.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-l_XCzPDB.js → ZoomOut-Cy0YD81B.js} +1 -1
  51. package/dist/client/assets/{access-gate-DGGPFLJY.js → access-gate-Z0tIQuZD.js} +1 -1
  52. package/dist/client/assets/add-section-modal-BjSXt_Ft.js +1 -0
  53. package/dist/client/assets/{agent-icon-nfQ4gZv_.js → agent-icon-6ZgcobdH.js} +1 -1
  54. package/dist/client/assets/{agents-list-CbewTuwJ.js → agents-list-opV_QYog.js} +1 -1
  55. package/dist/client/assets/{ai-providers-DNkiwO6Y.js → ai-providers-cDdONmBd.js} +1 -1
  56. package/dist/client/assets/{alert-BDrlNajQ.js → alert-BoZH3Ima.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-Bk0FRo3F.js → alert-dialog-DF_tGxsa.js} +1 -1
  58. package/dist/client/assets/{app-editor-BUVueF62.js → app-editor-O_UgWbEY.js} +1 -1
  59. package/dist/client/assets/{auth-S1bqm871.js → auth-Cnpk6Qza.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-BludY_iB.js → auth-catchall-DIhUdoJP.js} +1 -1
  61. package/dist/client/assets/{auth-entry-oexaRhaR.js → auth-entry-C8IPu7q8.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-z4aDUKt4.js → auth-split-layout-CEbN8Sql.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-Bzcf8255.js → authenticate-and-persist-oauth-CKqHS4SM.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-DfRlf74w.js → automation-list-row-DHUstmJS.js} +1 -1
  65. package/dist/client/assets/{automation-runs-DSMorTfH.js → automation-runs-C0yVZsV6.js} +1 -1
  66. package/dist/client/assets/{automations-Nuz-bSXv.js → automations-D_HR6Ap7.js} +1 -1
  67. package/dist/client/assets/{autosend-D0w6q98g.js → autosend-Cyh1j9FI.js} +1 -1
  68. package/dist/client/assets/{avatar-D5Pxh5hF.js → avatar-BW70eOki.js} +1 -1
  69. package/dist/client/assets/{badge-0yCoQaf8.js → badge-bTEbYhrk.js} +1 -1
  70. package/dist/client/assets/{block-document-BRJdgeHm.js → block-document-7zkAQj5f.js} +2 -2
  71. package/dist/client/assets/{brand-context-D4GMsZLP.js → brand-context-iDVoR_yH.js} +1 -1
  72. package/dist/client/assets/{buckets-B1ItHHA4.js → buckets-DrNQS2r4.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-towniy-I.js → bulk-category-panel-w_u75mYG.js} +1 -1
  74. package/dist/client/assets/{calendar-MnQ5t0b8.js → calendar-BBADsJX8.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-DypmA8fC.js → capability-load-error-AllVD78v.js} +1 -1
  76. package/dist/client/assets/{card-FqBeWO-i.js → card-Br54bDFn.js} +1 -1
  77. package/dist/client/assets/category-editor-BfjbFyAM.js +1 -0
  78. package/dist/client/assets/{chat-context-lp80NWoB.js → chat-context-CI4nbgci.js} +1 -1
  79. package/dist/client/assets/{checkbox-B8MfRjyu.js → checkbox-CAxq-T45.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-96shGlkT.js → cli-auth-success-B9sCeo2Q.js} +1 -1
  81. package/dist/client/assets/{collection-detail-C6uAxoGz.js → collection-detail-DRnk5jHY.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-HtQ51WrZ.js → collection-display-button-1a9-oNGk.js} +1 -1
  83. package/dist/client/assets/{collection-search-BdDcCEGe.js → collection-search-D29vjBdu.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-fvboaXh2.js → collection-table-wrapper-Bs0QBR8s.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-BnimuDg_.js → collection-tabs-B_iwXxJh.js} +1 -1
  86. package/dist/client/assets/{command-CTl1EdYe.js → command-lMWlEGpB.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-BZAVWmvI.js → commerce-onboarding-Cs8wr42d.js} +1 -1
  88. package/dist/client/assets/{companions-core-Dpc596PP.js → companions-core-Ysv-f1nZ.js} +1 -1
  89. package/dist/client/assets/{connect-p8cakTja.js → connect-ViXILJMP.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-CdnS5eXT.js → connect-desktop-dialog-D8sK3EEk.js} +1 -1
  91. package/dist/client/assets/{connection-BZ3QCY28.js → connection-CaC7PNA2.js} +1 -1
  92. package/dist/client/assets/{connection-card-CAi6Joxn.js → connection-card-Dcyt8aiQ.js} +1 -1
  93. package/dist/client/assets/{connection-detail-CgapEOXS.js → connection-detail-DUj6EOS9.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-DsmqIhiw.js → connection-form-helpers-PAzOM4y0.js} +1 -1
  95. package/dist/client/assets/{connections-nqiVMwo5.js → connections-BVde43Fp.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-C_uBnMkE.js → decopilot-sse-pool-D8DPyDew.js} +1 -1
  97. package/dist/client/assets/{dialog-FImDKsaC.js → dialog-DdDhMIgC.js} +1 -1
  98. package/dist/client/assets/{domain-settings-Cnt0BT3_.js → domain-settings-CgZfwtrF.js} +1 -1
  99. package/dist/client/assets/{drawer-BPMmWLg9.js → drawer-Cbnt7O-A.js} +1 -1
  100. package/dist/client/assets/dropdown-menu-CwkaxWi4.js +1 -0
  101. package/dist/client/assets/{empty-state-BHeOvWCI.js → empty-state-uROosaY2.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-CHaAGq1I.js → extract-connection-data-SOVeqaEf.js} +1 -1
  103. package/dist/client/assets/file-explorer-CL-EOxBo.js +2 -0
  104. package/dist/client/assets/{file-type-icon-j3ouVEiu.js → file-type-icon-CljbxK2Q.js} +1 -1
  105. package/dist/client/assets/{files-D1sbegNg.js → files-CvTHFkg6.js} +1 -1
  106. package/dist/client/assets/{form-C98Uc90j.js → form-CkVSdutp.js} +1 -1
  107. package/dist/client/assets/{general-P6C4HAAk.js → general-Bu4WruYw.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-Ddjhd2Tc.js → github-repo-picker-CG-o5MBt.js} +1 -1
  109. package/dist/client/assets/{hooks-BwQoK4db.js → hooks-QAnxouCY.js} +1 -1
  110. package/dist/client/assets/{index-Bn6pp4Md.js → index-B2TW_Tc6.js} +1 -1
  111. package/dist/client/assets/{index-CiPEiGIK.js → index-BHSaoCA_.js} +1 -1
  112. package/dist/client/assets/{index-BnGEdQVM.js → index-CQn2KfW0.js} +1 -1
  113. package/dist/client/assets/{index-aRSVfmas.js → index-CXFzWA8S.js} +1 -1
  114. package/dist/client/assets/{index-CXdmX3IS.js → index-CjrIBBwH.js} +5 -5
  115. package/dist/client/assets/index-DBC4gRwz.css +1 -0
  116. package/dist/client/assets/index-DCebXurG.js +1 -0
  117. package/dist/client/assets/{index-lOGFC8V2.js → index-DG04vqxi.js} +1 -1
  118. package/dist/client/assets/{index-BYIBOxmn.js → index-DI_qR3yY.js} +1 -1
  119. package/dist/client/assets/{index-BNHUCKgp.js → index-DSb-FJOs.js} +1 -1
  120. package/dist/client/assets/{index-BHYyC3SJ.js → index-DT2uZW0B.js} +2 -2
  121. package/dist/client/assets/{index-BaawLZEI.js → index-DheTI_1c.js} +1 -1
  122. package/dist/client/assets/{index-OL3R77fI.js → index-dNvo17TY.js} +5 -5
  123. package/dist/client/assets/{index-CNHG-C8l.js → index-kbCY_Lnd.js} +3 -3
  124. package/dist/client/assets/{index-redirect-6I5IVLFU.js → index-redirect-qTQjOFfx.js} +1 -1
  125. package/dist/client/assets/{input-DgjVA9qC.js → input-Bde2PvG3.js} +1 -1
  126. package/dist/client/assets/{integration-icon-DGkq5lKX.js → integration-icon-DueQrR1U.js} +1 -1
  127. package/dist/client/assets/{invite-member-dialog-jGUib3f5.js → invite-member-dialog-DfWhGlGO.js} +1 -1
  128. package/dist/client/assets/{label-qw23FVkg.js → label-gjjx6LT8.js} +1 -1
  129. package/dist/client/assets/{layout-Dw2SXFSk.js → layout-D0ncemVI.js} +1 -1
  130. package/dist/client/assets/{login-lhr3tWMV.js → login-CbRMe-z7.js} +1 -1
  131. package/dist/client/assets/{mcp-oauth-Bi8-Augk.js → mcp-oauth-BUu6XHC4.js} +1 -1
  132. package/dist/client/assets/{members-BQE4mPi_.js → members-BcRPDEDr.js} +1 -1
  133. package/dist/client/assets/{monaco-editor-D3rrTquk.js → monaco-editor-DSIF9trn.js} +1 -1
  134. package/dist/client/assets/{monitoring-stats-row-CzvvjeL0.js → monitoring-stats-row-Q7FkS_3d.js} +1 -1
  135. package/dist/client/assets/{multi-select-BAf0Ex_M.js → multi-select-CCsJk7QC.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-D6rDoi2d.js → oauth-callback-DaysAPAH.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-ai-provider-BckedQQq.js → oauth-callback-ai-provider-Dgo1-8KX.js} +1 -1
  138. package/dist/client/assets/{onboarding-CPZeOyH2.js → onboarding-Ds8zwvpW.js} +1 -1
  139. package/dist/client/assets/{org-install-D4RdHqpv.js → org-install-DXjHe0T_.js} +1 -1
  140. package/dist/client/assets/{org-layout-NrDecTOG.js → org-layout-B-Axsxfy.js} +1 -1
  141. package/dist/client/assets/{organization-choice-DEWU2sc0.js → organization-choice-KVvAdGYy.js} +1 -1
  142. package/dist/client/assets/{orgs-rmUKprAs.js → orgs-DYjar4_W.js} +1 -1
  143. package/dist/client/assets/{page-seo-form-hOokHyKW.js → page-seo-form-0A9v5c26.js} +1 -1
  144. package/dist/client/assets/page-seo-sheet-kpToS9Jn.js +1 -0
  145. package/dist/client/assets/{popover-EQ6fHMgX.js → popover-c7eoGO3I.js} +1 -1
  146. package/dist/client/assets/{post-editor-DzwRq-2E.js → post-editor-Civ4n0Uh.js} +1 -1
  147. package/dist/client/assets/{primitives-D43FY7wh.js → primitives-DPO_BHs3.js} +1 -1
  148. package/dist/client/assets/{profile-9ro7CW-j.js → profile-xVi9t53J.js} +1 -1
  149. package/dist/client/assets/project-app-view-jsGyF6Ml.js +1 -0
  150. package/dist/client/assets/record-editor-BMN_EixI.js +1 -0
  151. package/dist/client/assets/{redirect-editor-DbLhqpUS.js → redirect-editor-Hxkz-k-O.js} +1 -1
  152. package/dist/client/assets/registry-CDJreF4h.js +2 -0
  153. package/dist/client/assets/{registry-layout-CnXEDhPl.js → registry-layout-2ZDnGX34.js} +1 -1
  154. package/dist/client/assets/{reports-DFVcUaVj.js → reports-BttfXMwk.js} +1 -1
  155. package/dist/client/assets/{require-capability-C1InfZ4C.js → require-capability-C2ZqeJBu.js} +1 -1
  156. package/dist/client/assets/{required-auth-layout-CE5T2xjE.js → required-auth-layout-Bp2v8XrU.js} +1 -1
  157. package/dist/client/assets/{reset-password-DWHRlydi.js → reset-password-ClirSy3X.js} +1 -1
  158. package/dist/client/assets/roles-a4rGzQvU.js +1 -0
  159. package/dist/client/assets/{search-input-7KbxtfGo.js → search-input-CopgfT3D.js} +1 -1
  160. package/dist/client/assets/{secrets-DtHemQAh.js → secrets-BX2Rbuyd.js} +1 -1
  161. package/dist/client/assets/sections-editor-BLzG0gkI.js +2 -0
  162. package/dist/client/assets/{select-Cq8RdhNJ.js → select-CarKrHKp.js} +1 -1
  163. package/dist/client/assets/{select-model-Uo83wy3q.js → select-model-B6CE2WIr.js} +1 -1
  164. package/dist/client/assets/{self-tool-result-D7QwpMtO.js → self-tool-result-Cyj4zWS8.js} +1 -1
  165. package/dist/client/assets/{seo-editor-yYIxrbNX.js → seo-editor-evFyqeRd.js} +1 -1
  166. package/dist/client/assets/{settings-layout-C899x403.js → settings-layout-BBJIKue8.js} +1 -1
  167. package/dist/client/assets/{settings-section-LBRkXW6q.js → settings-section-D15E7ooI.js} +1 -1
  168. package/dist/client/assets/{shell-controls-DEoTB427.js → shell-controls-DAGwJ0vU.js} +1 -1
  169. package/dist/client/assets/{shell-layout-Dj-vc_bz.js → shell-layout-Dlcr5E8e.js} +1 -1
  170. package/dist/client/assets/{sidebar-CA_GtKuw.js → sidebar-CXBLzXTv.js} +1 -1
  171. package/dist/client/assets/{skeleton-D6VHo4EZ.js → skeleton-CQhKsrHO.js} +1 -1
  172. package/dist/client/assets/{sso-BLfsO2vh.js → sso-DgwUusR4.js} +1 -1
  173. package/dist/client/assets/{store-DwAC14TW.js → store-BCKSaz3k.js} +1 -1
  174. package/dist/client/assets/store-registry-CKMXxmsp.js +2 -0
  175. package/dist/client/assets/{studio-tools-DgseDYp-.js → studio-tools-DysRdJcu.js} +1 -1
  176. package/dist/client/assets/{switch-E8tqOsOD.js → switch-W15nd4O3.js} +1 -1
  177. package/dist/client/assets/{table-C1DMEAbM.js → table-DOgTrCQg.js} +1 -1
  178. package/dist/client/assets/{tabs-Dw8HW-v5.js → tabs-DzHKysHp.js} +1 -1
  179. package/dist/client/assets/{textarea-BcQnh26i.js → textarea-LQJIt3OL.js} +1 -1
  180. package/dist/client/assets/{toggle-group-CmZvG2mM.js → toggle-group-8m12csXH.js} +1 -1
  181. package/dist/client/assets/{toolbar-Du49EzPY.js → toolbar-Cd74BCqt.js} +1 -1
  182. package/dist/client/assets/{toolbar-icon-button-CQCG_egD.js → toolbar-icon-button-BllHpuFd.js} +1 -1
  183. package/dist/client/assets/{tooltip-D_7O_PaP.js → tooltip-CXWhkXAN.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-CFk3DhHi.js → use-ai-providers-DGiZffHP.js} +1 -1
  185. package/dist/client/assets/{use-api-keys-DVuE5MrQ.js → use-api-keys-DYMouCJR.js} +1 -1
  186. package/dist/client/assets/{use-automations-HWyUWVwo.js → use-automations-Bbv-8fSD.js} +1 -1
  187. package/dist/client/assets/{use-autosave-8oT6pXp6.js → use-autosave-BJfqo3kP.js} +1 -1
  188. package/dist/client/assets/{use-capability-LtqDjP9s.js → use-capability-CBmNgE0z.js} +1 -1
  189. package/dist/client/assets/{use-clock-tick-DpJH6E7g.js → use-clock-tick-DY0x6n8E.js} +1 -1
  190. package/dist/client/assets/{use-connection-Cy6jvP_M.js → use-connection-BgF_QzXd.js} +1 -1
  191. package/dist/client/assets/{use-copy-CmXDlHWP.js → use-copy-Dkvs0tIh.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-Cjw1QCzv.js → use-create-virtual-mcp-VXkfDng5.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-BEUC9PJP.js → use-debounced-autosave-beiuz3Qi.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-B4gNWI15.js → use-debounced-value-CLpLkR9v.js} +1 -1
  195. package/dist/client/assets/{use-deco-credits-CH81kAYD.js → use-deco-credits-DckR5ZY0.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-Cn27r_-Y.js → use-decopilot-events-44mCejxv.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-DqIcNFPB.js → use-delete-connection-HNMvBwi6.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-BteKRjr7.js → use-deployment-admin-Oe7lbkuz.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-CdmjJy0V.js → use-file-configs-D3AD3H9H.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-DmLV1cRA.js → use-infinite-scroll-BAcSrC7N.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-Cgq5wwoi.js → use-join-requests-BQfMYTCl.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-BjWgEuIB.js → use-mcp-auth-status-DGd2a9ic.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-B96aoUec.js → use-mcp-client-BHwO73my.js} +1 -1
  204. package/dist/client/assets/{use-mcp-tools-DnEMNjdD.js → use-mcp-tools-DOOSLqBK.js} +1 -1
  205. package/dist/client/assets/{use-members-BCQ7B8LT.js → use-members-Dk3MTFEE.js} +1 -1
  206. package/dist/client/assets/{use-mobile-CeuMa6ib.js → use-mobile-Be0GzI6n.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-BIABBNbr.js → use-navigate-to-agent-BBulir8t.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-ClgNaahZ.js → use-org-auth-client-B-WzKHHI.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-DWe98W2x.js → use-org-sso-Oys9HXPt.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-ByEBSwOh.js → use-organization-roles-vJ7fu1nu.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-DS1oEmTu.js → use-organization-settings-BpI1NVk5.js} +1 -1
  212. package/dist/client/assets/{use-registry-app-Cmh5GuxE.js → use-registry-app-DCTQM0ZE.js} +1 -1
  213. package/dist/client/assets/{use-registry-connections-q0LtDApL.js → use-registry-connections-89yqlYzI.js} +1 -1
  214. package/dist/client/assets/{use-secrets-DRbY3ncG.js → use-secrets-BmVXUvco.js} +1 -1
  215. package/dist/client/assets/{use-status-sounds-89pnm8qu.js → use-status-sounds-BAdfOhh8.js} +1 -1
  216. package/dist/client/assets/{use-view-mode-PC9LswZP.js → use-view-mode-Csyi6so3.js} +1 -1
  217. package/dist/client/assets/{use-virtual-mcp-BpTZf_DU.js → use-virtual-mcp-BDiB3K2g.js} +1 -1
  218. package/dist/client/assets/useInfiniteQuery-DG-ds5RA.js +1 -0
  219. package/dist/client/assets/{useQueries-Bj_NDoPk.js → useQueries-DnIQBt4G.js} +1 -1
  220. package/dist/client/assets/{useRouterState-D9qhlYTr.js → useRouterState-qjGvEq_I.js} +1 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-B4X4g3L9.js +1 -0
  222. package/dist/client/assets/{users-C3AKxeSh.js → users-D9cWtpvX.js} +1 -1
  223. package/dist/client/assets/{variant-calendar-Dy3WEToh.js → variant-calendar-CXlnuRCM.js} +1 -1
  224. package/dist/client/assets/{view-mode-toggle-BsQRQqvU.js → view-mode-toggle-DcMMAgJm.js} +1 -1
  225. package/dist/client/index.html +2 -2
  226. package/dist/server/cli.js +644 -640
  227. package/dist/server/migrate.js +106 -102
  228. package/dist/server/server.js +455 -455
  229. package/package.json +1 -1
  230. package/dist/client/assets/add-section-modal-Bp33coHl.js +0 -1
  231. package/dist/client/assets/category-editor-DmfqnUmJ.js +0 -1
  232. package/dist/client/assets/dropdown-menu-CMjeYrPG.js +0 -1
  233. package/dist/client/assets/file-explorer-CeMG0HQh.js +0 -2
  234. package/dist/client/assets/index-9poUSUqI.css +0 -1
  235. package/dist/client/assets/index-cTWd_py-.js +0 -1
  236. package/dist/client/assets/page-seo-sheet-CjglKrDT.js +0 -1
  237. package/dist/client/assets/project-app-view-CR6e0Trm.js +0 -1
  238. package/dist/client/assets/record-editor-tuBPkqq9.js +0 -1
  239. package/dist/client/assets/registry-BFjdCguf.js +0 -2
  240. package/dist/client/assets/roles-B_c7fU_T.js +0 -1
  241. package/dist/client/assets/sections-editor-CVb2m7a-.js +0 -2
  242. package/dist/client/assets/store-registry-fyLszV8Q.js +0 -2
  243. package/dist/client/assets/useInfiniteQuery-Usxu-nHN.js +0 -1
  244. package/dist/client/assets/useSuspenseInfiniteQuery-BMtv1LEJ.js +0 -1
@@ -1 +1 @@
1
- import{c as p,j as m}from"./index-OL3R77fI.js";import{u as l}from"./use-capability-LtqDjP9s.js";import{A as u}from"./access-gate-DGGPFLJY.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
1
+ import{c as p,j as m}from"./index-dNvo17TY.js";import{u as l}from"./use-capability-CBmNgE0z.js";import{A as u}from"./access-gate-Z0tIQuZD.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
@@ -1 +1 @@
1
- import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-OL3R77fI.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{f as R};
1
+ import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-dNvo17TY.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{f as R};
@@ -1 +1 @@
1
- import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-OL3R77fI.js";import{I as D}from"./input-DgjVA9qC.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
1
+ import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-dNvo17TY.js";import{I as D}from"./input-Bde2PvG3.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
@@ -0,0 +1 @@
1
+ import{b as re,r as $,F as Be,K as me,n as Fe,j as s,m as W,k as je,B as ce,c as J,W as Xe,a1 as Ue,X as ae,a3 as Je,a4 as et,o as rt,Z as Ot,Y as jt,e as at,t as ve,p as Ke,y as ct,z as vt,E as Mt,d as Dt,u as yt}from"./index-dNvo17TY.js";import{u as Pt}from"./use-organization-roles-vJ7fu1nu.js";import{u as $e}from"./use-org-auth-client-B-WzKHHI.js";import{g as dt,a as wt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-bTEbYhrk.js";import{A as mt,a as ut,c as ft,d as gt,b as ht,f as xt,g as pt,e as Tt}from"./alert-dialog-DF_tGxsa.js";import{c as Lt,D as Gt,b as kt,a as Ut}from"./dropdown-menu-CwkaxWi4.js";import{a as Bt}from"./DotsVertical-DZ0vOWt6.js";import{s as Ye}from"./Plus-YNEa18MU.js";import{s as Vt}from"./Trash01-DxLrtNwI.js";import{C as zt}from"./collection-table-wrapper-Bs0QBR8s.js";import{P as ie}from"./index-DG04vqxi.js";import{E as tt}from"./empty-state-uROosaY2.js";import{S as Qe}from"./search-input-CopgfT3D.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Ze}from"./integration-icon-DueQrR1U.js";import{u as Yt}from"./use-infinite-scroll-BAcSrC7N.js";import{C as He}from"./checkbox-CAxq-T45.js";import{b as Ft}from"./Settings02-YmXuGUsK.js";import{u as Kt}from"./useSuspenseInfiniteQuery-B4X4g3L9.js";import{u as $t,S as Qt}from"./use-mcp-client-BHwO73my.js";import{C as Zt}from"./collection-search-D29vjBdu.js";import{p as Ht}from"./connection-CaC7PNA2.js";import{u as _t}from"./use-members-Dk3MTFEE.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as qt}from"./use-connection-BgF_QzXd.js";import{u as Wt,c as Xt}from"./use-ai-providers-DGiZffHP.js";import{A as St}from"./avatar-BW70eOki.js";import{S as De}from"./switch-W15nd4O3.js";import{b as ye,c as Pe,T as we,a as Le}from"./tooltip-CXWhkXAN.js";import{S as st,a as lt,b as ot}from"./settings-section-D15E7ooI.js";import{t as Jt}from"./ChevronDown-CNxoymO2.js";import{i as es}from"./ChevronRight-DwRt0L3b.js";import{i as nt}from"./X-DNGu5XTw.js";import{a as ts}from"./use-capability-CBmNgE0z.js";import{A as ss}from"./access-gate-Z0tIQuZD.js";import"./Check-B4CLdvYI.js";import"./table-DOgTrCQg.js";import"./ArrowUp-MLVAquzH.js";import"./sidebar-CXBLzXTv.js";import"./LayoutLeft-D5OOMr76.js";import"./use-mobile-Be0GzI6n.js";import"./SearchMd-Dvao3UqZ.js";import"./Tool02-BvZQP5qO.js";import"./agent-icon-6ZgcobdH.js";import"./AlertCircle-SVkdglM5.js";import"./Tool01-DZGxkW_G.js";import"./ArrowRight-BxqI3bui.js";import"./ArrowUpRight-DG0flMIc.js";import"./TrendUp01-D5IxhiTp.js";import"./ZapSquare-CXyhxPYr.js";import"./ZoomOut-Cy0YD81B.js";import"./Users03-Bs7e93NA.js";import"./CheckCircle-ClGa5zl8.js";import"./ChevronUp-B-3hc4bz.js";import"./Stars02-Bj86wrgZ.js";import"./Copy01-CMvogd8K.js";import"./Globe01-pEx_1GgK.js";import"./Eye-D_G5gb6c.js";import"./FilterLines-DEwr_1sT.js";import"./Star01-CwoWZQS4.js";import"./Globe04-DR3EXf_Z.js";import"./SwitchHorizontal01-BIUTZZZa.js";import"./HardDrive-IZ1ZbZos.js";import"./Image01-hn4tRlSY.js";import"./Key01-BYwr89Cq.js";import"./XCircle-DcdOpEhZ.js";import"./LinkExternal01-CKBhcmnx.js";import"./LogOut01-FD1aivWo.js";import"./Monitor01-DglhG0d2.js";import"./Sun-3gadZPMK.js";import"./Package-BrHBRlvV.js";import"./Palette-DJJGWVQM.js";import"./Play-BlW23Kw8.js";import"./SearchLg-BJMZNLPz.js";import"./Shield01-AQo28rNc.js";import"./Stars01-DuankmF6.js";import"./Upload01-D4mHmAGn.js";import"./User01-CVt5zMT9.js";import"./Users01-Df3jcVcT.js";import"./XClose-CB7esYA7.js";import"./Zap-1Ijgmues.js";import"./auth-Cnpk6Qza.js";import"./studio-tools-DysRdJcu.js";import"./card-Br54bDFn.js";import"./capability-load-error-AllVD78v.js";const qe="basic-usage",We=[{id:qe,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_SEATS_GET","ORGANIZATION_SEATS_SET","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_SEATS_PREVIEW","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_INCLUDED_REPORT_SET","ORGANIZATION_REPORT_RUN_PAID","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...We.find(t=>t.id===qe)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===qe)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const i=new Set(e);for(const o of t.tools)i.add(o);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function rs(t){const e=J.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:o,totalToolsCount:c,onSelect:g,onToggle:h}=t,m=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==m?(f=W("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),e[0]=m,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Ze,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=u):u=e[6];let x;e[7]!==g||e[8]!==a||e[9]!==u?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[a,u]}),e[7]=g,e[8]=a,e[9]=u,e[10]=x):x=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==i||e[14]!==h||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(He,{checked:i,onCheckedChange:h,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=i,e[14]=h,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==f||e[18]!==x||e[19]!==d?(p=s.jsxs("div",{className:f,children:[x,d]}),e[17]=f,e[18]=x,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=J.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:o}=t,c=`tool-${l}-${n.name}`,g=i?"text-foreground":"text-muted-foreground";let h;e[0]!==g?(h=W("text-sm font-medium",g),e[0]=g,e[1]=h):h=e[1];let m;e[2]!==h||e[3]!==n.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:n.name})}),e[2]=h,e[3]=n.name,e[4]=m):m=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==m||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,f]}),e[7]=m,e[8]=f,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let x;e[10]!==i||e[11]!==o||e[12]!==u?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(He,{id:u,checked:i,onCheckedChange:o,onClick:ds})}),e[10]=i,e[11]=o,e[12]=u,e[13]=x):x=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==x?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const i=re(),[o,c]=$.useState(""),g=n!==void 0?n:o,h=$.useDeferredValue(g),[m,f]=$.useState("all"),[a,u]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:d}=Be(),p=$t({connectionId:Qt,orgId:d.id,orgSlug:d.slug}),C=100,R=h.trim(),_=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,A=!!l,N={..._&&{where:_},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:0,...A&&{include_virtual:!0}},v=JSON.stringify(N),{data:S,fetchNextPage:O,hasNextPage:M,isFetchingNextPage:E}=Kt({queryKey:me.collectionListInfinite(p,d.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await p.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{..._&&{where:_},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:T,...A&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,G)=>{if(T?.hasMore)return G.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),b=S?.pages.flatMap(T=>T?.items??[])??[],D=Yt(O,M??!1,E),r=l?b.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ht(T.connection_url)!==l):b,I=x.current,k=[...I.values()].map(T=>r.find(G=>G.id===T)).filter(T=>T!==void 0),L=r.filter(T=>!I.has(T.id)),z=[...k,...L],y=T=>{const G=t[T];return G!==void 0&&G.length>0},Y=z.filter(T=>{if(m==="all")return!0;const G=y(T.id);return m==="selected"?G:m==="unselected"?!G:!0}),[P,F]=$.useState(z[0]?.id??null),V=P?z.find(T=>T.id===P)??null:null,{data:U,isFetching:B}=Fe({queryKey:me.collectionItem(p,d.id,"","CONNECTIONS",P??""),queryFn:async()=>P?(await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:P}})).structuredContent?.item??null:null,enabled:!!P,staleTime:3e4}),Z=U?.tools??[],X=(T,G)=>t[T]?.includes(G)??!1,te=(T,G)=>{const Q=t[T]??[],q=Q.includes(G),ne={...t};if(q){const se=Q.filter(oe=>oe!==G);se.length===0?delete ne[T]:ne[T]=se}else ne[T]=[...Q,G];e(ne)},le=T=>{const G=T===P?Z:[];if(!G.length)return;const Q=t[T]??[],q=G.map(oe=>oe.name),ne=Q.length>0&&q.every(oe=>Q.includes(oe)),se={...t};ne?delete se[T]:(se[T]=q,F(T)),e(se)},K=T=>{F(T),u(!0)},H=()=>{u(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:W("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[n===void 0&&s.jsx(Zt,{value:o,onChange:c,placeholder:i("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>f("selected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>f("unselected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:Y.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:i(g?"common.toolSetSelector.noConnectionsFound":m==="selected"?"common.toolSetSelector.noServersSelected":m==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[Y.map(T=>{const G=P===T.id,Q=G?Z.length:0,q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:G?Z:T.tools},isSelected:G,hasToolsEnabled:y(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>K(T.id),onToggle:()=>le(T.id)},T.id)}),s.jsx("div",{ref:D,className:"h-4"}),E&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:W("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ce,{variant:"ghost",size:"sm",onClick:H,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Ft,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Ze,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):Z.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Z.map(T=>s.jsx(cs,{connectionId:V.id,tool:T,isSelected:X(V.id,T.name),onToggle:()=>te(V.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i("common.toolSetSelector.selectConnection")})})})]})}const us=Xe({role:Xe({id:ae().optional(),slug:ae().optional(),label:ae()}),allowAllStaticPermissions:et(),staticPermissions:Ue(ae()),toolSet:Je(ae(),Ue(ae())),allowAllModels:et(),modelSet:Je(ae(),Ue(ae())),memberIds:Ue(ae())});function it(t,e,l,n){const i=s.jsx(De,{checked:e,disabled:l,onCheckedChange:n});return l?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(Le,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):i}function fs(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re();let f;e[0]!==g?(f=g.trim().toLowerCase(),e[0]=g,e[1]=f):f=e[1];const a=$.useDeferredValue(f);let u;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==o||e[6]!==h||e[7]!==g||e[8]!==n||e[9]!==m){const x=os(),d=(E,b)=>{if(!h){if(l&&b){const D=x.flatMap(xs).flatMap(hs);i(!1),o(D.filter(r=>!E.tools.includes(r)));return}l||o(is(E,n,!b))}};let p;e[11]!==a?(p=E=>{const{section:b,capabilities:D}=E;return{section:b,capabilities:D.filter(r=>!a||r.label.toLowerCase().includes(a)||r.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const C=x.map(p).filter(gs);let R;e[13]!==m?(R=m("settings.orgRoleDetail.general"),e[13]=m,e[14]=R):R=e[14];let _;e[15]!==m?(_=m("settings.orgRoleDetail.allOrgPermissions"),e[15]=m,e[16]=_):_=e[16];let A;e[17]!==m?(A=m("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=m,e[18]=A):A=e[18];let N;e[19]!==l||e[20]!==i||e[21]!==o?(N=()=>{i(!l),o([])},e[19]=l,e[20]=i,e[21]=o,e[22]=N):N=e[22];let v;e[23]!==l||e[24]!==h||e[25]!==m||e[26]!==N?(v=it(m,l,h,N),e[23]=l,e[24]=h,e[25]=m,e[26]=N,e[27]=v):v=e[27];let S;e[28]!==l||e[29]!==i||e[30]!==o||e[31]!==h?(S=h?void 0:()=>{i(!l),o([])},e[28]=l,e[29]=i,e[30]=o,e[31]=h,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==_||e[35]!==A||e[36]!==v?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:v,onClick:S})}),e[33]=S,e[34]=_,e[35]=A,e[36]=v,e[37]=O):O=e[37];let M;e[38]!==O||e[39]!==R?(M=s.jsx(st,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=M):M=e[40],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[M,C.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:m("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:g})}):C.map(E=>{const{section:b,capabilities:D}=E;return s.jsx(st,{title:b,children:s.jsx(lt,{children:D.map(r=>{const I=ns(r,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[r.label,r.dangerous&&s.jsx(vt,{size:12,className:"text-warning shrink-0"})]}),description:r.description,action:it(m,I,h,()=>d(r,I)),onClick:h?void 0:()=>d(r,I)},r.id)})})},b)})]})}),e[2]=l,e[3]=a,e[4]=i,e[5]=o,e[6]=h,e[7]=g,e[8]=n,e[9]=m,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const bt=30;function _s(t){const e=J.c(40),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:o,models:c,allConnectionModelIds:g,selectedModels:h,allowAllModels:m,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:u,readOnly:x,defaultExpanded:d}=t,p=re(),[C,R]=$.useState(d),_=d||C,A=R,[N,v]=$.useState(bt);let S;e[0]!==f||e[1]!==m||e[2]!==h?(S=E=>m||f||h.includes("*")||h.includes(E),e[0]=f,e[1]=m,e[2]=h,e[3]=S):S=e[3];const O=S;let M;if(e[4]!==g||e[5]!==m||e[6]!==l||e[7]!==_||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==x||e[14]!==n||e[15]!==i||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=B=>O(B.id),e[19]=O,e[20]=E):E=e[20];const b=c.filter(E).length,D=c.slice(0,N),r=c.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(bs),e[21]=I):I=e[21];const k=o??Et[n]??It;let L;e[22]!==i||e[23]!==k?(L=s.jsx(Ze,{icon:k,name:i,size:"sm"}),e[22]=i,e[23]=k,e[24]=L):L=e[24];let z;e[25]!==i?(z=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=z):z=e[26];let y;e[27]!==L||e[28]!==z?(y=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,z]}),e[27]=L,e[28]=z,e[29]=y):y=e[29];const Y=p("settings.orgRoleDetail.enabledCount",{enabledCount:b,total:c.length});let P;e[30]!==Y?(P=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:Y}),e[30]=Y,e[31]=P):P=e[31];let F;e[32]!==_?(F=_?s.jsx(Jt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=F):F=e[33];let V;e[34]!==P||e[35]!==F?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[P,F]}),e[34]=P,e[35]=F,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==y?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[y,V]}),e[37]=V,e[38]=y,e[39]=U):U=e[39],M=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,_&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[D.map(B=>{const Z=O(B.id),X=()=>{if(!x){if(m){u(l,g,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:W("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:X,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ns,children:x?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:Z,disabled:!0,onCheckedChange:Ss})})}),s.jsx(Le,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:Z,onCheckedChange:X})})]},B.id)}),r&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=g,e[5]=m,e[6]=l,e[7]=_,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=x,e[14]=n,e[15]=i,e[16]=p,e[17]=N,e[18]=M}else M=e[18];return M}function Rs(t){return t+bt}function Ss(){}function Ns(t){return t.stopPropagation()}function bs(t){return!t}function Cs(t){const e=J.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:g,searchQuery:h,readOnly:m}=t,f=Xt(l.id);let a,u,x,d,p;if(e[0]!==g||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=f.filter(vs).map(_),N=h.trim().toLowerCase(),v=N?A.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):A;if(v.length===0){p=null;break e}const S=new Map;for(const I of v){const k=Ts(I.id,l.providerId),L=S.get(k)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),S.set(k,L)}const O=Array.from(S.entries()).map(js).sort(Os),M=O.length===1||N.length>0;x="flex flex-col gap-3";const E=Et[l.providerId]??It;let b;e[18]!==l.providerId||e[19]!==E?(b=s.jsx("img",{src:E,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=E,e[20]=b):b=e[20];const D=Nt[l.providerId]??l.providerId;let r;e[21]!==D?(r=s.jsx("h4",{className:"text-sm font-medium",children:D}),e[21]=D,e[22]=r):r=e[22],e[23]!==r||e[24]!==b?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[b,r]}),e[23]=r,e[24]=b,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:g,onToggleModel:o,onExitAllowAll:c,readOnly:m,defaultExpanded:M},I.id))}e[0]=g,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=f,e[8]=m,e[9]=h,e[10]=n,e[11]=a,e[12]=u,e[13]=x,e[14]=d,e[15]=p}else a=e[11],u=e[12],x=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let C;e[26]!==a||e[27]!==u?(C=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=C):C=e[28];let R;return e[29]!==x||e[30]!==d||e[31]!==C?(R=s.jsxs("div",{className:x,children:[d,C]}),e[29]=x,e[30]=d,e[31]=C,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(t){const e=J.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re(),f=$.useDeferredValue(g),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,b)=>{const D=n[E]??[],r={...n};if(D.includes(b)){const I=D.filter(k=>k!==b);I.length===0?delete r[E]:r[E]=I}else r[E]=[...D,b];o(r)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const x=u;let d;e[3]!==n||e[4]!==i||e[5]!==o?(d=(E,b,D)=>{i(!1),o({...n,[E]:b.filter(r=>r!==D)})},e[3]=n,e[4]=i,e[5]=o,e[6]=d):d=e[6];const p=d,C=!h&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==C?(R=W("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",C),e[7]=C,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==h?(_=()=>{if(h)return;const E=!l;i(E),E&&o({})},e[9]=l,e[10]=i,e[11]=o,e[12]=h,e[13]=_):_=e[13];let A;e[14]!==m?(A=m("settings.orgRoleDetail.allModels"),e[14]=m,e[15]=A):A=e[15];let N;e[16]!==A?(N=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=N):N=e[17];let v;e[18]!==l||e[19]!==i||e[20]!==o||e[21]!==h||e[22]!==m?(v=s.jsx("div",{onClick:ys,children:h?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:m("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{i(E),E&&o({})}})}),e[18]=l,e[19]=i,e[20]=o,e[21]=h,e[22]=m,e[23]=v):v=e[23];let S;e[24]!==R||e[25]!==_||e[26]!==N||e[27]!==v?(S=s.jsxs("div",{className:R,onClick:_,children:[N,v]}),e[24]=R,e[25]=_,e[26]=N,e[27]=v,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==f||e[32]!==p||e[33]!==n||e[34]!==h||e[35]!==m||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:m("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),m("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Cs,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:f,readOnly:h})},E.id)),e[29]=a,e[30]=l,e[31]=f,e[32]=p,e[33]=n,e[34]=h,e[35]=m,e[36]=x,e[37]=O):O=e[37];let M;return e[38]!==S||e[39]!==O?(M=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=M):M=e[40],M}function Ds(){}function ys(t){return t.stopPropagation()}function Ps(t){const e=J.c(75),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:o}=t,c=re(),[g,h]=$.useState(""),m=$.useDeferredValue(g);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[a,u]=$.useState(f),{data:x}=_t();let d,p,C,R,_,A,N,v,S,O,M;if(e[1]!==x?.data?.members||e[2]!==m||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==g||e[8]!==i||e[9]!==c){const P=x?.data?.members??[];let F;e[21]!==m?(F=K=>{const H=m.toLowerCase();return K.user?.name?.toLowerCase().includes(H)||K.user?.email?.toLowerCase().includes(H)},e[21]=m,e[22]=F):F=e[22];const V=P.filter(F);let U;e[23]!==o||e[24]!==n||e[25]!==a?(U=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=U):U=e[26],C=U,p=mt,O=l,M=n,d=ut,v="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let Z;e[29]!==B?(Z=s.jsx(ft,{children:B}),e[29]=B,e[30]=Z):Z=e[30];let X;e[31]!==c?(X=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=X):X=e[32];let te;e[33]!==X?(te=s.jsx(gt,{children:X}),e[33]=X,e[34]=te):te=e[34],e[35]!==Z||e[36]!==te?(S=s.jsxs(ht,{className:"px-6 pt-6",children:[Z,te]}),e[35]=Z,e[36]=te,e[37]=S):S=e[37],A="flex flex-col h-80";let le;e[38]!==c?(le=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=le):le=e[39],e[40]!==g||e[41]!==le?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:g,onChange:h,placeholder:le,className:"w-full"})}),e[40]=g,e[41]=le,e[42]=N):N=e[42],R="flex-1 overflow-auto",_=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(g?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(K=>{const H=K.role!=="owner",T=i.includes(K.id),G=a.includes(K.id);return s.jsxs("label",{className:W("flex items-center gap-3 p-2 rounded-lg",!H||T?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(He,{checked:G||T,onCheckedChange:()=>{!H||T||u(Q=>Q.includes(K.id)?Q.filter(q=>q!==K.id):[...Q,K.id])},disabled:!H||T}),s.jsx(St,{url:K.user?.image??void 0,fallback:Rt(K.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:K.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:K.user?.email})]}),!H&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),T&&H&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},K.id)})}),e[1]=x?.data?.members,e[2]=m,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=g,e[8]=i,e[9]=c,e[10]=d,e[11]=p,e[12]=C,e[13]=R,e[14]=_,e[15]=A,e[16]=N,e[17]=v,e[18]=S,e[19]=O,e[20]=M}else d=e[10],p=e[11],C=e[12],R=e[13],_=e[14],A=e[15],N=e[16],v=e[17],S=e[18],O=e[19],M=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let b;e[46]!==E||e[47]!==A||e[48]!==N?(b=s.jsxs("div",{className:A,children:[N,E]}),e[46]=E,e[47]=A,e[48]=N,e[49]=b):b=e[49];let D;e[50]!==c?(D=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=D):D=e[51];let r;e[52]!==D?(r=s.jsx(xt,{children:D}),e[52]=D,e[53]=r):r=e[53];const I=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let L;e[57]!==C||e[58]!==I||e[59]!==k?(L=s.jsx(pt,{onClick:C,disabled:I,children:k}),e[57]=C,e[58]=I,e[59]=k,e[60]=L):L=e[60];let z;e[61]!==r||e[62]!==L?(z=s.jsxs(Tt,{className:"px-6 pb-6",children:[r,L]}),e[61]=r,e[62]=L,e[63]=z):z=e[63];let y;e[64]!==d||e[65]!==b||e[66]!==z||e[67]!==v||e[68]!==S?(y=s.jsxs(d,{className:v,children:[S,b,z]}),e[64]=d,e[65]=b,e[66]=z,e[67]=v,e[68]=S,e[69]=y):y=e[69];let Y;return e[70]!==p||e[71]!==y||e[72]!==O||e[73]!==M?(Y=s.jsx(p,{open:O,onOpenChange:M,children:y}),e[70]=p,e[71]=y,e[72]=O,e[73]=M,e[74]=Y):Y=e[74],Y}function ws(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:g,onAddMemberDialogOpenChange:h}=t,m=i===void 0?!1:i,f=o===void 0?void 0:o,a=re(),u=$.useDeferredValue(c),{data:x}=_t();let d,p,C;if(e[0]!==x?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==f||e[6]!==c||e[7]!==a){const v=x?.data?.members??[];let S;e[11]!==l?(S=r=>l.includes(r.id),e[11]=l,e[12]=S):S=e[12];const O=v.filter(S);let M;e[13]!==u?(M=r=>{const I=u.toLowerCase();return r.user?.name?.toLowerCase().includes(I)||r.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=M):M=e[14];const E=O.filter(M);let b;e[15]!==f||e[16]!==a?(b=f??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=f,e[16]=a,e[17]=b):b=e[17];const D=b;C="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(r=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(St,{url:r.user?.image??void 0,fallback:Rt(r.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.user?.email})]}),m?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsx(ce,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:D})})]})}):s.jsx(ce,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(I=>I!==r.id)),children:s.jsx(nt,{size:16})})]},r.id))}),e[0]=x?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=m,e[5]=f,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=C}else d=e[8],p=e[9],C=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let _;e[21]!==l||e[22]!==n?(_=v=>n([...l,...v]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==g||e[25]!==l||e[26]!==h||e[27]!==_?(A=s.jsx(Ps,{open:g,onOpenChange:h,selectedMemberIds:l,onAddMembers:_}),e[24]=g,e[25]=l,e[26]=h,e[27]=_,e[28]=A):A=e[28];let N;return e[29]!==C||e[30]!==R||e[31]!==A?(N=s.jsxs("div",{className:C,children:[R,A]}),e[29]=C,e[30]=R,e[31]=A,e[32]=N):N=e[32],N}function Ls(t){const e=J.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx($.Suspense,{fallback:l,children:s.jsx(ws,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Gs={owner:[],admin:[],user:[]};function ks(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Gs[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},i=n.self||[],o=i.includes("*"),c=o?[]:i.filter(a=>a!=="*"),g={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)g[x.id]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u;else{const x=l.find(d=>d.id===a);x&&(g[a]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u)}const h=n.models||[],m=h.length===0||h.includes("*:*"),f={};if(!m)for(const a of h){const u=a.indexOf(":");if(u===-1)continue;const x=a.slice(0,u),d=a.slice(u+1);f[x]||(f[x]=[]),f[x].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:g,allowAllModels:m,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const c=e.find(g=>g.id===n)?.tools?.map(g=>g.name)??[];l[n]=c.length>0&&c.every(g=>i.includes(g))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${i}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?ks(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function zs(t){const e=J.c(19),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,o=n===void 0?void 0:n,c=re();let g;e[0]!==o||e[1]!==c?(g=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=g):g=e[2];const h=g;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let d;e[6]!==x?(d=s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ce,{variant:"outline",size:"sm",disabled:!0,children:[u,x]})})}),e[6]=x,e[7]=d):d=e[7];let p;e[8]!==h?(p=s.jsx(Le,{children:s.jsx("p",{children:h})}),e[8]=h,e[9]=p):p=e[9];let C;return e[10]!==d||e[11]!==p?(C=s.jsx(ye,{children:s.jsxs(Pe,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=C):C=e[12],C}let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ye,{size:16}),e[13]=m):m=e[13];let f;e[14]!==c?(f=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=f):f=e[15];let a;return e[16]!==i||e[17]!==f?(a=s.jsxs(ce,{variant:"outline",size:"sm",onClick:i,children:[m,f]}),e[16]=i,e[17]=f,e[18]=a):a=e[18],a}function Ys(t){const e=J.c(14),{locator:l}=Be(),n=$e(),i=qt();let o;e[0]!==l?(o=me.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let g;e[4]!==o||e[5]!==c?(g={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=g):g=e[6];const{data:h,isPending:m}=Fe(g);if(m||!i){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let f;e[8]!==h?.data?.members?(f=h?.data?.members??[],e[8]=h?.data?.members,e[9]=f):f=e[9];const a=f;let u;return e[10]!==i||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const o=re(),{locator:c}=Be(),g=$e(),h=rt(),m=t.kind==="builtin",f=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,x]=$.useState(m?"org":"mcp"),d=Ot({resolver:jt(us),defaultValues:Vs(t,n,i)}),p=d.formState.isValid,C=d.formState.isDirty,R=at({mutationFn:async r=>{const I=Bs(r,i),k=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-"),L=(r.role.slug==="owner"||r.role.slug==="admin"||r.role.slug==="user")&&!r.role.id,z=async(y,Y)=>{const P=n.filter(U=>U.role===(Y??y)).map(U=>U.id),F=r.memberIds.filter(U=>!P.includes(U)),V=P.filter(U=>!r.memberIds.includes(U));for(const U of F){const B=await g.organization.updateMemberRole({memberId:U,role:[y]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await g.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(L)return await z(r.role.slug),r;if(r.role.id){const y=r.role.label.toLowerCase().replace(/\s+/g,"-"),Y=r.role.slug,P=y!==Y,F=await g.organization.updateRole({roleId:r.role.id,data:{permission:I,...P?{roleName:y}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await z(P?y:Y,P?Y:void 0),P?{...r,role:{...r.role,slug:y}}:r}else{const y=await g.organization.createRole({role:k,permission:I});if(y?.error)throw new Error(y.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const Y of r.memberIds){const P=await g.organization.updateMemberRole({memberId:Y,role:[k]});if(P?.error)throw new Error(P.error.message)}return{...r,role:{...r.role,id:y.data?.roleData?.id,slug:k}}}},onSuccess:(r,I)=>{h.invalidateQueries({queryKey:me.members(c)}),h.invalidateQueries({queryKey:me.organizationRoles(c)});const k=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":k?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(r),l(r.role.id)},onError:r=>{ve.error(r instanceof Error?r.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(r=>{if(!r.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(r)}),A=!f,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...f?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,O]=$.useState(""),[M,E]=$.useState(!1),b=r=>{x(r),O("")},D={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ie,{children:s.jsxs(ie.Content,{className:W("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ie.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ce,{size:"sm",onClick:_,disabled:R.isPending||!p||!C,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):wt(d.watch("role.label")))}),f&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(r=>s.jsx("button",{type:"button",onClick:()=>b(r.id),className:W("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===r.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:r.label},r.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:S,onChange:O,placeholder:D[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(zs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:W("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:W(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!f&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0}),searchQuery:S}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="models"&&s.jsx(Ms,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:r=>d.setValue("allowAllModels",r,{shouldDirty:!0}),onModelSetChange:r=>d.setValue("modelSet",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="members"&&s.jsx(Ls,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:M,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=J.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:o,error:c}=ts();let g;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==i||e[4]!==o?(g=s.jsx(ss,{granted:i,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=i,e[4]=o,e[5]=g):g=e[5],g}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Zs(){const t=J.c(135),e=re(),[l,n]=$.useState(""),[i,o]=$.useState(null),c=Dt();let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},t[0]=g):g=t[0];const{role:h}=yt(g),{locator:m}=Be(),f=$e(),a=rt(),{customRoles:u,refetch:x}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:w=>({...w,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let C;e:{if(!h){C=null;break e}if(h==="new"){C={kind:"new"};break e}if(h.startsWith("builtin-")){C={kind:"builtin",role:h.slice(8)};break e}let j;t[3]!==h?(j=ee=>ee.id===h,t[3]=h,t[4]=j):j=t[4];const w=u.find(j);C=w?{kind:"custom",role:w}:null}const R=C;let _;t[5]!==m?(_=me.members(m),t[5]=m,t[6]=_):_=t[6];let A;t[7]!==f?(A=()=>f.organization.listMembers(),t[7]=f,t[8]=A):A=t[8];let N;t[9]!==_||t[10]!==A?(N={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=N):N=t[11];const{data:v}=Fe(N);let S;t[12]!==v?.data?.members?(S=v?.data?.members??[],t[12]=v?.data?.members,t[13]=S):S=t[13];const O=S;let M;t[14]!==O?(M=j=>O.filter(w=>w.role===j).length,t[14]=O,t[15]=M):M=t[15];const E=M;let b;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=de=>({kind:"builtin",role:{...de,memberCount:E(de.role),label:e(de.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const w=Qs.map(j);let ee;t[24]!==E?(ee=de=>({kind:"custom",role:{...de,memberCount:E(de.role)}}),t[24]=E,t[25]=ee):ee=t[25];const Ct=u.map(ee);if(b=[...w,...Ct],l){const de=l.toLowerCase();b=b.filter(At=>At.role.label.toLowerCase().includes(de))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=b}else b=t[20];let D;t[26]!==f?(D=async j=>{const w=await f.organization.deleteRole({roleId:j});if(w?.error)throw new Error(w.error.message);return w?.data},t[26]=f,t[27]=D):D=t[27];const r=at({mutationFn:D,onSuccess:(j,w)=>{Ke("role_deleted",{role_id:w}),a.invalidateQueries({queryKey:me.members(m)}),a.invalidateQueries({queryKey:me.organizationRoles(m)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===w&&p(void 0)},onError:Js});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let k;t[30]!==I?(k={id:"role",header:I,render:Xs,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=k):k=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let z;t[34]!==e?(z=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=z):z=t[35];let y;t[36]!==L||t[37]!==z?(y={id:"type",header:L,render:z,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=z,t[38]=y):y=t[38];let Y;t[39]!==e?(Y=e("settings.roles.columnPermissions"),t[39]=e,t[40]=Y):Y=t[40];let P;t[41]!==e?(P=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const w=j.role,ee=[];return w.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):w.staticPermissionCount&&w.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:w.staticPermissionCount})),w.allowsAllConnections?ee.push(e("settings.roles.allConnections")):w.connectionCount&&w.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:w.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=P):P=t[42];let F;t[43]!==Y||t[44]!==P?(F={id:"permissions",header:Y,render:P,cellClassName:"flex-1 min-w-0"},t[43]=Y,t[44]=P,t[45]=F):F=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(Lt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(kt,{align:"end",onClick:Hs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const w=j.role;w.id&&o({id:w.id,label:w.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let Z;t[52]!==k||t[53]!==y||t[54]!==F||t[55]!==U||t[56]!==B?(Z=[k,y,F,U,B],t[52]=k,t[53]=y,t[54]=F,t[55]=U,t[56]=B,t[57]=Z):Z=t[57];const X=Z;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const w=j.role;p(w.id)}},t[58]=p,t[59]=te):te=t[59];const le=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let w;return t[62]!==x||t[63]!==p?(w=()=>{x(),p(void 0)},t[62]=x,t[63]=p,t[64]=w):w=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:w},Ks(R))}let K;t[65]!==e?(K=e("settings.roles.pageTitle"),t[65]=e,t[66]=K):K=t[66];let H;t[67]!==K?(H=s.jsx(ie.Title,{children:K}),t[67]=K,t[68]=H):H=t[68];let T;t[69]!==e?(T=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=T):T=t[70];let G;t[71]===Symbol.for("react.memo_cache_sentinel")?(G=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=G):G=t[71];let Q;t[72]!==l||t[73]!==T?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:G}),t[72]=l,t[73]=T,t[74]=Q):Q=t[74];let q;t[75]!==p?(q=()=>p("new"),t[75]=p,t[76]=q):q=t[76];let ne;t[77]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(Ye,{size:16}),t[77]=ne):ne=t[77];let se;t[78]!==e?(se=e("settings.roles.createRole"),t[78]=e,t[79]=se):se=t[79];let oe;t[80]!==q||t[81]!==se?(oe=s.jsxs(ce,{onClick:q,children:[ne,se]}),t[80]=q,t[81]=se,t[82]=oe):oe=t[82];let ue;t[83]!==Q||t[84]!==oe?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,oe]}),t[83]=Q,t[84]=oe,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==b||t[90]!==X||t[91]!==le||t[92]!==fe?(ge=s.jsx(zt,{columns:X,data:b,isLoading:!1,onRowClick:le,emptyState:fe}),t[89]=b,t[90]=X,t[91]=le,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==H||t[95]!==ue||t[96]!==ge?(he=s.jsx(ie.Content,{children:s.jsx(ie.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[H,ue,ge]})})}),t[94]=H,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=i!==null;let Ge;t[98]===Symbol.for("react.memo_cache_sentinel")?(Ge=j=>!j&&o(null),t[98]=Ge):Ge=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const ze=i?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,t[114]=Re):Re=t[114];let Se;t[115]!==r||t[116]!==i?(Se=()=>{i?.id&&r.mutate(i.id),o(null)},t[115]=r,t[116]=i,t[117]=Se):Se=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let be;t[120]!==Se||t[121]!==Ne?(be=s.jsx(pt,{onClick:Se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=Se,t[121]=Ne,t[122]=be):be=t[122];let Ce;t[123]!==Re||t[124]!==be?(Ce=s.jsxs(Tt,{children:[Re,be]}),t[123]=Re,t[124]=be,t[125]=Ce):Ce=t[125];let Ae;t[126]!==Ie||t[127]!==Ce?(Ae=s.jsxs(ut,{children:[Ie,Ce]}),t[126]=Ie,t[127]=Ce,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:Ge,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let ke;return t[132]!==he||t[133]!==Oe?(ke=s.jsxs(ie,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=ke):ke=t[134],ke}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Xs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",dt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Js(t,e){Ke("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=J.c(7),e=re();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($.Suspense,{fallback:s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Zs,{})}),t[4]=i):i=t[4];let o;return t[5]!==n?(o=s.jsx(Mt,{fallback:n,children:i}),t[5]=n,t[6]=o):o=t[6],o}function Po(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Po as default};
@@ -1 +1 @@
1
- import{c as b,m as w,j as a,k as j}from"./index-OL3R77fI.js";import{i as k}from"./SearchMd-BrD-cd_r.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:m,disabled:i}=f,p=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==m?(n=m?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(k,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=m,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==p||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=p,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{c as b,m as w,j as a,k as j}from"./index-dNvo17TY.js";import{i as k}from"./SearchMd-Dvao3UqZ.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:m,disabled:i}=f,p=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==m?(n=m?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(k,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=m,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==p||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=p,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-OL3R77fI.js";import{i as F}from"./AlertCircle-DK36ztTJ.js";import{s as E}from"./Plus-T77LDyNx.js";import{s as B}from"./User01-DvG56ZWG.js";import{t as L}from"./Users01-BLP_h_4S.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-FImDKsaC.js";import{I as z}from"./input-DgjVA9qC.js";import{L as N}from"./label-qw23FVkg.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-Cq8RdhNJ.js";import{S as M}from"./skeleton-D6VHo4EZ.js";import{T as Q}from"./textarea-BcQnh26i.js";import{P as C}from"./index-lOGFC8V2.js";import{c as U}from"./settings-section-LBRkXW6q.js";import{u as W,a as X}from"./use-secrets-DRbY3ncG.js";import{R as Y}from"./require-capability-C1InfZ4C.js";import"./X-LakbiULD.js";import"./tooltip-D_7O_PaP.js";import"./Check-CpPKSRkX.js";import"./ChevronDown-CyntSUXM.js";import"./ChevronUp-CYn2F25s.js";import"./sidebar-CA_GtKuw.js";import"./LayoutLeft-L2Wkb8sz.js";import"./use-mobile-CeuMa6ib.js";import"./card-FqBeWO-i.js";import"./ArrowUpRight-W5JdzCod.js";import"./studio-tools-DgseDYp-.js";import"./use-capability-LtqDjP9s.js";import"./access-gate-DGGPFLJY.js";import"./capability-load-error-DypmA8fC.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"":"s";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e("settings.secrets.secretsCount",{count:r.length,plural:p}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
1
+ import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-dNvo17TY.js";import{i as F}from"./AlertCircle-SVkdglM5.js";import{s as E}from"./Plus-YNEa18MU.js";import{s as B}from"./User01-CVt5zMT9.js";import{t as L}from"./Users01-Df3jcVcT.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-DdDhMIgC.js";import{I as z}from"./input-Bde2PvG3.js";import{L as N}from"./label-gjjx6LT8.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-CarKrHKp.js";import{S as M}from"./skeleton-CQhKsrHO.js";import{T as Q}from"./textarea-LQJIt3OL.js";import{P as C}from"./index-DG04vqxi.js";import{c as U}from"./settings-section-D15E7ooI.js";import{u as W,a as X}from"./use-secrets-BmVXUvco.js";import{R as Y}from"./require-capability-C2ZqeJBu.js";import"./X-DNGu5XTw.js";import"./tooltip-CXWhkXAN.js";import"./Check-B4CLdvYI.js";import"./ChevronDown-CNxoymO2.js";import"./ChevronUp-B-3hc4bz.js";import"./sidebar-CXBLzXTv.js";import"./LayoutLeft-D5OOMr76.js";import"./use-mobile-Be0GzI6n.js";import"./card-Br54bDFn.js";import"./ArrowUpRight-DG0flMIc.js";import"./studio-tools-DysRdJcu.js";import"./use-capability-CBmNgE0z.js";import"./access-gate-Z0tIQuZD.js";import"./capability-load-error-AllVD78v.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"":"s";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e("settings.secrets.secretsCount",{count:r.length,plural:p}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
@@ -0,0 +1,2 @@
1
+ import{c as He,b as rt,r as V,m as Fe,j as n,af as Gn,B as Je,k as Wn,o as _a,t as Q,K as ja}from"./index-dNvo17TY.js";import{a3 as Ea,a4 as ka,a5 as Ra,H as Un,J as Yt,a6 as qn,a7 as Jn,K as Yn,P as Qn,i as Xn,a8 as wa,V as Zn,W as es,a9 as Va,aa as Na,G as Da,L as ts,M as At,Q as ns,U as ss,N as as,_ as os,ab as Ta,ac as Mt,ad as Pa,S as is,ae as it,af as Ca,ag as Aa,ah as Ma,ai as Ka,e as La,k as Ba,aj as Fa,ak as Oa,al as Ia,am as $a,r as Gt,an as Wt,ao as za,ap as xt,aq as Tt,ar as Ha,as as Ga,at as Ze,au as Pn,av as Wa,aw as Pt,ax as Ut,ay as Ua,az as un,aA as qa,aB as wt,aC as Ja,aD as Ya,aE as Qa,aF as Xa,aG as Za,aH as bt,aI as eo,aJ as to,aK as no,m as so,aL as Cn,aM as Ct,aN as ao,aO as oo,aP as io,aQ as ro,aR as dn,aS as An,aT as Mn,aU as Vt,aV as qt,aW as Kn,aX as lo,aY as mn,aZ as co,a_ as uo,a$ as mo,b0 as Ln,b1 as fo,b2 as po}from"./index-CjrIBBwH.js";import{t as go}from"./ChevronDown-CNxoymO2.js";import{a0 as pn,V as rs,G as ho,z as ls,a1 as vo,a2 as So}from"./agent-icon-6ZgcobdH.js";import{i as cs}from"./ChevronRight-DwRt0L3b.js";import{n as xo}from"./ChevronUp-B-3hc4bz.js";import{i as bo}from"./Globe01-pEx_1GgK.js";import{m as Jt}from"./automation-runs-C0yVZsV6.js";import{c as yt,T as _t,a as jt}from"./tooltip-CXWhkXAN.js";import{b as yo,h as _o,a as jo,c as Eo,d as ko,e as Ro}from"./dialog-DdDhMIgC.js";import{I as wo}from"./input-Bde2PvG3.js";import{a as us}from"./Copy01-CMvogd8K.js";import{c as Vo}from"./ZoomOut-Cy0YD81B.js";import{i as No}from"./Settings02-YmXuGUsK.js";import{s as Do}from"./Eye-D_G5gb6c.js";import{s as ds}from"./TrendUp01-D5IxhiTp.js";import{s as gn}from"./Plus-YNEa18MU.js";import{s as ms}from"./Trash01-DxLrtNwI.js";import{i as To}from"./Zap-1Ijgmues.js";import{a as vt,D as fs,b as ps,c as gs,i as Po}from"./dropdown-menu-CwkaxWi4.js";import{S as Co,r as Bn,a as Ao,d as Mo,b as Ko,i as Lo,f as Bo,P as Fo,c as Oo}from"./page-seo-form-0A9v5c26.js";import{b as Io}from"./Tool01-DZGxkW_G.js";import{A as $o}from"./add-section-modal-BjSXt_Ft.js";import"./ArrowUp-MLVAquzH.js";import"./chat-context-CI4nbgci.js";import"./autosend-Cyh1j9FI.js";import"./hooks-QAnxouCY.js";import"./use-mcp-client-BHwO73my.js";import"./auth-Cnpk6Qza.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-D8DPyDew.js";import"./studio-tools-DysRdJcu.js";import"./use-virtual-mcp-BDiB3K2g.js";import"./use-ai-providers-DGiZffHP.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-44mCejxv.js";import"./use-organization-settings-BpI1NVk5.js";import"./drawer-Cbnt7O-A.js";import"./collection-search-D29vjBdu.js";import"./SearchMd-Dvao3UqZ.js";import"./use-mobile-Be0GzI6n.js";import"./AreaChart-Df1Li3kS.js";import"./index-BHSaoCA_.js";import"./calendar-BBADsJX8.js";import"./X-DNGu5XTw.js";import"./shell-layout-Dlcr5E8e.js";import"./avatar-BW70eOki.js";import"./User01-CVt5zMT9.js";import"./Users03-Bs7e93NA.js";import"./SearchLg-BJMZNLPz.js";import"./Stars02-Bj86wrgZ.js";import"./XClose-CB7esYA7.js";import"./CheckCircle-ClGa5zl8.js";import"./FilterLines-DEwr_1sT.js";import"./required-auth-layout-Bp2v8XrU.js";import"./use-org-sso-Oys9HXPt.js";import"./index-kbCY_Lnd.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-BIUTZZZa.js";import"./popover-c7eoGO3I.js";import"./use-registry-app-DCTQM0ZE.js";import"./use-mcp-tools-DOOSLqBK.js";import"./use-connection-BgF_QzXd.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CKqHS4SM.js";import"./mcp-oauth-BUu6XHC4.js";import"./extract-connection-data-SOVeqaEf.js";import"./metadata-dUsYcpuu.js";import"./use-members-Dk3MTFEE.js";import"./use-org-auth-client-B-WzKHHI.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-SVkdglM5.js";import"./DotsVertical-DZ0vOWt6.js";import"./use-copy-Dkvs0tIh.js";import"./Check-B4CLdvYI.js";import"./LinkExternal01-CKBhcmnx.js";import"./command-lMWlEGpB.js";import"./index-B2TW_Tc6.js";import"./ArrowRight-BxqI3bui.js";import"./companions-core-Ysv-f1nZ.js";import"./ZapSquare-CXyhxPYr.js";import"./Star01-CwoWZQS4.js";import"./Image01-hn4tRlSY.js";import"./Upload01-D4mHmAGn.js";import"./form-CkVSdutp.js";import"./label-gjjx6LT8.js";import"./select-CarKrHKp.js";import"./tabs-DzHKysHp.js";import"./Tool02-BvZQP5qO.js";import"./toggle-group-8m12csXH.js";import"./use-deco-credits-DckR5ZY0.js";import"./sidebar-CXBLzXTv.js";import"./LayoutLeft-D5OOMr76.js";import"./alert-dialog-DF_tGxsa.js";import"./toolbar-icon-button-BllHpuFd.js";import"./skeleton-CQhKsrHO.js";import"./github-repo-picker-CG-o5MBt.js";import"./use-debounced-value-CLpLkR9v.js";import"./use-navigate-to-agent-BBulir8t.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-Dcyt8aiQ.js";import"./use-registry-connections-89yqlYzI.js";import"./useInfiniteQuery-DG-ds5RA.js";import"./use-infinite-scroll-BAcSrC7N.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-Br54bDFn.js";import"./integration-icon-DueQrR1U.js";import"./textarea-LQJIt3OL.js";import"./connection-form-helpers-PAzOM4y0.js";import"./collection-tabs-B_iwXxJh.js";import"./badge-bTEbYhrk.js";import"./useSuspenseInfiniteQuery-B4X4g3L9.js";import"./Monitor01-DglhG0d2.js";import"./connect-desktop-dialog-D8sK3EEk.js";import"./select-model-B6CE2WIr.js";import"./checkbox-CAxq-T45.js";import"./Key01-BYwr89Cq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D15E7ooI.js";import"./ArrowUpRight-DG0flMIc.js";import"./Stars01-DuankmF6.js";import"./index-CQn2KfW0.js";import"./Palette-DJJGWVQM.js";import"./file-type-icon-CljbxK2Q.js";import"./toolbar-Cd74BCqt.js";import"./Package-BrHBRlvV.js";import"./index-DSb-FJOs.js";import"./XCircle-DcdOpEhZ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BAdfOhh8.js";import"./empty-state-uROosaY2.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-CBmNgE0z.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-DGd2a9ic.js";import"./Play-BlW23Kw8.js";import"./use-debounced-autosave-beiuz3Qi.js";import"./index-DG04vqxi.js";import"./search-input-CopgfT3D.js";import"./switch-W15nd4O3.js";import"./Users01-Df3jcVcT.js";import"./use-secrets-BmVXUvco.js";import"./useQueries-DnIQBt4G.js";import"./monaco-editor-DSIF9trn.js";import"./use-file-configs-D3AD3H9H.js";import"./use-automations-Bbv-8fSD.js";import"./automation-list-row-DHUstmJS.js";import"./Globe04-DR3EXf_Z.js";import"./HardDrive-IZ1ZbZos.js";import"./LogOut01-FD1aivWo.js";import"./Sun-3gadZPMK.js";import"./Shield01-AQo28rNc.js";import"./table-DOgTrCQg.js";import"./use-clock-tick-DY0x6n8E.js";function zo(g){return g.schema?.definitions??g.schema?.$defs??{}}function Ho(g,e){const o=zo(e),d=o[btoa(g)];if(!d)return;let f=typeof d.image=="string"?d.image:void 0;if(!f&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),m=o[b];f=typeof m?.image=="string"?m.image:void 0}}if(f?.includes("{{{"))return f}function Go(g,e){if(!e)return;const o=Ea(g);if(!o)return;const d=Ho(o.resolveType,e);if(!d)return;const f=ka(d,o.data);if(f)return Ra(f)}const Wo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Uo="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Fn(g){return Array.from({length:g},(e,o)=>({id:crypto.randomUUID(),index:o}))}function hs(g){return g.map((e,o)=>({...e,index:o}))}function qo(g,e){if(e===g.length)return g;if(e<g.length)return hs(g.slice(0,e));const o=Array.from({length:e-g.length},(d,f)=>({id:crypto.randomUUID(),index:g.length+f}));return[...g,...o]}function vs(g){const e=He.c(20),{section:o,raw:d,meta:f}=g,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let m;e[0]!==f||e[1]!==d?(m=d&&f?Go(d,f):void 0,e[0]=f,e[1]=d,e[2]=m):m=e[2];const h=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Vo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==h?(y=h&&n.jsx("img",{src:h,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=h,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:Da}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(pn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let r;e[11]!==E?(r=Fe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=r):r=e[12];let p;e[13]!==o.label||e[14]!==r?(p=n.jsx("span",{className:r,children:o.label}),e[13]=o.label,e[14]=r,e[15]=p):p=e[15];let i;return e[16]!==y||e[17]!==D||e[18]!==p?(i=n.jsxs(n.Fragment,{children:[u,y,D,p]}),e[16]=y,e[17]=D,e[18]=p,e[19]=i):i=e[19],i}function Ss(g,e){const o=g.isSavedBlock===!0,d=g.isMultivariate===!0;return Fe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Wo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Jo(g){const e=He.c(81),{section:o,raw:d,meta:f,sortableId:x,selected:b,onSelect:m,onDelete:h,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:r}=g,p=rt(),i=d?Xn(d.__resolveType??""):!1;let P;e[0]!==o?(P=wa(o),e[0]=o,e[1]=P):P=e[1];const l=P;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ei},e[2]=x,e[3]=R):R=e[3];const{attributes:A,listeners:z,setNodeRef:v,transform:C,isDragging:ie}=Zn(R);let L;e[4]!==C?(L=es.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=L):L=e[5];const ue=ie?0:void 0;let K;e[6]!==L||e[7]!==ue?(K={transform:L,opacity:ue},e[6]=L,e[7]=ue,e[8]=K):K=e[8];const ge=K;let B;e[9]!==o?(B=Va(o),e[9]=o,e[10]=B):B=e[10];const se=B,he="button",fe=0;let F;e[11]!==m?(F=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),m())},e[11]=m,e[12]=F):F=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let X;e[13]!==o||e[14]!==b||e[15]!==J?(X=Fe("touch-none transition-colors",J,Ss(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=X):X=e[16];let re;e[17]!==f||e[18]!==d||e[19]!==o?(re=n.jsx(vs,{section:o,raw:d,meta:f}),e[17]=f,e[18]=d,e[19]=o,e[20]=re):re=e[20];const O=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Fe("h-7 w-7 shrink-0",i?"":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),D()},onPointerDown:Zo,children:n.jsx(To,{className:Fe("h-3.5 w-3.5",i&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:p(i?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ke;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==p?(Ke=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection"),className:Fe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),k()},onPointerDown:Xo,children:o.isHidden?n.jsx(No,{className:"h-3.5 w-3.5"}):n.jsx(Do,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=p,e[25]=Ke):Ke=e[25];let Z;e[26]!==p?(Z=p("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=p,e[27]=Z):Z=e[27];let Le;e[28]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(rs,{className:"h-3.5 w-3.5"}),e[28]=Le):Le=e[28];let ve;e[29]!==Z?(ve=n.jsx(fs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Qo,onPointerDown:Yo,children:Le})}),e[29]=Z,e[30]=ve):ve=e[30];let de;e[31]!==u?(de=G=>{G.stopPropagation(),u()},e[31]=u,e[32]=de):de=e[32];let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(us,{className:"h-4 w-4"}),e[33]=oe):oe=e[33];let ee;e[34]!==p?(ee=p("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=p,e[35]=ee):ee=e[35];let le;e[36]!==de||e[37]!==ee?(le=n.jsxs(vt,{onClick:de,children:[oe,ee]}),e[36]=de,e[37]=ee,e[38]=le):le=e[38];let pe;e[39]!==l||e[40]!==E||e[41]!==p?(pe=l&&n.jsxs(vt,{className:Na,onClick:G=>{G.stopPropagation(),E()},children:[n.jsx(ds,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=p,e[42]=pe):pe=e[42];let ke;e[43]!==se||e[44]!==y||e[45]!==p?(ke=se&&n.jsxs(vt,{className:Uo,onClick:G=>{G.stopPropagation(),y()},children:[n.jsx(pn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=se,e[44]=y,e[45]=p,e[46]=ke):ke=e[46];let Re;e[47]!==r||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==p?(Re=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:G=>{G.stopPropagation(),r()},children:[n.jsx(pn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=r,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=p,e[51]=Re):Re=e[51];let Se;e[52]!==h?(Se=G=>{G.stopPropagation(),h()},e[52]=h,e[53]=Se):Se=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(ms,{className:"h-4 w-4"}),e[54]=De):De=e[54];let _e;e[55]!==p?(_e=p("sectionsEditor.sectionList.deleteMenuItem"),e[55]=p,e[56]=_e):_e=e[56];let I;e[57]!==Se||e[58]!==_e?(I=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:Se,children:[De,_e]}),e[57]=Se,e[58]=_e,e[59]=I):I=e[59];let ce;e[60]!==le||e[61]!==pe||e[62]!==ke||e[63]!==Re||e[64]!==I?(ce=n.jsxs(ps,{align:"end",className:"w-44",children:[le,pe,ke,Re,I]}),e[60]=le,e[61]=pe,e[62]=ke,e[63]=Re,e[64]=I,e[65]=ce):ce=e[65];let je;e[66]!==ve||e[67]!==ce?(je=n.jsxs(gs,{children:[ve,ce]}),e[66]=ve,e[67]=ce,e[68]=je):je=e[68];let Te;return e[69]!==A||e[70]!==z||e[71]!==m||e[72]!==v||e[73]!==ge||e[74]!==X||e[75]!==re||e[76]!==O||e[77]!==Ke||e[78]!==je||e[79]!==F?(Te=n.jsxs("div",{ref:v,style:ge,...A,...z,role:he,tabIndex:fe,onClick:m,onKeyDown:F,className:X,children:[re,O,Ke,je]}),e[69]=A,e[70]=z,e[71]=m,e[72]=v,e[73]=ge,e[74]=X,e[75]=re,e[76]=O,e[77]=Ke,e[78]=je,e[79]=F,e[80]=Te):Te=e[80],Te}function Yo(g){return g.stopPropagation()}function Qo(g){return g.stopPropagation()}function Xo(g){return g.stopPropagation()}function Zo(g){return g.stopPropagation()}function ei(){return!1}function ti(g){const e=He.c(104),{listKey:o,rawSections:d,sections:f,meta:x,selectedIndex:b,onSelect:m,onReorder:h,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:r,onDetach:p,onAddSection:i,canAddSection:P}=g,l=P===void 0?!0:P,R=rt();let A;e[0]!==f.length?(A=()=>Fn(f.length),e[0]=f.length,e[1]=A):A=e[1];const[z,v]=V.useState(A),[C,ie]=V.useState(null),[L,ue]=V.useState(o),[K,ge]=V.useState(f.length),B=V.useRef(!1);L!==o?(ue(o),ge(f.length),v(Fn(f.length))):K!==f.length&&(ge(f.length),v(Ie=>qo(Ie,f.length)));let se;e[2]===Symbol.for("react.memo_cache_sentinel")?(se={activationConstraint:{distance:8}},e[2]=se):se=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:ts},e[3]=he):he=e[3];const fe=Un(Yt(Qn,se),Yt(Yn,he));let F;e[4]!==z?(F=z.map(ni),e[4]=z,e[5]=F):F=e[5];const J=F;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=Ie=>{ie(String(Ie.active.id))},e[6]=X):X=e[6];const re=X;let O;e[7]!==J||e[8]!==h?(O=Ie=>{ie(null);const{active:N,over:ae}=Ie;if(!ae||N.id===ae.id)return;const $=J.indexOf(String(N.id)),Xe=J.indexOf(String(ae.id));$===-1||Xe===-1||(v(et=>hs(At([...et],$,Xe))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),h?.($,Xe))},e[7]=J,e[8]=h,e[9]=O):O=e[9];const Ke=O;let Z;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{ie(null)},e[10]=Z):Z=e[10];const Le=Z;let ve,de,oe,ee,le,pe,ke,Re,Se,De,_e,I,ce,je,Te;if(e[11]!==C||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ke||e[16]!==x||e[17]!==i||e[18]!==r||e[19]!==u||e[20]!==p||e[21]!==y||e[22]!==k||e[23]!==m||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==f||e[28]!==b||e[29]!==fe||e[30]!==R){je=Symbol.for("react.early_return_sentinel");e:{const Ie=N=>{B.current||m(N)};if(e[46]!==C||e[47]!==l||e[48]!==z||e[49]!==i||e[50]!==d||e[51]!==f||e[52]!==R){const N=C?z.find(ae=>ae.id===C):null;if(ee=N!=null?f[N.index]:null,oe=N!=null?d[N.index]:void 0,z.length===0){let ae;e[56]!==R?(ae=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=ae):ae=e[57];let $;e[58]!==ae?($=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ae}),e[58]=ae,e[59]=$):$=e[59];const Xe=!l;let et;e[60]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(gn,{size:14}),e[60]=et):et=e[60];let lt;e[61]!==R?(lt=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=lt):lt=e[62];let ct;e[63]!==i||e[64]!==Xe||e[65]!==lt?(ct=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Xe,onClick:i,children:[et,lt]}),e[63]=i,e[64]=Xe,e[65]=lt,e[66]=ct):ct=e[66];let ut;e[67]!==$||e[68]!==ct?(ut=n.jsxs("div",{className:"space-y-2",children:[$,ct]}),e[67]=$,e[68]=ct,e[69]=ut):ut=e[69],je=ut;break e}ce=Fe(N&&"cursor-grabbing"),e[46]=C,e[47]=l,e[48]=z,e[49]=i,e[50]=d,e[51]=f,e[52]=R,e[53]=oe,e[54]=ee,e[55]=ce}else oe=e[53],ee=e[54],ce=e[55];de=ns,Re=fe,Se=ss,De=re,_e=Ke,I=Le,ve=as,pe=J,ke=os,Te="space-y-1",le=z.map(N=>{const ae=f[N.index];return ae?n.jsx(Jo,{sortableId:N.id,section:ae,raw:d[N.index],meta:x,selected:b===N.index,onSelect:()=>Ie(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>k(N.index),onToggleHidden:()=>D(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>r(N.index),onDetach:()=>p(N.index)},N.id):null})}e[11]=C,e[12]=l,e[13]=z,e[14]=J,e[15]=Ke,e[16]=x,e[17]=i,e[18]=r,e[19]=u,e[20]=p,e[21]=y,e[22]=k,e[23]=m,e[24]=D,e[25]=E,e[26]=d,e[27]=f,e[28]=b,e[29]=fe,e[30]=R,e[31]=ve,e[32]=de,e[33]=oe,e[34]=ee,e[35]=le,e[36]=pe,e[37]=ke,e[38]=Re,e[39]=Se,e[40]=De,e[41]=_e,e[42]=I,e[43]=ce,e[44]=je,e[45]=Te}else ve=e[31],de=e[32],oe=e[33],ee=e[34],le=e[35],pe=e[36],ke=e[37],Re=e[38],Se=e[39],De=e[40],_e=e[41],I=e[42],ce=e[43],je=e[44],Te=e[45];if(je!==Symbol.for("react.early_return_sentinel"))return je;let G;e[70]!==le||e[71]!==Te?(G=n.jsx("div",{className:Te,children:le}),e[70]=le,e[71]=Te,e[72]=G):G=e[72];let Ae;e[73]!==ve||e[74]!==pe||e[75]!==ke||e[76]!==G?(Ae=n.jsx(ve,{items:pe,strategy:ke,children:G}),e[73]=ve,e[74]=pe,e[75]=ke,e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==oe||e[79]!==ee||e[80]!==x?(Oe=ee?n.jsx("div",{className:Fe("cursor-grabbing shadow-lg ring-1 ring-border/60",Ss(ee,!1)),children:n.jsx(vs,{section:ee,raw:oe,meta:x})}):null,e[78]=oe,e[79]=ee,e[80]=x,e[81]=Oe):Oe=e[81];let ze;e[82]!==Oe?(ze=Gn.createPortal(n.jsx(qn,{dropAnimation:Jn,children:Oe}),document.body),e[82]=Oe,e[83]=ze):ze=e[83];let Be;e[84]!==de||e[85]!==Re||e[86]!==Se||e[87]!==De||e[88]!==_e||e[89]!==I||e[90]!==Ae||e[91]!==ze?(Be=n.jsxs(de,{sensors:Re,collisionDetection:Se,onDragStart:De,onDragEnd:_e,onDragCancel:I,children:[Ae,ze]}),e[84]=de,e[85]=Re,e[86]=Se,e[87]=De,e[88]=_e,e[89]=I,e[90]=Ae,e[91]=ze,e[92]=Be):Be=e[92];const xe=!l;let we;e[93]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(gn,{size:14}),e[93]=we):we=e[93];let be;e[94]!==R?(be=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=be):be=e[95];let te;e[96]!==i||e[97]!==xe||e[98]!==be?(te=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:i,children:[we,be]}),e[96]=i,e[97]=xe,e[98]=be,e[99]=te):te=e[99];let me;return e[100]!==ce||e[101]!==Be||e[102]!==te?(me=n.jsxs("div",{className:ce,children:[Be,te]}),e[100]=ce,e[101]=Be,e[102]=te,e[103]=me):me=e[103],me}function ni(g){return g.id}function On(g){const e=He.c(57),{open:o,initialName:d,autoLabel:f,isPending:x,onSubmit:b,onOpenChange:m}=g,h=x===void 0?!1:x,u=rt(),[y,k]=V.useState(d),[D,E]=V.useState(o);o!==D&&(E(o),o&&k(d));let r;e[0]!==h||e[1]!==m?(r=re=>{!re&&!h&&m(!1)},e[0]=h,e[1]=m,e[2]=r):r=e[2];const p=r;let i;e[3]!==h||e[4]!==y||e[5]!==b?(i=async re=>{re.preventDefault(),!h&&await b(y.trim())},e[3]=h,e[4]=y,e[5]=b,e[6]=i):i=e[6];const P=i;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(yo,{children:l}),e[9]=l,e[10]=R):R=e[10];let A;e[11]!==f||e[12]!==u?(A=u("sectionsEditor.variantRenameDialog.description",{fallback:f||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=f,e[12]=u,e[13]=A):A=e[13];let z;e[14]!==A?(z=n.jsx(_o,{children:A}),e[14]=A,e[15]=z):z=e[15];let v;e[16]!==R||e[17]!==z?(v=n.jsxs(jo,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=v):v=e[18];let C;e[19]!==u?(C=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=C):C=e[20];let ie;e[21]!==C?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:C}),e[21]=C,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=re=>k(re.target.value),e[23]=L):L=e[23];let ue;e[24]!==f||e[25]!==h||e[26]!==y?(ue=n.jsx(wo,{id:"variant-rename-name",value:y,onChange:L,placeholder:f,autoFocus:!0,disabled:h}),e[24]=f,e[25]=h,e[26]=y,e[27]=ue):ue=e[27];let K;e[28]!==ie||e[29]!==ue?(K=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ue]}),e[28]=ie,e[29]=ue,e[30]=K):K=e[30];let ge;e[31]!==m?(ge=()=>m(!1),e[31]=m,e[32]=ge):ge=e[32];let B;e[33]!==u?(B=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=B):B=e[34];let se;e[35]!==h||e[36]!==ge||e[37]!==B?(se=n.jsx(Je,{type:"button",variant:"outline",onClick:ge,disabled:h,children:B}),e[35]=h,e[36]=ge,e[37]=B,e[38]=se):se=e[38];let he;e[39]!==h||e[40]!==u?(he=h?n.jsxs(n.Fragment,{children:[n.jsx(Wn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=h,e[40]=u,e[41]=he):he=e[41];let fe;e[42]!==h||e[43]!==he?(fe=n.jsx(Je,{type:"submit",disabled:h,children:he}),e[42]=h,e[43]=he,e[44]=fe):fe=e[44];let F;e[45]!==se||e[46]!==fe?(F=n.jsxs(Eo,{children:[se,fe]}),e[45]=se,e[46]=fe,e[47]=F):F=e[47];let J;e[48]!==P||e[49]!==K||e[50]!==F||e[51]!==v?(J=n.jsx(ko,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:P,children:[v,K,F]})}),e[48]=P,e[49]=K,e[50]=F,e[51]=v,e[52]=J):J=e[52];let X;return e[53]!==p||e[54]!==o||e[55]!==J?(X=n.jsx(Ro,{open:o,onOpenChange:p,children:J}),e[53]=p,e[54]=o,e[55]=J,e[56]=X):X=e[56],X}const si="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",xs="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function bs(g){const e=He.c(5),{rule:o,matchers:d}=g,f=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==f){const u=d.find(y=>y.resolveType===f)?.iconName??Ta(f);x=ho(u),e[0]=d,e[1]=f,e[2]=x}else x=e[2];const b=x;if(!b)return null;let m;return e[3]!==b?(m=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=m):m=e[4],m}function In(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function fn(g){return g.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function ai(g){return g.map((e,o)=>({...e,index:o}))}function ys(g){const e=He.c(17),{label:o,effectiveRule:d,matchers:f,canDelete:x,dragging:b,onRename:m,onDuplicate:h,onDelete:u}=g,y=rt();let k;e[0]!==d||e[1]!==f?(k=n.jsx(bs,{rule:d,matchers:f}),e[0]=d,e[1]=f,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==x||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==y?(E=!b&&n.jsxs(gs,{children:[n.jsx(fs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:ii,onPointerDown:oi,children:n.jsx(rs,{size:14})})}),n.jsxs(ps,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:p=>{p.stopPropagation(),m?.()},children:[n.jsx(Io,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:p=>{p.stopPropagation(),h?.()},children:[n.jsx(us,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Po,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:p=>{p.stopPropagation(),u?.()},children:[n.jsx(ms,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=b,e[7]=o,e[8]=u,e[9]=h,e[10]=m,e[11]=y,e[12]=E):E=e[12];let r;return e[13]!==k||e[14]!==D||e[15]!==E?(r=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=r):r=e[16],r}function oi(g){return g.stopPropagation()}function ii(g){return g.stopPropagation()}function ri(g){const e=He.c(33),{entry:o,sortableId:d,isActive:f,canDelete:x,decofile:b,meta:m,matchers:h,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:li},e[0]=d,e[1]=E):E=e[1];const{attributes:r,listeners:p,setNodeRef:i,transform:P,isDragging:l}=Zn(E);let R;e[2]!==P?(R=es.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const A=l?0:void 0;let z;e[4]!==R||e[5]!==A?(z={transform:R,opacity:A},e[4]=R,e[5]=A,e[6]=z):z=e[6];const v=z,C=m??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==C?(ie=Mt(o.variant.rule,b,C),e[7]=b,e[8]=o.variant.rule,e[9]=C,e[10]=ie):ie=e[10];const L=ie;let ue;e[11]!==u?(ue=fe=>{fe.target===fe.currentTarget&&(fe.key==="Enter"||fe.key===" ")&&(fe.preventDefault(),u())},e[11]=u,e[12]=ue):ue=e[12];const K=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=f?xs:si;let B;e[13]!==K||e[14]!==ge?(B=Fe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",K,ge),e[13]=K,e[14]=ge,e[15]=B):B=e[15];let se;e[16]!==x||e[17]!==L||e[18]!==o.variant.label||e[19]!==h||e[20]!==D||e[21]!==k||e[22]!==y?(se=n.jsx(ys,{label:o.variant.label,effectiveRule:L,matchers:h,canDelete:x,onRename:y,onDuplicate:k,onDelete:D}),e[16]=x,e[17]=L,e[18]=o.variant.label,e[19]=h,e[20]=D,e[21]=k,e[22]=y,e[23]=se):se=e[23];let he;return e[24]!==r||e[25]!==p||e[26]!==u||e[27]!==i||e[28]!==v||e[29]!==B||e[30]!==se||e[31]!==ue?(he=n.jsx("div",{ref:i,style:v,...r,...p,onClick:u,onKeyDown:ue,className:B,children:se}),e[24]=r,e[25]=p,e[26]=u,e[27]=i,e[28]=v,e[29]=B,e[30]=se,e[31]=ue,e[32]=he):he=e[32],he}function li(){return!1}function ci(g){const e=He.c(9),{variant:o,decofile:d,meta:f,matchers:x}=g,b=f??void 0;let m;e[0]!==d||e[1]!==b||e[2]!==o.rule?(m=Mt(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=m):m=e[3];const h=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Fe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",xs),e[4]=u):u=e[4];let y;return e[5]!==h||e[6]!==x||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ys,{label:o.label,effectiveRule:h,matchers:x,canDelete:!1,dragging:!0})}),e[5]=h,e[6]=x,e[7]=o.label,e[8]=y):y=e[8],y}function ui(g){const e=He.c(91),{listKey:o,variants:d,activeIndex:f,decofile:x,meta:b,matchers:m,onSelect:h,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=g,r=rt();let p;e[0]!==d?(p=()=>fn(d),e[0]=d,e[1]=p):p=e[1];const[i,P]=V.useState(p),[l,R]=V.useState(null),[A,z]=V.useState(o),[v,C]=V.useState(d.length);let ie;e[2]!==d?(ie=()=>In(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ue]=V.useState(ie),K=V.useRef(!1),ge=In(d);A!==o?(z(o),C(d.length),ue(ge),P(fn(d))):v!==d.length?(C(d.length),ue(ge),P(fn(d))):L!==ge&&(ue(ge),P(Be=>d.map((xe,we)=>({id:Be[we]?.id??crypto.randomUUID(),index:we,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let se;e[5]===Symbol.for("react.memo_cache_sentinel")?(se={coordinateGetter:ts},e[5]=se):se=e[5];const he=Un(Yt(Qn,B),Yt(Yn,se));let fe;e[6]!==i?(fe=i.map(di),e[6]=i,e[7]=fe):fe=e[7];const F=fe,J=d.length>1;let X;e[8]!==i?(X=Be=>{const xe=String(Be.active.id);R(i.find(we=>we.id===xe)??null)},e[8]=i,e[9]=X):X=e[9];const re=X;let O;e[10]!==F||e[11]!==u?(O=Be=>{R(null);const{active:xe,over:we}=Be;if(!we||xe.id===we.id)return;const be=F.indexOf(String(xe.id)),te=F.indexOf(String(we.id));be===-1||te===-1||(P(me=>ai(At([...me],be,te))),K.current=!0,requestAnimationFrame(()=>{K.current=!1}),u(be,te))},e[10]=F,e[11]=u,e[12]=O):O=e[12];const Ke=O;let Z;e[13]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},e[13]=Z):Z=e[13];const Le=Z;let ve,de,oe,ee,le,pe,ke,Re,Se,De,_e,I,ce;if(e[14]!==f||e[15]!==J||e[16]!==x||e[17]!==i||e[18]!==F||e[19]!==Ke||e[20]!==re||e[21]!==m||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==h||e[28]!==he||e[29]!==r){const Be=$=>{K.current||h($)};_e="space-y-1 border-b p-2";let xe;e[43]!==r?(xe=r("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=r,e[44]=xe):xe=e[44];let we;e[45]!==xe?(we=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:xe}),e[45]=xe,e[46]=we):we=e[46];let be;e[47]!==r?(be=r("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=r,e[48]=be):be=e[48];let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(gn,{size:14}),e[49]=te):te=e[49];let me;e[50]!==E||e[51]!==be?(me=n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":be,className:"size-6",onClick:E,children:te})}),e[50]=E,e[51]=be,e[52]=me):me=e[52];let Ie;e[53]!==r?(Ie=r("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=r,e[54]=Ie):Ie=e[54];let N;e[55]!==Ie?(N=n.jsx(jt,{children:Ie}),e[55]=Ie,e[56]=N):N=e[56];let ae;e[57]!==me||e[58]!==N?(ae=n.jsxs(yt,{children:[me,N]}),e[57]=me,e[58]=N,e[59]=ae):ae=e[59],e[60]!==we||e[61]!==ae?(I=n.jsxs("div",{className:"flex items-center justify-between",children:[we,ae]}),e[60]=we,e[61]=ae,e[62]=I):I=e[62],de=ns,pe=he,ke=ss,Re=re,Se=Ke,De=Le,ve=as,ee=F,le=os,ce="space-y-0.5",oe=i.map($=>n.jsx(ri,{sortableId:$.id,entry:$,isActive:$.index===f,canDelete:J,decofile:x,meta:b,matchers:m,onSelect:()=>Be($.index),onRename:()=>y($.index),onDuplicate:()=>k($.index),onDelete:()=>D($.index)},$.id)),e[14]=f,e[15]=J,e[16]=x,e[17]=i,e[18]=F,e[19]=Ke,e[20]=re,e[21]=m,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=h,e[28]=he,e[29]=r,e[30]=ve,e[31]=de,e[32]=oe,e[33]=ee,e[34]=le,e[35]=pe,e[36]=ke,e[37]=Re,e[38]=Se,e[39]=De,e[40]=_e,e[41]=I,e[42]=ce}else ve=e[30],de=e[31],oe=e[32],ee=e[33],le=e[34],pe=e[35],ke=e[36],Re=e[37],Se=e[38],De=e[39],_e=e[40],I=e[41],ce=e[42];let je;e[63]!==oe||e[64]!==ce?(je=n.jsx("div",{className:ce,children:oe}),e[63]=oe,e[64]=ce,e[65]=je):je=e[65];let Te;e[66]!==ve||e[67]!==ee||e[68]!==le||e[69]!==je?(Te=n.jsx(ve,{items:ee,strategy:le,children:je}),e[66]=ve,e[67]=ee,e[68]=le,e[69]=je,e[70]=Te):Te=e[70];let G;e[71]!==l||e[72]!==x||e[73]!==m||e[74]!==b?(G=l?n.jsx(ci,{variant:l.variant,decofile:x,meta:b,matchers:m}):null,e[71]=l,e[72]=x,e[73]=m,e[74]=b,e[75]=G):G=e[75];let Ae;e[76]!==G?(Ae=Gn.createPortal(n.jsx(qn,{dropAnimation:Jn,children:G}),document.body),e[76]=G,e[77]=Ae):Ae=e[77];let Oe;e[78]!==de||e[79]!==pe||e[80]!==ke||e[81]!==Re||e[82]!==Se||e[83]!==De||e[84]!==Te||e[85]!==Ae?(Oe=n.jsxs(de,{sensors:pe,collisionDetection:ke,onDragStart:Re,onDragEnd:Se,onDragCancel:De,children:[Te,Ae]}),e[78]=de,e[79]=pe,e[80]=ke,e[81]=Re,e[82]=Se,e[83]=De,e[84]=Te,e[85]=Ae,e[86]=Oe):Oe=e[86];let ze;return e[87]!==_e||e[88]!==I||e[89]!==Oe?(ze=n.jsxs("div",{className:_e,children:[I,Oe]}),e[87]=_e,e[88]=I,e[89]=Oe,e[90]=ze):ze=e[90],ze}function di(g){return g.id}function mi(g){const e=He.c(16),{schema:o,value:d,onChange:f,meta:x,decofile:b,onSaveReferencedBlock:m,sandbox:h}=g,u=rt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=V.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(ls,{className:"size-3.5"})}),k.map((i,P)=>{const l=P===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&n.jsx(cs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,P+1)),title:i,className:Fe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:i})]},`${i}-${P}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let r;e[4]!==k||e[5]!==b||e[6]!==x||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==o||e[11]!==d?(r=n.jsx(is,{schema:o,value:d,onChange:f,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:x,decofile:b,onSaveReferencedBlock:m,sandbox:h}),e[4]=k,e[5]=b,e[6]=x,e[7]=f,e[8]=m,e[9]=h,e[10]=o,e[11]=d,e[12]=r):r=e[12];let p;return e[13]!==E||e[14]!==r?(p=n.jsxs("div",{className:"space-y-2",children:[E,r]}),e[13]=E,e[14]=r,e[15]=p):p=e[15],p}function $n(g){const e=He.c(21),{activeSchema:o,formValue:d,formResetKey:f,onFormChange:x,onBreadcrumbChange:b,breadcrumbPath:m,emptyMessage:h,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p}=g;let i;e[0]!==m?(i=m===void 0?[]:m,e[0]=m,e[1]=i):i=e[1];const P=i;let l;e[2]!==o||e[3]!==P||e[4]!==E||e[5]!==f||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==x||e[10]!==r||e[11]!==p||e[12]!==y||e[13]!==k?(l=o&&d?y?n.jsx(Co,{schema:o,resolveType:y,value:d,formResetKey:f,onChange:x,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(is,{schema:o,value:d,onChange:x,basePath:"",breadcrumbPath:P,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:r,sandbox:p},f):null,e[2]=o,e[3]=P,e[4]=E,e[5]=f,e[6]=d,e[7]=D,e[8]=b,e[9]=x,e[10]=r,e[11]=p,e[12]=y,e[13]=k,e[14]=l):l=e[14];const R=l;let A;e[15]!==h||e[16]!==R?(A=R??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:h}),e[15]=h,e[16]=R,e[17]=A):A=e[17];let z;return e[18]!==u||e[19]!==A?(z=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,A]})}),e[18]=u,e[19]=A,e[20]=z):z=e[20],z}const fi="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function pi(g,e){return Pa(g,e,it)}function gi(g){const e=He.c(19),{pageKey:o,initialName:d,initialPath:f,onFieldChange:x}=g,b=rt(),[m,h]=V.useState(d),[u,y]=V.useState(f),[k,D]=V.useState(o);k!==o&&(D(o),h(d),y(f));let E;e[0]!==x?(E=A=>{h(A.target.value),x("name",A.target.value)},e[0]=x,e[1]=E):E=e[1];let r;e[2]!==b?(r=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=r):r=e[3];let p;e[4]!==m||e[5]!==E||e[6]!==r?(p=n.jsx("input",{type:"text",value:m,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:r}),e[4]=m,e[5]=E,e[6]=r,e[7]=p):p=e[7];let i;e[8]!==x?(i=A=>{y(A.target.value),x("path",A.target.value)},e[8]=x,e[9]=i):i=e[9];let P;e[10]!==b?(P=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==i||e[14]!==P?(l=n.jsx("input",{type:"text",value:u,onChange:i,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:P}),e[12]=u,e[13]=i,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==p||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[p,l]}),e[16]=p,e[17]=l,e[18]=R):R=e[18],R}function zn(g){const e=He.c(13),{onClick:o}=g,d=rt();let f;e[0]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=f):f=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ds,{size:14}),e[2]=x):x=e[2];let b;e[3]!==o||e[4]!==f?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":f,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:x})}),e[3]=o,e[4]=f,e[5]=b):b=e[5];let m;e[6]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=m):m=e[7];let h;e[8]!==m?(h=n.jsx(jt,{side:"bottom",children:m}),e[8]=m,e[9]=h):h=e[9];let u;return e[10]!==b||e[11]!==h?(u=n.jsxs(yt,{children:[b,h]}),e[10]=b,e[11]=h,e[12]=u):u=e[12],u}function Hn(g){const e=He.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:x,globals:b,onSelect:m,onSelectGlobal:h,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P}=g;let l;e[0]!==f||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==x||e[5]!==m||e[6]!==h?(l=n.jsx(Ca,{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:x,globals:b,onSelect:m,onSelectGlobal:h}),e[0]=f,e[1]=d,e[2]=o,e[3]=b,e[4]=x,e[5]=m,e[6]=h,e[7]=l):l=e[7];let R;e[8]!==p||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==r||e[13]!==k||e[14]!==i||e[15]!==P||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(mi,{schema:u,value:y,onChange:k,meta:r,decofile:p,onSaveReferencedBlock:i,sandbox:P},D)}),e[8]=p,e[9]=D,e[10]=y,e[11]=E,e[12]=r,e[13]=k,e[14]=i,e[15]=P,e[16]=u,e[17]=R):R=e[17];let A;return e[18]!==l||e[19]!==R?(A=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=A):A=e[20],A}function fc({orgSlug:g,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:f,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:m=null,externalSelectedIndex:h,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const r=rt(),p=d?{orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f}:null,{data:i,isLoading:P}=Aa(p),{data:l,isLoading:R}=Ma(p),A=Ka(),z=A?.entity?.id===e?A.entity.metadata?.siteSlug??null:null,[v,C]=V.useState(null),[ie,L]=V.useState(null),[ue,K]=V.useState(null),[ge,B]=V.useState(0),[se,he]=V.useState(void 0),[fe,F]=V.useState(null),[J,X]=V.useState(null),[re,O]=V.useState([]),[Ke,Z]=V.useState(0),[Le,ve]=V.useState(null),[de,oe]=V.useState(null),[ee,le]=V.useState(null),[pe,ke]=V.useState(!0),[Re,Se]=V.useState(!1),[De,_e]=V.useState(!1),[I,ce]=V.useState(y),[je,Te]=V.useState(y);y&&!je&&(Te(!0),ce(!0),C(null),L(null),K(null),O([])),!y&&je&&Te(!1);const[G,Ae]=V.useState(null),[Oe,ze]=V.useState(void 0),[Be,xe]=V.useState([]),[we,be]=V.useState(0),[te,me]=V.useState(0),[Ie,N]=V.useState(null),[ae,$]=V.useState(null),[Xe,et]=V.useState(null),lt=_a(),ct=`${g}/${e}/${o}`,ut=La({orgSlug:g,virtualMcpId:e,branch:o}),[_s,js]=V.useState(x),[Es,ks]=V.useState(b),[Rs,ws]=V.useState(m);(_s!==x||Es!==b||Rs!==m)&&(queueMicrotask(()=>ut.flush()),js(x),ks(b),ws(m),C(null),L(null),K(null),B(0),F(null),X(null),me(0),N(null),$(null),O([]),Z(t=>t+1),ce(!1),Ae(null),ze(void 0),xe([]),be(t=>t+1));const Ve=Ba({orgSlug:g,virtualMcpId:e,branch:o}),Kt=so((t,s)=>{Ve.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Qt=Fa({orgSlug:g,virtualMcpId:e,branch:o}),[Nt,Lt]=V.useState(!1),We=V.useRef(null),tt=V.useRef(null),nt=V.useRef(null),Xt=V.useRef({}),Ye=V.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Wn,{size:20,className:"animate-spin text-muted-foreground"})});if(!i||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Vs=Oa(i),Ne=!!m,Ge=Ne?null:Ia(Vs,x,b),w=Ne?m:Ge?.key??null,Zt=Ne&&m?i[m]:void 0,hn=Ne&&m&&Zt?$a(m,Zt):Ne&&m?m:"",Bt=!Ne&&w&&i[w]?i[w]:null,en=I&&i&&l&&w&&Ge?Bn(i,{kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},l):null,Ns=I?Bt?.seo:void 0,tn=Oe!==void 0?Oe:Ns,Ds=I?Ao(tn):void 0,Ts=en?.seoTypeOptions??[],Ps=I&&l?Mo(l):"",vn=G??Ds??{},nn=I&&en?Ko(vn,en):null,Cs=I&&nn&&Lo(tn)?Gt(nn,l):null,As=I?Bo(i,l)?.seoData:void 0,$e=Ne?[{label:"Default",sections:[{__resolveType:m}]}]:pi(Bt?.sections,i??{}),Ft=$e.length>1,Ce=Math.min(ge,$e.length-1),dt=$e[Ce],U=dt?.sections??[],Me=Wt(U,i),Sn=!Ne&&za(Bt?.sections);if(Ne&&m&&Xe!==m){et(m);const t=U[0],s=Me[0];if(t&&s){C(0),me(0),O([]);const a=xt(t,s,i);a&&(L(a.data),K(a.resolveType),$(null),N(null))}}!Ne&&Xe!==null&&et(null),Ye.current={rawSections:U,parsedSections:Me,decofile:i??{},activePageKey:w,pageVariants:$e,variantIndex:Ce,sectionVariantIndex:te,selectedSectionIndex:v};const Ms=()=>({multivariate:Sn,index:Ce,variants:$e.map(t=>({rule:t.rule}))}),xn=(t,s)=>{if(!E)return;if(!w||!Sn||t.length<=1){E(null);return}const a=Kn(w,{multivariate:!0,index:s,variants:t},i,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!w){E(null);return}const c=Ms(),S=Kn(w,c,i,l);if(!t||s<0){E(S.length>0?S:null);return}const j=lo({pageKey:w,page:c,sectionIndex:s,sectionLazy:Me[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:i,meta:l}),_=[...S,...j];E(_.length>0?_:null)},mt=(t,s,a,c=v??-1,S=!1)=>{const j=Ze(t,s);if(!j){L(null),K(null),$(null),N(null),S&&Et(null,c,a);return}const T=Pn(j,it)[a];if(!T){L(null),K(null),$(null),N(null),S&&Et(null,c,a);return}const ne=Ja(T.value,i);L(ne?.data??null),K(ne?.resolveType??null);const{resolveType:M,formValue:H}=Tt(T.rule,i,l??void 0);$(M),N(H),S&&Et(j,c,a)};if(h!==void 0&&h!==se&&(he(h??null),typeof h=="number")){const t=U[h],s=Me[h];if(t&&s)if(C(h),me(0),O([]),Z(a=>a+1),s.isMultivariate)mt(t,s,0,h);else{const a=xt(t,s,i);a?(L(a.data),K(a.resolveType)):(L(null),K(null)),$(null),N(null)}}const Ot={orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f??void 0,siteSlug:z},sn=ue&&l?Gt(ue,l):null,Ue=(t,s)=>{if(!w)return;We.current&&(clearTimeout(We.current),We.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null),tt.current&&(clearTimeout(tt.current),tt.current=null);const a=Ct(i,w,t,Ce,$e);Ve.mutate({blockKey:w,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{C(null),L(null),K(null),me(0),N(null),$(null),O([]),Z(t=>t+1)},Ks=(t,s)=>{We.current&&clearTimeout(We.current);const a=Ye.current.sectionVariantIndex;We.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current,M=c[s];if(!M)return;const H=S[s];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ve.mutate({blockKey:q,data:t},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!_)return;const W={...j[_]},Ee=[...c];if(H.isMultivariate){const q=Ze(M,H);if(!q||!_)return;const Y=uo(q,a,t);Ee[s]=bt(M,H,Y)}else if(H.isHidden){const q=Xn(M.__resolveType),Y=q?{...M.section}:{...M},Pe=Array.isArray(Y.variants)?[...Y.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Y.variants=Pe,q?Ee[s]={...M,section:Y}:Ee[s]=Y}else H.isLazy?Ee[s]={...M,section:t}:Ee[s]=t;if(T.length>1){const q=W.sections,Y=[...q?.variants??[]];Y[ne]&&(Y[ne]={...Y[ne],value:Ee}),W.sections={...q,variants:Y}}else W.sections=Ee;Ve.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:q=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},mn)},Ls=t=>{C(t),me(0),O([]),Z(S=>S+1);const s=U[t],a=Me[t];if(!s||!a)return;if(a.isMultivariate){mt(s,a,0,t);return}const c=xt(s,a,i);if(!c){L(null),K(null),$(null),N(null),Et(null,t,0);return}L(c.data),K(c.resolveType),$(null),N(null),Et(null,t,0)},bn=t=>{const s=t;L(s),v!==null&&Ks(s,v)},an=t=>{if(!w||!i||!l||!Ge)return;const s={kind:"page",pageKey:w,pageName:String(Ge.name??""),path:String(Ge.path??"")},a=Bn(i,s,l);a&&ut.save(w,()=>{const c=lt.getQueryData(ja.decofile(ct))?.[w];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Xt.current};return Xt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Oo(s,a,S,t.inner):S})},Bs=(t,s)=>{w&&(Xt.current[t]=s,an())},Fs=(t,s)=>{if(!w)return;const a=At([...U],t,s);v!==null&&(v===t?C(s):t<v&&s>=v?C(v-1):t>v&&s<=v&&C(v+1)),Ue(a)},Os=t=>{if(!w)return;const s=U.filter((a,c)=>c!==t);v===t?kt():v!==null&&v>t&&C(v-1),Ue(s)},Is=t=>{if(!w)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,ro(s)),v!==null&&v>t&&C(v+1),Ue(a)},$s=t=>{if(!w)return;const s=U[t],a=Me[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?oo(s):io(s);if(!c)return;const S=[...U];S[t]=c,v===t&&kt(),Ue(S)},zs=t=>{if(!w)return;const s=U[t],a=Me[t];if(!s||!a||a.isMultivariate)return;const c=ao(s);if(!c)return;const S=[...U];S[t]=c,v===t&&kt(),Ue(S)},Hs=t=>{if(!w)return;const s=U[t],a=Me[t];if(!s||!a?.isSavedBlock)return;const c=xt(s,a,i);if(!c?.data)return;const{name:S,...j}=c.data,_=[...U];a.isLazy?_[t]={...s,section:j}:_[t]=j,v===t&&kt(),Ue(_)},Gs=t=>{if(!w)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;Ue(s,{onSuccess:()=>{Se(!1),C(a),me(0),O([]),Z(_=>_+1);const c=s[a],S=Wt(s,i)[a];if(!c||!S)return;if(S.isMultivariate){mt(c,S,0);return}const j=xt(c,S,i);if(!j){L(null),K(null),$(null),N(null);return}L(j.data),K(j.resolveType),$(null),N(null)}})},Ws=t=>{if(v===null)return;const s=U[v],a=Me[v];!s||!a?.isMultivariate||(me(t),O([]),Z(c=>c+1),mt(s,a,t,v,!0))},Us=t=>{if(v===null||!w)return;const s=U[v],a=Me[v];if(!s||!a?.isMultivariate)return;const c=Ze(s,a);if(!c)return;const S=to(c,t);if(!S){Q.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...U];j[v]=bt(s,a,S);const _=S.variants;let T=te;t===te?T=Math.min(t,_.length-1):t<te&&(T=te-1),me(T),O([]),Z(ne=>ne+1),mt(j[v],a,T),Ue(j)},qs=t=>{if(v===null||!w)return;const s=U[v],a=Me[v];if(!s||!a?.isMultivariate)return;const c=Ze(s,a);if(!c)return;const S=no(c,t),j=[...U];j[v]=bt(s,a,S);const _=t+1;me(_),O([]),Z(T=>T+1),mt(j[v],a,_),Ue(j)},Js=(t,s)=>{if(v===null||!w||t===s)return;const a=U[v],c=Me[v];if(!a||!c?.isMultivariate)return;const S=Ze(a,c);if(!S)return;const j=Za(S,t,s),_=[...U];_[v]=bt(a,c,j);let T=te;te===t?T=s:t<te&&s>=te?T=te-1:t>te&&s<=te&&(T=te+1),me(T),mt(_[v],c,T),Ue(_)},on=t=>{const s=t??v;if(s===null||!w)return;const a=U[s],c=Me[s];if(!a||!c)return;const S=Ya(a,c);if(!S){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...U];j[s]=S.section;const _=Wt(j,i)[s];if(!_?.isMultivariate){Q.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),me(S.newVariantIndex),O([]),Z(T=>T+1),mt(S.section,_,S.newVariantIndex,s),Ue(j)},Ys=()=>{if(v===null||!w)return;const t=U[v],s=Me[v];if(!t||!s?.isMultivariate)return;const a=Ze(t,s);if(!a)return;const c=eo(t,s,a);if(!c){Q.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...U];S[v]=c;const j=Wt(S,i)[v];if(!j)return;me(0),$(null),N(null),O([]),Z(T=>T+1);const _=xt(c,j,i);_?(L(_.data),K(_.resolveType)):(L(null),K(null)),Et(null,v,0),Ue(S)},Qs=async t=>{if(Le===null||!w)return;const s=dn(t,i);if(s){Q.error(s);return}const a=U[Le],c=Me[Le];if(!a||!c)return;const S=xt(a,c,i);if(!S){Q.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await Ve.mutateAsync({blockKey:t,data:j});const _=[...U];_[Le]={__resolveType:t},await Ve.mutateAsync({blockKey:w,data:Ct(i,w,_,Ce,$e)}),v===Le&&kt(),ve(null),Q.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},yn=dt?.rule;if(Ft&&v===null&&J===null&&yn){const{resolveType:t,formValue:s}=Tt(yn,i??{},l??void 0);X(t),F(s)}const It=l?Ha(l):[],_n=l&&i?Ga(l,i):[],Xs=!Ne&&!!(f&&l&&i),Zs=J&&l?Gt(J,l):null,Rt=()=>{tt.current&&(clearTimeout(tt.current),tt.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null)},Dt=async(t,s)=>{if(!(co(s,t,l)>0))try{await Qt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},jn=t=>{tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Ye.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],T=_[c],ne=T?.rule;if(wt(ne,a,l)){const M=ne?.__resolveType??"",H=a[M],W=typeof H?.name=="string"?H.name:M,{__resolveType:Ee,...q}=t;Ve.mutate({blockKey:M,data:Vt(Ee??"",q,W)},{onSuccess:()=>u?.(),onError:Y=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}T&&(_[c]={...T,rule:t}),S.sections={...j,variants:_},Ve.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},mn)},ea=t=>{X(t);const s=t?{__resolveType:t}:{__resolveType:Ln};F({}),jn(s)},ta=t=>{const s=t;F(s);const a=J?{__resolveType:J,...s}:{...s};jn(a)},na=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Ye.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],ne=T[c];if(!ne)return;const M=Pt(ne.rule,a,l),H=qt(t);T[c]={...ne,rule:H};const W={...a,[s]:{...S,sections:{..._,variants:T}}},{resolveType:Ee,formValue:q}=Tt(H,W,l??void 0);X(Ee),F(q);try{await Ve.mutateAsync({blockKey:s,data:W[s]}),M&&M!==t&&await Dt(M,W),u?.()}catch(Y){Q.error(Y instanceof Error?Y.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},En=t=>{nt.current&&clearTimeout(nt.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ye.current;s!==null&&(nt.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(!_)return;const M=c[s],H=S[s];if(!M||!H?.isMultivariate)return;const W=Ze(M,H);if(!W)return;const q=(W.variants??[])[a]?.rule;if(wt(q,j,l)){const ye=q?.__resolveType??"",qe=j[ye],at=typeof qe?.name=="string"?qe.name:ye,{__resolveType:gt,...ot}=t;Ve.mutate({blockKey:ye,data:Vt(gt??"",ot,at)},{onSuccess:()=>u?.(),onError:ht=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const Y=Cn(W,a,t),Pe=[...c];Pe[s]=bt(M,H,Y);const Qe=Ct(j,_,Pe,ne,T);Ve.mutate({blockKey:_,data:Qe},{onSuccess:()=>u?.(),onError:ye=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ye.message}))})},mn))},sa=t=>{$(t),N({}),En(t?{__resolveType:t}:{__resolveType:Ln})},aa=t=>{const s=t;N(s);const a=ae?{__resolveType:ae,...s}:{...s};En(a)},oa=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(s===null||!_)return;const M=c[s],H=S[s];if(!M||!H?.isMultivariate)return;const W=Ze(M,H);if(!W)return;const Ee=W.variants??[],q=Pt(Ee[a]?.rule,j,l),Y=qt(t),Pe=Cn(W,a,Y),Qe=[...c];Qe[s]=bt(M,H,Pe);const ye=Ct(j,_,Qe,ne,T),qe={...j,[_]:ye},{resolveType:at,formValue:gt}=Tt(Y,qe,l??void 0);$(at),N(gt);try{await Ve.mutateAsync({blockKey:_,data:ye}),q&&q!==t&&await Dt(q,qe),u?.()}catch(ot){Q.error(ot instanceof Error?ot.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ne&&!Ge)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ne&&!Zt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=v!==null?Me[v]??null:null,kn=v!==null?U[v]:null,Rn=kn&&ft?.isMultivariate?Ze(kn,ft):null,St=Rn?Pn(Rn,it):[],rn=Math.min(te,Math.max(St.length-1,0)),$t=St[rn]??null,pt=ft?.isMultivariate===!0,wn=v!==null&&ft!==null,zt=wn&&(pt||!!(sn&&ie)),ia=zt&&!Ne&&ft?.isSavedBlock===!0,st=Ne||ia,ra=Ne?hn:ft?.label??"",la=ae&&l?Gt(ae,l):null,ln=zt&&(!Ne||re.length>0)?Ne?[hn,...re]:[Ge.name,ft.label,...pt&&$t?[$t.label]:[],...re]:[],ca=I&&Ge?[Ge.name,"SEO",...Be]:[],Ht=I?ca:st?ln.length>0?ln:[ra]:ln,ua=!I&&!Ne&&pt&&re.length===0,Vn=()=>{if(!w)return;Rt(),We.current&&(clearTimeout(We.current),We.current=null);const t=i[w],s=Qa(t.sections,U);if(!s)return;const a=Xa(s);Ve.mutate({blockKey:w,data:{...t,sections:s}},{onSuccess:()=>{B(a),C(null),L(null),K(null),O([]),F(null),X(null)},onError:c=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},cn=(t,s,a)=>{if(!w)return;Rt(),We.current&&(clearTimeout(We.current),We.current=null);const c=i[w],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const T=mo(j,_),ne={...i,[w]:{...c,sections:T}};Ve.mutate({blockKey:w,data:ne[w]},{onSuccess:()=>{s?.(),a&&Dt(a,ne)},onError:M=>Q.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},da=t=>{oe(null),B(t),C(null),L(null),K(null),O([]);const s=$e[t]?.rule,{resolveType:a,formValue:c}=Tt(s,i??{},l??void 0);X(a),F(c),xn($e.map(S=>({rule:S.rule})),t)},ma=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),B(a);const c=At($e.map(S=>({rule:S.rule})),t,s);xn(c,a),cn(S=>At(S,t,s))},fa=t=>{const s=$e[t]?.rule,a=Pt(s,i??{},l??void 0);cn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{$e.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),C(null),L(null),K(null),O([]),F(null),X(null)},a)},pa=t=>{cn(s=>fo(s,t),()=>{B(t+1),C(null),L(null),K(null),O([]),F(null),X(null)})},ga=async(t,s)=>{Rt();const a=Ye.current.activePageKey,c=Ye.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],ne=T[t];if(!ne?.rule||typeof ne.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=ne.rule,H=s.trim();Lt(!0);try{if(!H){if(!wt(M,c,l)){oe(null);return}const Qe=M.__resolveType??"";T[t]={...ne,rule:An(M,c,l)};const ye={...c,[a]:{...S,sections:{..._,variants:T}}};await Ve.mutateAsync({blockKey:a,data:ye[a]}),await Dt(Qe,ye),oe(null),u?.();return}const W=Mn(M,c,l);if(!W){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await Ve.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,H)}),oe(null),u?.();return}const Ee=un(H),q=dn(Ee,c);if(q){Q.error(q);return}const Y=Vt(W.resolveType,W.data,H);let Pe=null;try{await Ve.mutateAsync({blockKey:Ee,data:Y}),Pe=Ee,T[t]={...ne,rule:qt(Ee)},await Ve.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:T}}}),Pe=null}catch(Qe){throw Pe&&await Qt.mutateAsync({blockKey:Pe}).catch(()=>{}),Qe}oe(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),u?.()}catch(W){Q.error(W instanceof Error?W.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ha=async(t,s)=>{Rt();const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(a===null||!_)return;const M=c[a],H=S[a];if(!M||!H?.isMultivariate)return;const W=Ze(M,H);if(!W)return;const Ee=W.variants??[],q=Ee[t];if(!q?.rule||typeof q.rule!="object"){Q.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=q.rule,Pe=s.trim();Lt(!0);const Qe=async ye=>{const qe={...W,variants:ye},at=[...c];at[a]=bt(M,H,qe);const gt=Ct(j,_,at,ne,T);return await Ve.mutateAsync({blockKey:_,data:gt}),{...j,[_]:gt}};try{if(!Pe){if(!wt(Y,j,l)){le(null);return}const ht=Y.__resolveType??"",Tn=[...Ee];Tn[t]={...q,rule:An(Y,j,l)};const ya=await Qe(Tn);await Dt(ht,ya),le(null),u?.();return}const ye=Mn(Y,j,l);if(!ye){Q.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ye.blockKey){await Ve.mutateAsync({blockKey:ye.blockKey,data:Vt(ye.resolveType,ye.data,Pe)}),le(null),u?.();return}const qe=un(Pe),at=dn(qe,j);if(at){Q.error(at);return}const gt=Vt(ye.resolveType,ye.data,Pe);let ot=null;try{await Ve.mutateAsync({blockKey:qe,data:gt}),ot=qe;const ht=[...Ee];ht[t]={...q,rule:qt(qe)},await Qe(ht),ot=null}catch(ht){throw ot&&await Qt.mutateAsync({blockKey:ot}).catch(()=>{}),ht}le(null),Q.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ye){Q.error(ye instanceof Error?ye.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Nn=()=>{kt()},va=t=>{Ae(t),an({inner:t})},Sa=t=>{ze(t),an({raw:t})},xa=()=>{Ae(null),xe([])},ba=()=>be(t=>t+1),Dn=t=>{if(I){if(t===0){ut.flush(),ce(!1),Ae(null),ze(void 0),xe([]),be(a=>a+1),k?.();return}if(t===1){xe([]),be(a=>a+1);return}xe(Be.slice(0,t-1)),be(a=>a+1);return}if(Ne){O(re.slice(0,t)),Z(a=>a+1);return}if(t===0){Nn();return}if(t===1){O([]),Z(a=>a+1);return}if(pt&&t===2){O([]),Z(a=>a+1);return}const s=pt?2:1;O(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||zt||I?n.jsxs("div",{className:Fe("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn(po(Ht.length,{isMultivariateSectionTop:ua})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:Fe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ls,{className:"size-4"})}),!Ne&&Ft&&dt&&n.jsxs("button",{type:"button",onClick:Nn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:Fe("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",fi),children:[n.jsx(bs,{rule:Mt(dt.rule,i??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":r("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(cs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(s),title:t,className:Fe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),st&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(bo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),wn&&!pt&&!ft?.isHidden&&w&&n.jsx(zn,{onClick:()=>on()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(gi,{pageKey:w,initialName:Ge.name,initialPath:Ge.path,onFieldChange:Bs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>ce(!0),children:n.jsx(vo,{size:14})})}),n.jsx(jt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&w?D(w):_e(!0),children:n.jsx(So,{size:14})})}),n.jsx(jt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(zn,{onClick:Vn})]})}),I?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Bt&&w?n.jsx(Fo,{rawSeo:tn,innerSeo:vn,defaultResolveType:Ps,seoSchema:Cs,activeResolveType:nn,seoTypeOptions:Ts,formResetKey:we,siteDefaultSeo:As,onBreadcrumbChange:xe,onPersistRaw:Sa,onInnerChange:va,onClearForm:xa,onBumpFormKey:ba}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Wa,{listKey:`${w??""}:${v??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:rn,onSelect:Ws,onRename:le,onDuplicate:qs,onDelete:Us,onRemoveAll:Ys,onReorder:Js,onAdd:()=>on()}),pt&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Hn,{currentRt:ae??"",currentLabel:Ut($t?.rule,i??{},it,l??void 0),currentGlobalKey:Pt($t?.rule,i??{},l??void 0)??void 0,matchers:It,globals:_n,onSelect:sa,onSelectGlobal:oa,schema:la,formValue:Ie,onChange:aa,formKey:`${v??"none"}:${rn}:${ae??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx($n,{activeSchema:sn,formValue:ie,formResetKey:Ke,onFormChange:bn,onBreadcrumbChange:O,breadcrumbPath:re,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})]}):Ne?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx($n,{activeSchema:sn,formValue:ie,formResetKey:Ke,onFormChange:bn,onBreadcrumbChange:O,breadcrumbPath:re,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})}):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&w&&n.jsx(ui,{listKey:w,variants:$e,activeIndex:Ce,decofile:i??{},meta:l,matchers:It,onSelect:da,onReorder:ma,onRename:oe,onDuplicate:pa,onDelete:fa,onAdd:Vn}),Ft&&J!==null&&n.jsxs("div",{className:Fe("px-3 border-b",pe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":pe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),pe?n.jsx(xo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(go,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),pe&&n.jsx("div",{className:Fe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Hn,{currentRt:J,currentLabel:Ut(dt?.rule,i??{},it,l??void 0),currentGlobalKey:Pt(dt?.rule,i??{},l??void 0)??void 0,matchers:It,globals:_n,onSelect:ea,onSelectGlobal:na,schema:Zs,formValue:fe,onChange:ta,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:i,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(ti,{listKey:`${w??""}-${Ce}`,rawSections:U,sections:Me,meta:l,selectedIndex:v,onSelect:Ls,onReorder:Fs,onDelete:Os,onDuplicate:Is,onMakeReusable:ve,onToggleHidden:$s,onToggleLazy:zs,onAddVariant:on,onDetach:Hs,onAddSection:()=>Se(!0),canAddSection:Xs})})]}),n.jsx(Ua,{open:Le!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Le!==null?un(Me[Le]?.label??""):"",isPending:Ve.isPending,onSubmit:Qs}),f&&n.jsx($o,{open:Re,onOpenChange:Se,meta:l,decofile:i,previewBaseUrl:f,onSelect:Gs}),De&&w&&i&&n.jsx(qa,{open:De,onOpenChange:_e,pageKey:w,decofile:i}),de!==null&&n.jsx(On,{open:!0,initialName:wt($e[de]?.rule,i??{},l??void 0)?Ut($e[de]?.rule,i??{},it,l??void 0):"",autoLabel:it(Mt($e[de]?.rule,i??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ga(de,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),ee!==null&&n.jsx(On,{open:!0,initialName:wt(St[ee]?.rule,i??{},l??void 0)?Ut(St[ee]?.rule,i??{},it,l??void 0):"",autoLabel:it(Mt(St[ee]?.rule,i??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ha(ee,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{fc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as i,aC as nt,aA as Pe,j as d,cO as rt,aE as be,aB as k,cP as st,ax as j,aD as _,bE as $,cQ as lt,af as Ne,cR as Ee,ay as at,bz as ct,bG as it,cX as dt,cY as ut,cZ as pt,c_ as ft,cS as mt,az as ht,c$ as vt,cT as gt,cV as xt,c as ee,m as oe}from"./index-OL3R77fI.js";import{V as St}from"./tooltip-D_7O_PaP.js";import{i as wt}from"./Check-CpPKSRkX.js";import{t as Re}from"./ChevronDown-CyntSUXM.js";import{n as Ct}from"./ChevronUp-CYn2F25s.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,F]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>F(f)),[O,U]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Fe=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
1
+ import{r as i,aC as nt,aA as Pe,j as d,cO as rt,aE as be,aB as k,cP as st,ax as j,aD as _,bE as $,cQ as lt,af as Ne,cR as Ee,ay as at,bz as ct,bG as it,cX as dt,cY as ut,cZ as pt,c_ as ft,cS as mt,az as ht,c$ as vt,cT as gt,cV as xt,c as ee,m as oe}from"./index-dNvo17TY.js";import{V as St}from"./tooltip-CXWhkXAN.js";import{i as wt}from"./Check-B4CLdvYI.js";import{t as Re}from"./ChevronDown-CNxoymO2.js";import{n as Ct}from"./ChevronUp-B-3hc4bz.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,F]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>F(f)),[O,U]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Fe=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};