decocms 4.149.4 → 4.149.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cem6ePeU.js → AlertCircle-Dq3WjiEJ.js} +1 -1
- package/dist/client/assets/{AreaChart-eUXp69My.js → AreaChart-B-nTjrAx.js} +1 -1
- package/dist/client/assets/{ArrowUp-C2eUAqJf.js → ArrowUp-5hFEweXq.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DfJzPFvU.js → ArrowUpRight-joowW-C5.js} +1 -1
- package/dist/client/assets/{Check-Dyt2_0ga.js → Check-qxVfMARc.js} +1 -1
- package/dist/client/assets/{CheckCircle-B-XbmPy7.js → CheckCircle-asKx-P0w.js} +1 -1
- package/dist/client/assets/{ChevronDown-D6KfEPdr.js → ChevronDown-e1-U-GuJ.js} +1 -1
- package/dist/client/assets/{ChevronRight-DILmeK7M.js → ChevronRight-BBTu-8S3.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bmy1l0Py.js → ChevronUp-sCAKY-xq.js} +1 -1
- package/dist/client/assets/{Copy01-USV1_HJa.js → Copy01-D5KM45B8.js} +1 -1
- package/dist/client/assets/{DotsVertical-BhuMjSRb.js → DotsVertical-D9Tqe4NW.js} +1 -1
- package/dist/client/assets/{Eye-DLI5NPy9.js → Eye-Dp-Mi9OG.js} +1 -1
- package/dist/client/assets/{FilterLines-5S8WKVB6.js → FilterLines-FFxKsijU.js} +1 -1
- package/dist/client/assets/{HardDrive-DQfGmY_Q.js → HardDrive-BdTCtFl3.js} +1 -1
- package/dist/client/assets/{Key01-jW_JyKg4.js → Key01-D8-RvxFO.js} +1 -1
- package/dist/client/assets/{LayoutLeft-UdAY9lHL.js → LayoutLeft-Bx_rpAKD.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CxFcmhCv.js → LinkExternal01-Cnx8YByp.js} +1 -1
- package/dist/client/assets/{LogOut01-DvI1_F9a.js → LogOut01-CFjw7N9j.js} +1 -1
- package/dist/client/assets/{Monitor01-zHncMHvK.js → Monitor01-BVloJrIj.js} +1 -1
- package/dist/client/assets/{Palette-CLw6FxLo.js → Palette-CBZCTOFO.js} +1 -1
- package/dist/client/assets/{Play-C0sf4kYZ.js → Play-DmT_WIMA.js} +1 -1
- package/dist/client/assets/{Plus-DmVmPu15.js → Plus-ZpX9WmDD.js} +1 -1
- package/dist/client/assets/{SearchLg-mmh32yOh.js → SearchLg-C4sVe0kR.js} +1 -1
- package/dist/client/assets/{SearchMd-BV0JzQs2.js → SearchMd-95D3LDtT.js} +1 -1
- package/dist/client/assets/{Settings02-D-zT1K0J.js → Settings02-Vn36Nz-O.js} +1 -1
- package/dist/client/assets/{Shield01-DaH6VmhZ.js → Shield01-CgDNV0PO.js} +1 -1
- package/dist/client/assets/{Star01-CTYXgmts.js → Star01-B6iNea3E.js} +1 -1
- package/dist/client/assets/{Stars01-D42-h5Va.js → Stars01-Dhu1azXB.js} +1 -1
- package/dist/client/assets/{Stars02-D936Q5vu.js → Stars02-RfkiFS-R.js} +1 -1
- package/dist/client/assets/{Sun-SO-tAlk7.js → Sun-Bplz7qPS.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DRBzItNZ.js → SwitchHorizontal01-qIK6-vj3.js} +1 -1
- package/dist/client/assets/{Tool01-BhOhq1Lq.js → Tool01-CSu_r-q6.js} +1 -1
- package/dist/client/assets/{Tool02-CCtBgqj3.js → Tool02-C7v0SFCB.js} +1 -1
- package/dist/client/assets/{Trash01-BNbLXf93.js → Trash01-g8BP4GVQ.js} +1 -1
- package/dist/client/assets/{TrendUp01-CiD1se1i.js → TrendUp01-eR8W-77t.js} +1 -1
- package/dist/client/assets/{Upload01-BE-MvOgE.js → Upload01-DnrfGhvH.js} +1 -1
- package/dist/client/assets/{User01-Bq5KW4vO.js → User01-BpaY3mYf.js} +1 -1
- package/dist/client/assets/{Users01-CiMe0bfz.js → Users01-BJlhJb2g.js} +1 -1
- package/dist/client/assets/{Users03-Jpb3Rs6p.js → Users03-l3anhVFn.js} +1 -1
- package/dist/client/assets/{X-Cvof5f1Z.js → X-9WQSG5hH.js} +1 -1
- package/dist/client/assets/{XCircle-BDBptK5c.js → XCircle-C0NcnpbU.js} +1 -1
- package/dist/client/assets/{XClose-CS8UpX89.js → XClose-Dl7-u4Iu.js} +1 -1
- package/dist/client/assets/{Zap-NmQQQZMA.js → Zap-BbdbOIdc.js} +1 -1
- package/dist/client/assets/{ZapSquare-DXB9EHwI.js → ZapSquare-BqtHYgtB.js} +1 -1
- package/dist/client/assets/{access-gate-CbW94wEf.js → access-gate-By-4JO-o.js} +1 -1
- package/dist/client/assets/{add-section-modal-Bk3Oe2RT.js → add-section-modal-BN30Bar9.js} +1 -1
- package/dist/client/assets/{agent-icon-DCuaG5nE.js → agent-icon-Cm6sZdRT.js} +1 -1
- package/dist/client/assets/{agents-list-DdAi-Yry.js → agents-list-BUgr1hav.js} +1 -1
- package/dist/client/assets/{ai-providers-fHhP762R.js → ai-providers-Cm0dXDPE.js} +1 -1
- package/dist/client/assets/{alert-CUOdafoW.js → alert-YLQI9fN7.js} +1 -1
- package/dist/client/assets/{alert-dialog-DegRzpzC.js → alert-dialog-lWVONnNL.js} +1 -1
- package/dist/client/assets/{app-editor-CE4GU1zo.js → app-editor-ljQPDR3G.js} +1 -1
- package/dist/client/assets/{auth-njKnK4H1.js → auth-BKg8KB4Q.js} +1 -1
- package/dist/client/assets/{auth-catchall-BFK7E1pJ.js → auth-catchall-DR66W1mO.js} +1 -1
- package/dist/client/assets/{auth-entry-BwVmvJ3X.js → auth-entry-CNhTCeZL.js} +1 -1
- package/dist/client/assets/{auth-split-layout-liW-Nrmb.js → auth-split-layout-BoYLdXts.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-QBHD9BB_.js → authenticate-and-persist-oauth-B1Tlj1JC.js} +1 -1
- package/dist/client/assets/{automation-list-row-D0RC9AH1.js → automation-list-row-BOCKdejq.js} +1 -1
- package/dist/client/assets/{automation-runs-CvtFUnmv.js → automation-runs-BbHHbX_e.js} +1 -1
- package/dist/client/assets/{automations-DJt2joIh.js → automations-CkfZzB79.js} +1 -1
- package/dist/client/assets/{avatar-lulgkVBD.js → avatar-Cqm3Lq4j.js} +1 -1
- package/dist/client/assets/{badge-X6hr_bP1.js → badge-Dn-iMFnd.js} +1 -1
- package/dist/client/assets/{block-document-rRRPfL2F.js → block-document-dvTSh6dF.js} +1 -1
- package/dist/client/assets/{brand-context-CeGOX_AV.js → brand-context-OQ4qiW_D.js} +1 -1
- package/dist/client/assets/{buckets-DmNQbiTG.js → buckets-CF8VmWZX.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C7P16qHU.js → bulk-category-panel-CZisl2ea.js} +1 -1
- package/dist/client/assets/{calendar-CD5nT3ox.js → calendar-Dw4fmCzc.js} +1 -1
- package/dist/client/assets/{capability-load-error-B3z7rQwl.js → capability-load-error-B7Gug_ai.js} +1 -1
- package/dist/client/assets/{card-K9NXEEZ3.js → card-B4X8T5VG.js} +1 -1
- package/dist/client/assets/{category-editor-DctkYND3.js → category-editor-DkhV5mKx.js} +1 -1
- package/dist/client/assets/{chat-context-DE138twl.js → chat-context-DyvKnksd.js} +1 -1
- package/dist/client/assets/{checkbox-BAZ2VUBa.js → checkbox-CcdD9hyv.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DrqfNzua.js → cli-auth-success-DMY2fPhY.js} +1 -1
- package/dist/client/assets/{collection-detail-Ba6zN7Zl.js → collection-detail-Ci_4bXR8.js} +1 -1
- package/dist/client/assets/{collection-display-button-B14rVoQg.js → collection-display-button-Sp3ecRXl.js} +1 -1
- package/dist/client/assets/{collection-search-mxPX78OM.js → collection-search-kogdFX9E.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bkd7YWxQ.js → collection-table-wrapper-NjFiGSWD.js} +1 -1
- package/dist/client/assets/{collection-tabs-DsjmXCy-.js → collection-tabs-SfyxjJ1V.js} +1 -1
- package/dist/client/assets/command-YBlMu_ai.js +1 -0
- package/dist/client/assets/{commerce-onboarding-qvsyKJ8s.js → commerce-onboarding-vJjbRJ6-.js} +1 -1
- package/dist/client/assets/{companions-core-CqeGIV51.js → companions-core-BLY1ba6m.js} +1 -1
- package/dist/client/assets/{connect-CphvQ4wI.js → connect-Be1bOrCG.js} +1 -1
- package/dist/client/assets/{connection-CMjbZsyl.js → connection-DzWf3enH.js} +1 -1
- package/dist/client/assets/{connection-card-XHraSHoo.js → connection-card-CM5pZnY-.js} +1 -1
- package/dist/client/assets/{connection-detail-D8QT7TNK.js → connection-detail-CeURNEnm.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-oVBbFTiT.js → connection-form-helpers-B3UhdWRQ.js} +1 -1
- package/dist/client/assets/{connections-DoS9utJq.js → connections-BqK2NucS.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-boA36psC.js → decopilot-sse-pool-CgnyrQVH.js} +1 -1
- package/dist/client/assets/{dialog-Pi_xgHC0.js → dialog-S6zU-X1o.js} +1 -1
- package/dist/client/assets/{domain-settings-X-ltER7d.js → domain-settings-B3oIP9FI.js} +1 -1
- package/dist/client/assets/{drawer-EWP6-H-C.js → drawer-CQnxFo4h.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CXH88k_k.js → dropdown-menu-6Z0gFMED.js} +1 -1
- package/dist/client/assets/{empty-state-CsvH74tC.js → empty-state-COuzTPqh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DAPoTrnj.js → extract-connection-data-cNElALED.js} +1 -1
- package/dist/client/assets/{file-explorer-C0TKY3ZH.js → file-explorer-g9e5GYsb.js} +1 -1
- package/dist/client/assets/{form-zuTrl1XI.js → form-CIpF7vgQ.js} +1 -1
- package/dist/client/assets/{general-S5-VFfo3.js → general-CBQd18e0.js} +1 -1
- package/dist/client/assets/{github-repo-picker-D1KIwdhu.js → github-repo-picker-TiUDTq3i.js} +1 -1
- package/dist/client/assets/{hooks-Dj4UYQoq.js → hooks-DHZH9aGB.js} +1 -1
- package/dist/client/assets/{index-Dg5X15-s.js → index--X-_IuJt.js} +1 -1
- package/dist/client/assets/{index-JHgS_7cQ.js → index-BygPN3qk.js} +1 -1
- package/dist/client/assets/{index-BBstqQhT.js → index-C18CjY9m.js} +1 -1
- package/dist/client/assets/{index-CjF26QCG.js → index-CXWWJmED.js} +4 -4
- package/dist/client/assets/{index-5hW5oe3V.js → index-Cg2H39JI.js} +1 -1
- package/dist/client/assets/{index-B3wdQaZS.js → index-CgcZ4SGk.js} +1 -1
- package/dist/client/assets/index-DuveA0RN.js +667 -0
- package/dist/client/assets/{index-DAcffUvI.js → index-DvqSQIGZ.js} +3 -3
- package/dist/client/assets/{index-DpxOAuT-.js → index-E1eNQIog.js} +1 -1
- package/dist/client/assets/{index-FbgXWMub.js → index-gOR0IO0m.js} +1 -1
- package/dist/client/assets/{index-WUBDU1FB.js → index-nTAcDhrG.js} +1 -1
- package/dist/client/assets/{index-redirect-B6vefq92.js → index-redirect-CKCQOv9k.js} +1 -1
- package/dist/client/assets/{input-IDFu6vm5.js → input-boqiKbt5.js} +1 -1
- package/dist/client/assets/{integration-icon-CVSw-anG.js → integration-icon-CIE0aLCY.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BDb4qLWt.js → invite-member-dialog-DnZikhEH.js} +1 -1
- package/dist/client/assets/{label-BuF4MPfP.js → label-DfOap5yU.js} +1 -1
- package/dist/client/assets/{layout-DQ9DEg_C.js → layout-BI6y6iNU.js} +1 -1
- package/dist/client/assets/{login-CY92pUHI.js → login-Bxz1oEzH.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D2KZ3LUV.js → mcp-oauth-CKM-_P-X.js} +1 -1
- package/dist/client/assets/{members-sfEjr02q.js → members-C5y1dFR4.js} +1 -1
- package/dist/client/assets/{monaco-editor-8X3kMk2i.js → monaco-editor-BRq76hge.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bm_bwn8F.js → monitoring-stats-row-BLHDtrTQ.js} +1 -1
- package/dist/client/assets/{multi-select-C0BUOFQc.js → multi-select-RZvwXwrz.js} +1 -1
- package/dist/client/assets/{oauth-callback-BDX83GPd.js → oauth-callback-ByicHq3C.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B-OL5Oa2.js → oauth-callback-ai-provider-Bw98D_pD.js} +1 -1
- package/dist/client/assets/{onboarding-D7REgMR-.js → onboarding-spuHZ0NH.js} +1 -1
- package/dist/client/assets/{org-install-rC6F7bBI.js → org-install-BGrmsO9g.js} +1 -1
- package/dist/client/assets/{org-layout-BI7ruwed.js → org-layout-DcwVQlX4.js} +1 -1
- package/dist/client/assets/{organization-choice-BKiHG2hM.js → organization-choice-C2JAi_ED.js} +1 -1
- package/dist/client/assets/{orgs-COTFB_t_.js → orgs--jYXD7u1.js} +1 -1
- package/dist/client/assets/{page-seo-form-D-9GA6jy.js → page-seo-form-pKdIo57G.js} +1 -1
- package/dist/client/assets/{popover-JRycFW6L.js → popover-BtPGwDNE.js} +1 -1
- package/dist/client/assets/{post-editor-DlyzsB4C.js → post-editor-DPXxoCoz.js} +1 -1
- package/dist/client/assets/{primitives-AUy2V9a6.js → primitives-DdoQa3QE.js} +1 -1
- package/dist/client/assets/{profile-CnZUfcnQ.js → profile-fiZ91Xp9.js} +1 -1
- package/dist/client/assets/project-app-view-CoYAIu-F.js +1 -0
- package/dist/client/assets/record-editor-nkfMWlpb.js +1 -0
- package/dist/client/assets/redirect-editor-BIuFC300.js +1 -0
- package/dist/client/assets/registry-Ckii7P7G.js +2 -0
- package/dist/client/assets/{registry-layout-CymF3LMI.js → registry-layout-DaOGMHqm.js} +1 -1
- package/dist/client/assets/{reports-BWBEMqGv.js → reports-DHNztBYl.js} +1 -1
- package/dist/client/assets/{require-capability-Dqpucqyz.js → require-capability-Co5c18xf.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DB8umWNL.js → required-auth-layout-lByVfD5H.js} +1 -1
- package/dist/client/assets/{reset-password-B14X8hFz.js → reset-password-DADQiRrh.js} +1 -1
- package/dist/client/assets/{roles-1AgaZ90j.js → roles-D2MwEeXZ.js} +1 -1
- package/dist/client/assets/{search-input-CC86MHPM.js → search-input-BDo6-Pt1.js} +1 -1
- package/dist/client/assets/{secrets-JCPTiDma.js → secrets-C-C_o8Bt.js} +1 -1
- package/dist/client/assets/sections-editor-YetzsJwI.js +2 -0
- package/dist/client/assets/{select-CYXr2k1e.js → select-BzIcrZmY.js} +1 -1
- package/dist/client/assets/{select-model-O_LgvrNh.js → select-model-B7suGfbk.js} +1 -1
- package/dist/client/assets/{self-tool-result-fmpw3BpA.js → self-tool-result-Bv9KK_AD.js} +1 -1
- package/dist/client/assets/{seo-editor-BQw3qwj0.js → seo-editor-2qChhEJP.js} +1 -1
- package/dist/client/assets/{settings-layout-DR4sDh-a.js → settings-layout-CpRZ7TSL.js} +1 -1
- package/dist/client/assets/{settings-section-CQn6aKZC.js → settings-section-kinXnNNm.js} +1 -1
- package/dist/client/assets/{shell-controls-6ljtijs2.js → shell-controls-BMudmoTG.js} +1 -1
- package/dist/client/assets/{shell-layout-hVA8oTRe.js → shell-layout-iBF19CF5.js} +1 -1
- package/dist/client/assets/{sidebar-C8SHXIOH.js → sidebar-D1q5weH4.js} +1 -1
- package/dist/client/assets/{skeleton-CVuAFcA8.js → skeleton-DfWmK_Y8.js} +1 -1
- package/dist/client/assets/{sso-CGjLmOAn.js → sso-Dma7NHaa.js} +1 -1
- package/dist/client/assets/{store-Dns-mqtV.js → store-D8fbZLHn.js} +1 -1
- package/dist/client/assets/store-registry-COaoSZXt.js +2 -0
- package/dist/client/assets/{studio-tools-Cinrb_dT.js → studio-tools-CTvMzhHZ.js} +1 -1
- package/dist/client/assets/{switch-CUY_GjpD.js → switch-Ck7aTeHo.js} +1 -1
- package/dist/client/assets/{tab-id-ChQ_Nf-x.js → tab-id-m51PiwPd.js} +1 -1
- package/dist/client/assets/{table-CHmBCOra.js → table-Dr5WgajV.js} +1 -1
- package/dist/client/assets/{tabs-Ck0IiC4A.js → tabs-Bp95nj86.js} +1 -1
- package/dist/client/assets/{textarea-2SjkctT-.js → textarea-B0wrekwX.js} +1 -1
- package/dist/client/assets/{toggle-group-D-W6Cfqy.js → toggle-group-AX7GMgVr.js} +1 -1
- package/dist/client/assets/{toolbar-CzMwHqoE.js → toolbar-C0vQI8SC.js} +1 -1
- package/dist/client/assets/{tooltip-DASp4d0o.js → tooltip-gZsEQkQ4.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CYR9cqcD.js → use-ai-providers-C8J33FgM.js} +1 -1
- package/dist/client/assets/{use-automations-CFGJtaJi.js → use-automations-FgqBXimw.js} +1 -1
- package/dist/client/assets/{use-autosave-CjPCze4P.js → use-autosave-D5qpnRyv.js} +1 -1
- package/dist/client/assets/{use-capability-CvjJL9co.js → use-capability-DSXju304.js} +1 -1
- package/dist/client/assets/{use-clock-tick-saad32Ii.js → use-clock-tick-D7wjISi9.js} +1 -1
- package/dist/client/assets/{use-connection-CxlwOHmS.js → use-connection-5V9ysZDz.js} +1 -1
- package/dist/client/assets/{use-copy-CH4yzWsd.js → use-copy-DwMjsVFX.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bq7hkoso.js → use-create-virtual-mcp-D-HE681o.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-J6WpwdLn.js → use-debounced-autosave-yMskey-B.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DmKXCTEI.js → use-debounced-value-Do7XX3ss.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Bvs8MgnA.js → use-deco-credits-gC1IJXsk.js} +1 -1
- package/dist/client/assets/{use-decopilot-events---My6CTP.js → use-decopilot-events-CeCOBA6F.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BMpSJvba.js → use-delete-connection-B_3WZuBR.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-5G1LPB1d.js → use-deployment-admin-pptP7LNT.js} +1 -1
- package/dist/client/assets/{use-file-configs-SWmwhE7u.js → use-file-configs-BV4ALFV5.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BKPCQUiM.js → use-infinite-scroll-BQjvXdPz.js} +1 -1
- package/dist/client/assets/{use-join-requests-DbLKzMbz.js → use-join-requests-CzxtXa1_.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DF1Y9mBA.js → use-mcp-auth-status-Df8Z4xSe.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BGlPrg7w.js → use-mcp-client-C66yIlAd.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-rAYUC4rV.js → use-mcp-tools-B0oPBVvy.js} +1 -1
- package/dist/client/assets/{use-members-6WuLtpPb.js → use-members-yG-yZAF7.js} +1 -1
- package/dist/client/assets/{use-mobile-rYfTSvFb.js → use-mobile-5SOdKrGk.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-kFHXJGki.js → use-navigate-to-agent-Cp0ofdA2.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-YfI11Izs.js → use-org-auth-client-_My7JqZY.js} +1 -1
- package/dist/client/assets/{use-org-sso-DF0HSba8.js → use-org-sso-DpN_CP64.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CakjCh04.js → use-organization-roles-qiwXKsX5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DytCiPyY.js → use-organization-settings-0GX_RgcP.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C6iHTOsi.js → use-registry-connections-DRFd-vEw.js} +1 -1
- package/dist/client/assets/{use-secrets-5rkcyWSN.js → use-secrets-Crn3uZRK.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BoAmb66E.js → use-status-sounds-DvGgswK8.js} +1 -1
- package/dist/client/assets/{use-tags-Cm5qRjFb.js → use-tags-dvoKIzN1.js} +1 -1
- package/dist/client/assets/{use-view-mode-C09g_1Ul.js → use-view-mode-Cj5GH6Ff.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DZ1qOoD6.js → use-virtual-mcp-zisjRgmS.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C3YlsjqB.js +1 -0
- package/dist/client/assets/{useQueries-dlQFGrcQ.js → useQueries-DgSNUKr1.js} +1 -1
- package/dist/client/assets/{useRouterState-lpGvmBN8.js → useRouterState-C6ZTwoUL.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DGBuv3Vr.js +1 -0
- package/dist/client/assets/{users-BcKjWTBq.js → users-fvoOrysV.js} +1 -1
- package/dist/client/assets/{variant-calendar-YZNIRuQz.js → variant-calendar-hDYLzpME.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Bt6zgi1l.js → view-mode-toggle-BQG_J_5h.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/command-B46E7rrG.js +0 -1
- package/dist/client/assets/index-CKHQvX6y.js +0 -667
- package/dist/client/assets/project-app-view-BH4FvNdJ.js +0 -1
- package/dist/client/assets/record-editor-Dbv_2fCT.js +0 -1
- package/dist/client/assets/redirect-editor-pbJvqMWG.js +0 -1
- package/dist/client/assets/registry-jvTUyBpU.js +0 -2
- package/dist/client/assets/sections-editor-COCqEl95.js +0 -2
- package/dist/client/assets/store-registry-q1s_IA8O.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D8Y9iE3e.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bh9Im6EJ.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as Ue,b as ct,r as w,m as Oe,j as n,af as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-CXWWJmED.js";import{am as Ta,an as Pa,ao as Aa,a1 as Qn,a2 as Jt,ap as Xn,aq as Zn,a3 as es,a4 as ts,ar as ns,as as Ca,ab as ss,ac as as,at as Ma,au as Ka,N as La,a5 as os,a6 as Ct,a9 as rs,aa as is,a7 as ls,ah as cs,av as Fa,aw as Mt,ax as Ba,S as us,ay as lt,az as Oa,aA as Ia,aB as $a,aC as za,D as Ha,F as Ga,aD as Ua,aE as Wa,aF as qa,aG as Ya,af as Gt,aH as Ut,aI as Ja,aJ as St,aK as Tt,aL as Qa,aM as Xa,aN as tt,aO as Mn,aP as Za,aQ as Pt,aR as Wt,aS as eo,aT as dn,aU as to,aV as wt,aW as no,aX as so,aY as ao,aZ as oo,a_ as ro,a$ as xt,b0 as io,b1 as lo,b2 as co,H as uo,b3 as Kn,b4 as At,b5 as Ln,b6 as Fn,b7 as mo,b8 as fo,b9 as po,ba as go,bb as mn,bc as Bn,bd as On,be as Vt,bf as qt,bg as In,bh as ho,bi as fn,bj as vo,bk as bo,bl as So,bm as xo,bn as yo}from"./index-DuveA0RN.js";import{t as _o}from"./ChevronDown-e1-U-GuJ.js";import{a4 as gn,y as jo,Y as ds,J as Eo,x as ms,a6 as ko,a7 as Ro}from"./agent-icon-Cm6sZdRT.js";import{i as fs}from"./ChevronRight-BBTu-8S3.js";import{n as wo}from"./ChevronUp-sCAKY-xq.js";import{i as Vo}from"./Tool02-C7v0SFCB.js";import{n as Yt}from"./automation-runs-BbHHbX_e.js";import{c as yt,T as _t,a as jt}from"./tooltip-gZsEQkQ4.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-S6zU-X1o.js";import{I as Mo}from"./input-boqiKbt5.js";import{a as ps}from"./Copy01-D5KM45B8.js";import{i as Ko}from"./Settings02-Vn36Nz-O.js";import{s as Lo}from"./Eye-Dp-Mi9OG.js";import{s as gs}from"./TrendUp01-eR8W-77t.js";import{s as hn}from"./Plus-ZpX9WmDD.js";import{s as hs}from"./Trash01-g8BP4GVQ.js";import{i as Fo}from"./Zap-BbdbOIdc.js";import{a as ht,D as vs,b as bs,c as Ss,i as Bo}from"./dropdown-menu-6Z0gFMED.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-pKdIo57G.js";import{c as qo}from"./Tool01-CSu_r-q6.js";import{A as Yo}from"./add-section-modal-BN30Bar9.js";import"./ArrowUp-5hFEweXq.js";import"./chat-context-DyvKnksd.js";import"./tab-id-m51PiwPd.js";import"./hooks-DHZH9aGB.js";import"./use-mcp-client-C66yIlAd.js";import"./auth-BKg8KB4Q.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CgnyrQVH.js";import"./studio-tools-CTvMzhHZ.js";import"./use-virtual-mcp-zisjRgmS.js";import"./use-ai-providers-C8J33FgM.js";import"./use-decopilot-events-CeCOBA6F.js";import"./use-organization-settings-0GX_RgcP.js";import"./drawer-CQnxFo4h.js";import"./collection-search-kogdFX9E.js";import"./SearchMd-95D3LDtT.js";import"./use-mobile-5SOdKrGk.js";import"./AreaChart-B-nTjrAx.js";import"./index-gOR0IO0m.js";import"./calendar-Dw4fmCzc.js";import"./X-9WQSG5hH.js";import"./shell-layout-iBF19CF5.js";import"./avatar-Cqm3Lq4j.js";import"./User01-BpaY3mYf.js";import"./Users03-l3anhVFn.js";import"./SearchLg-C4sVe0kR.js";import"./Stars02-RfkiFS-R.js";import"./XClose-Dl7-u4Iu.js";import"./CheckCircle-asKx-P0w.js";import"./FilterLines-FFxKsijU.js";import"./required-auth-layout-lByVfD5H.js";import"./use-org-sso-DpN_CP64.js";import"./index-DvqSQIGZ.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-qIK6-vj3.js";import"./popover-BtPGwDNE.js";import"./github-repo-picker-TiUDTq3i.js";import"./use-debounced-value-Do7XX3ss.js";import"./use-connection-5V9ysZDz.js";import"./authenticate-and-persist-oauth-B1Tlj1JC.js";import"./mcp-oauth-CKM-_P-X.js";import"./LinkExternal01-Cnx8YByp.js";import"./use-mcp-tools-B0oPBVvy.js";import"./extract-connection-data-cNElALED.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-Cp0ofdA2.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-members-yG-yZAF7.js";import"./use-org-auth-client-_My7JqZY.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-Dq3WjiEJ.js";import"./DotsVertical-D9Tqe4NW.js";import"./use-tags-dvoKIzN1.js";import"./use-copy-DwMjsVFX.js";import"./Check-qxVfMARc.js";import"./command-YBlMu_ai.js";import"./index-CgcZ4SGk.js";import"./XCircle-C0NcnpbU.js";import"./companions-core-BLY1ba6m.js";import"./ZapSquare-BqtHYgtB.js";import"./Star01-B6iNea3E.js";import"./Upload01-DnrfGhvH.js";import"./form-CIpF7vgQ.js";import"./label-DfOap5yU.js";import"./select-BzIcrZmY.js";import"./tabs-Bp95nj86.js";import"./toggle-group-AX7GMgVr.js";import"./use-deco-credits-gC1IJXsk.js";import"./sidebar-D1q5weH4.js";import"./LayoutLeft-Bx_rpAKD.js";import"./alert-dialog-lWVONnNL.js";import"./toolbar-C0vQI8SC.js";import"./skeleton-DfWmK_Y8.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CM5pZnY-.js";import"./use-registry-connections-DRFd-vEw.js";import"./useInfiniteQuery-C3YlsjqB.js";import"./use-infinite-scroll-BQjvXdPz.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-B4X8T5VG.js";import"./integration-icon-CIE0aLCY.js";import"./textarea-B0wrekwX.js";import"./connection-form-helpers-B3UhdWRQ.js";import"./collection-tabs-SfyxjJ1V.js";import"./badge-Dn-iMFnd.js";import"./useSuspenseInfiniteQuery-DGBuv3Vr.js";import"./Monitor01-BVloJrIj.js";import"./select-model-B7suGfbk.js";import"./checkbox-CcdD9hyv.js";import"./Key01-D8-RvxFO.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-kinXnNNm.js";import"./ArrowUpRight-joowW-C5.js";import"./Stars01-Dhu1azXB.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DvGgswK8.js";import"./empty-state-COuzTPqh.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DSXju304.js";import"./monaco-editor-BRq76hge.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-Df8Z4xSe.js";import"./Play-DmT_WIMA.js";import"./use-debounced-autosave-yMskey-B.js";import"./index-Cg2H39JI.js";import"./search-input-BDo6-Pt1.js";import"./switch-Ck7aTeHo.js";import"./Users01-BJlhJb2g.js";import"./use-secrets-Crn3uZRK.js";import"./useQueries-DgSNUKr1.js";import"./use-file-configs-BV4ALFV5.js";import"./use-automations-FgqBXimw.js";import"./automation-list-row-BOCKdejq.js";import"./Palette-CBZCTOFO.js";import"./HardDrive-BdTCtFl3.js";import"./LogOut01-CFjw7N9j.js";import"./Sun-Bplz7qPS.js";import"./Shield01-CgDNV0PO.js";import"./table-Dr5WgajV.js";import"./use-clock-tick-D7wjISi9.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const S=d.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof S=="string"){const x=S.replace("#/definitions/",""),f=o[x];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="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 zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function xs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return xs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,S=o.isSavedBlock===!0,x=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==x||e[7]!==S?(k=S?{color:La}:x?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=x,e[7]=S,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{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 i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo: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 nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:S,selected:x,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?ns(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==S?(R={id:S,animateLayoutChanges:ir},e[2]=S,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=ss(R);let L;e[4]!==N?(L=as.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==x||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,x)),e[13]=o,e[14]=x,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Fo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(ds,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let be;e[29]!==Me?(be=n.jsx(vs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=be):be=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ps,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(gs,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(hs,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(bs,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let Se;e[66]!==be||e[67]!==pe?(Se=n.jsxs(Ss,{children:[be,pe]}),e[66]=be,e[67]=pe,e[68]=Se):Se=e[68];let xe;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==Se||e[79]!==I?(xe=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,Se]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=Se,e[79]=I,e[80]=xe):xe=e[80],xe}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:S,selectedIndex:x,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:os},e[3]=he):he=e[3];const me=Qn(Jt(ts,ne),Jt(es,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:F,over:B}=ze;if(!B||F.id===B.id)return;const G=J.indexOf(String(F.id)),nt=J.indexOf(String(B.id));G===-1||nt===-1||(p(Re=>xs(Ct([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let be,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,Se,xe;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==S||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==x||e[29]!==me||e[30]!==R){Se=Symbol.for("react.early_return_sentinel");e:{const ze=F=>{O.current||f(F)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const F=N?z.find(B=>B.id===N):null;if(ae=F!=null?m[F.index]:null,se=F!=null?d[F.index]:void 0,z.length===0){let B;e[56]!==R?(B=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=B):B=e[57];let G;e[58]!==B?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:B}),e[58]=B,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],Se=vt;break e}pe=Oe(F&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=rs,le=me,fe=is,De=ee,je=Ae,re=et,be=ls,oe=J,de=cs,xe="space-y-1",ue=z.map(F=>{const B=m[F.index];return B?n.jsx(nr,{sortableId:F.id,section:B,raw:d[F.index],meta:S,selected:x===F.index,onSelect:()=>ze(F.index),onDelete:()=>u(F.index),onDuplicate:()=>y(F.index),onMakeReusable:()=>k(F.index),onToggleHidden:()=>D(F.index),onToggleLazy:()=>E(F.index),onAddVariant:()=>i(F.index),onDetach:()=>g(F.index)},F.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=S,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=x,e[29]=me,e[30]=R,e[31]=be,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=Se,e[45]=xe}else be=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],Se=e[44],xe=e[45];if(Se!==Symbol.for("react.early_return_sentinel"))return Se;let T;e[70]!==ue||e[71]!==xe?(T=n.jsx("div",{className:xe,children:ue}),e[70]=ue,e[71]=xe,e[72]=T):T=e[72];let Ke;e[73]!==be||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(be,{items:oe,strategy:de,children:T}),e[73]=be,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==S?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:S})}):null,e[78]=se,e[79]=ae,e[80]=S,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(Xn,{dropAnimation:Zn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:S,onSubmit:x,onOpenChange:f}=h,v=S===void 0?!1:S,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==x?(r=async ee=>{ee.preventDefault(),!v&&await x(y.trim())},e[3]=v,e[4]=y,e[5]=x,e[6]=r):r=e[6];const A=r;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(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="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)]",js="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 Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let S;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Fa(m);S=Eo(u),e[0]=d,e[1]=m,e[2]=S}else S=e[2];const x=S;if(!x)return null;let f;return e[3]!==x?(f=n.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function pn(h){return h.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function dr(h){return h.map((e,o)=>({...e,index:o}))}function ks(h){const e=Ue.c(17),{label:o,effectiveRule:d,matchers:m,canDelete:S,dragging:x,onRename:f,onDuplicate:v,onDelete:u}=h,y=ct();let k;e[0]!==d||e[1]!==m?(k=n.jsx(Es,{rule:d,matchers:m}),e[0]=d,e[1]=m,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]!==S||e[6]!==x||e[7]!==o||e[8]!==u||e[9]!==v||e[10]!==f||e[11]!==y?(E=!x&&n.jsxs(Ss,{children:[n.jsx(vs,{asChild:!0,children:n.jsx(Qe,{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:fr,onPointerDown:mr,children:n.jsx(ds,{size:14})})}),n.jsxs(bs,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:g=>{g.stopPropagation(),f?.()},children:[n.jsx(qo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:g=>{g.stopPropagation(),v?.()},children:[n.jsx(ps,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Bo,{}),n.jsxs(ht,{variant:"destructive",disabled:!S,onClick:g=>{g.stopPropagation(),u?.()},children:[n.jsx(hs,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=S,e[6]=x,e[7]=o,e[8]=u,e[9]=v,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function mr(h){return h.stopPropagation()}function fr(h){return h.stopPropagation()}function pr(h){const e=Ue.c(33),{entry:o,sortableId:d,isActive:m,canDelete:S,decofile:x,meta:f,matchers:v,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=h;let E;e[0]!==d?(E={id:d,animateLayoutChanges:gr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:g,setNodeRef:r,transform:A,isDragging:l}=ss(E);let R;e[2]!==A?(R=as.Transform.toString(A?{...A,x:0}:null),e[2]=A,e[3]=R):R=e[3];const K=l?0:void 0;let z;e[4]!==R||e[5]!==K?(z={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=z):z=e[6];const p=z,N=f??void 0;let ie;e[7]!==x||e[8]!==o.variant.rule||e[9]!==N?(ie=Mt(o.variant.rule,x,N),e[7]=x,e[8]=o.variant.rule,e[9]=N,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=me=>{me.target===me.currentTarget&&(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const M=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=m?js:ur;let O;e[13]!==M||e[14]!==ge?(O=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",M,ge),e[13]=M,e[14]=ge,e[15]=O):O=e[15];let ne;e[16]!==S||e[17]!==L||e[18]!==o.variant.label||e[19]!==v||e[20]!==D||e[21]!==k||e[22]!==y?(ne=n.jsx(ks,{label:o.variant.label,effectiveRule:L,matchers:v,canDelete:S,onRename:y,onDuplicate:k,onDelete:D}),e[16]=S,e[17]=L,e[18]=o.variant.label,e[19]=v,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==i||e[25]!==g||e[26]!==u||e[27]!==r||e[28]!==p||e[29]!==O||e[30]!==ne||e[31]!==ce?(he=n.jsx("div",{ref:r,style:p,...i,...g,onClick:u,onKeyDown:ce,className:O,children:ne}),e[24]=i,e[25]=g,e[26]=u,e[27]=r,e[28]=p,e[29]=O,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function gr(){return!1}function hr(h){const e=Ue.c(9),{variant:o,decofile:d,meta:m,matchers:S}=h,x=m??void 0;let f;e[0]!==d||e[1]!==x||e[2]!==o.rule?(f=Mt(o.rule,d,x),e[0]=d,e[1]=x,e[2]=o.rule,e[3]=f):f=e[3];const v=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",js),e[4]=u):u=e[4];let y;return e[5]!==v||e[6]!==S||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ks,{label:o.label,effectiveRule:v,matchers:S,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=S,e[7]=o.label,e[8]=y):y=e[8],y}function vr(h){const e=Ue.c(91),{listKey:o,variants:d,activeIndex:m,decofile:S,meta:x,matchers:f,onSelect:v,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=h,i=ct();let g;e[0]!==d?(g=()=>pn(d),e[0]=d,e[1]=g):g=e[1];const[r,A]=w.useState(g),[l,R]=w.useState(null),[K,z]=w.useState(o),[p,N]=w.useState(d.length);let ie;e[2]!==d?(ie=()=>Gn(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=w.useState(ie),M=w.useRef(!1),ge=Gn(d);K!==o?(z(o),N(d.length),ce(ge),A(pn(d))):p!==d.length?(N(d.length),ce(ge),A(pn(d))):L!==ge&&(ce(ge),A($e=>d.map((Ee,ye)=>({id:$e[ye]?.id??crypto.randomUUID(),index:ye,variant:Ee}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:os},e[5]=ne):ne=e[5];const he=Qn(Jt(ts,O),Jt(es,ne));let me;e[6]!==r?(me=r.map(br),e[6]=r,e[7]=me):me=e[7];const I=me,J=d.length>1;let Z;e[8]!==r?(Z=$e=>{const Ee=String($e.active.id);R(r.find(ye=>ye.id===Ee)??null)},e[8]=r,e[9]=Z):Z=e[9];const ee=Z;let $;e[10]!==I||e[11]!==u?($=$e=>{R(null);const{active:Ee,over:ye}=$e;if(!ye||Ee.id===ye.id)return;const ke=I.indexOf(String(Ee.id)),Le=I.indexOf(String(ye.id));ke===-1||Le===-1||(A(Te=>dr(Ct([...Te],ke,Le))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),u(ke,Le))},e[10]=I,e[11]=u,e[12]=$):$=e[12];const Ae=$;let Me;e[13]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{R(null)},e[13]=Me):Me=e[13];const et=Me;let be,H,se,ae,ue,oe,de,le,fe,De,je,re,pe;if(e[14]!==m||e[15]!==J||e[16]!==S||e[17]!==r||e[18]!==I||e[19]!==Ae||e[20]!==ee||e[21]!==f||e[22]!==x||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==v||e[28]!==he||e[29]!==i){const $e=G=>{M.current||v(G)};je="space-y-1 border-b p-2";let Ee;e[43]!==i?(Ee=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Ee):Ee=e[44];let ye;e[45]!==Ee?(ye=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Ee}),e[45]=Ee,e[46]=ye):ye=e[46];let ke;e[47]!==i?(ke=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=ke):ke=e[48];let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(hn,{size:14}),e[49]=Le):Le=e[49];let Te;e[50]!==E||e[51]!==ke?(Te=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":ke,className:"size-6",onClick:E,children:Le})}),e[50]=E,e[51]=ke,e[52]=Te):Te=e[52];let ze;e[53]!==i?(ze=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=ze):ze=e[54];let F;e[55]!==ze?(F=n.jsx(jt,{children:ze}),e[55]=ze,e[56]=F):F=e[56];let B;e[57]!==Te||e[58]!==F?(B=n.jsxs(yt,{children:[Te,F]}),e[57]=Te,e[58]=F,e[59]=B):B=e[59],e[60]!==ye||e[61]!==B?(re=n.jsxs("div",{className:"flex items-center justify-between",children:[ye,B]}),e[60]=ye,e[61]=B,e[62]=re):re=e[62],H=rs,oe=he,de=is,le=ee,fe=Ae,De=et,be=ls,ae=I,ue=cs,pe="space-y-0.5",se=r.map(G=>n.jsx(pr,{sortableId:G.id,entry:G,isActive:G.index===m,canDelete:J,decofile:S,meta:x,matchers:f,onSelect:()=>$e(G.index),onRename:()=>y(G.index),onDuplicate:()=>k(G.index),onDelete:()=>D(G.index)},G.id)),e[14]=m,e[15]=J,e[16]=S,e[17]=r,e[18]=I,e[19]=Ae,e[20]=ee,e[21]=f,e[22]=x,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=v,e[28]=he,e[29]=i,e[30]=be,e[31]=H,e[32]=se,e[33]=ae,e[34]=ue,e[35]=oe,e[36]=de,e[37]=le,e[38]=fe,e[39]=De,e[40]=je,e[41]=re,e[42]=pe}else be=e[30],H=e[31],se=e[32],ae=e[33],ue=e[34],oe=e[35],de=e[36],le=e[37],fe=e[38],De=e[39],je=e[40],re=e[41],pe=e[42];let Se;e[63]!==se||e[64]!==pe?(Se=n.jsx("div",{className:pe,children:se}),e[63]=se,e[64]=pe,e[65]=Se):Se=e[65];let xe;e[66]!==be||e[67]!==ae||e[68]!==ue||e[69]!==Se?(xe=n.jsx(be,{items:ae,strategy:ue,children:Se}),e[66]=be,e[67]=ae,e[68]=ue,e[69]=Se,e[70]=xe):xe=e[70];let T;e[71]!==l||e[72]!==S||e[73]!==f||e[74]!==x?(T=l?n.jsx(hr,{variant:l.variant,decofile:S,meta:x,matchers:f}):null,e[71]=l,e[72]=S,e[73]=f,e[74]=x,e[75]=T):T=e[75];let Ke;e[76]!==T?(Ke=Yn.createPortal(n.jsx(Xn,{dropAnimation:Zn,children:T}),document.body),e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==H||e[79]!==oe||e[80]!==de||e[81]!==le||e[82]!==fe||e[83]!==De||e[84]!==xe||e[85]!==Ke?(Ie=n.jsxs(H,{sensors:oe,collisionDetection:de,onDragStart:le,onDragEnd:fe,onDragCancel:De,children:[xe,Ke]}),e[78]=H,e[79]=oe,e[80]=de,e[81]=le,e[82]=fe,e[83]=De,e[84]=xe,e[85]=Ke,e[86]=Ie):Ie=e[86];let Ge;return e[87]!==je||e[88]!==re||e[89]!==Ie?(Ge=n.jsxs("div",{className:je,children:[re,Ie]}),e[87]=je,e[88]=re,e[89]=Ie,e[90]=Ge):Ge=e[90],Ge}function br(h){return h.id}function Sr(h){const e=Ue.c(16),{schema:o,value:d,onChange:m,meta:S,decofile:x,onSaveReferencedBlock:f,sandbox:v}=h,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=w.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(ms,{className:"size-3.5"})}),k.map((r,A)=>{const l=A===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[A>0&&n.jsx(fs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,A+1)),title:r,className:Oe("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:r})]},`${r}-${A}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==x||e[6]!==S||e[7]!==m||e[8]!==f||e[9]!==v||e[10]!==o||e[11]!==d?(i=n.jsx(us,{schema:o,value:d,onChange:m,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:S,decofile:x,onSaveReferencedBlock:f,sandbox:v}),e[4]=k,e[5]=x,e[6]=S,e[7]=m,e[8]=f,e[9]=v,e[10]=o,e[11]=d,e[12]=i):i=e[12];let g;return e[13]!==E||e[14]!==i?(g=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=g):g=e[15],g}function Un(h){const e=Ue.c(23),{activeSchema:o,formValue:d,formResetKey:m,onFormChange:S,onBreadcrumbChange:x,breadcrumbPath:f,emptyMessage:v,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A}=h;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==o||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==x||e[9]!==S||e[10]!==A||e[11]!==i||e[12]!==r||e[13]!==g||e[14]!==y||e[15]!==k?(K=o&&d?y?n.jsx(Oo,{schema:o,resolveType:y,value:d,formResetKey:m,onChange:S,onBreadcrumbChange:x,siteDefaultSeo:k}):n.jsx(us,{schema:o,value:d,onChange:S,basePath:"",breadcrumbPath:R,onBreadcrumbChange:x,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A},m):null,e[2]=o,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=x,e[9]=S,e[10]=A,e[11]=i,e[12]=r,e[13]=g,e[14]=y,e[15]=k,e[16]=K):K=e[16];const z=K;let p;e[17]!==v||e[18]!==z?(p=z??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=z,e[19]=p):p=e[19];let N;return e[20]!==u||e[21]!==p?(N=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,p]})}),e[20]=u,e[21]=p,e[22]=N):N=e[22],N}const xr="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 yr(h,e){return Ba(h,e,lt)}function _r(h){const e=Ue.c(19),{pageKey:o,initialName:d,initialPath:m,onFieldChange:S}=h,x=ct(),[f,v]=w.useState(d),[u,y]=w.useState(m),[k,D]=w.useState(o);k!==o&&(D(o),v(d),y(m));let E;e[0]!==S?(E=K=>{v(K.target.value),S("name",K.target.value)},e[0]=S,e[1]=E):E=e[1];let i;e[2]!==x?(i=x("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=x,e[3]=i):i=e[3];let g;e[4]!==f||e[5]!==E||e[6]!==i?(g=n.jsx("input",{type:"text",value:f,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:i}),e[4]=f,e[5]=E,e[6]=i,e[7]=g):g=e[7];let r;e[8]!==S?(r=K=>{y(K.target.value),S("path",K.target.value)},e[8]=S,e[9]=r):r=e[9];let A;e[10]!==x?(A=x("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=x,e[11]=A):A=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==A?(l=n.jsx("input",{type:"text",value:u,onChange:r,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:A}),e[12]=u,e[13]=r,e[14]=A,e[15]=l):l=e[15];let R;return e[16]!==g||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[g,l]}),e[16]=g,e[17]=l,e[18]=R):R=e[18],R}function Wn(h){const e=Ue.c(13),{onClick:o}=h,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(gs,{size:14}),e[2]=S):S=e[2];let x;e[3]!==o||e[4]!==m?(x=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:S})}),e[3]=o,e[4]=m,e[5]=x):x=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let v;e[8]!==f?(v=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=v):v=e[9];let u;return e[10]!==x||e[11]!==v?(u=n.jsxs(yt,{children:[x,v]}),e[10]=x,e[11]=v,e[12]=u):u=e[12],u}function qn(h){const e=Ue.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:S,globals:x,onSelect:f,onSelectGlobal:v,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A}=h;let l;e[0]!==m||e[1]!==d||e[2]!==o||e[3]!==x||e[4]!==S||e[5]!==f||e[6]!==v?(l=n.jsx(Oa,{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:S,globals:x,onSelect:f,onSelectGlobal:v}),e[0]=m,e[1]=d,e[2]=o,e[3]=x,e[4]=S,e[5]=f,e[6]=v,e[7]=l):l=e[7];let R;e[8]!==g||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==A||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(Sr,{schema:u,value:y,onChange:k,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A},D)}),e[8]=g,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=A,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function ic({orgSlug:h,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:m,currentPath:S,activePageBlockKey:x=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),g=d?{orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m}:null,{data:r,isLoading:A}=Ia(g),{data:l,isLoading:R}=$a(g),K=za(),z=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,N]=w.useState(null),[ie,L]=w.useState(null),[ce,M]=w.useState(null),[ge,O]=w.useState(0),[ne,he]=w.useState(void 0),[me,I]=w.useState(null),[J,Z]=w.useState(null),[ee,$]=w.useState([]),Ae=w.useRef(null),[Me,et]=w.useState(ee.length);Me!==ee.length&&(et(ee.length),requestAnimationFrame(()=>{Ae.current&&(Ae.current.scrollTop=0)}));const[be,H]=w.useState(0),[se,ae]=w.useState(null),[ue,oe]=w.useState(null),[de,le]=w.useState(null),[fe,De]=w.useState(!0),[je,re]=w.useState(!1),[pe,Se]=w.useState(!1),xe=w.useRef(null),[T,Ke]=w.useState(y),[Ie,Ge]=w.useState(y);y&&!Ie&&(Ge(!0),Ke(!0),N(null),L(null),M(null),$([])),!y&&Ie&&Ge(!1);const[$e,Ee]=w.useState(null),[ye,ke]=w.useState(void 0),[Le,Te]=w.useState([]),[ze,F]=w.useState(0),[B,G]=w.useState(0),[nt,Re]=w.useState(null),[We,Ne]=w.useState(null),[vt,vn]=w.useState(null),Rs=Na(),ws=`${h}/${e}/${o}`,Qt=Ha({orgSlug:h,virtualMcpId:e,branch:o}),[Vs,Ns]=w.useState(S),[Ds,Ts]=w.useState(x),[Ps,As]=w.useState(f);(Vs!==S||Ds!==x||Ps!==f)&&(queueMicrotask(()=>Qt.flush()),Ns(S),Ts(x),As(f),N(null),L(null),M(null),O(0),I(null),Z(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1),Ke(!1),Ee(null),ke(void 0),Te([]),F(t=>t+1));const we=Ga({orgSlug:h,virtualMcpId:e,branch:o}),Kt=uo((t,s)=>{we.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Ua({orgSlug:h,virtualMcpId:e,branch:o}),[Nt,Lt]=w.useState(!1),Fe=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||A||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Cs=Wa(r),Ve=!!f,qe=Ve?null:qa(Cs,S,x),V=Ve?f:qe?.key??null,en=Ve&&f?r[f]:void 0,bn=Ve&&f&&en?Ya(f,en):Ve&&f?f:"",Ft=!Ve&&V&&r[V]?r[V]:null,tn=T&&r&&l&&V&&qe?$n(r,{kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ms=T?Ft?.seo:void 0,nn=ye!==void 0?ye:Ms,Ks=T?Io(nn):void 0,Ls=tn?.seoTypeOptions??[],Fs=T&&l?$o(l):"",Sn=$e??Ks??{},sn=T&&tn?zo(Sn,tn):null,Bs=T&&sn&&Ho(nn)?Gt(sn,l):null,Os=T?Go(r,l)?.seoData:void 0,He=Ve?[{label:"Default",sections:[{__resolveType:f}]}]:yr(Ft?.sections,r??{}),Bt=He.length>1,Ce=Math.min(ge,He.length-1),ut=He[Ce],q=ut?.sections??[],Be=Ut(q,r),xn=!Ve&&Ja(Ft?.sections);if(Ve&&f&&vt!==f){vn(f);const t=q[0],s=Be[0];if(t&&s){N(0),G(0),$([]);const a=St(t,s,r);a&&(L(a.data),M(a.resolveType),Ne(null),Re(null))}}!Ve&&vt!==null&&vn(null),Xe.current={rawSections:q,parsedSections:Be,decofile:r??{},activePageKey:V,pageVariants:He,variantIndex:Ce,sectionVariantIndex:B,selectedSectionIndex:p};const Is=()=>({multivariate:xn,index:Ce,variants:He.map(t=>({rule:t.rule}))}),yn=(t,s)=>{if(!E)return;if(!V||!xn||t.length<=1){E(null);return}const a=In(V,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!V){E(null);return}const c=Is(),b=In(V,c,r,l);if(!t||s<0){E(b.length>0?b:null);return}const j=ho({pageKey:V,page:c,sectionIndex:s,sectionLazy:Be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...b,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,b=!1)=>{const j=tt(t,s);if(!j){L(null),M(null),Ne(null),Re(null),b&&Et(null,c,a);return}const P=Mn(j,lt)[a];if(!P){L(null),M(null),Ne(null),Re(null),b&&Et(null,c,a);return}const te=no(P.value,r);L(te?.data??null),M(te?.resolveType??null);const{resolveType:C,formValue:U}=Tt(P.rule,r,l??void 0);Ne(C),Re(U),b&&Et(j,c,a)};if(v!==void 0&&v!==ne&&(he(v??null),typeof v=="number")){const t=q[v],s=Be[v];if(t&&s)if(N(v),G(0),$([]),H(a=>a+1),s.isMultivariate)dt(t,s,0,v);else{const a=St(t,s,r);a?(L(a.data),M(a.resolveType)):(L(null),M(null)),Ne(null),Re(null)}}const Ot={orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m??void 0,siteSlug:z},an=ce&&l?Gt(ce,l):null,Ye=(t,s)=>{if(!V)return;Fe.current&&(clearTimeout(Fe.current),Fe.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(r,V,t,Ce,He);we.mutate({blockKey:V,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{N(null),L(null),M(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1)},$s=(t,s)=>{Fe.current&&clearTimeout(Fe.current);const a=Xe.current.sectionVariantIndex;Fe.current=setTimeout(()=>{const{rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current,C=c[s];if(!C)return;const U=b[s];if(!U)return;if(U.isSavedBlock){const Y=U.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;we.mutate({blockKey:Y,data:t},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!_)return;const W={...j[_]},_e=[...c];if(U.isMultivariate){const Y=tt(C,U);if(!Y||!_)return;const Q=bo(Y,a,t);_e[s]=xt(C,U,Q)}else if(U.isHidden){const Y=ns(C.__resolveType),Q=Y?{...C.section}:{...C},Pe=Array.isArray(Q.variants)?[...Q.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Q.variants=Pe,Y?_e[s]={...C,section:Q}:_e[s]=Q}else U.isLazy?_e[s]={...C,section:t}:_e[s]=t;if(P.length>1){const Y=W.sections,Q=[...Y?.variants??[]];Q[te]&&(Q[te]={...Q[te],value:_e}),W.sections={...Y,variants:Q}}else W.sections=_e;we.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:Y=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))})},fn)},zs=t=>{N(t),G(0),$([]),H(b=>b+1);const s=q[t],a=Be[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=St(s,a,r);if(!c){L(null),M(null),Ne(null),Re(null),Et(null,t,0);return}L(c.data),M(c.resolveType),Ne(null),Re(null),Et(null,t,0)},_n=t=>{const s=t;L(s),p!==null&&$s(s,p)},on=t=>{if(!V||!r||!l||!qe)return;const s={kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},a=$n(r,s,l);a&&Qt.save(V,()=>{const c=Rs.getQueryData(Da.decofile(ws))?.[V];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const b={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...b,seo:t.raw}:t?.inner!==void 0?Wo(s,a,b,t.inner):b})},Hs=(t,s)=>{V&&(Zt.current[t]=s,on())},Gs=(t,s)=>{if(!V)return;const a=Ct([...q],t,s);p!==null&&(p===t?N(s):t<p&&s>=p?N(p-1):t>p&&s<=p&&N(p+1)),Ye(a)},Us=t=>{if(!V)return;const s=q.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&N(p-1),Ye(s)},Ws=t=>{if(!V)return;const s=q[t];if(!s)return;const a=[...q];a.splice(t+1,0,go(s)),p!==null&&p>t&&N(p+1),Ye(a)},qs=t=>{if(!V)return;const s=q[t],a=Be[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?fo(s):po(s);if(!c)return;const b=[...q];b[t]=c,p===t&&kt(),Ye(b)},Ys=t=>{if(!V)return;const s=q[t],a=Be[t];if(!s||!a||a.isMultivariate)return;const c=mo(s);if(!c)return;const b=[...q];b[t]=c,p===t&&kt(),Ye(b)},Js=t=>{if(!V)return;const s=q[t],a=Be[t];if(!s||!a?.isSavedBlock)return;const c=St(s,a,r);if(!c?.data)return;const{name:b,...j}=c.data,_=[...q];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Qs=t=>{if(!V)return;const s=[...q,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{re(!1),N(a),G(0),$([]),H(_=>_+1);const c=s[a],b=Ut(s,r)[a];if(!c||!b)return;if(b.isMultivariate){dt(c,b,0);return}const j=St(c,b,r);if(!j){L(null),M(null),Ne(null),Re(null);return}L(j.data),M(j.resolveType),Ne(null),Re(null)}})},jn=t=>{xe.current=t.append,re(!0)},Xs=t=>{const s=xe.current;if(!s){Qs(t);return}s({__resolveType:t.resolveType}),re(!1),xe.current=null},Zs=t=>{if(p===null)return;const s=q[p],a=Be[p];!s||!a?.isMultivariate||(G(t),$([]),H(c=>c+1),dt(s,a,t,p,!0))},ea=t=>{if(p===null||!V)return;const s=q[p],a=Be[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const b=lo(c,t);if(!b){X.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...q];j[p]=xt(s,a,b);const _=b.variants;let P=B;t===B?P=Math.min(t,_.length-1):t<B&&(P=B-1),G(P),$([]),H(te=>te+1),dt(j[p],a,P),Ye(j)},ta=t=>{if(p===null||!V)return;const s=q[p],a=Be[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const b=co(c,t),j=[...q];j[p]=xt(s,a,b);const _=t+1;G(_),$([]),H(P=>P+1),dt(j[p],a,_),Ye(j)},na=(t,s)=>{if(p===null||!V||t===s)return;const a=q[p],c=Be[p];if(!a||!c?.isMultivariate)return;const b=tt(a,c);if(!b)return;const j=ro(b,t,s),_=[...q];_[p]=xt(a,c,j);let P=B;B===t?P=s:t<B&&s>=B?P=B-1:t>B&&s<=B&&(P=B+1),G(P),dt(_[p],c,P),Ye(_)},rn=t=>{const s=t??p;if(s===null||!V)return;const a=q[s],c=Be[s];if(!a||!c)return;const b=so(a,c);if(!b){X.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...q];j[s]=b.section;const _=Ut(j,r)[s];if(!_?.isMultivariate){X.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}N(s),G(b.newVariantIndex),$([]),H(P=>P+1),dt(b.section,_,b.newVariantIndex,s),Ye(j)},sa=()=>{if(p===null||!V)return;const t=q[p],s=Be[p];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=io(t,s,a);if(!c){X.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const b=[...q];b[p]=c;const j=Ut(b,r)[p];if(!j)return;G(0),Ne(null),Re(null),$([]),H(P=>P+1);const _=St(c,j,r);_?(L(_.data),M(_.resolveType)):(L(null),M(null)),Et(null,p,0),Ye(b)},aa=async t=>{if(se===null||!V)return;const s=mn(t,r);if(s){X.error(s);return}const a=q[se],c=Be[se];if(!a||!c)return;const b=St(a,c,r);if(!b){X.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...b.data,name:t};try{await we.mutateAsync({blockKey:t,data:j});const _=[...q];_[se]={__resolveType:t},await we.mutateAsync({blockKey:V,data:At(r,V,_,Ce,He)}),p===se&&kt(),ae(null),X.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){X.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},En=ut?.rule;if(Bt&&p===null&&J===null&&En){const{resolveType:t,formValue:s}=Tt(En,r??{},l??void 0);Z(t),I(s)}const It=l?Qa(l):[],kn=l&&r?Xa(l,r):[],oa=!Ve&&!!(m&&l&&r),ra=J&&l?Gt(J,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(vo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){X.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Rn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const b={...a[s]},j={...b.sections},_=[...j.variants??[]],P=_[c],te=P?.rule;if(wt(te,a,l)){const C=te?.__resolveType??"",U=a[C],W=typeof U?.name=="string"?U.name:C,{__resolveType:_e,...Y}=t;we.mutate({blockKey:C,data:Vt(_e??"",Y,W)},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}P&&(_[c]={...P,rule:t}),b.sections={...j,variants:_},we.mutate({blockKey:s,data:b},{onSuccess:()=>u?.(),onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},fn)},ia=t=>{Z(t);const s=t?Ln(t,l):{__resolveType:Fn};I(t?s:{}),Rn(s)},la=t=>{const s=t;I(s);const a=J?{__resolveType:J,...s}:{...s};Rn(a)},ca=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const b=a[s],j=b?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[c];if(!te)return;const C=Pt(te.rule,a,l),U=qt(t);P[c]={...te,rule:U};const W={...a,[s]:{...b,sections:{..._,variants:P}}},{resolveType:_e,formValue:Y}=Tt(U,W,l??void 0);Z(_e),I(Y);try{await we.mutateAsync({blockKey:s,data:W[s]}),C&&C!==t&&await Dt(C,W),u?.()}catch(Q){X.error(Q instanceof Error?Q.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},wn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(!_)return;const C=c[s],U=b[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const Y=(W.variants??[])[a]?.rule;if(wt(Y,j,l)){const ve=Y?.__resolveType??"",Je=j[ve],rt=typeof Je?.name=="string"?Je.name:ve,{__resolveType:pt,...it}=t;we.mutate({blockKey:ve,data:Vt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Kn(W,a,t),Pe=[...c];Pe[s]=xt(C,U,Q);const Ze=At(j,_,Pe,te,P);we.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:ve=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},fn))},ua=t=>{Ne(t);const s=t?Ln(t,l):{__resolveType:Fn};Re(t?s:{}),wn(s)},da=t=>{const s=t;Re(s);const a=We?{__resolveType:We,...s}:{...s};wn(a)},ma=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(s===null||!_)return;const C=c[s],U=b[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=Pt(_e[a]?.rule,j,l),Q=qt(t),Pe=Kn(W,a,Q),Ze=[...c];Ze[s]=xt(C,U,Pe);const ve=At(j,_,Ze,te,P),Je={...j,[_]:ve},{resolveType:rt,formValue:pt}=Tt(Q,Je,l??void 0);Ne(rt),Re(pt);try{await we.mutateAsync({blockKey:_,data:ve}),Y&&Y!==t&&await Dt(Y,Je),u?.()}catch(it){X.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:S})});if(Ve&&!en)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=p!==null?Be[p]??null:null,Vn=p!==null?q[p]:null,Nn=Vn&&mt?.isMultivariate?tt(Vn,mt):null,bt=Nn?Mn(Nn,lt):[],ln=Math.min(B,Math.max(bt.length-1,0)),$t=bt[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ie)),fa=zt&&!Ve&&mt?.isSavedBlock===!0,ot=Ve||fa,pa=Ve?bn:mt?.label??"",ga=We&&l?Gt(We,l):null,cn=zt&&(!Ve||ee.length>0)?Ve?[bn,...ee]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...ee]:[],ha=T&&qe?[qe.name,"SEO",...Le]:[],Ht=T?ha:ot?cn.length>0?cn:[pa]:cn,va=!T&&!Ve&&ft&&ee.length===0,Tn=()=>{if(!V)return;Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const t=r[V],s=ao(t.sections,q);if(!s)return;const a=oo(s);we.mutate({blockKey:V,data:{...t,sections:s}},{onSuccess:()=>{O(a),N(null),L(null),M(null),$([]),I(null),Z(null)},onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!V)return;Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const c=r[V],b=c.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const j=b;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const P=So(j,_),te={...r,[V]:{...c,sections:P}};we.mutate({blockKey:V,data:te[V]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},ba=t=>{oe(null),O(t),N(null),L(null),M(null),$([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);Z(a),I(c),yn(He.map(b=>({rule:b.rule})),t)},Sa=(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),O(a);const c=Ct(He.map(b=>({rule:b.rule})),t,s);yn(c,a),un(b=>Ct(b,t,s))},xa=t=>{const s=He[t]?.rule,a=Pt(s,r??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Ce?O(Ce-1):t===Ce&&O(Math.max(0,t-1)),N(null),L(null),M(null),$([]),I(null),Z(null)},a)},ya=t=>{un(s=>xo(s,t),()=>{O(t+1),N(null),L(null),M(null),$([]),I(null),Z(null)})},_a=async(t,s)=>{Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const b=c[a],j=b.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[t];if(!te?.rule||typeof te.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=te.rule,U=s.trim();Lt(!0);try{if(!U){if(!wt(C,c,l)){oe(null);return}const Ze=C.__resolveType??"";P[t]={...te,rule:Bn(C,c,l)};const ve={...c,[a]:{...b,sections:{..._,variants:P}}};await we.mutateAsync({blockKey:a,data:ve[a]}),await Dt(Ze,ve),oe(null),u?.();return}const W=On(C,c,l);if(!W){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await we.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,U)}),oe(null),u?.();return}const _e=dn(U),Y=mn(_e,c);if(Y){X.error(Y);return}const Q=Vt(W.resolveType,W.data,U);let Pe=null;try{await we.mutateAsync({blockKey:_e,data:Q}),Pe=_e,P[t]={...te,rule:qt(_e)},await we.mutateAsync({blockKey:a,data:{...b,sections:{..._,variants:P}}}),Pe=null}catch(Ze){throw Pe&&await Xt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ze}oe(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),u?.()}catch(W){X.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ja=async(t,s)=>{Rt(),Fe.current&&(clearTimeout(Fe.current),Fe.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:b,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(a===null||!_)return;const C=c[a],U=b[a];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=_e[t];if(!Y?.rule||typeof Y.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=Y.rule,Pe=s.trim();Lt(!0);const Ze=async ve=>{const Je={...W,variants:ve},rt=[...c];rt[a]=xt(C,U,Je);const pt=At(j,_,rt,te,P);return await we.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Pe){if(!wt(Q,j,l)){le(null);return}const gt=Q.__resolveType??"",Cn=[..._e];Cn[t]={...Y,rule:Bn(Q,j,l)};const Va=await Ze(Cn);await Dt(gt,Va),le(null),u?.();return}const ve=On(Q,j,l);if(!ve){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await we.mutateAsync({blockKey:ve.blockKey,data:Vt(ve.resolveType,ve.data,Pe)}),le(null),u?.();return}const Je=dn(Pe),rt=mn(Je,j);if(rt){X.error(rt);return}const pt=Vt(ve.resolveType,ve.data,Pe);let it=null;try{await we.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[..._e];gt[t]={...Y,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}le(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ve){X.error(ve instanceof Error?ve.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Pn=()=>{kt()},Ea=t=>{Ee(t),on({inner:t})},ka=t=>{ke(t),on({raw:t})},Ra=()=>{Ee(null),Te([])},wa=()=>F(t=>t+1),An=t=>{if(T){if(t===0){Qt.flush(),Ke(!1),Ee(null),ke(void 0),Te([]),F(a=>a+1),k?.();return}if(t===1){Te([]),F(a=>a+1);return}Te(Le.slice(0,t-1)),F(a=>a+1);return}if(Ve){$(ee.slice(0,t)),H(a=>a+1);return}if(t===0){Pn();return}if(t===1){$([]),H(a=>a+1);return}if(ft&&t===2){$([]),H(a=>a+1);return}const s=ft?2:1;$(ee.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:ot||zt||T?n.jsxs("div",{className:Oe("border-b px-3 py-2.5",ot&&"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:()=>An(yo(Ht.length,{isMultivariateSectionTop:va})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ms,{className:"size-4"})}),!Ve&&Bt&&ut&&n.jsxs("button",{type:"button",onClick:Pn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Oe("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",xr),children:[n.jsx(Es,{rule:Mt(ut.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":i("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(fs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>An(s),title:t,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Vo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Dn&&!ft&&!mt?.isHidden&&V&&n.jsx(Wn,{onClick:()=>rn()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("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(_r,{pageKey:V,initialName:qe.name,initialPath:qe.path,onFieldChange:Hs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ke(!0),children:n.jsx(ko,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&V?D(V):Se(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Wn,{onClick:Tn})]})}),T?n.jsx(Yt,{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:Ft&&V?n.jsx(Uo,{rawSeo:nn,innerSeo:Sn,defaultResolveType:Fs,seoSchema:Bs,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:ze,siteDefaultSeo:Os,onBreadcrumbChange:Te,onPersistRaw:ka,onInnerChange:Ea,onClearForm:Ra,onBumpFormKey:wa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&bt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Za,{listKey:`${V??""}:${p??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:Zs,onRename:le,onDuplicate:ta,onDelete:ea,onRemoveAll:sa,onReorder:na,onAdd:()=>rn()}),ft&&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:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(qn,{currentRt:We??"",currentLabel:Wt($t?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ua,onSelectGlobal:ma,schema:ga,formValue:nt,onChange:da,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:be,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})]}):Ve?n.jsx(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:be,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Bt&&V&&n.jsx(vr,{listKey:V,variants:He,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:ba,onReorder:Sa,onRename:oe,onDuplicate:ya,onDelete:xa,onAdd:Tn}),Bt&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",fe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>De(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":fe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),fe?n.jsx(wo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_o,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),fe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(qn,{currentRt:J,currentLabel:Wt(ut?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ia,onSelectGlobal:ca,schema:ra,formValue:me,onChange:la,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(lr,{listKey:`${V??""}-${Ce}`,rawSections:q,sections:Be,meta:l,selectedIndex:p,onSelect:zs,onReorder:Gs,onDelete:Us,onDuplicate:Ws,onMakeReusable:ae,onToggleHidden:qs,onToggleLazy:Ys,onAddVariant:rn,onDetach:Js,onAddSection:()=>re(!0),canAddSection:oa})})]}),n.jsx(eo,{open:se!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:se!==null?dn(Be[se]?.label??""):"",isPending:we.isPending,onSubmit:aa}),m&&n.jsx(Yo,{open:je,onOpenChange:t=>{re(t),t||(xe.current=null)},meta:l,decofile:r,previewBaseUrl:m,onSelect:Xs}),pe&&V&&r&&n.jsx(to,{open:pe,onOpenChange:Se,pageKey:V,decofile:r}),ue!==null&&n.jsx(Hn,{open:!0,initialName:wt(He[ue]?.rule,r??{},l??void 0)?Wt(He[ue]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Mt(He[ue]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await _a(ue,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),de!==null&&n.jsx(Hn,{open:!0,initialName:wt(bt[de]?.rule,r??{},l??void 0)?Wt(bt[de]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Mt(bt[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ja(de,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{ic as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,aD as nt,aB as Pe,j as d,cP as rt,aF as be,aC as k,cQ as st,ay as j,aE as _,bG as $,cR as lt,af as Ne,cS as Ee,az as at,bA as ct,bI as it,cY as dt,cZ as ut,c_ as pt,c$ as ft,cT as mt,aA as ht,d0 as vt,cU as gt,cW as xt,c as ee,m as oe}from"./index-CjF26QCG.js";import{V as St}from"./tooltip-DASp4d0o.js";import{i as wt}from"./Check-Dyt2_0ga.js";import{t as Re}from"./ChevronDown-D6KfEPdr.js";import{n as Ct}from"./ChevronUp-Bmy1l0Py.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,Z=N.left-P,X=N.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,Z=window.innerWidth-N.right-P,X=N.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"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,Z=Math.max(ce,se+(I?he:0)+P+D),X=T+Z;l.style.height=X+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const Z=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=Z+"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",Ze=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});Ze.displayName=Ce;var ye="SelectScrollDownButton",Xe=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});Xe.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,Zt=Be,Xt=Fe,Qt=$e,Jt=Ge,eo=qe,to=Ze,oo=Xe;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(Xt,{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(Zt,{"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,aD as nt,aB as Pe,j as d,cP as rt,aF as be,aC as k,cQ as st,ay as j,aE as _,bG as $,cR as lt,af as Ne,cS as Ee,az as at,bA as ct,bI as it,cY as dt,cZ as ut,c_ as pt,c$ as ft,cT as mt,aA as ht,d0 as vt,cU as gt,cW as xt,c as ee,m as oe}from"./index-CXWWJmED.js";import{V as St}from"./tooltip-gZsEQkQ4.js";import{i as wt}from"./Check-qxVfMARc.js";import{t as Re}from"./ChevronDown-e1-U-GuJ.js";import{n as Ct}from"./ChevronUp-sCAKY-xq.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,Z=N.left-P,X=N.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,Z=window.innerWidth-N.right-P,X=N.width+Z,ve=Math.max(X,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=X+"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,Z=Math.max(ce,se+(I?he:0)+P+D),X=T+Z;l.style.height=X+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const Z=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=Z+"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",Ze=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});Ze.displayName=Ce;var ye="SelectScrollDownButton",Xe=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});Xe.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,Zt=Be,Xt=Fe,Qt=$e,Jt=Ge,eo=qe,to=Ze,oo=Xe;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(Xt,{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(Zt,{"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,4 +1,4 @@
|
|
|
1
|
-
import{c as H,j as s,b as se,r as V,B as le,m as ie,af as yt,X as Ye,Y as ye,F as ve,o as _e,Z as Qe,_ as Je,e as ke,K as ce,t as oe,p as ne,D as jt,n as St,d as Nt,E as kt,z as Ct}from"./index-
|
|
1
|
+
import{c as H,j as s,b as se,r as V,B as le,m as ie,af as yt,X as Ye,Y as ye,F as ve,o as _e,Z as Qe,_ as Je,e as ke,K as ce,t as oe,p as ne,D as jt,n as St,d as Nt,E as kt,z as Ct}from"./index-CXWWJmED.js";import{e as Me,d as Ee,a as Ze,b as Oe,h as et,c as tt,D as wt}from"./dialog-S6zU-X1o.js";import{d as It,b as _t,a as Mt,D as Et}from"./drawer-CQnxFo4h.js";import{u as Ot}from"./use-mobile-5SOdKrGk.js";import{c as st,S as Ie,F as Lt,u as Le}from"./chat-context-DyvKnksd.js";import{C as Tt}from"./checkbox-CcdD9hyv.js";import{I as pe}from"./input-boqiKbt5.js";import{S as At,a as Pt,b as zt,c as Dt,d as Rt}from"./select-BzIcrZmY.js";import{S as te}from"./skeleton-DfWmK_Y8.js";import{i as it,b as lt,c as Ft,a as Kt,s as $t}from"./Settings02-Vn36Nz-O.js";import{d as Ut,a as Bt,b as Wt,i as Vt}from"./Tool01-CSu_r-q6.js";import{i as Ht}from"./Key01-D8-RvxFO.js";import{i as nt}from"./SearchMd-95D3LDtT.js";import{d as Te,u as qt,b as Gt}from"./use-ai-providers-C8J33FgM.js";import{g as Ae}from"./ai-providers-logos-DD3qZ33J.js";import{i as Xt}from"./Monitor01-BVloJrIj.js";import{i as Yt}from"./AlertCircle-Dq3WjiEJ.js";import{u as we}from"./studio-tools-CTvMzhHZ.js";import{i as Qt}from"./ChevronRight-BBTu-8S3.js";import{A as Jt}from"./avatar-Cqm3Lq4j.js";import{S as De,a as Re,b as ot}from"./settings-section-kinXnNNm.js";import{s as rt}from"./Eye-Dp-Mi9OG.js";import{i as Zt}from"./Check-qxVfMARc.js";import{a as es}from"./Copy01-D5KM45B8.js";import{t as Fe}from"./ChevronDown-e1-U-GuJ.js";import{t as ts}from"./Stars01-Dhu1azXB.js";function xe(l){const e=H.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}function ge(l){const e=H.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}const ss={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:xe},codex:{labelKey:"chat.agentIcons.codex",Icon:ge}};function Zi(l){return(l&&ss[l])??null}const Ke="bunx decocms@latest link",is=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:s.jsx(xe,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:s.jsx(ge,{size:18})}];function ls(l){const e=H.c(46),{open:t,onOpenChange:i}=l,n=se();let o;e[0]!==t?(o={fast:t},e[0]=t,e[1]=o):o=e[1];const r=st(o),[c,u]=V.useState(!1);let d,a,h,p,m,f,v,N;if(e[2]!==r.hostname||e[3]!==r.machineId||e[4]!==r.online||e[5]!==i||e[6]!==t||e[7]!==n){const C=r.hostname??r.machineId??n("chat.connectDesktopDialog.yourDesktop");p=Me,v=t,N=i,h=Ee,f="sm:max-w-md",a=Ze,d=Oe,m=r.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:C}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=r.hostname,e[3]=r.machineId,e[4]=r.online,e[5]=i,e[6]=t,e[7]=n,e[8]=d,e[9]=a,e[10]=h,e[11]=p,e[12]=m,e[13]=f,e[14]=v,e[15]=N}else d=e[8],a=e[9],h=e[10],p=e[11],m=e[12],f=e[13],v=e[14],N=e[15];let b;e[16]!==d||e[17]!==m?(b=s.jsx(d,{children:m}),e[16]=d,e[17]=m,e[18]=b):b=e[18];let j;e[19]!==r.online||e[20]!==n?(j=r.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=r.online,e[20]=n,e[21]=j):j=e[21];let w;e[22]!==j?(w=s.jsx(et,{children:j}),e[22]=j,e[23]=w):w=e[23];let O;e[24]!==a||e[25]!==b||e[26]!==w?(O=s.jsxs(a,{children:[b,w]}),e[24]=a,e[25]=b,e[26]=w,e[27]=O):O=e[27];let _;e[28]!==c||e[29]!==r.online?(_=!r.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:Ke}),s.jsx(le,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(Ke).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},children:c?s.jsx(Zt,{size:14}):s.jsx(es,{size:14})})]}),e[28]=c,e[29]=r.online,e[30]=_):_=e[30];let I;e[31]!==r.capabilities||e[32]!==r.online||e[33]!==n?(I=r.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:is.map(C=>{const M=r.capabilities.includes(C.capability);return s.jsxs("div",{className:ie("flex items-center gap-3 rounded-md border px-3 py-2",M?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:ie("flex size-6 items-center justify-center",M?"text-foreground":"text-muted-foreground"),children:C.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:n(C.labelKey)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n(M?C.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),s.jsx("span",{className:ie("size-2 rounded-full",M?"bg-success":"bg-muted-foreground/30")})]},C.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ie,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=r.capabilities,e[32]=r.online,e[33]=n,e[34]=I):I=e[34];let x;e[35]!==h||e[36]!==_||e[37]!==I||e[38]!==f||e[39]!==O?(x=s.jsxs(h,{className:f,children:[O,_,I]}),e[35]=h,e[36]=_,e[37]=I,e[38]=f,e[39]=O,e[40]=x):x=e[40];let k;return e[41]!==p||e[42]!==x||e[43]!==v||e[44]!==N?(k=s.jsx(p,{open:v,onOpenChange:N,children:x}),e[41]=p,e[42]=x,e[43]=v,e[44]=N,e[45]=k):k=e[45],k}function fe(l,e,t){let i=t.initialDeps??[],n,o=!0;function r(){var c,u,d;let a;t.key&&((c=t.debug)!=null&&c.call(t))&&(a=Date.now());const h=l();if(!(h.length!==i.length||h.some((f,v)=>i[v]!==f)))return n;i=h;let m;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(m=Date.now()),n=e(...h),t.key&&((d=t.debug)!=null&&d.call(t))){const f=Math.round((Date.now()-a)*100)/100,v=Math.round((Date.now()-m)*100)/100,N=v/16,b=(j,w)=>{for(j=String(j);j.length<w;)j=" "+j;return j};console.info(`%c⏱ ${b(v,5)} /${b(f,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*N,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=c=>{i=c},r}function $e(l,e){if(l===void 0)throw new Error("Unexpected undefined");return l}const ns=(l,e)=>Math.abs(l-e)<1.01,os=(l,e,t)=>{let i;return function(...n){l.clearTimeout(i),i=l.setTimeout(()=>e.apply(this,n),t)}},Ue=l=>{const{offsetWidth:e,offsetHeight:t}=l;return{width:e,height:t}},rs=l=>l,as=l=>{const e=Math.max(l.startIndex-l.overscan,0),t=Math.min(l.endIndex+l.overscan,l.count-1),i=[];for(let n=e;n<=t;n++)i.push(n);return i},cs=(l,e)=>{const t=l.scrollElement;if(!t)return;const i=l.targetWindow;if(!i)return;const n=r=>{const{width:c,height:u}=r;e({width:Math.round(c),height:Math.round(u)})};if(n(Ue(t)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(r=>{const c=()=>{const u=r[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Ue(t))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Be={passive:!0},We=typeof window>"u"?!0:"onscrollend"in window,ds=(l,e)=>{const t=l.scrollElement;if(!t)return;const i=l.targetWindow;if(!i)return;let n=0;const o=l.options.useScrollendEvent&&We?()=>{}:os(i,()=>{e(n,!1)},l.options.isScrollingResetDelay),r=a=>()=>{const{horizontal:h,isRtl:p}=l.options;n=h?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(n,a)},c=r(!0),u=r(!1);t.addEventListener("scroll",c,Be);const d=l.options.useScrollendEvent&&We;return d&&t.addEventListener("scrollend",u,Be),()=>{t.removeEventListener("scroll",c),d&&t.removeEventListener("scrollend",u)}},us=(l,e,t)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},ms=(l,{adjustments:e=0,behavior:t},i)=>{var n,o;const r=l+e;(o=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[i.options.horizontal?"left":"top"]:r,behavior:t})};class hs{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,i,n;return((n=(i=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:i.now)==null?void 0:n.call(i))??Date.now()},this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const c=o.target,u=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=i())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=i())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,n])=>{typeof n>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:rs,rangeExtractor:as,onChange:()=>{},measureElement:us,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var i,n;(n=(i=this.options).onChange)==null||n.call(i,this,t)},this.maybeNotify=fe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const n=new Map,o=new Map;for(let r=i-1;r>=0;r--){const c=t[r];if(n.has(c.lane))continue;const u=o.get(c.lane);if(u==null||c.end>u.end?o.set(c.lane,c):c.end<u.end&&n.set(c.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,c)=>r.end===c.end?r.index-c.index:r.end-c.end)[0]:void 0},this.getMeasurementOptions=fe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,i,n,o,r,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u}),{key:!1}),this.getMeasurements=fe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const h=this.measurementsCache.slice(0,a),p=new Array(c).fill(void 0);for(let m=0;m<a;m++){const f=h[m];f&&(p[f.lane]=m)}for(let m=a;m<t;m++){const f=o(m),v=this.laneAssignments.get(m);let N,b;const j=u==="estimate"||d.has(f);if(v!==void 0&&this.options.lanes>1){N=v;const I=p[N],x=I!==void 0?h[I]:void 0;b=x?x.end+this.options.gap:i+n}else{const I=this.options.lanes===1?h[m-1]:this.getFurthestMeasurement(h,m);b=I?I.end+this.options.gap:i+n,N=I?I.lane:m%this.options.lanes,this.options.lanes>1&&j&&this.laneAssignments.set(m,N)}const w=d.get(f),O=typeof w=="number"?w:this.options.estimateSize(m),_=b+O;h[m]={index:m,start:b,size:O,end:_,key:f,lane:N},p[N]=m}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,n,o)=>this.range=t.length>0&&i>0?fs({measurements:t,outerSize:i,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=fe(()=>{let t=null,i=null;const n=this.calculateRange();return n&&(t=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,n=t.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),c=Math.min(this.options.count-1,n+o);return t>=r&&t<=c}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,c)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(c))});return}const i=this.indexFromElement(t),n=this.options.getItemKey(i),o=this.elementsCache.get(n);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,i)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,c=i-r;c!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,c,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,i)),this.notify(!1))},this.getVirtualItems=fe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const c=t[o],u=i[c];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return $e(i[at(0,i.length-1,n=>$e(i[n]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,i,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();i==="auto"&&(i=t>=r+o?"end":"start"),i==="center"?t+=(n-o)/2:i==="end"&&(t-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(i==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)i="end";else if(r.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,r.size),i]},this.scrollToOffset=(t,{align:i="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,i),r=this.now();this.scrollState={index:null,align:i,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:i="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,i);if(!o)return;const[r,c]=o,u=this.now();this.scrollState={index:t,align:c,behavior:n,startedAt:u,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:i="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=i[i.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=i.length-1;for(;r>=0&&o.some(c=>c===null);){const c=i[r];o[c.lane]===null&&(o[c.lane]=c.end),r--}n=Math.max(...o.filter(c=>c!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=i?i[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&ns(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const at=(l,e,t,i)=>{for(;l<=e;){const n=(l+e)/2|0,o=t(n);if(o<i)l=n+1;else if(o>i)e=n-1;else return n}return l>0?l-1:0};function fs({measurements:l,outerSize:e,scrollOffset:t,lanes:i}){const n=l.length-1,o=u=>l[u].start;if(l.length<=i)return{startIndex:0,endIndex:n};let r=at(0,n,o,t),c=r;if(i===1)for(;c<n&&l[c].end<t+e;)c++;else if(i>1){const u=Array(i).fill(0);for(;c<n&&u.some(a=>a<t+e);){const a=l[c];u[a.lane]=a.end,c++}const d=Array(i).fill(t+e);for(;r>=0&&d.some(a=>a>=t);){const a=l[r];d[a.lane]=a.start,r--}r=Math.max(0,r-r%i),c=Math.min(n,c+(i-1-c%i))}return{startIndex:r,endIndex:c}}const Ve=typeof document<"u"?V.useLayoutEffect:V.useEffect;function ps({useFlushSync:l=!0,...e}){const t=V.useReducer(()=>({}),{})[1],i={...e,onChange:(o,r)=>{var c;l&&r?yt.flushSync(t):t(),(c=e.onChange)==null||c.call(e,o,r)}},[n]=V.useState(()=>new hs(i));return n.setOptions(i),Ve(()=>n._didMount(),[]),Ve(()=>n._willUpdate()),n}function xs(l){return ps({observeElementRect:cs,observeElementOffset:ds,scrollToFn:ms,...l})}const ct=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function je(l){if(l)return ct.find(e=>e.id===l)}const He=4;function be(l){const e=H.c(8),{logo:t,name:i,description:n,onClick:o}=l;let r;e[0]!==t||e[1]!==i?(r=t?s.jsx("img",{src:t,alt:i,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Jt,{fallback:i.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=i,e[2]=r):r=e[2];let c;return e[3]!==n||e[4]!==i||e[5]!==o||e[6]!==r?(c=s.jsx(ot,{onClick:o,icon:r,title:i,description:n}),e[3]=n,e[4]=i,e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function dt(l){const e=H.c(38),{providers:t,onSelect:i,onShowAll:n}=l,o=se();let r;e[0]!==t?(r=t.find(ys),e[0]=t,e[1]=r):r=e[1];const c=r;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=u):u=e[2];const d=u;let a;if(e[3]!==i||e[4]!==t||e[5]!==o){let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O=(S,E)=>{const P=d[S.id]??Number.MAX_SAFE_INTEGER,A=d[E.id]??Number.MAX_SAFE_INTEGER;return P-A},e[7]=O):O=e[7];const _=t.filter(bs).sort(O);let I;e[8]!==t?(I=t.find(vs),e[8]=t,e[9]=I):I=e[9];const x=I;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=je("openai"),e[10]=k):k=e[10];const C=k;let M;e[11]!==i?(M=S=>s.jsx(be,{logo:S.logo,name:S.name,description:S.description,onClick:()=>i({kind:"provider",provider:S})},S.id),e[11]=i,e[12]=M):M=e[12];let y;e[13]!==i||e[14]!==x?(y=x&&C?[s.jsx(be,{logo:C.logo,name:C.name,description:C.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],e[13]=i,e[14]=x,e[15]=y):y=e[15];let g;e[16]!==i||e[17]!==x||e[18]!==o?(g=x?[...ct.filter(gs).map(S=>s.jsx(be,{logo:S.logo,name:S.name,description:S.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:S})},S.id)),s.jsx(be,{logo:x.logo,name:o("settings.aiProviders.customOpenAiCompatible"),description:o("settings.aiProviders.customOpenAiDescription"),onClick:()=>i({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[16]=i,e[17]=x,e[18]=o,e[19]=g):g=e[19],a=[..._.map(M),...y,...g],e[3]=i,e[4]=t,e[5]=o,e[6]=a}else a=e[6];const h=a,p=h.length-He,m=!!n&&p>0;let f;e[20]!==h||e[21]!==m?(f=m?h.slice(0,He):h,e[20]=h,e[21]=m,e[22]=f):f=e[22];const v=f;let N;e[23]!==c||e[24]!==i||e[25]!==o?(N=c&&s.jsx(De,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:o("settings.aiProviders.recommended")}),s.jsx(Re,{className:"relative",children:s.jsx(be,{logo:c.logo,name:c.name,description:c.description,onClick:()=>i({kind:"provider",provider:c})})})]})}),e[23]=c,e[24]=i,e[25]=o,e[26]=N):N=e[26];let b;e[27]!==p||e[28]!==n||e[29]!==m||e[30]!==o?(b=m&&s.jsx(ot,{onClick:n,title:o("settings.aiProviders.moreProviders",{count:p,plural:p===1?"":"s"}),action:s.jsx(Qt,{size:16,className:"text-muted-foreground"})}),e[27]=p,e[28]=n,e[29]=m,e[30]=o,e[31]=b):b=e[31];let j;e[32]!==b||e[33]!==v?(j=s.jsx(De,{children:s.jsxs(Re,{children:[v,b]})}),e[32]=b,e[33]=v,e[34]=j):j=e[34];let w;return e[35]!==N||e[36]!==j?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,j]}),e[35]=N,e[36]=j,e[37]=w):w=e[37],w}function gs(l){return l.id!=="openai"}function vs(l){return l.id==="openai-compatible"}function bs(l){return l.id!=="deco"&&l.id!=="openai-compatible"}function ys(l){return l.id==="deco"}const js=Ye({label:ye().optional(),apiKey:ye().min(1,"API key is required")});function Ss(l){const e=H.c(87),{providerId:t,onCancel:i,onSuccess:n}=l,{org:o}=ve(),r=we(),c=_e(),[u,d]=V.useState(!1),a=se();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={resolver:Qe(js),defaultValues:{label:"",apiKey:""}},e[0]=h):h=e[0];const{register:p,handleSubmit:m,formState:f}=Je(h),{errors:v}=f;let N;e[1]!==t||e[2]!==r||e[3]!==a?(N=async U=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:U.label||a("settings.connectForms.defaultKeyLabel"),apiKey:U.apiKey})},e[1]=t,e[2]=r,e[3]=a,e[4]=N):N=e[4];let b;e[5]!==n||e[6]!==o||e[7]!==c||e[8]!==a?(b=()=>{c.invalidateQueries({queryKey:ce.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:ce.aiProviders(o.id)}),oe.success(a("settings.connectForms.keySavedSuccess")),n()},e[5]=n,e[6]=o,e[7]=c,e[8]=a,e[9]=b):b=e[9];let j;e[10]!==a?(j=U=>{oe.error(a("settings.connectForms.failedSaveKey",{error:U.message}))},e[10]=a,e[11]=j):j=e[11];let w;e[12]!==N||e[13]!==b||e[14]!==j?(w={mutationFn:N,onSuccess:b,onError:j},e[12]=N,e[13]=b,e[14]=j,e[15]=w):w=e[15];const{mutate:O,isPending:_,error:I}=ke(w);let x;e[16]!==O?(x=U=>O(U),e[16]=O,e[17]=x):x=e[17];let k;e[18]!==m||e[19]!==x?(k=m(x),e[18]=m,e[19]=x,e[20]=k):k=e[20];let C;e[21]!==a?(C=a("settings.connectForms.labelField"),e[21]=a,e[22]=C):C=e[22];let M;e[23]!==C?(M=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:C}),e[23]=C,e[24]=M):M=e[24];let y;e[25]!==a?(y=a("settings.connectForms.labelPlaceholder"),e[25]=a,e[26]=y):y=e[26];let g;e[27]!==p?(g=p("label"),e[27]=p,e[28]=g):g=e[28];let S;e[29]!==y||e[30]!==g?(S=s.jsx(pe,{placeholder:y,...g,className:"h-8 text-sm"}),e[29]=y,e[30]=g,e[31]=S):S=e[31];let E;e[32]!==M||e[33]!==S?(E=s.jsxs("div",{className:"space-y-1",children:[M,S]}),e[32]=M,e[33]=S,e[34]=E):E=e[34];let P;e[35]!==a?(P=a("settings.connectForms.apiKeyField"),e[35]=a,e[36]=P):P=e[36];let A;e[37]!==P?(A=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:P}),e[37]=P,e[38]=A):A=e[38];const L=u?"text":"password";let z;e[39]!==p?(z=p("apiKey"),e[39]=p,e[40]=z):z=e[40];let R;e[41]!==L||e[42]!==z?(R=s.jsx(pe,{type:L,placeholder:"sk-...",...z,className:"ph-no-capture h-8 text-sm pr-8"}),e[41]=L,e[42]=z,e[43]=R):R=e[43];let K;e[44]!==u?(K=()=>d(!u),e[44]=u,e[45]=K):K=e[45];let D;e[46]!==u||e[47]!==a?(D=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[46]=u,e[47]=a,e[48]=D):D=e[48];let W;e[49]!==u?(W=u?s.jsx(it,{size:14}):s.jsx(rt,{size:14}),e[49]=u,e[50]=W):W=e[50];let Q;e[51]!==K||e[52]!==D||e[53]!==W?(Q=s.jsx("button",{type:"button",onClick:K,"aria-label":D,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:W}),e[51]=K,e[52]=D,e[53]=W,e[54]=Q):Q=e[54];let J;e[55]!==R||e[56]!==Q?(J=s.jsxs("div",{className:"relative",children:[R,Q]}),e[55]=R,e[56]=Q,e[57]=J):J=e[57];let Z;e[58]!==v.apiKey?(Z=v.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:v.apiKey.message}),e[58]=v.apiKey,e[59]=Z):Z=e[59];let X;e[60]!==A||e[61]!==J||e[62]!==Z?(X=s.jsxs("div",{className:"space-y-1",children:[A,J,Z]}),e[60]=A,e[61]=J,e[62]=Z,e[63]=X):X=e[63];let ee;e[64]!==I?(ee=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[64]=I,e[65]=ee):ee=e[65];let q;e[66]!==a?(q=a("settings.connectForms.cancel"),e[66]=a,e[67]=q):q=e[67];let G;e[68]!==_||e[69]!==i||e[70]!==q?(G=s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:_,children:q}),e[68]=_,e[69]=i,e[70]=q,e[71]=G):G=e[71];let Y;e[72]!==_||e[73]!==a?(Y=a(_?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[72]=_,e[73]=a,e[74]=Y):Y=e[74];let T;e[75]!==_||e[76]!==Y?(T=s.jsx(le,{type:"submit",size:"sm",disabled:_,children:Y}),e[75]=_,e[76]=Y,e[77]=T):T=e[77];let F;e[78]!==G||e[79]!==T?(F=s.jsxs(tt,{children:[G,T]}),e[78]=G,e[79]=T,e[80]=F):F=e[80];let $;return e[81]!==E||e[82]!==X||e[83]!==ee||e[84]!==F||e[85]!==k?($=s.jsxs("form",{onSubmit:k,className:"space-y-3",children:[E,X,ee,F]}),e[81]=E,e[82]=X,e[83]=ee,e[84]=F,e[85]=k,e[86]=$):$=e[86],$}const Ns=Ye({label:ye().optional(),baseUrl:ye().min(1,"Base URL is required"),apiKey:ye().optional()});function ks(l){const e=H.c(105),{preset:t,onCancel:i,onSuccess:n}=l,{org:o}=ve(),r=we(),c=_e(),[u,d]=V.useState(!1),a=se();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=Qe(Ns),e[0]=h):h=e[0];const p=t?.defaultBaseUrl??"";let m;e[1]!==p?(m={resolver:h,defaultValues:{label:"",baseUrl:p,apiKey:""}},e[1]=p,e[2]=m):m=e[2];const{register:f,handleSubmit:v,formState:N}=Je(m),{errors:b}=N;let j;e[3]!==t||e[4]!==r?(j=async ae=>{const bt=JSON.stringify({baseUrl:ae.baseUrl,apiKey:ae.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:ae.label||t?.name||ae.baseUrl,apiKey:bt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let w;e[6]!==n||e[7]!==o||e[8]!==c||e[9]!==a?(w=()=>{c.invalidateQueries({queryKey:ce.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:ce.aiProviders(o.id)}),oe.success(a("settings.connectForms.connectionSavedSuccess")),n()},e[6]=n,e[7]=o,e[8]=c,e[9]=a,e[10]=w):w=e[10];let O;e[11]!==a?(O=ae=>{oe.error(a("settings.connectForms.failedSaveConnection",{error:ae.message}))},e[11]=a,e[12]=O):O=e[12];let _;e[13]!==j||e[14]!==w||e[15]!==O?(_={mutationFn:j,onSuccess:w,onError:O},e[13]=j,e[14]=w,e[15]=O,e[16]=_):_=e[16];const{mutate:I,isPending:x,error:k}=ke(_);let C;e[17]!==t||e[18]!==a?(C=t?a("settings.connectForms.labelPlaceholderPreset",{name:t.name}):a("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[17]=t,e[18]=a,e[19]=C):C=e[19];const M=C;let y;e[20]!==t?.baseUrlPlaceholder||e[21]!==a?(y=t?.baseUrlPlaceholder??a("settings.connectForms.baseUrlPlaceholder"),e[20]=t?.baseUrlPlaceholder,e[21]=a,e[22]=y):y=e[22];const g=y;let S;e[23]!==I?(S=ae=>I(ae),e[23]=I,e[24]=S):S=e[24];let E;e[25]!==v||e[26]!==S?(E=v(S),e[25]=v,e[26]=S,e[27]=E):E=e[27];let P;e[28]!==a?(P=a("settings.connectForms.labelField"),e[28]=a,e[29]=P):P=e[29];let A;e[30]!==P?(A=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:P}),e[30]=P,e[31]=A):A=e[31];let L;e[32]!==f?(L=f("label"),e[32]=f,e[33]=L):L=e[33];let z;e[34]!==M||e[35]!==L?(z=s.jsx(pe,{placeholder:M,...L,className:"h-8 text-sm"}),e[34]=M,e[35]=L,e[36]=z):z=e[36];let R;e[37]!==A||e[38]!==z?(R=s.jsxs("div",{className:"space-y-1",children:[A,z]}),e[37]=A,e[38]=z,e[39]=R):R=e[39];let K;e[40]!==g||e[41]!==b||e[42]!==t?.defaultBaseUrl||e[43]!==f||e[44]!==a?(K=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...f("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.connectForms.baseUrlField")}),s.jsx(pe,{type:"url",placeholder:g,...f("baseUrl"),className:"h-8 text-sm"}),b.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:b.baseUrl.message})]}),e[40]=g,e[41]=b,e[42]=t?.defaultBaseUrl,e[43]=f,e[44]=a,e[45]=K):K=e[45];let D;e[46]!==a?(D=a("settings.connectForms.apiKeyField"),e[46]=a,e[47]=D):D=e[47];let W;e[48]!==t?.apiKeyRecommended||e[49]!==a?(W=t?.apiKeyRecommended?a("settings.connectForms.recommended"):a("settings.connectForms.optional"),e[48]=t?.apiKeyRecommended,e[49]=a,e[50]=W):W=e[50];let Q;e[51]!==W?(Q=s.jsxs("span",{className:"text-muted-foreground/60",children:["(",W,")"]}),e[51]=W,e[52]=Q):Q=e[52];let J;e[53]!==D||e[54]!==Q?(J=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[D," ",Q]}),e[53]=D,e[54]=Q,e[55]=J):J=e[55];const Z=u?"text":"password";let X;e[56]!==f?(X=f("apiKey"),e[56]=f,e[57]=X):X=e[57];let ee;e[58]!==Z||e[59]!==X?(ee=s.jsx(pe,{type:Z,placeholder:"sk-...",...X,className:"ph-no-capture h-8 text-sm pr-8"}),e[58]=Z,e[59]=X,e[60]=ee):ee=e[60];let q;e[61]!==u?(q=()=>d(!u),e[61]=u,e[62]=q):q=e[62];let G;e[63]!==u||e[64]!==a?(G=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[63]=u,e[64]=a,e[65]=G):G=e[65];let Y;e[66]!==u?(Y=u?s.jsx(it,{size:14}):s.jsx(rt,{size:14}),e[66]=u,e[67]=Y):Y=e[67];let T;e[68]!==q||e[69]!==G||e[70]!==Y?(T=s.jsx("button",{type:"button",onClick:q,"aria-label":G,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Y}),e[68]=q,e[69]=G,e[70]=Y,e[71]=T):T=e[71];let F;e[72]!==ee||e[73]!==T?(F=s.jsxs("div",{className:"relative",children:[ee,T]}),e[72]=ee,e[73]=T,e[74]=F):F=e[74];let $;e[75]!==J||e[76]!==F?($=s.jsxs("div",{className:"space-y-1",children:[J,F]}),e[75]=J,e[76]=F,e[77]=$):$=e[77];let U;e[78]!==t?(U=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[78]=t,e[79]=U):U=e[79];let B;e[80]!==k?(B=k&&s.jsx("p",{className:"text-xs text-destructive",children:k.message}),e[80]=k,e[81]=B):B=e[81];let re;e[82]!==a?(re=a("settings.connectForms.cancel"),e[82]=a,e[83]=re):re=e[83];let de;e[84]!==x||e[85]!==i||e[86]!==re?(de=s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:x,children:re}),e[84]=x,e[85]=i,e[86]=re,e[87]=de):de=e[87];let ue;e[88]!==x||e[89]!==a?(ue=a(x?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[88]=x,e[89]=a,e[90]=ue):ue=e[90];let me;e[91]!==x||e[92]!==ue?(me=s.jsx(le,{type:"submit",size:"sm",disabled:x,children:ue}),e[91]=x,e[92]=ue,e[93]=me):me=e[93];let he;e[94]!==de||e[95]!==me?(he=s.jsxs(tt,{children:[de,me]}),e[94]=de,e[95]=me,e[96]=he):he=e[96];let Se;return e[97]!==E||e[98]!==R||e[99]!==K||e[100]!==$||e[101]!==U||e[102]!==B||e[103]!==he?(Se=s.jsxs("form",{onSubmit:E,className:"space-y-3",children:[R,K,$,U,B,he]}),e[97]=E,e[98]=R,e[99]=K,e[100]=$,e[101]=U,e[102]=B,e[103]=he,e[104]=Se):Se=e[104],Se}const Cs={kind:"closed"};function ws(l,e){switch(e.type){case"open":return l.kind==="closed"?{kind:"grid"}:l;case"close":return{kind:"closed"};case"back":switch(l.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return l}case"select-form":return l.kind!=="grid"?l:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return l.kind!=="grid"?l:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return l.kind==="oauth-pending"?{kind:"grid"}:l;case"select-provision":return l.kind!=="grid"?l:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return l.kind!=="provision-pending"?l:{kind:"provision-error",providerId:l.providerId,error:e.error};case"retry-provision":return l.kind!=="provision-error"?l:{kind:"provision-pending",providerId:l.providerId}}}function Is(l){switch(l.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return l.providerId;default:return null}}function _s({open:l,onOpenChange:e,initialProvider:t}){const i=se(),o=Te()?.providers??[],{org:r}=ve(),c=we(),u=_e(),[d,a]=V.useReducer(ws,Cs),h=V.useRef(!1);V.useEffect(()=>{l&&d.kind==="closed"?a({type:"open"}):!l&&d.kind!=="closed"&&a({type:"close"})},[l,d.kind]);const p=()=>{h.current=!1,a({type:"close"}),e(!1)},m=()=>{u.invalidateQueries({queryKey:ce.aiProviderKeys(r.id)}),u.invalidateQueries({queryKey:ce.aiProviders(r.id)})},{mutate:f}=ke({mutationFn:async({providerId:y,code:g,stateToken:S,label:E})=>(await c.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:y,code:g,stateToken:S,label:E}),y),onSuccess:y=>{ne("ai_provider_oauth_succeeded",{provider_id:y}),m();const g=o.find(S=>S.id===y);oe.success(i("settings.connectProviderDialog.oauthSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(y,g)=>{ne("ai_provider_oauth_failed",{provider_id:g.providerId,error:y.message}),oe.error(i("settings.connectProviderDialog.oauthFailedMessage",{error:y.message})),a({type:"oauth-failed"})}}),{mutate:v}=ke({mutationFn:async y=>(await c.call("AI_PROVIDER_PROVISION_KEY",{providerId:y}),y),onSuccess:y=>{ne("ai_provider_provision_succeeded",{provider_id:y}),m();const g=o.find(S=>S.id===y);oe.success(i("settings.connectProviderDialog.provisionSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(y,g)=>{ne("ai_provider_provision_failed",{provider_id:g,error:y.message}),a({type:"provision-error",error:y.message})}}),N=async y=>{const{provider:g}=y,S=y.kind==="openai-compatible"?y.preset?.id??null:null,E=g.supportedMethods.includes("oauth-pkce"),P=g.supportedMethods.includes("api-key");if(g.supportsProvision===!0){ne("ai_provider_connect_clicked",{provider_id:g.id,method:"provision"}),a({type:"select-provision",providerId:g.id}),v(g.id);return}if(E){ne("ai_provider_connect_clicked",{provider_id:g.id,method:"oauth-pkce"});try{const L=await c.call("AI_PROVIDER_OAUTH_URL",{providerId:g.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!L?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");a({type:"select-oauth",providerId:g.id,stateToken:L.stateToken}),window.open(L.url,"AiProviderOAuth","width=600,height=700")}catch(L){oe.error(i("settings.connectProviderDialog.startOAuthFailedMessage",{error:L instanceof Error?L.message:String(L)}))}return}P&&(ne("ai_provider_connect_clicked",{provider_id:g.id,...S!==null?{preset_id:S}:{},method:"api-key"}),a({type:"select-form",providerId:g.id,presetId:S}))},b=V.useRef(N);b.current=N;const j=V.useRef(t);j.current=t,V.useEffect(()=>{!j.current||d.kind!=="grid"||h.current||(h.current=!0,b.current(j.current))},[d.kind]);const w=d.kind==="oauth-pending"?d.stateToken:null,O=d.kind==="oauth-pending"?d.providerId:null;V.useEffect(()=>{if(d.kind!=="oauth-pending")return;let y=!1;const g=d.stateToken,S=d.providerId,E=A=>{if(A.origin!==window.location.origin||A.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:L,stateToken:z}=A.data;if(z!==g){oe.error(i("settings.connectProviderDialog.securityCheckFailedMessage")),a({type:"oauth-failed"});return}y=!0;const R=o.find(K=>K.id===S);f({providerId:S,code:L,stateToken:g,label:R?.name??S})};window.addEventListener("message",E);const P=setTimeout(()=>{y||(ne("ai_provider_oauth_timeout",{provider_id:S}),a({type:"oauth-failed"}),oe.error(i("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(P)}},[d.kind,w,O,f]);const _=Is(d),I=_?o.find(y=>y.id===_):null,k=(d.kind==="form"&&d.presetId?je(d.presetId):null)?.name??I?.name??i("settings.connectProviderDialog.defaultTitle"),C=d.kind!=="grid"&&d.kind!=="closed",M=()=>{t?p():a({type:"back"})};return s.jsx(Me,{open:d.kind!=="closed",onOpenChange:y=>!y&&p(),children:s.jsxs(Ee,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ze,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(le,{variant:"ghost",size:"icon","aria-label":i("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:M,children:s.jsx(lt,{size:16})}),s.jsx(Oe,{children:k})]}),d.kind==="grid"&&!t&&s.jsx(et,{children:i("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&s.jsx(dt,{providers:o,onSelect:N}),d.kind==="form"&&(d.providerId==="openai-compatible"?s.jsx(ks,{preset:d.presetId?je(d.presetId):void 0,onCancel:()=>a({type:"back"}),onSuccess:()=>{m(),p()}}):s.jsx(Ss,{providerId:d.providerId,onCancel:()=>a({type:"back"}),onSuccess:()=>{m(),p()}})),d.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ie,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:i("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ie,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Yt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{variant:"outline",size:"sm",onClick:()=>a({type:"back"}),children:i("settings.connectProviderDialog.backButton")}),s.jsx(le,{size:"sm",onClick:()=>{a({type:"retry-provision"}),v(d.providerId)},children:i("settings.connectProviderDialog.retryButton")})]})]})]})})}function Ms(){const l=H.c(7),{org:e}=ve(),t=we();let i;l[0]!==e.id?(i=ce.defaultBrand(e.id),l[0]=e.id,l[1]=i):i=l[1];let n;l[2]!==t?(n=async()=>{const{items:c}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(c)?c:[]).find(Es)??null},l[2]=t,l[3]=n):n=l[3];let o;l[4]!==i||l[5]!==n?(o={queryKey:i,queryFn:n},l[4]=i,l[5]=n,l[6]=o):o=l[6];const{data:r}=St(o);return r??null}function Es(l){return l.isDefault&&!l.archivedAt}function Os(l){const e=l.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),i=t?t.value:e[0]?.value;return typeof i=="string"?i:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function Ls(l){const e=H.c(66);let t;e[0]!==l?(t=l===void 0?{}:l,e[0]=l,e[1]=t):t=e[1];const{title:i,description:n,onLocalRuntimePicked:o}=t,r=se(),{org:c}=ve(),{localMode:u}=jt(),d=Ms(),a=st(),h=Lt(),[p,m]=V.useState(null),[f,v]=V.useState(!1),[N,b]=V.useState(!1),j=Te();let w;e[2]!==j?.providers?(w=j?.providers??[],e[2]=j?.providers,e[3]=w):w=e[3];const O=w;let _,I,x;if(e[4]!==d||e[5]!==h||e[6]!==n||e[7]!==a.capabilities||e[8]!==a.online||e[9]!==u||e[10]!==o||e[11]!==c.name||e[12]!==r||e[13]!==i){const L=[];if(a.online){if(a.capabilities.includes("claude-code")){let B;e[17]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(xe,{size:16}),e[17]=B):B=e[17],L.push({option:"claude-code-desktop",label:"Claude Code",icon:B})}if(a.capabilities.includes("codex")){let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(ge,{size:16}),e[18]=B):B=e[18],L.push({option:"codex-desktop",label:"Codex",icon:B})}}const z=L.length>0&&h!==null,R=c.name;let K;e[19]!==d?(K=d?Os(d):null,e[19]=d,e[20]=K):K=e[20];const D=K,W=d?.favicon??d?.logo??null;let Q;e[21]!==R||e[22]!==r||e[23]!==i?(Q=i??(R?r("chat.noAiProviderEmptyState.headingWithOrg",{org:R}):r("chat.noAiProviderEmptyState.headingDefault")),e[21]=R,e[22]=r,e[23]=i,e[24]=Q):Q=e[24];const J=Q;let Z;e[25]!==n||e[26]!==z||e[27]!==u||e[28]!==r?(Z=n??r(z?"chat.noAiProviderEmptyState.subtitleWithDesktop":u?"chat.noAiProviderEmptyState.subtitleLocalMode":"chat.noAiProviderEmptyState.subtitleDefault"),e[25]=n,e[26]=z,e[27]=u,e[28]=r,e[29]=Z):Z=e[29];const X=Z,ee=!!(W||D);let q;e[30]!==D?(q=D?{backgroundColor:`${D}18`,borderColor:`${D}30`}:void 0,e[30]=D,e[31]=q):q=e[31];const G=q,Y=ee?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";_="flex flex-col items-center gap-8 w-full max-w-3xl px-4";let T;e[32]!==Y||e[33]!==G||e[34]!==W||e[35]!==a.online||e[36]!==D||e[37]!==r?(T=W?s.jsx("div",{className:Y,style:G,children:s.jsx("img",{src:W,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>b(!0),"aria-label":a.online?r("chat.noAiProviderEmptyState.desktopLinkedLabel"):r("chat.noAiProviderEmptyState.connectDesktopLabel"),className:ie(Y,"cursor-pointer transition-colors hover:bg-accent"),style:G,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Xt,{size:24,style:D?{color:D}:void 0,className:ie(!D&&"text-muted-foreground")}),a.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[32]=Y,e[33]=G,e[34]=W,e[35]=a.online,e[36]=D,e[37]=r,e[38]=T):T=e[38];let F;e[39]!==J?(F=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:J}),e[39]=J,e[40]=F):F=e[40];let $;e[41]!==X?($=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:X}),e[41]=X,e[42]=$):$=e[42];let U;e[43]!==F||e[44]!==$?(U=s.jsxs("div",{className:"space-y-2",children:[F,$]}),e[43]=F,e[44]=$,e[45]=U):U=e[45],e[46]!==T||e[47]!==U?(I=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[T,U]}),e[46]=T,e[47]=U,e[48]=I):I=e[48],x=z&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:L.map(B=>s.jsxs(le,{variant:"default",className:"gap-2",onClick:()=>{h?.setPendingAgentOption(B.option),o?.(B.option)},children:[B.icon,r("chat.noAiProviderEmptyState.useLabel",{label:B.label})]},B.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),r("chat.noAiProviderEmptyState.orConnectProvider"),s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[4]=d,e[5]=h,e[6]=n,e[7]=a.capabilities,e[8]=a.online,e[9]=u,e[10]=o,e[11]=c.name,e[12]=r,e[13]=i,e[14]=_,e[15]=I,e[16]=x}else _=e[14],I=e[15],x=e[16];let k,C;e[49]===Symbol.for("react.memo_cache_sentinel")?(k=L=>m(L),C=()=>v(!0),e[49]=k,e[50]=C):(k=e[49],C=e[50]);let M;e[51]!==O?(M=s.jsx("div",{className:"w-full",children:s.jsx(dt,{providers:O,onSelect:k,onShowAll:C})}),e[51]=O,e[52]=M):M=e[52];const y=p!==null||f;let g;e[53]===Symbol.for("react.memo_cache_sentinel")?(g=L=>{L||(m(null),v(!1))},e[53]=g):g=e[53];const S=p??void 0;let E;e[54]!==S||e[55]!==y?(E=s.jsx(_s,{open:y,onOpenChange:g,initialProvider:S}),e[54]=S,e[55]=y,e[56]=E):E=e[56];let P;e[57]!==N?(P=s.jsx(ls,{open:N,onOpenChange:b}),e[57]=N,e[58]=P):P=e[58];let A;return e[59]!==E||e[60]!==P||e[61]!==_||e[62]!==I||e[63]!==x||e[64]!==M?(A=s.jsxs("div",{className:_,children:[I,x,M,E,P]}),e[59]=E,e[60]=P,e[61]=_,e[62]=I,e[63]=x,e[64]=M,e[65]=A):A=e[65],A}function Pe(l){const e=l.title.includes(": ");return{provider:e?l.title.split(": ")[0]??"":l.modelId.split("/")[0]??"",displayName:e?l.title.split(": ").slice(1).join(": "):l.title}}function Ts(l){return l<32e3?{level:1,labelKey:"chat.shared.contextLevelSmall",descriptionKey:"chat.shared.contextLevelSmallDesc"}:l<2e5?{level:2,labelKey:"chat.shared.contextLevelMedium",descriptionKey:"chat.shared.contextLevelMediumDesc"}:l<5e5?{level:3,labelKey:"chat.shared.contextLevelLarge",descriptionKey:"chat.shared.contextLevelLargeDesc"}:{level:4,labelKey:"chat.shared.contextLevelVeryLarge",descriptionKey:"chat.shared.contextLevelVeryLargeDesc"}}const As=["bg-destructive","bg-warning","bg-success","bg-success"],Ps=["text-success","text-warning","text-warning","text-destructive"];function zs(l,e){const t=Math.round(l*.75/1e3),i=t>=1?`${t}K`:`${Math.round(l*.75)}`;return e("chat.shared.approxWords",{wordCount:i})}function Ds(l){return l<1?{level:1,labelKey:"chat.shared.costLevelCheap"}:l<5?{level:2,labelKey:"chat.shared.costLevelModerate"}:l<15?{level:3,labelKey:"chat.shared.costLevelHigh"}:{level:4,labelKey:"chat.shared.costLevelExpensive"}}const Rs={text:{icon:s.jsx(Wt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityText"},vision:{icon:s.jsx(Bt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityVision"},image:{icon:s.jsx(Ft,{className:"size-3.5"}),labelKey:"chat.shared.capabilityImage"},tools:{icon:s.jsx(Ut,{className:"size-3.5"}),labelKey:"chat.shared.capabilityTools"},reasoning:{icon:s.jsx(ts,{className:"size-3.5"}),labelKey:"chat.shared.capabilityReasoning"},"web-search":{icon:s.jsx(nt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityWebSearch"}};function Fs(l){const e=H.c(10),{capability:t}=l,i=se(),n=Rs[t];if(n){const u=n.icon;let d;e[0]!==n.labelKey||e[1]!==i?(d=i(n.labelKey),e[0]=n.labelKey,e[1]=i,e[2]=d):d=e[2];let a;return e[3]!==n.icon||e[4]!==d?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[u,d]}),e[3]=n.icon,e[4]=d,e[5]=a):a=e[5],a}let o;e[6]!==t?(o=t.charAt(0).toUpperCase(),e[6]=t,e[7]=o):o=e[7];const r=o+t.slice(1);let c;return e[8]!==r?(c=s.jsx("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:r}),e[8]=r,e[9]=c):c=e[9],c}function Ks(l){const e=H.c(59),{model:t,compact:i}=l,n=i===void 0?!1:i,o=se();if(!t){let x;e[0]!==o?(x=o("chat.shared.hoverToPreview"),e[0]=o,e[1]=x):x=e[1];let k;return e[2]!==x?(k=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:x}),e[2]=x,e[3]=k):k=e[3],k}const r=t.costs?.input!=null?t.costs.input*1e6:null,c=t.costs?.output!=null?t.costs.output*1e6:null;let u;e[4]!==t?(u=Pe(t),e[4]=t,e[5]=u):u=e[5];const{provider:d,displayName:a}=u;if(n){let x;e[6]!==t.limits||e[7]!==o?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.context")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," ",o("chat.shared.tokens")]})]}),e[6]=t.limits,e[7]=o,e[8]=x):x=e[8];let k;e[9]!==r||e[10]!==o?(k=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.input")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[9]=r,e[10]=o,e[11]=k):k=e[11];let C;e[12]!==c||e[13]!==o?(C=c!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.output")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",c.toFixed(2)," / 1M"]})]}),e[12]=c,e[13]=o,e[14]=C):C=e[14];let M;e[15]!==t.limits||e[16]!==o?(M=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.outputLimit")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," ",o("chat.shared.tokens")]})]}),e[15]=t.limits,e[16]=o,e[17]=M):M=e[17];let y;return e[18]!==x||e[19]!==k||e[20]!==C||e[21]!==M?(y=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,k,C,M]}),e[18]=x,e[19]=k,e[20]=C,e[21]=M,e[22]=y):y=e[22],y}let h;e[23]!==d?(h=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[23]=d,e[24]=h):h=e[24];let p;e[25]!==t.logo||e[26]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[25]=t.logo,e[26]=t.title,e[27]=p):p=e[27];let m;e[28]!==a?(m=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:a}),e[28]=a,e[29]=m):m=e[29];let f;e[30]!==p||e[31]!==m?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,m]}),e[30]=p,e[31]=m,e[32]=f):f=e[32];let v;e[33]!==t.modelId?(v=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[33]=t.modelId,e[34]=v):v=e[34];let N;e[35]!==h||e[36]!==f||e[37]!==v?(N=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[h,f,v]}),e[35]=h,e[36]=f,e[37]=v,e[38]=N):N=e[38];let b;e[39]!==t.capabilities?(b=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map($s)}),e[39]=t.capabilities,e[40]=b):b=e[40];let j;e[41]!==t.limits||e[42]!==o?(j=t.limits?.contextWindow&&(()=>{const{level:x,labelKey:k,descriptionKey:C}=Ts(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.contextWindow")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(M=>s.jsx("div",{className:ie("w-2 h-2 rounded-full",M<=x?As[x-1]:"bg-muted")},M))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:o(k)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",o(C)]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," ",o("chat.shared.tokens")]})]})})(),e[41]=t.limits,e[42]=o,e[43]=j):j=e[43];let w;e[44]!==t.limits||e[45]!==o?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.outputLimit")}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," ",o("chat.shared.tokens")]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:zs(t.limits.maxOutputTokens,o)})]})]}),e[44]=t.limits,e[45]=o,e[46]=w):w=e[46];let O;e[47]!==r||e[48]!==c||e[49]!==o?(O=(r!=null||c!=null)&&(()=>{const{level:x,labelKey:k}=r!=null?Ds(r):{level:0,labelKey:null};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.pricing")}),r!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:ie("text-sm font-bold leading-none",C<=x?Ps[x-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k?o(k):""})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.shared.input")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M"," ",o("chat.shared.tokens")]})]}),c!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.shared.output")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",c.toFixed(2)," / 1M"," ",o("chat.shared.tokens")]})]})]})]})})(),e[47]=r,e[48]=c,e[49]=o,e[50]=O):O=e[50];let _;e[51]!==j||e[52]!==w||e[53]!==O?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,w,O]}),e[51]=j,e[52]=w,e[53]=O,e[54]=_):_=e[54];let I;return e[55]!==_||e[56]!==N||e[57]!==b?(I=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[N,b,_]}),e[55]=_,e[56]=N,e[57]=b,e[58]=I):I=e[58],I}function $s(l){return s.jsx(Fs,{capability:l},l)}function ut(l){const e=H.c(22),{model:t,placeholder:i,isLoading:n}=l,o=n===void 0?!1:n,r=se();let c;e[0]!==i||e[1]!==r?(c=i??r("chat.shared.selectModel"),e[0]=i,e[1]=r,e[2]=c):c=e[2];const u=c;if(o){let b;return e[3]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(te,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(te,{className:"w-16 h-3 hidden md:block"})]}),e[3]=b):b=e[3],b}if(!t){let b;e[4]!==u?(b=s.jsx("span",{className:"text-sm text-muted-foreground",children:u}),e[4]=u,e[5]=b):b=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Fe,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[6]=j):j=e[6];let w;return e[7]!==b?(w=s.jsxs("div",{className:"flex items-center gap-1.5",children:[b,j]}),e[7]=b,e[8]=w):w=e[8],w}let d;e[9]!==t?(d=Pe(t),e[9]=t,e[10]=d):d=e[10];const{displayName:a}=d;let h;e[11]!==t?(h=Ae(t),e[11]=t,e[12]=h):h=e[12];const p=h;let m;e[13]!==t.title||e[14]!==p?(m=s.jsx("img",{src:p,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[13]=t.title,e[14]=p,e[15]=m):m=e[15];let f;e[16]!==a?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:a}),e[16]=a,e[17]=f):f=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Fe,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[18]=v):v=e[18];let N;return e[19]!==m||e[20]!==f?(N=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,f,v]}),e[19]=m,e[20]=f,e[21]=N):N=e[21],N}const Us=["vision","image","file","audio","video"],mt=["image/png","image/jpeg","image/gif","image/webp"],ht=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ze(l){const e=l?.capabilities;return e?Us.some(t=>e.includes(t)):!1}function el(l,e){if(!l)return!1;if(l.startsWith("text/"))return!0;const t=e?.capabilities??[],i=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(i&&mt.includes(l)||n&&l==="application/pdf"||o&&l.startsWith("audio/")||r&&l.startsWith("video/")||ze(e)&&ht.includes(l))}function tl(l){const e=l?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...mt),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ze(l)&&t.push(...ht),t.join(",")}function sl(l){const e=l?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("chat.shared.fileTypeImages"),e.includes("file")&&t.push("chat.shared.fileTypePdfs"),e.includes("audio")&&t.push("chat.shared.fileTypeAudio"),e.includes("video")&&t.push("chat.shared.fileTypeVideo"),ze(l)&&t.push("chat.shared.fileTypeOffice"),{parts:t,count:t.length}}const ft=["smarter","faster","cheaper"],Bs={smarter:"chat.decopilot.tierSmarter",faster:"chat.decopilot.tierFaster",cheaper:"chat.decopilot.tierCheaper"},Ws=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Vs=Ws.flatMap(({tier:l,prefixes:e})=>e.map(t=>({tier:l,prefix:t}))).sort((l,e)=>e.prefix.length-l.prefix.length),Hs="google/gemini-2.5-pro",qe=new Map;function qs(l){const e=qe.get(l);if(e!==void 0)return e;let t=null;if(l.endsWith(":free"))t="cheaper";else for(const{tier:i,prefix:n}of Vs)if(l.startsWith(n)){if(n===Hs&&l.length>n.length&&l[n.length]==="-"){const r=l[n.length+1];if(!r||!/\d/.test(r))continue}t=i;break}return qe.set(l,t),t}function Ge(l){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of l){const i=qs(t.modelId);e[i??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((i,n)=>i.title.localeCompare(n.title));return e}const pt="studio:model-shortlist:",Gs=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Xs(l){try{const e=localStorage.getItem(pt+l);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ys(l,e){localStorage.setItem(pt+l,JSON.stringify([...e]))}function Qs(l){const e=H.c(21),{model:t,onHover:i}=l;let n;e[0]!==t?(n=Pe(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let c;e[2]!==t?(c=Ae(t),e[2]=t,e[3]=c):c=e[3];const u=c;let d;e[4]!==t||e[5]!==i?(d=()=>i(t),e[4]=t,e[5]=i,e[6]=d):d=e[6];let a;e[7]!==t.title||e[8]!==u?(a=s.jsx("img",{src:u,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=u,e[9]=a):a=e[9];let h;e[10]!==o?(h=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=h):h=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let m;e[14]!==h||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[h,p]}),e[14]=h,e[15]=p,e[16]=m):m=e[16];let f;return e[17]!==d||e[18]!==a||e[19]!==m?(f=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[a,m]}),e[17]=d,e[18]=a,e[19]=m,e[20]=f):f=e[20],f}function Js(l){const e=H.c(16),{error:t,onRetry:i}=l,n=se();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(Ct,{className:"size-5 text-destructive"})}),e[0]=o):o=e[0];const r=n("chat.decopilot.failedToLoadModels");let c;e[1]!==r?(c=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),e[1]=r,e[2]=c):c=e[2];const u=t?.message||n("chat.decopilot.couldNotFetchModels"),d=" "+n("chat.decopilot.tryAnotherProviderOrRetry");let a;e[3]!==u||e[4]!==d?(a=s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[u,d]}),e[3]=u,e[4]=d,e[5]=a):a=e[5];let h;e[6]!==c||e[7]!==a?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[c,a]}),e[6]=c,e[7]=a,e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx($t,{className:"size-3.5"}),e[9]=p):p=e[9];const m=n("chat.decopilot.retry");let f;e[10]!==i||e[11]!==m?(f=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(le,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[p,m]})}),e[10]=i,e[11]=m,e[12]=f):f=e[12];let v;return e[13]!==f||e[14]!==h?(v=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[o,h,f]}),e[13]=f,e[14]=h,e[15]=v):v=e[15],v}function Zs(){const l=H.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(ei)}),l[0]=e):e=l[0],e}function ei(l,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(te,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(te,{className:"flex-1 h-4"}),s.jsx(te,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Xe(l){const e=H.c(12),{label:t,models:i,onSelect:n,onHover:o}=l;if(i.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let c;if(e[2]!==i||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=a=>s.jsx("div",{onClick:()=>n(a),className:"cursor-pointer",children:s.jsx(Qs,{model:a,onHover:o})},a.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],c=i.map(d),e[2]=i,e[3]=o,e[4]=n,e[5]=c}else c=e[5];let u;return e[9]!==r||e[10]!==c?(u=s.jsxs("div",{children:[r,c]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function Ce(l,e){return e(l==="other"?"chat.decopilot.tierOther":Bs[l])}function ti(l){const e=H.c(21),{model:t,isChecked:i,onToggle:n,onHover:o}=l,[r,c]=V.useState(i);r!==i&&c(i);let u;e[0]!==t?(u=Ae(t),e[0]=t,e[1]=u):u=e[1];const d=u;let a;e[2]!==t||e[3]!==o?(a=()=>o(t),e[2]=t,e[3]=o,e[4]=a):a=e[4];let h;e[5]!==t.modelId||e[6]!==n?(h=()=>{c(si),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=h):h=e[7];let p;e[8]!==r||e[9]!==h?(p=s.jsx(Tt,{checked:r,onCheckedChange:h}),e[8]=r,e[9]=h,e[10]=p):p=e[10];let m;e[11]!==d||e[12]!==t.title?(m=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=m):m=e[13];let f;e[14]!==t.title?(f=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=f):f=e[15];let v;return e[16]!==a||e[17]!==p||e[18]!==m||e[19]!==f?(v=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:a,children:[p,m,f]}),e[16]=a,e[17]=p,e[18]=m,e[19]=f,e[20]=v):v=e[20],v}function si(l){return!l}function ii(l,e){const t=[];for(const i of ft)if(l[i].length>0){t.push({type:"header",label:Ce(i,e)});for(const n of l[i])t.push({type:"model",model:n})}if(l.other.length>0){t.push({type:"header",label:Ce("other",e)});for(const i of l.other)t.push({type:"model",model:i})}return t}function li({items:l,shortlistSet:e,onToggle:t,onHover:i}){const n=V.useRef(null),o=xs({count:l.length,getScrollElement:()=>n.current,estimateSize:r=>l[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const c=l[r.index];return c?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:c.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:c.label}):s.jsx(ti,{model:c.model,isChecked:e.has(c.model.modelId),onToggle:t,onHover:i})},r.key):null})})})}function ni(l){const e=H.c(30),{keyId:t,searchTerm:i,onHover:n,onModelSelect:o,managing:r,onToggleManage:c,filterModels:u}=l,d=se(),{models:a}=Gt(t),h=u?a.filter(u):a.filter(oi);let p;e[0]!==t?(p=()=>(t?Xs(t):null)??Gs,e[0]=t,e[1]=p):p=e[1];const[m,f]=V.useState(p),[,v]=V.useTransition();let N;e[2]!==t||e[3]!==v?(N=g=>{t&&v(()=>{f(S=>{const E=new Set(S);return E.has(g)?E.delete(g):E.add(g),Ys(t,E),E})})},e[2]=t,e[3]=v,e[4]=N):N=e[4];const b=N,j=i.toLowerCase().trim(),w=g=>j?g.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):g;if(r){const g=Ge(w(h)),S=ii(g,d);let E;e[5]!==m?(E=R=>m.has(R.modelId),e[5]=m,e[6]=E):E=e[6];const P=h.filter(E).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(lt,{size:14}),e[7]=A):A=e[7];let L;e[8]!==d?(L=d("chat.decopilot.back"),e[8]=d,e[9]=L):L=e[9];let z;return e[10]!==c||e[11]!==L?(z=s.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,L]}),e[10]=c,e[11]=L,e[12]=z):z=e[12],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,s.jsx("span",{className:"text-xs text-muted-foreground",children:d("chat.decopilot.selectedCount",{count:P})})]}),s.jsx(li,{items:S,shortlistSet:m,onToggle:b,onHover:n})]})}let O;e[13]!==m?(O=g=>m.has(g.modelId),e[13]=m,e[14]=O):O=e[14];const _=h.filter(O),I=_.length>0?_:h,x=Ge(w(I));let k;e[15]!==x||e[16]!==n||e[17]!==o||e[18]!==d?(k=ft.map(g=>s.jsx(Xe,{label:Ce(g,d),models:x[g],onSelect:o,onHover:n},g)),e[15]=x,e[16]=n,e[17]=o,e[18]=d,e[19]=k):k=e[19];let C;e[20]!==d?(C=Ce("other",d),e[20]=d,e[21]=C):C=e[21];let M;e[22]!==x.other||e[23]!==n||e[24]!==o||e[25]!==C?(M=s.jsx(Xe,{label:C,models:x.other,onSelect:o,onHover:n}),e[22]=x.other,e[23]=n,e[24]=o,e[25]=C,e[26]=M):M=e[26];let y;return e[27]!==k||e[28]!==M?(y=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,M]}),e[27]=k,e[28]=M,e[29]=y):y=e[29],y}function oi(l){return l.asyncResearch!==!0}function ri(){const l=H.c(6);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(te,{className:"size-4 shrink-0"}),s.jsx(te,{className:"flex-1 h-6"}),s.jsx(te,{className:"w-[140px] h-8 shrink-0"})]})}),l[0]=e):e=l[0];let t;l[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(ai)})]}),l[1]=t):t=l[1];let i;l[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(te,{className:"size-6 shrink-0"}),s.jsx(te,{className:"h-6 w-32"})]}),l[2]=i):i=l[2];let n;l[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[i,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(te,{className:"h-6 w-20 rounded-md"}),s.jsx(te,{className:"h-6 w-24 rounded-md"})]})]}),l[3]=n):n=l[3];let o;l[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(te,{className:"h-4 w-24"}),s.jsx(te,{className:"h-4 w-32"})]}),l[4]=o):o=l[4];let r;return l[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(te,{className:"h-4 w-16"}),s.jsx(te,{className:"h-4 w-40"})]})]})]})})]}),l[5]=r):r=l[5],r}function ai(l,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(te,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(te,{className:"flex-1 h-4"}),s.jsx(te,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function xt(l){const e=H.c(66),{onClose:t,credentialId:i,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:c,compact:u}=l,d=se(),[a,h]=V.useState(null),[p,m]=V.useState(""),[f,v]=V.useState(!1),N=V.useRef(null),b=Te(),j=qt();let w;e[0]!==b?.providers?(w=Object.fromEntries((b?.providers??[]).map(ui)),e[0]=b?.providers,e[1]=w):w=e[1];const O=w,_=Nt(),{org:I}=ve();let x;e[2]!==n?(x=T=>{n(T),h(null)},e[2]=n,e[3]=x):x=e[3];const k=x;let C;e[4]!==i||e[5]!==t||e[6]!==r?(C=T=>{i&&(r(T),m(""),t())},e[4]=i,e[5]=t,e[6]=r,e[7]=C):C=e[7];const M=C;if(j.length===0){const T=!u&&"sm:w-[740px]";let F;e[8]!==T?(F=ie("flex items-center justify-center p-8 w-full",T),e[8]=T,e[9]=F):F=e[9];let $;e[10]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(Ls,{}),e[10]=$):$=e[10];let U;return e[11]!==F?(U=s.jsx("div",{className:F,children:$}),e[11]=F,e[12]=U):U=e[12],U}const y=u?"sm:h-[420px]":"sm:h-[460px]";let g;e[13]!==y?(g=ie("flex flex-col md:flex-row h-full min-h-0",y),e[13]=y,e[14]=g):g=e[14];const S=u?"w-full":"md:border-r md:w-[420px] md:min-w-[420px]";let E;e[15]!==S?(E=ie("flex-1 flex flex-col min-h-0 overflow-hidden",S),e[15]=S,e[16]=E):E=e[16];let P;e[17]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(nt,{size:16,className:"text-muted-foreground shrink-0"}),e[17]=P):P=e[17];let A;e[18]!==f||e[19]!==d?(A=d(f?"chat.decopilot.searchAllModels":"chat.decopilot.searchForModel"),e[18]=f,e[19]=d,e[20]=A):A=e[20];let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=T=>m(T.target.value),e[21]=L):L=e[21];let z;e[22]!==p||e[23]!==A?(z=s.jsx(pe,{ref:N,type:"text",placeholder:A,value:p,onChange:L,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[22]=p,e[23]=A,e[24]=z):z=e[24];let R;e[25]!==i||e[26]!==k||e[27]!==j||e[28]!==O||e[29]!==d?(R=j.length>0&&s.jsxs(At,{value:i??"",onValueChange:k,children:[s.jsxs(Pt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:di,children:[s.jsx(zt,{placeholder:d("chat.decopilot.key"),children:(()=>{const T=j.find(re=>re.id===i),F=T?O[T.providerId]:void 0,$=je(T?.presetId),U=$?.logo??F?.logo,B=$?.name??F?.name??T?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[U?s.jsx("img",{src:U,alt:B,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:B.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:B})]})})()}),s.jsx(Vt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(Dt,{children:j.map(T=>{const F=O[T.providerId],$=je(T.presetId),U=$?.logo??F?.logo,B=$?.name??F?.name??T.providerId;return s.jsx(Rt,{value:T.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[U?s.jsx("img",{src:U,alt:B,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:B.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[B," — ",T.label]})]})},T.id)})})]}),e[25]=i,e[26]=k,e[27]=j,e[28]=O,e[29]=d,e[30]=R):R=e[30];let K;e[31]!==z||e[32]!==R?(K=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[P,z,R]})}),e[31]=z,e[32]=R,e[33]=K):K=e[33];let D;e[34]!==i?(D=T=>{const{error:F,resetError:$}=T;return s.jsx(Js,{error:F,onRetry:$,credentialId:i??void 0})},e[34]=i,e[35]=D):D=e[35];let W;e[36]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Zs,{}),e[36]=W):W=e[36];const Q=i??void 0;let J;e[37]===Symbol.for("react.memo_cache_sentinel")?(J=()=>v(ci),e[37]=J):J=e[37];let Z;e[38]!==c||e[39]!==M||e[40]!==f||e[41]!==p||e[42]!==Q?(Z=s.jsx(V.Suspense,{fallback:W,children:s.jsx(ni,{keyId:Q,searchTerm:p,onHover:h,onModelSelect:M,managing:f,onToggleManage:J,filterModels:c})}),e[38]=c,e[39]=M,e[40]=f,e[41]=p,e[42]=Q,e[43]=Z):Z=e[43];let X;e[44]!==i||e[45]!==D||e[46]!==Z?(X=s.jsx(kt,{fallback:D,children:Z},i),e[44]=i,e[45]=D,e[46]=Z,e[47]=X):X=e[47];let ee;e[48]!==f||e[49]!==_||e[50]!==I||e[51]!==d?(ee=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>V.startTransition(()=>v(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Kt,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageModels")]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Ht,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageApiKeys")]})]}),e[48]=f,e[49]=_,e[50]=I,e[51]=d,e[52]=ee):ee=e[52];let q;e[53]!==K||e[54]!==X||e[55]!==ee||e[56]!==E?(q=s.jsxs("div",{className:E,children:[K,X,ee]}),e[53]=K,e[54]=X,e[55]=ee,e[56]=E,e[57]=q):q=e[57];let G;e[58]!==u||e[59]!==a||e[60]!==o?(G=!u&&s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Ks,{model:a??o??null})}),e[58]=u,e[59]=a,e[60]=o,e[61]=G):G=e[61];let Y;return e[62]!==q||e[63]!==G||e[64]!==g?(Y=s.jsxs("div",{className:g,children:[q,G]}),e[62]=q,e[63]=G,e[64]=g,e[65]=Y):Y=e[65],Y}function ci(l){return!l}function di(l){return l.stopPropagation()}function ui(l){return[l.id,l]}function mi(l){const e=H.c(12),{onClose:t}=l,{credentialId:i,setCredentialId:n,selectedModel:o,setModel:r}=Le();let c;e[0]!==n?(c=a=>{ne("chat_credential_changed",{credential_id:a}),n(a)},e[0]=n,e[1]=c):c=e[1];let u;e[2]!==i||e[3]!==o?.modelId||e[4]!==r?(u=a=>{i&&(ne("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:a.modelId,to_model_provider:a.providerId??null,credential_id:i}),r({...a,keyId:i}))},e[2]=i,e[3]=o?.modelId,e[4]=r,e[5]=u):u=e[5];let d;return e[6]!==i||e[7]!==t||e[8]!==o||e[9]!==c||e[10]!==u?(d=s.jsx(xt,{onClose:t,credentialId:i,onCredentialChange:c,selectedModel:o,onModelChange:u}),e[6]=i,e[7]=t,e[8]=o,e[9]=c,e[10]=u,e[11]=d):d=e[11],d}function hi(l){const e=H.c(2),{onClose:t}=l;let i;return e[0]!==t?(i=s.jsx(mi,{onClose:t}),e[0]=t,e[1]=i):i=e[1],i}function fi(l){const e=H.c(2);let t;return e[0]!==l?(t=s.jsx(xt,{...l}),e[0]=l,e[1]=t):t=e[1],t}const pi=[{tier:"fast",labelKey:"chat.desktopCli.tierFastDescription"},{tier:"smart",labelKey:"chat.desktopCli.tierSmartDescription"},{tier:"thinking",labelKey:"chat.desktopCli.tierThinkingDescription"}];function gt(l){const e=H.c(11),{modelSet:t,selectedModelId:i,onSelect:n}=l,o=se();let r,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==i||e[5]!==o){const d=Object.fromEntries(t.models.map(xi));r="flex flex-col p-2 w-[320px]",c=pi.map(a=>{const{tier:h,labelKey:p}=a,m=t.tiers[h];if(!m.modelId)return null;const f=d[m.modelId];if(!f)return null;const v=i===m.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ie("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",v&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:m.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:m.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:o(p)})]})]},h)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=i,e[5]=o,e[6]=r,e[7]=c}else r=e[6],c=e[7];let u;return e[8]!==r||e[9]!==c?(u=s.jsx("div",{className:r,children:c}),e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function xi(l){return[l.modelId,l]}const gi=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 5 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],Ne="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",vi=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null}],bi="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",yi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg";function ji(l){return{fast:{modelId:"claude-code:haiku",label:l("chat.agentModels.haikuLabel"),description:l("chat.agentModels.quickerResponses"),iconNode:s.jsx(xe,{size:16})},smart:{modelId:"claude-code:sonnet",label:l("chat.agentModels.sonnetLabel"),description:l("chat.agentModels.balancedQuality"),iconNode:s.jsx(xe,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:l("chat.agentModels.opusLabel"),description:l("chat.agentModels.deeperReasoning"),iconNode:s.jsx(xe,{size:16})}}}function Si(l){return{fast:{modelId:"codex:gpt-5.6-luna",label:l("chat.agentModels.gptLunaLabel"),description:l("chat.agentModels.quickerResponses"),iconNode:s.jsx(ge,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:l("chat.agentModels.gptTerraLabel"),description:l("chat.agentModels.balancedQuality"),iconNode:s.jsx(ge,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:l("chat.agentModels.gptSolLabel"),description:l("chat.agentModels.deeperReasoning"),iconNode:s.jsx(ge,{size:16})}}}function vt(l,e){return l==="claude-code"?{logo:bi,tiers:ji(e),models:gi}:l==="codex"?{logo:yi,tiers:Si(e),models:vi}:null}function Ni(l){const e=H.c(12),{onClose:t,agent:i}=l,n=se(),o=Le(),r=i??o.pendingHarnessId??"decopilot";let c;e[0]!==r||e[1]!==n?(c=vt(r,n),e[0]=r,e[1]=n,e[2]=c):c=e[2];const u=c;if(!u){let p;return e[3]!==t?(p=s.jsx(hi,{onClose:t}),e[3]=t,e[4]=p):p=e[4],p}const d=o.selectedModel?.modelId??u.tiers[o.simpleModeTier].modelId;let a;e[5]!==t||e[6]!==o?(a=p=>{o.setModel({...p,keyId:void 0}),t()},e[5]=t,e[6]=o,e[7]=a):a=e[7];let h;return e[8]!==u||e[9]!==d||e[10]!==a?(h=s.jsx(gt,{modelSet:u,selectedModelId:d,onSelect:a}),e[8]=u,e[9]=d,e[10]=a,e[11]=h):h=e[11],h}function ki(l){const e=H.c(14);let t,i;e[0]!==l?({agent:t,...i}=l,e[0]=l,e[1]=t,e[2]=i):(t=e[1],i=e[2]);const n=se();let o;e[3]!==t||e[4]!==n?(o=t?vt(t,n):null,e[3]=t,e[4]=n,e[5]=o):o=e[5];const r=o;if(!r){let a;return e[6]!==i?(a=s.jsx(fi,{...i}),e[6]=i,e[7]=a):a=e[7],a}const c=i.selectedModel?.modelId??r.tiers.smart.modelId;let u;e[8]!==i?(u=a=>{i.onModelChange(a),i.onClose()},e[8]=i,e[9]=u):u=e[9];let d;return e[10]!==r||e[11]!==c||e[12]!==u?(d=s.jsx(gt,{modelSet:r,selectedModelId:c,onSelect:u}),e[10]=r,e[11]=c,e[12]=u,e[13]=d):d=e[13],d}function il(l){const e=H.c(49),{variant:t,className:i,placeholder:n,model:o,isLoading:r,credentialId:c,onCredentialChange:u,onModelChange:d,filterModels:a,agent:h}=l,p=t===void 0?"borderless":t,m=n===void 0?"Select model":n,f=se(),[v,N]=V.useState(!1),b=d!==void 0,j=Ot(),w=p==="borderless"?"ghost":"outline",O=p==="borderless"&&"md:border-none";let _;e[0]!==i||e[1]!==O?(_=ie("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",O,i),e[0]=i,e[1]=O,e[2]=_):_=e[2];let I;e[3]!==r||e[4]!==o||e[5]!==m||e[6]!==b?(I=b?s.jsx(ut,{model:o??null,placeholder:m,isLoading:r}):s.jsx(wi,{placeholder:m}),e[3]=r,e[4]=o,e[5]=m,e[6]=b,e[7]=I):I=e[7];let x;e[8]!==w||e[9]!==_||e[10]!==I?(x=s.jsx(le,{variant:w,size:"sm",className:_,children:I}),e[8]=w,e[9]=_,e[10]=I,e[11]=x):x=e[11];const k=x;let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(ri,{}),e[12]=C):C=e[12];let M;e[13]!==h||e[14]!==c||e[15]!==a||e[16]!==o||e[17]!==u||e[18]!==d||e[19]!==b?(M=s.jsx(V.Suspense,{fallback:C,children:b?s.jsx(ki,{onClose:()=>N(!1),agent:h,credentialId:c??null,onCredentialChange:u??Ci,selectedModel:o??null,onModelChange:d,filterModels:a}):s.jsx(Ni,{onClose:()=>N(!1),agent:h})}),e[13]=h,e[14]=c,e[15]=a,e[16]=o,e[17]=u,e[18]=d,e[19]=b,e[20]=M):M=e[20];const y=M;if(j){let L;e[21]!==k?(L=s.jsx(It,{asChild:!0,children:k}),e[21]=k,e[22]=L):L=e[22];let z;e[23]!==f?(z=f("chat.selectModel.selectModel"),e[23]=f,e[24]=z):z=e[24];let R;e[25]!==z?(R=s.jsx(_t,{className:"sr-only",children:z}),e[25]=z,e[26]=R):R=e[26];let K;e[27]!==y?(K=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:y}),e[27]=y,e[28]=K):K=e[28];let D;e[29]!==R||e[30]!==K?(D=s.jsxs(Mt,{className:"p-0 flex flex-col max-h-[95vh]",children:[R,K]}),e[29]=R,e[30]=K,e[31]=D):D=e[31];let W;return e[32]!==v||e[33]!==L||e[34]!==D?(W=s.jsxs(Et,{open:v,onOpenChange:N,children:[L,D]}),e[32]=v,e[33]=L,e[34]=D,e[35]=W):W=e[35],W}let g;e[36]!==k?(g=s.jsx(wt,{asChild:!0,children:k}),e[36]=k,e[37]=g):g=e[37];let S;e[38]!==f?(S=f("chat.selectModel.selectModel"),e[38]=f,e[39]=S):S=e[39];let E;e[40]!==S?(E=s.jsx(Oe,{className:"sr-only",children:S}),e[40]=S,e[41]=E):E=e[41];let P;e[42]!==y||e[43]!==E?(P=s.jsxs(Ee,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[E,y]}),e[42]=y,e[43]=E,e[44]=P):P=e[44];let A;return e[45]!==v||e[46]!==g||e[47]!==P?(A=s.jsxs(Me,{open:v,onOpenChange:N,children:[g,P]}),e[45]=v,e[46]=g,e[47]=P,e[48]=A):A=e[48],A}function Ci(){}function wi(l){const e=H.c(4),{placeholder:t}=l,{selectedModel:i,isModelsLoading:n}=Le();let o;return e[0]!==n||e[1]!==i||e[2]!==t?(o=s.jsx(ut,{model:i,placeholder:t,isLoading:n}),e[0]=n,e[1]=i,e[2]=t,e[3]=o):o=e[3],o}export{ls as C,ri as M,Ls as N,dt as P,ki as a,xe as b,ge as c,tl as d,il as e,je as f,sl as g,_s as h,el as i,Zi as l,ze as m};
|