decocms 4.316.8 → 4.317.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DxYCNcK8.js → AlertCircle-CvNkLcsO.js} +1 -1
- package/dist/client/assets/{AreaChart-CmfyOVSz.js → AreaChart-CSSrVbcX.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DdJRt_vK.js → ArrowLeft-Ln0LNrXp.js} +1 -1
- package/dist/client/assets/{ArrowUp-CixBAt8Q.js → ArrowUp-D629Mb3w.js} +1 -1
- package/dist/client/assets/{Check-Eb20R0uP.js → Check-CKt7kGsd.js} +1 -1
- package/dist/client/assets/{CheckCircle-qBq1p-Wj.js → CheckCircle-mv7-ypug.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bv15tE3e.js → ChevronDown-CnPHyH5A.js} +1 -1
- package/dist/client/assets/{ChevronRight-Ci9WZW0s.js → ChevronRight-DdS63gkb.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Dw6UipKY.js → ChevronSelectorVertical-D8umbTYG.js} +1 -1
- package/dist/client/assets/{ChevronUp-CJSi4ok2.js → ChevronUp-ylRdQRex.js} +1 -1
- package/dist/client/assets/{Copy01-CbJTmUFe.js → Copy01-DDc5DYlU.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cdyvlf63.js → CreditCard01-jp5QVACe.js} +1 -1
- package/dist/client/assets/{DotsVertical-BhHlLSsp.js → DotsVertical-Bi8zkQ90.js} +1 -1
- package/dist/client/assets/{Download01-DlfNPuhH.js → Download01-CKf-gKDD.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-hLwbmw2P.js → ErrorBarContext-CwWhH_t4.js} +1 -1
- package/dist/client/assets/{Eye-CD_6MgPf.js → Eye-DXxdN1gq.js} +1 -1
- package/dist/client/assets/{FilterLines-DdFZlVgI.js → FilterLines-dSEFajEE.js} +1 -1
- package/dist/client/assets/{GitBranch01-LMEq5ZXZ.js → GitBranch01-C1Lu83ty.js} +1 -1
- package/dist/client/assets/{Globe01-BJpcU1hY.js → Globe01-Dha0bbDh.js} +1 -1
- package/dist/client/assets/{Globe04-D16fda-t.js → Globe04-CFA4wFJC.js} +1 -1
- package/dist/client/assets/{HardDrive-CFC2NbAD.js → HardDrive-D0FT4JHF.js} +1 -1
- package/dist/client/assets/{Image01-CsV_5vxX.js → Image01-slXRU7Zv.js} +1 -1
- package/dist/client/assets/{Key01-1-wwfLyJ.js → Key01-BaUPD50J.js} +1 -1
- package/dist/client/assets/{LinkExternal01--B4PKy8C.js → LinkExternal01-Cu8q8TyX.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-x8CVxEbg.js → LockUnlocked01-R9XHKzKD.js} +1 -1
- package/dist/client/assets/{LogOut01-DQgirYVV.js → LogOut01-G5_xLIhM.js} +1 -1
- package/dist/client/assets/{Monitor01-C0j6D2fo.js → Monitor01-L0tZYSKQ.js} +1 -1
- package/dist/client/assets/{Package-DuLKvK8F.js → Package-DviXgiuM.js} +1 -1
- package/dist/client/assets/{Palette-cNnA20fO.js → Palette-DY0XYqhu.js} +1 -1
- package/dist/client/assets/{Play-DPV4DI_n.js → Play-BjOu0Brf.js} +1 -1
- package/dist/client/assets/{Plus-bEkTtkKz.js → Plus-CChyZYWb.js} +1 -1
- package/dist/client/assets/{SearchLg-BdF7piHb.js → SearchLg-B7BqY8rM.js} +1 -1
- package/dist/client/assets/{SearchMd-CJQ8cMjx.js → SearchMd-C15U6rGb.js} +1 -1
- package/dist/client/assets/{Sector-ljpJVNLt.js → Sector-BPSiaaeF.js} +1 -1
- package/dist/client/assets/{Settings02-CNUNhUgm.js → Settings02-BBs-XBr4.js} +1 -1
- package/dist/client/assets/{Share07-C1YlUnXi.js → Share07-C2wZgYsU.js} +1 -1
- package/dist/client/assets/{Shield01-CkMXeKwS.js → Shield01-DB8jblJb.js} +1 -1
- package/dist/client/assets/{Stars01-CHLSkzFP.js → Stars01-BrYl4UPC.js} +1 -1
- package/dist/client/assets/{Stars02-D-xvdNDD.js → Stars02-Bjd10p5h.js} +1 -1
- package/dist/client/assets/{Sun-Wp9EFk29.js → Sun-DURbhC_d.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-rurvH3NP.js → SwitchHorizontal01-DKHrNHvQ.js} +1 -1
- package/dist/client/assets/{Tool01-yRCio4tn.js → Tool01-CWUzFy5X.js} +1 -1
- package/dist/client/assets/{Tool02-BEkq_UYF.js → Tool02-qjcc9miB.js} +1 -1
- package/dist/client/assets/{Trash01-BF-11Z1s.js → Trash01-CRm0bRR3.js} +1 -1
- package/dist/client/assets/{TrendUp01-DxMv3fk0.js → TrendUp01-gVityjDF.js} +1 -1
- package/dist/client/assets/{Upload01-BOCrxZQR.js → Upload01-dRwHInn7.js} +1 -1
- package/dist/client/assets/{User01-CpM2XW8p.js → User01-rxqPQIKe.js} +1 -1
- package/dist/client/assets/{UserSquare-LJomGlyM.js → UserSquare-6jbHCY0r.js} +1 -1
- package/dist/client/assets/{Users01-DeUETtu_.js → Users01-B8VhqH7r.js} +1 -1
- package/dist/client/assets/{Users03-DFOE_2-2.js → Users03-Cg3iPl3n.js} +1 -1
- package/dist/client/assets/{XCircle-B5vQfqGO.js → XCircle-fgqsbzhf.js} +1 -1
- package/dist/client/assets/{XClose-Ba3XQssr.js → XClose-DE1anhKv.js} +1 -1
- package/dist/client/assets/{YAxis-C9GiZqnq.js → YAxis-DpXDQD8T.js} +1 -1
- package/dist/client/assets/{Zap-BKNLqGjJ.js → Zap-Brll3GtA.js} +1 -1
- package/dist/client/assets/{ZapSquare-CM3Nbg7t.js → ZapSquare-DTXwxwOz.js} +1 -1
- package/dist/client/assets/{ZoomOut-7Tk19jfc.js → ZoomOut-Dez1Ra4B.js} +1 -1
- package/dist/client/assets/{access-gate-CqhWkz2i.js → access-gate-BSQk1Rzv.js} +1 -1
- package/dist/client/assets/{agent-icon-w4R2jc53.js → agent-icon-ChVISiUs.js} +1 -1
- package/dist/client/assets/agents-list-D551Og-t.js +1 -0
- package/dist/client/assets/ai-providers-CPn31knd.js +1 -0
- package/dist/client/assets/{alert-BrNJxiqY.js → alert-DPF6U2qY.js} +1 -1
- package/dist/client/assets/{alert-dialog-BjMRiobA.js → alert-dialog-DAcPFaME.js} +1 -1
- package/dist/client/assets/analytics-tab-spcdbaXx.js +2 -0
- package/dist/client/assets/{api-keys-DpupF6Ta.js → api-keys-BuQmhxuH.js} +1 -1
- package/dist/client/assets/app-editor-YQAKDcpK.js +1 -0
- package/dist/client/assets/{auth-DPbVtDUU.js → auth-BGkoJ1cG.js} +1 -1
- package/dist/client/assets/{auth-catchall-Uq-U88m_.js → auth-catchall-D_mNgihV.js} +1 -1
- package/dist/client/assets/{auth-entry-DDLZNGZv.js → auth-entry-DfPzg9zj.js} +1 -1
- package/dist/client/assets/{auth-split-layout-R3LFcplO.js → auth-split-layout-CYKtd5YH.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B9KBhaKh.js → authenticate-and-persist-oauth-BkZkHJZD.js} +1 -1
- package/dist/client/assets/{automation-list-row-B_jk-CDq.js → automation-list-row-B6fgeAly.js} +1 -1
- package/dist/client/assets/{automation-runs-D30XDZRc.js → automation-runs-CCyhCizU.js} +1 -1
- package/dist/client/assets/automations-D0m_7RAE.js +1 -0
- package/dist/client/assets/{avatar-BY92F4ad.js → avatar-Dz9Cdkfa.js} +1 -1
- package/dist/client/assets/{badge-BR_XljuY.js → badge-CLPA3ucP.js} +1 -1
- package/dist/client/assets/{block-document-CINlvN6A.js → block-document-D-2XnruA.js} +1 -1
- package/dist/client/assets/{breadcrumb-Bc4JIo3J.js → breadcrumb-2GV4TpKd.js} +1 -1
- package/dist/client/assets/{buckets-BUtzynXz.js → buckets-DNcQfcr8.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BQMXPsuX.js → bulk-category-panel-DmLfL9v8.js} +1 -1
- package/dist/client/assets/{capability-load-error-CVkgY2J4.js → capability-load-error-DkvHos-W.js} +1 -1
- package/dist/client/assets/{cards-BJ0aI8_q.js → cards-CZP2Hek5.js} +1 -1
- package/dist/client/assets/category-editor-nA-BziD8.js +1 -0
- package/dist/client/assets/cdn-tab-B0g2tuRG.js +1 -0
- package/dist/client/assets/{chart-BwGsSrhZ.js → chart-DLwNihK6.js} +1 -1
- package/dist/client/assets/{chat-context-Cco1pivx.js → chat-context-CAsN7haM.js} +1 -1
- package/dist/client/assets/{checkbox-CDbf8BBM.js → checkbox-U8zBPmpm.js} +1 -1
- package/dist/client/assets/{choose-editor-Cblp6Sh9.js → choose-editor-YaLHWgso.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B59QsFt6.js → cli-auth-success-CUjuu8JM.js} +1 -1
- package/dist/client/assets/collection-detail-BQ-LYvRK.js +1 -0
- package/dist/client/assets/{collection-display-button-BX62xg4W.js → collection-display-button-D26vPWk5.js} +1 -1
- package/dist/client/assets/{collection-search-Bzjfhxul.js → collection-search-BYssgoWM.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-JL8pr-GN.js → collection-table-wrapper-DVqPAlfp.js} +1 -1
- package/dist/client/assets/{collection-tabs-CDynQFjW.js → collection-tabs-DE_Himgg.js} +1 -1
- package/dist/client/assets/{command-CrPl1P1v.js → command-vRQZOs-8.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-p_f_6FGF.js → commerce-onboarding-BBKhTt2f.js} +1 -1
- package/dist/client/assets/{config-a8v7b3uF.js → config-DzpAHZgc.js} +1 -1
- package/dist/client/assets/{connect-ZhOJ8Vca.js → connect-BTuE7fqF.js} +1 -1
- package/dist/client/assets/{connection-9wGAtpBl.js → connection-B69s8icJ.js} +1 -1
- package/dist/client/assets/{connection-card-OTfQst01.js → connection-card-DTi-12VQ.js} +1 -1
- package/dist/client/assets/connection-detail-DQoQ96OA.js +1 -0
- package/dist/client/assets/{connection-form-helpers-cIAbpE3O.js → connection-form-helpers-d8MRf_ol.js} +1 -1
- package/dist/client/assets/connections-BBt22oTv.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-DehHkBgy.js → decopilot-sse-pool-C93pdOD1.js} +1 -1
- package/dist/client/assets/{dialog-BWZ-h6mW.js → dialog-BBUJZcpD.js} +1 -1
- package/dist/client/assets/{domain-settings-Cx5Jc1vj.js → domain-settings-CCzeKQrl.js} +1 -1
- package/dist/client/assets/{drawer-DLdgOnkI.js → drawer-ROsGZL8h.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DuMndB0N.js → dropdown-menu-Fmf4NmkL.js} +1 -1
- package/dist/client/assets/e2e-tab-CWXL_Rel.js +1 -0
- package/dist/client/assets/{editor-BySvQBuX.js → editor-BfKSMUcF.js} +1 -1
- package/dist/client/assets/{empty-state-BC-ydujK.js → empty-state-CeJslyet.js} +1 -1
- package/dist/client/assets/{empty-state-D59-EXiy.js → empty-state-DQWPOyXn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CEqw-EJY.js → extract-connection-data-BV9lY0YE.js} +1 -1
- package/dist/client/assets/file-explorer-DN4S-Gzu.js +2 -0
- package/dist/client/assets/{file-type-icon-Bsjcp9VP.js → file-type-icon-gS1uLZ7y.js} +1 -1
- package/dist/client/assets/{folder-icon-BQrWn4YK.js → folder-icon-CKBCnr8T.js} +1 -1
- package/dist/client/assets/{form-BJ7iKOGy.js → form-Pq5VEUJX.js} +1 -1
- package/dist/client/assets/general-CG8aZZXM.js +1 -0
- package/dist/client/assets/{github-repo-picker-DTu9Rc_U.js → github-repo-picker-BJ1F-akh.js} +1 -1
- package/dist/client/assets/{hooks-DyBznHIN.js → hooks-Do0onfCH.js} +1 -1
- package/dist/client/assets/hosting-tab-DRaG29sb.js +1 -0
- package/dist/client/assets/{index-CEYPS6t1.js → index-B4SwE6N4.js} +1 -1
- package/dist/client/assets/{index-DMc9AFb8.js → index-BC5LO8yG.js} +1 -1
- package/dist/client/assets/index-B_yD-LXQ.js +1 -0
- package/dist/client/assets/{index-BfRm5Prf.js → index-CRwNbXJ2.js} +2 -2
- package/dist/client/assets/{index-D7aoPi7g.js → index-DQi5Cm5z.js} +6 -6
- package/dist/client/assets/{index-VPFEEz3Y.js → index-Dg_D1q-d.js} +5 -5
- package/dist/client/assets/{index-CkV2Ad16.js → index-Diw377tl.js} +1 -1
- package/dist/client/assets/index-XAxRN-k7.js +1 -0
- package/dist/client/assets/{index-D0OuD0aw.js → index-cmQGzepO.js} +1 -1
- package/dist/client/assets/{index-redirect-G1vNLqIK.js → index-redirect-B0f0F0qe.js} +1 -1
- package/dist/client/assets/{infra-billing-6669Wvf3.js → infra-billing-BFxO9knx.js} +1 -1
- package/dist/client/assets/{input-Jwsq1p59.js → input-DpPa_42i.js} +1 -1
- package/dist/client/assets/{integration-icon-DCo0C0nC.js → integration-icon-CWNKMETE.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DM9vw8s9.js → invite-member-dialog-remVNBKv.js} +1 -1
- package/dist/client/assets/{label-IQXBKL0A.js → label-BL_7ZfUT.js} +1 -1
- package/dist/client/assets/{layout-CFmbF8fK.js → layout-Czug-Tzw.js} +1 -1
- package/dist/client/assets/{login-CvMZ86JI.js → login-B5LcYsVn.js} +1 -1
- package/dist/client/assets/{markdown-CMUMuWo8.js → markdown-DiIariuP.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DoXPg1lT.js → mcp-oauth-ifEh5lsV.js} +1 -1
- package/dist/client/assets/{members-3FQa3BUN.js → members-DhJdQ5V-.js} +1 -1
- package/dist/client/assets/{monaco-editor-C8Ljyyw0.js → monaco-editor-71ToWHer.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-wixAUsdX.js → monitoring-stats-row-BKk7NuZS.js} +1 -1
- package/dist/client/assets/{multi-select-C5ysj02F.js → multi-select-Dik65Adz.js} +1 -1
- package/dist/client/assets/{oauth-callback-zTZeNVqa.js → oauth-callback-BBbWDmtj.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-l2MdraSy.js → oauth-callback-ai-provider-BvdmgcPR.js} +1 -1
- package/dist/client/assets/{onboarding-BwUbT0cK.js → onboarding-C1FzaSSC.js} +1 -1
- package/dist/client/assets/{org-layout-CsKTES2L.js → org-layout-B-DeoBFn.js} +1 -1
- package/dist/client/assets/{organization-choice-CdO5XJKs.js → organization-choice-CQ1g34ON.js} +1 -1
- package/dist/client/assets/orgs-BCaSf3_9.js +1 -0
- package/dist/client/assets/{page-seo-form-BDRoNeFx.js → page-seo-form-CBDVI6Sy.js} +1 -1
- package/dist/client/assets/{popover-ij0svucG.js → popover-CWhQzDoV.js} +1 -1
- package/dist/client/assets/post-calendar-DzXMpJiI.js +1 -0
- package/dist/client/assets/post-editor-cJ-g33aP.js +1 -0
- package/dist/client/assets/{primitives-DuEapsi7.js → primitives-CcjAy_Wl.js} +1 -1
- package/dist/client/assets/{profile-BGZBi6QT.js → profile-BkGYLaF7.js} +1 -1
- package/dist/client/assets/project-app-view-Dsj22h-4.js +1 -0
- package/dist/client/assets/{prompts-j4FtgRsB.js → prompts-IUQTjTeW.js} +1 -1
- package/dist/client/assets/record-editor-CJv_62ZD.js +1 -0
- package/dist/client/assets/redirect-editor-DTdkzPCL.js +1 -0
- package/dist/client/assets/registry-D1hrikAH.js +2 -0
- package/dist/client/assets/{registry-layout-kHL_6bBy.js → registry-layout-Dq5O3dna.js} +1 -1
- package/dist/client/assets/{reports-CS014rdq.js → reports-DddsMmcD.js} +1 -1
- package/dist/client/assets/{require-capability-bmqBJQzK.js → require-capability-D8zMRnaB.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DHiafxJe.js → required-auth-layout-DXyOZrhi.js} +1 -1
- package/dist/client/assets/{reset-password--L9BgyDR.js → reset-password-DxpMImOc.js} +1 -1
- package/dist/client/assets/{review-settings-FspSNK4C.js → review-settings-iIiY3_wn.js} +1 -1
- package/dist/client/assets/{roles-Bg1BztSJ.js → roles-0Svq_q5F.js} +1 -1
- package/dist/client/assets/schema-yAsjbXXp.js +1 -0
- package/dist/client/assets/{scroll-area-WPaSc-Gy.js → scroll-area-BvnHZd_6.js} +1 -1
- package/dist/client/assets/{search-input-DZhHq80D.js → search-input-bYvwKxnA.js} +1 -1
- package/dist/client/assets/{secrets-DXpqeCwB.js → secrets-BRhLfU_S.js} +1 -1
- package/dist/client/assets/{sections-editor-zYydvqwm.js → sections-editor-C2iz5o9t.js} +2 -2
- package/dist/client/assets/{select-Cj47fYAP.js → select-DNzQTE9-.js} +1 -1
- package/dist/client/assets/{select-model-Dy6xcYmT.js → select-model-uxVcrYeA.js} +1 -1
- package/dist/client/assets/{self-tool-result-B-QtkyJE.js → self-tool-result-Biy61Uc5.js} +1 -1
- package/dist/client/assets/seo-editor-CKv8V286.js +1 -0
- package/dist/client/assets/settings-layout-C6DMTBGx.js +1 -0
- package/dist/client/assets/{shell-controls-ClgYTjKc.js → shell-controls-3vrU3MB9.js} +1 -1
- package/dist/client/assets/{shell-layout-DwNMmbai.js → shell-layout-ChmjyFL-.js} +1 -1
- package/dist/client/assets/{skill-preview-Olh0vSgI.js → skill-preview-COx4IWY-.js} +1 -1
- package/dist/client/assets/{skills-DgtOm9L0.js → skills-BRQGFpXX.js} +1 -1
- package/dist/client/assets/{spinner-Cjs_Q2Re.js → spinner-D9tRFss2.js} +1 -1
- package/dist/client/assets/{sso-D5jE56J_.js → sso-BHUSAeIS.js} +1 -1
- package/dist/client/assets/store-B-uB1JKj.js +1 -0
- package/dist/client/assets/store-registry-PTGLl7mv.js +2 -0
- package/dist/client/assets/{super-agent-icon-Cskp_DHm.js → super-agent-icon-VLWg2gcg.js} +1 -1
- package/dist/client/assets/{switch-Cl3zliT1.js → switch-Vpgt8Dtr.js} +1 -1
- package/dist/client/assets/synced-repos-b9Znddsv.js +1 -0
- package/dist/client/assets/{table-DQACY323.js → table-BNqY6P4c.js} +1 -1
- package/dist/client/assets/{tabs-dCa-HMU5.js → tabs-DPRnGGBh.js} +1 -1
- package/dist/client/assets/task-board-wCy7jspP.js +1 -0
- package/dist/client/assets/tasks-DBtLSGKB.js +1 -0
- package/dist/client/assets/{textarea-9dSZZaaI.js → textarea-R3gwzWuz.js} +1 -1
- package/dist/client/assets/{thread-route-QQoL8601.js → thread-route-B4oWVYoI.js} +1 -1
- package/dist/client/assets/{toggle-group-BJ2Dw4w8.js → toggle-group-BNyMaUAI.js} +1 -1
- package/dist/client/assets/{toolbar-v_n93XOW.js → toolbar-DDVFxk0t.js} +1 -1
- package/dist/client/assets/{track-BfFCGHHa.js → track-lHZWKOcc.js} +1 -1
- package/dist/client/assets/{types-CJF2y9z4.js → types-M9rjJ4so.js} +1 -1
- package/dist/client/assets/{use-ai-providers-pq7pHCJO.js → use-ai-providers-CM54Q0OX.js} +1 -1
- package/dist/client/assets/{use-api-keys-L6l3Ihn8.js → use-api-keys-UQKmlrqG.js} +1 -1
- package/dist/client/assets/{use-automations-DKvQQ-Un.js → use-automations-CPxuY6-O.js} +1 -1
- package/dist/client/assets/{use-autosave-D1EB0xCQ.js → use-autosave-yRmtJAFw.js} +1 -1
- package/dist/client/assets/{use-connection-gwy1-aoh.js → use-connection-G7c7s6Q6.js} +1 -1
- package/dist/client/assets/{use-copy-DE_73RZk.js → use-copy-DB-byMLt.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D2VWnmML.js → use-create-virtual-mcp-BW2-Udqu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-KiWGPHI8.js → use-debounced-autosave-DvymupLc.js} +1 -1
- package/dist/client/assets/{use-debounced-value-1xVNprnQ.js → use-debounced-value-DopC2TwH.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CXhyu1GG.js → use-decopilot-events-DF_rDZmO.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DaS0EFE4.js → use-delete-connection-CR3a3pq_.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BK6jaS4w.js → use-deployment-admin-710BKY0Z.js} +1 -1
- package/dist/client/assets/{use-destination-route-Dq8o_NoS.js → use-destination-route-TwScqij0.js} +1 -1
- package/dist/client/assets/{use-file-configs-y-5UVs8c.js → use-file-configs-BZkqroRL.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-KMYUKVfY.js → use-infinite-scroll-C3BgauEG.js} +1 -1
- package/dist/client/assets/{use-join-requests-BzKe96rz.js → use-join-requests-B0FizwZw.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BlEZkVmH.js → use-mcp-auth-status-hGYxLW55.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BgFseqPh.js → use-mcp-client-EO5iWiVs.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CtFKKmtd.js → use-mcp-tools-K3GZYNAp.js} +1 -1
- package/dist/client/assets/{use-members-lRc2qCIE.js → use-members-BYGwa9Z7.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-SoOQYvc2.js → use-navigate-to-agent-UrsMPHtA.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-B4UjNXjz.js → use-org-auth-client-ZxQTDAGn.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-bE1aTdKv.js → use-org-repo-syncs-C3wPoLn0.js} +1 -1
- package/dist/client/assets/{use-org-sso-CbIeyqui.js → use-org-sso-EQbKGGm_.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BLo0T8Fm.js → use-organization-roles-Cgk3qsYL.js} +1 -1
- package/dist/client/assets/use-organization-settings-DRNltYjf.js +1 -0
- package/dist/client/assets/{use-panel-navigate-BgYbuioR.js → use-panel-navigate-CeNfN5zO.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CvmL6uQj.js → use-registry-connections-h293jGTM.js} +1 -1
- package/dist/client/assets/{use-secrets-DWRmBbSF.js → use-secrets-DLBve_-_.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DarbWu6k.js → use-section-preview-base-DhS-dmV_.js} +1 -1
- package/dist/client/assets/{use-status-sounds-ZWQqhqFf.js → use-status-sounds-DRtkfkey.js} +1 -1
- package/dist/client/assets/{use-tags-nluWdBq3.js → use-tags-D04LvBWo.js} +1 -1
- package/dist/client/assets/{use-view-mode-A8EChCzN.js → use-view-mode-CkYnF9E6.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CF0V8LwT.js → use-virtual-mcp-CxvwShU4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DFMRU76h.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DcraGyx6.js +1 -0
- package/dist/client/assets/{users-UynRf9Bl.js → users-Dt0Je5TG.js} +1 -1
- package/dist/client/assets/variant-calendar-BlvMqXMa.js +1 -0
- package/dist/client/assets/{view-mode-toggle-C2tUQoYX.js → view-mode-toggle-BH1dvVv_.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +560 -560
- package/dist/server/server.js +386 -386
- package/package.json +1 -1
- package/dist/client/assets/agents-list-CDeH5mua.js +0 -1
- package/dist/client/assets/ai-providers-DDvjwzWy.js +0 -1
- package/dist/client/assets/analytics-tab-RCsJdvCm.js +0 -2
- package/dist/client/assets/app-editor-D3ntLHjS.js +0 -1
- package/dist/client/assets/automations-GkNAR7bE.js +0 -1
- package/dist/client/assets/category-editor-B-OVEZbF.js +0 -1
- package/dist/client/assets/cdn-tab-wM-WQ63z.js +0 -1
- package/dist/client/assets/collection-detail-Bjx918Rr.js +0 -1
- package/dist/client/assets/connection-detail-CqWHYlYV.js +0 -1
- package/dist/client/assets/connections-3asH1ZHi.js +0 -1
- package/dist/client/assets/e2e-tab-ByFhcI1q.js +0 -1
- package/dist/client/assets/file-explorer-CYu8Tft6.js +0 -2
- package/dist/client/assets/general-DQOIyRSU.js +0 -1
- package/dist/client/assets/hosting-tab-BrxXni8T.js +0 -1
- package/dist/client/assets/index-BrNrV4tj.js +0 -1
- package/dist/client/assets/index-Cnrmg7Sw.js +0 -1
- package/dist/client/assets/orgs-BYBWIc7Z.js +0 -1
- package/dist/client/assets/post-calendar-BbsX87_T.js +0 -1
- package/dist/client/assets/post-editor-h6w4I9ZS.js +0 -1
- package/dist/client/assets/project-app-view-DNCXwiez.js +0 -1
- package/dist/client/assets/record-editor-_ikmjKxL.js +0 -1
- package/dist/client/assets/redirect-editor-BvTmI3Kg.js +0 -1
- package/dist/client/assets/registry-BV-iwWNW.js +0 -2
- package/dist/client/assets/seo-editor-BaWAkLyV.js +0 -1
- package/dist/client/assets/settings-layout-C3usVBay.js +0 -1
- package/dist/client/assets/store-0lLifZn2.js +0 -1
- package/dist/client/assets/store-registry-DEKcUAxj.js +0 -2
- package/dist/client/assets/synced-repos-CW5C3-Hv.js +0 -1
- package/dist/client/assets/task-board-CNsj1P77.js +0 -1
- package/dist/client/assets/tasks-BN3GZt1f.js +0 -1
- package/dist/client/assets/use-organization-settings-DWaM_I5Z.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C7vyKwkW.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-94-R8xK3.js +0 -1
- package/dist/client/assets/variant-calendar-BH5D4ifY.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as st,b as Vt,r as w,n as Ue,j as n,aH as Zn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Aa,t as q,K as Ca}from"./index-VPFEEz3Y.js";import{b as Pa}from"./chat-context-Cco1pivx.js";import{a8 as ts,a9 as Ma,aa as La,ab as Ka,ac as Ba,O as ns,P as Xt,ad as ss,ae as as,Q as os,U as is,af as rs,ag as Ia,$ as ls,a0 as cs,ah as Oa,ai as Fa,aj as us,G as $a,V as ds,W as Lt,Z as ms,_ as fs,X as ps,a5 as gs,ak as za,al as Kt,am as hs,an as Ha,ao as Ua,ap as Ga,aq as qa,ar as Wa,e as Qa,g as Ya,as as Ja,at as Xa,au as Za,av as eo,aw as Bn,ax as to,ay as no,az as so,a3 as qt,aA as ao,aB as oo,aC as Wt,aD as io,aE as bt,aF as Ct,aG as ro,aH as lo,aI as nt,aJ as In,aK as co,h as uo,aL as On,aM as mo,aN as fo,aO as Pt,aP as Qt,aQ as Fn,aR as po,aS as fn,aT as go,aU as ht,aV as Et,aW as ho,aX as vo,aY as So,aZ as bo,a_ as yo,a$ as yt,b0 as xo,b1 as _o,b2 as jo,j as Eo,b3 as $n,b4 as Mt,b5 as zn,b6 as Hn,b7 as Ro,b8 as wo,b9 as ko,ba as To,bb as pn,bc as Un,bd as Gn,be as Rt,bf as Yt,bg as qn,bh as Vo,bi as gn,bj as Do,bk as No,bl as Ao,bm as Co,bn as Po,bo as Mo}from"./index-D7aoPi7g.js";import{t as Lo}from"./ChevronDown-Bv15tE3e.js";import{ad as vn,u as Ko,Q as vs,z as Bo,r as Io,ak as Oo,o as Fo}from"./agent-icon-w4R2jc53.js";import{i as $o}from"./ChevronRight-Ci9WZW0s.js";import{n as zo}from"./ChevronUp-CJSi4ok2.js";import{i as Ho}from"./Globe01-BJpcU1hY.js";import{S as Jt}from"./scroll-area-WPaSc-Gy.js";import{b as Uo,h as Go,a as qo,c as Wo,d as Qo,e as Yo}from"./dialog-BWZ-h6mW.js";import{I as Jo}from"./input-Jwsq1p59.js";import{a as Ss}from"./Copy01-CbJTmUFe.js";import{i as Xo}from"./Settings02-CNUNhUgm.js";import{s as Zo}from"./Eye-CD_6MgPf.js";import{s as ei}from"./TrendUp01-DxMv3fk0.js";import{s as Sn}from"./Plus-bEkTtkKz.js";import{s as bs}from"./Trash01-BF-11Z1s.js";import{i as ti}from"./Zap-BKNLqGjJ.js";import{D as ys,a as vt,c as xs,b as _s,i as ni}from"./dropdown-menu-DuMndB0N.js";import{a as si,P as ai,b as oi}from"./page-seo-form-BDRoNeFx.js";import{a as ii}from"./Tool01-yRCio4tn.js";import{u as ri,A as li}from"./use-section-preview-base-DarbWu6k.js";import"./use-panel-navigate-BgYbuioR.js";import"./use-destination-route-Dq8o_NoS.js";import"./thread-route-QQoL8601.js";import"./Check-Eb20R0uP.js";import"./Download01-DlfNPuhH.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DyBznHIN.js";import"./use-mcp-client-BgFseqPh.js";import"./auth-DPbVtDUU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DehHkBgy.js";import"./task-board-CNsj1P77.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CF0V8LwT.js";import"./use-ai-providers-pq7pHCJO.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CXhyu1GG.js";import"./use-organization-settings-DWaM_I5Z.js";import"./ArrowUp-CixBAt8Q.js";import"./automation-runs-D30XDZRc.js";import"./useInfiniteQuery-C7vyKwkW.js";import"./use-infinite-scroll-KMYUKVfY.js";import"./use-connection-gwy1-aoh.js";import"./table-DQACY323.js";import"./empty-state-BC-ydujK.js";import"./use-members-lRc2qCIE.js";import"./use-org-auth-client-B4UjNXjz.js";import"./AlertCircle-DxYCNcK8.js";import"./CheckCircle-qBq1p-Wj.js";import"./DotsVertical-BhHlLSsp.js";import"./XCircle-B5vQfqGO.js";import"./use-automations-DKvQQ-Un.js";import"./useSuspenseInfiniteQuery-94-R8xK3.js";import"./avatar-BY92F4ad.js";import"./User01-CpM2XW8p.js";import"./Tool02-BEkq_UYF.js";import"./Stars01-CHLSkzFP.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DE_73RZk.js";import"./markdown-CMUMuWo8.js";import"./ZoomOut-7Tk19jfc.js";import"./monaco-editor-C8Ljyyw0.js";import"./spinner-Cjs_Q2Re.js";import"./editor-BySvQBuX.js";import"./types-CJF2y9z4.js";import"./XClose-Ba3XQssr.js";import"./Share07-C1YlUnXi.js";import"./SearchMd-CJQ8cMjx.js";import"./shell-layout-DwNMmbai.js";import"./Users03-DFOE_2-2.js";import"./SearchLg-BdF7piHb.js";import"./Stars02-D-xvdNDD.js";import"./FilterLines-DdFZlVgI.js";import"./Monitor01-C0j6D2fo.js";import"./required-auth-layout-DHiafxJe.js";import"./use-org-sso-CbIeyqui.js";import"./Image01-CsV_5vxX.js";import"./LinkExternal01--B4PKy8C.js";import"./integration-icon-DCo0C0nC.js";import"./Palette-cNnA20fO.js";import"./use-navigate-to-agent-SoOQYvc2.js";import"./chart-BwGsSrhZ.js";import"./index-CkV2Ad16.js";import"./AreaChart-CmfyOVSz.js";import"./form-BJ7iKOGy.js";import"./label-IQXBKL0A.js";import"./file-type-icon-Bsjcp9VP.js";import"./drawer-DLdgOnkI.js";import"./collection-search-Bzjfhxul.js";import"./Upload01-BOCrxZQR.js";import"./select-Cj47fYAP.js";import"./UserSquare-LJomGlyM.js";import"./ArrowLeft-DdJRt_vK.js";import"./tabs-dCa-HMU5.js";import"./toggle-group-BJ2Dw4w8.js";import"./super-agent-icon-Cskp_DHm.js";import"./self-tool-result-B-QtkyJE.js";import"./alert-dialog-BjMRiobA.js";import"./extract-connection-data-CEqw-EJY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-1xVNprnQ.js";import"./authenticate-and-persist-oauth-B9KBhaKh.js";import"./mcp-oauth-DoXPg1lT.js";import"./track-BfFCGHHa.js";import"./popover-ij0svucG.js";import"./toolbar-v_n93XOW.js";import"./github-repo-picker-DTu9Rc_U.js";import"./LockUnlocked01-x8CVxEbg.js";import"./use-mcp-tools-CtFKKmtd.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-OTfQst01.js";import"./use-registry-connections-CvmL6uQj.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-9dSZZaaI.js";import"./connection-form-helpers-cIAbpE3O.js";import"./collection-tabs-CDynQFjW.js";import"./badge-BR_XljuY.js";import"./select-model-Dy6xcYmT.js";import"./checkbox-CDbf8BBM.js";import"./ChevronSelectorVertical-Dw6UipKY.js";import"./Key01-1-wwfLyJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-BQrWn4YK.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-ZWQqhqFf.js";import"./ZapSquare-CM3Nbg7t.js";import"./skill-preview-Olh0vSgI.js";import"./GitBranch01-LMEq5ZXZ.js";import"./Package-DuLKvK8F.js";import"./use-file-configs-y-5UVs8c.js";import"./pt-BR-CLy76QW2.js";import"./Play-DPV4DI_n.js";import"./use-debounced-autosave-KiWGPHI8.js";import"./search-input-DZhHq80D.js";import"./use-mcp-auth-status-BlEZkVmH.js";import"./switch-Cl3zliT1.js";import"./Users01-DeUETtu_.js";import"./use-secrets-DWRmBbSF.js";import"./config-a8v7b3uF.js";import"./Shield01-CkMXeKwS.js";import"./command-CrPl1P1v.js";import"./index-DMc9AFb8.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-Bc4JIo3J.js";import"./SwitchHorizontal01-rurvH3NP.js";import"./use-tags-nluWdBq3.js";import"./automation-list-row-B_jk-CDq.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-bE1aTdKv.js";import"./cards-BJ0aI8_q.js";import"./CreditCard01-Cdyvlf63.js";import"./Globe04-D16fda-t.js";import"./HardDrive-CFC2NbAD.js";import"./LogOut01-DQgirYVV.js";import"./Sun-Wp9EFk29.js";function ci(d){return d.schema?.definitions??d.schema?.$defs??{}}function js(d,e){const o=ci(e),u=o[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=o[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function ui(d,e){for(const o of js(d,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function di(d,e){if(!e)return;const o=ts(d);if(!o)return;const u=ui(o.resolveType,e);if(!u)return;const p=Ma(u,o.data);if(p)return La(p)}const mi={escape:Ba};function fi(d,e){for(const o of js(d,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function pi(d,e){if(!e)return;const o=ts(d);if(o)try{const u=fi(o.resolveType,e);return u&&Ka.render(u,o.data,{},mi).trim()||void 0}catch{return}}const gi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",hi="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 Wn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Es(d){return d.map((e,o)=>({...e,index:o}))}function vi(d,e){if(e===d.length)return d;if(e<d.length)return Es(d.slice(0,e));const o=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...o]}function Rs(d){const e=st.c(25),{section:o,raw:u,meta:p}=d,x=o.isSavedBlock===!0,j=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?di(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?pi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Ko,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let V;e[11]!==j||e[12]!==x?(V=x?{color:$a}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=V):V=e[13];let c;e[14]!==V?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:V}),e[14]=V,e[15]=c):c=e[15];const b=o.isHidden&&"line-through opacity-50";let R;e[16]!==b?(R=Ue("min-w-0 flex-1 truncate text-sm font-medium",b),e[16]=b,e[17]=R):R=e[17];const l=k??o.label;let D;e[18]!==R||e[19]!==l?(D=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=D):D=e[20];let i;return e[21]!==D||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,D]}),e[21]=D,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const Si="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",bi="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",yi="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?Si:d?yi:bi)}function ws(d,e){const o=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?gi:u?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function xi(d){const e=st.c(82),{section:o,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:K,onToggleLazy:M,onAddVariant:V,onDetach:c}=d,b=Vt(),R=u?rs(u.__resolveType??""):!1,l=o.isHidden===!0,D=R||l;let i;e[0]!==o?(i=Ia(o),e[0]=o,e[1]=i):i=e[1];const Q=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:wi},e[2]=x,e[3]=U):U=e[3];const{attributes:Le,listeners:Y,setNodeRef:m,transform:P,isDragging:we}=ls(U);let N;e[4]!==P?(N=cs.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=N):N=e[5];const Z=we?0:void 0;let T;e[6]!==N||e[7]!==Z?(T={transform:N,opacity:Z},e[6]=N,e[7]=Z,e[8]=T):T=e[8];const oe=T;let B;e[9]!==o?(B=Oa(o),e[9]=o,e[10]=B):B=e[10];const Ce=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let J;e[13]!==o||e[14]!==j||e[15]!==de?(J=Ue("touch-none transition-colors",de,ws(o,j)),e[13]=o,e[14]=j,e[15]=de,e[16]=J):J=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==o?(ie=n.jsx(Rs,{section:o,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=o,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==b?(ye=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=b,e[23]=ye):ye=e[23];let re;e[24]!==K?(re=_=>{_.stopPropagation(),K()},e[24]=K,e[25]=re):re=e[25];let L;e[26]!==l?(L=l?n.jsx(Xo,{className:"h-3.5 w-3.5"}):n.jsx(Zo,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=L):L=e[27];let qe;e[28]!==l||e[29]!==b?(qe=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=b,e[30]=qe):qe=e[30];let Ke;e[31]!==qe?(Ke=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Ke):Ke=e[32];const Ie=xs,ke=ys,F=!0,te=tt,Oe="button",Pe="ghost",xe="icon";let ne;e[33]!==b?(ne=b("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=b,e[34]=ne):ne=e[34];const me=Ue(hn(D,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Oe,variant:Pe,size:xe,"aria-label":ne,className:me,onClick:ji,onPointerDown:_i,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(Ss,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==b?(je=b("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=b,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==Q||e[52]!==V||e[53]!==b?(I=Q&&n.jsxs(vt,{className:Fa,onClick:_=>{_.stopPropagation(),V()},children:[n.jsx(ei,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=Q,e[52]=V,e[53]=b,e[54]=I):I=e[54];let Ee;e[55]!==Ce||e[56]!==k||e[57]!==b?(Ee=Ce&&n.jsxs(vt,{className:hi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Ce,e[56]=k,e[57]=b,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==o.isMultivariate||e[61]!==o.isSavedBlock||e[62]!==b?(ge=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=o.isMultivariate,e[61]=o.isSavedBlock,e[62]=b,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(bs,{className:"h-4 w-4"}),e[66]=he):he=e[66];let X;e[67]!==b?(X=b("sectionsEditor.sectionList.deleteMenuItem"),e[67]=b,e[68]=X):X=e[68];let ue;e[69]!==ce||e[70]!==X?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,X]}),e[69]=ce,e[70]=X,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(_s,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Ie||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Ie,{children:[pe,ve]}),e[78]=Ie,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:oe,...Le,...Y,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:J,children:[ie,!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":b(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(D,R)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ri,children:n.jsx(ti,{className:Ue("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:b(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(hn(D,l)),onClick:re,onPointerDown:Ei,children:L})}),Ke]}),Te]})}function _i(d){return d.stopPropagation()}function ji(d){return d.stopPropagation()}function Ei(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function wi(){return!1}function ki(d){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:K,onToggleHidden:M,onToggleLazy:V,onAddVariant:c,onDetach:b,onAddSection:R,canAddSection:l}=d,D=l===void 0?!0:l,i=Vt();let Q;e[0]!==p.length?(Q=()=>Wn(p.length),e[0]=p.length,e[1]=Q):Q=e[1];const[U,Le]=w.useState(Q),[Y,m]=w.useState(null),[P,we]=w.useState(o),[N,Z]=w.useState(p.length),T=w.useRef(!1);P!==o?(we(o),Z(p.length),Le(Wn(p.length))):N!==p.length&&(Z(p.length),Le(Te=>vi(Te,p.length)));let oe;e[2]===Symbol.for("react.memo_cache_sentinel")?(oe={activationConstraint:{distance:8}},e[2]=oe):oe=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ds},e[3]=B):B=e[3];const Ce=ns(Xt(is,oe),Xt(os,B));let ee;e[4]!==U?(ee=U.map(Ti),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let J;e[6]===Symbol.for("react.memo_cache_sentinel")?(J=Te=>{m(String(Te.active.id))},e[6]=J):J=e[6];const ie=J;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:Se}=Te;if(!Se||_.id===Se.id)return;const ae=de.indexOf(String(_.id)),Ve=de.indexOf(String(Se.id));ae===-1||Ve===-1||(Le(Fe=>Es(Lt([...Fe],ae,Ve))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(ae,Ve))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{m(null)},e[10]=L):L=e[10];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==Y||e[12]!==D||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==b||e[21]!==k||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==V||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Ce||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==Y||e[47]!==D||e[48]!==U||e[49]!==R||e[50]!==u||e[51]!==p||e[52]!==i){const _=Y?U.find(Se=>Se.id===Y):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let Se;e[56]!==i?(Se=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=Se):Se=e[57];let ae;e[58]!==Se?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Se}),e[58]=Se,e[59]=ae):ae=e[59];const Ve=!D;let Fe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsx(Sn,{size:14}),e[60]=Fe):Fe=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let De;e[63]!==R||e[64]!==Ve||e[65]!==ct?(De=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:R,children:[Fe,ct]}),e[63]=R,e[64]=Ve,e[65]=ct,e[66]=De):De=e[66];let Xe;e[67]!==ae||e[68]!==De?(Xe=n.jsxs("div",{className:"space-y-2",children:[ae,De]}),e[67]=ae,e[68]=De,e[69]=Xe):Xe=e[69],se=Xe;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=Y,e[47]=D,e[48]=U,e[49]=R,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Ie=ms,xe=Ce,ne=fs,me=ie,_e=re,fe=qe,Ke=ps,Oe=de,Pe=gs,Me="space-y-1",te=U.map(_=>{const Se=p[_.index];return Se?n.jsx(xi,{sortableId:_.id,section:Se,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>K(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>V(_.index),onAddVariant:()=>c(_.index),onDetach:()=>b(_.index)},_.id):null})}e[11]=Y,e[12]=D,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=R,e[18]=c,e[19]=g,e[20]=b,e[21]=k,e[22]=K,e[23]=v,e[24]=M,e[25]=V,e[26]=u,e[27]=p,e[28]=j,e[29]=Ce,e[30]=i,e[31]=Ke,e[32]=Ie,e[33]=ke,e[34]=F,e[35]=te,e[36]=Oe,e[37]=Pe,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Ke=e[31],Ie=e[32],ke=e[33],F=e[34],te=e[35],Oe=e[36],Pe=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Ke||e[74]!==Oe||e[75]!==Pe||e[76]!==je?(le=n.jsx(Ke,{items:Oe,strategy:Pe,children:je}),e[73]=Ke,e[74]=Oe,e[75]=Pe,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ws(F,!1)),children:n.jsx(Rs,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Ie||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Ie,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Ie,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!D;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(Sn,{size:14}),e[93]=he):he=e[93];let X;e[94]!==i?(X=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=X):X=e[95];let ue;e[96]!==R||e[97]!==ce||e[98]!==X?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:R,children:[he,X]}),e[96]=R,e[97]=ce,e[98]=X,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function Ti(d){return d.id}function Qn(d){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Vt(),[k,K]=w.useState(u),[M,V]=w.useState(o);o!==M&&(V(o),o&&K(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const b=c;let R;e[3]!==y||e[4]!==k||e[5]!==j?(R=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=R):R=e[6];const l=R;let D;e[7]!==g?(D=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=D):D=e[8];let i;e[9]!==D?(i=n.jsx(Uo,{children:D}),e[9]=D,e[10]=i):i=e[10];let Q;e[11]!==p||e[12]!==g?(Q=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=Q):Q=e[13];let U;e[14]!==Q?(U=n.jsx(Go,{children:Q}),e[14]=Q,e[15]=U):U=e[15];let Le;e[16]!==i||e[17]!==U?(Le=n.jsxs(qo,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Le):Le=e[18];let Y;e[19]!==g?(Y=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=Y):Y=e[20];let m;e[21]!==Y?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:Y}),e[21]=Y,e[22]=m):m=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=ie=>K(ie.target.value),e[23]=P):P=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Jo,{id:"variant-rename-name",value:k,onChange:P,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let oe;e[35]!==y||e[36]!==Z||e[37]!==T?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:Z,disabled:y,children:T}),e[35]=y,e[36]=Z,e[37]=T,e[38]=oe):oe=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Ce;e[42]!==y||e[43]!==B?(Ce=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Ce):Ce=e[44];let ee;e[45]!==oe||e[46]!==Ce?(ee=n.jsxs(Wo,{children:[oe,Ce]}),e[45]=oe,e[46]=Ce,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Le?(de=n.jsx(Qo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Le,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Le,e[52]=de):de=e[52];let J;return e[53]!==b||e[54]!==o||e[55]!==de?(J=n.jsx(Yo,{open:o,onOpenChange:b,children:de}),e[53]=b,e[54]=o,e[55]=de,e[56]=J):J=e[56],J}function ks(d){const e=st.c(5),{rule:o,matchers:u}=d,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??za(p);x=Bo(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Yn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function Jn(d){return d.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Vi(d,e){const o=new Map;for(const u of d){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Di(d){return d.map((e,o)=>({...e,index:o}))}function Ts(d){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Vt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(ks,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let V;e[5]!==x||e[6]!==j||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(V=!j&&n.jsxs(xs,{children:[n.jsx(ys,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ai,onPointerDown:Ni,children:n.jsx(vs,{size:14})})}),n.jsxs(_s,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:b=>{b.stopPropagation(),v?.()},children:[n.jsx(ii,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:b=>{b.stopPropagation(),y?.()},children:[n.jsx(Ss,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ni,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:b=>{b.stopPropagation(),g?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=V):V=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==V?(c=n.jsxs(n.Fragment,{children:[K,M,V]}),e[13]=K,e[14]=M,e[15]=V,e[16]=c):c=e[16],c}function Ni(d){return d.stopPropagation()}function Ai(d){return d.stopPropagation()}function Ci(d){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:K}=d;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Pi},e[0]=o.id,e[1]=M):M=e[1];const{attributes:V,listeners:c,setNodeRef:b,transform:R,isDragging:l}=ls(M);let D;e[2]!==R?(D=cs.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=D):D=e[3];const i=l?0:void 0;let Q;e[4]!==D||e[5]!==i?(Q={transform:D,opacity:i},e[4]=D,e[5]=i,e[6]=Q):Q=e[6];const U=Q,Le=j??void 0;let Y;e[7]!==x||e[8]!==o.variant.rule||e[9]!==Le?(Y=Kt(o.variant.rule,x,Le),e[7]=x,e[8]=o.variant.rule,e[9]=Le,e[10]=Y):Y=e[10];const m=Y;let P;e[11]!==y?(P=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=P):P=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?hs:us;let Z;e[13]!==we||e[14]!==N?(Z=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=Z):Z=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==o.variant.label||e[19]!==v||e[20]!==K||e[21]!==k||e[22]!==g?(T=n.jsx(Ts,{label:o.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:K}),e[16]=p,e[17]=m,e[18]=o.variant.label,e[19]=v,e[20]=K,e[21]=k,e[22]=g,e[23]=T):T=e[23];let oe;return e[24]!==V||e[25]!==c||e[26]!==y||e[27]!==b||e[28]!==U||e[29]!==Z||e[30]!==T||e[31]!==P?(oe=n.jsx("div",{ref:b,style:U,...V,...c,onClick:y,onKeyDown:P,className:Z,children:T}),e[24]=V,e[25]=c,e[26]=y,e[27]=b,e[28]=U,e[29]=Z,e[30]=T,e[31]=P,e[32]=oe):oe=e[32],oe}function Pi(){return!1}function Mi(d){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==o.rule?(v=Kt(o.rule,u,j),e[0]=u,e[1]=j,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==o.label?(k=n.jsx("div",{className:g,children:n.jsx(Ts,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=k):k=e[8],k}function Li(d){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:K,onDelete:M,onAdd:V}=d,c=Vt();let b;e[0]!==u?(b=()=>Jn(u),e[0]=u,e[1]=b):b=e[1];const[R,l]=w.useState(b),[D,i]=w.useState(null),[Q,U]=w.useState(o),[Le,Y]=w.useState(u.length);let m;e[2]!==u?(m=()=>Yn(u),e[2]=u,e[3]=m):m=e[3];const[P,we]=w.useState(m),N=w.useRef(!1),Z=Yn(u);Q!==o?(U(o),Y(u.length),we(Z),l(Jn(u))):(Le!==u.length||P!==Z)&&(Y(u.length),we(Z),l(ge=>Vi(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ds},e[5]=oe):oe=e[5];const B=ns(Xt(is,T),Xt(os,oe));let Ce;e[6]!==R?(Ce=R.map(Ki),e[6]=R,e[7]=Ce):Ce=e[7];const ee=Ce,de=u.length>1;let J;e[8]!==R?(J=ge=>{const ce=String(ge.active.id);i(R.find(he=>he.id===ce)??null)},e[8]=R,e[9]=J):J=e[9];const ie=J;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const X=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));X===-1||ue===-1||(l(ve=>Di(Lt([...ve],X,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(X,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{i(null)},e[13]=L):L=e[13];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==R||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==V||e[24]!==M||e[25]!==K||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=ae=>{N.current||y(ae)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let X;e[47]!==c?(X=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=X):X=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Sn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==V||e[51]!==X?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":X,className:"size-6",onClick:V,children:ue})}),e[50]=V,e[51]=X,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let Se;e[57]!==ve||e[58]!==_?(Se=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=Se):Se=e[59],e[60]!==he||e[61]!==Se?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,Se]}),e[60]=he,e[61]=Se,e[62]=fe):fe=e[62],Ie=ms,Oe=B,Pe=fs,xe=ie,ne=re,me=qe,Ke=ps,F=ee,te=gs,pe="space-y-0.5",ke=R.map(ae=>n.jsx(Ci,{entry:ae,isActive:ae.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(ae.index),onRename:()=>k(ae.index),onDuplicate:()=>K(ae.index),onDelete:()=>M(ae.index)},ae.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=R,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=V,e[24]=M,e[25]=K,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Ke,e[31]=Ie,e[32]=ke,e[33]=F,e[34]=te,e[35]=Oe,e[36]=Pe,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Ke=e[30],Ie=e[31],ke=e[32],F=e[33],te=e[34],Oe=e[35],Pe=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Ke||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Ke,{items:F,strategy:te,children:se}),e[66]=Ke,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==D||e[72]!==x||e[73]!==v||e[74]!==j?(je=D?n.jsx(Mi,{variant:D.variant,decofile:x,meta:j,matchers:v}):null,e[71]=D,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Ie||e[79]!==Oe||e[80]!==Pe||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Ie,{sensors:Oe,collisionDetection:Pe,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Ie,e[79]=Oe,e[80]=Pe,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Ki(d){return d.id}function Xn(d){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:K,formKey:M,formWrapperClassName:V,meta:c,decofile:b,onSaveReferencedBlock:R,sandbox:l}=d;let D;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(D=n.jsx(Ha,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=D):D=e[7];let i;e[8]!==b||e[9]!==M||e[10]!==k||e[11]!==V||e[12]!==c||e[13]!==K||e[14]!==R||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:V,children:n.jsx(Ua,{schema:g,value:k,onChange:K,meta:c,decofile:b,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=b,e[9]=M,e[10]=k,e[11]=V,e[12]=c,e[13]=K,e[14]=R,e[15]=l,e[16]=g,e[17]=i):i=e[17];let Q;return e[18]!==D||e[19]!==i?(Q=n.jsxs(n.Fragment,{children:[D,i]}),e[18]=D,e[19]=i,e[20]=Q):Q=e[20],Q}function Ic({orgSlug:d,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:V}){const c=Vt(),b=Pa()?.taskId??null,R=u?{orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p}:null,{data:l,isLoading:D}=Ga(R),{data:i,isLoading:Q}=qa(R),U=Wa(),Le=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,Y=ri({virtualMcpId:e,sandboxUrl:p}),[m,P]=w.useState(null),[we,N]=w.useState(null),[Z,T]=w.useState(null),[oe,B]=w.useState(0),[Ce,ee]=w.useState(void 0),[de,J]=w.useState(null),[ie,ye]=w.useState(null),[re,L]=w.useState([]),qe=w.useRef(null),[Ke,Ie]=w.useState(re.length);Ke!==re.length&&(Ie(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=w.useState(0),[te,Oe]=w.useState(null),[Pe,xe]=w.useState(null),[ne,me]=w.useState(null),[_e,fe]=w.useState(!0),[pe,se]=w.useState(!1),[Me,je]=w.useState(!1),le=w.useRef(null),[I,Ee]=w.useState(k),[ge,ce]=w.useState(k);k&&!ge&&(ce(!0),Ee(!0),P(null),N(null),T(null),L([])),!k&&ge&&ce(!1);const[he,X]=w.useState(null),[ue,ve]=w.useState(void 0),[Te,_]=w.useState([]),[Se,ae]=w.useState(0),[Ve,Fe]=w.useState(0),[ct,De]=w.useState(null),[Xe,We]=w.useState(null),[bn,yn]=w.useState(null),Vs=Aa(),Ds=`${d}/${e}/${o}`,Zt=Qa({orgSlug:d,virtualMcpId:e,branch:o}),[Ns,As]=w.useState(x),[Cs,Ps]=w.useState(j),[Ms,Ls]=w.useState(v);(Ns!==x||Cs!==j||Ms!==v)&&(queueMicrotask(()=>Zt.flush()),As(x),Ps(j),Ls(v),P(null),N(null),T(null),B(0),J(null),ye(null),Fe(0),De(null),We(null),L([]),F(t=>t+1),Ee(!1),X(null),ve(void 0),_([]),ae(t=>t+1));const Ne=Ya({orgSlug:d,virtualMcpId:e,branch:o}),Bt=Eo((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Ja({orgSlug:d,virtualMcpId:e,branch:o}),[Dt,It]=w.useState(!1),ze=w.useRef(null),at=w.useRef(null),ot=w.useRef(null),tn=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||D||Q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ks=Xa(l),Ae=!!v,Qe=Ae?null:Za(Ks,x,j),E=Ae?v:Qe?.key??null,nn=Ae&&v?l[v]:void 0,xn=Ae&&v&&nn?eo(v,nn):Ae&&v?v:"",Ot=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Qe?Bn(l,{kind:"page",pageKey:E,pageName:String(Qe.name??""),path:String(Qe.path??"")},i):null,Bs=I?Ot?.seo:void 0,an=ue!==void 0?ue:Bs,Is=I?to(an):void 0,Os=sn?.seoTypeOptions??[],Fs=I&&i?no(i):"",_n=he??Is??{},on=I&&sn?si(_n,sn):null,$s=I&&on&&so(an)?qt(on,i):null,zs=I?ao(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:oo(Ot?.sections,l??{}),Ft=Ge.length>1,$e=Math.min(oe,Ge.length-1),ut=Ge[$e],H=ut?.sections??[],He=Wt(H,l),jn=!Ae&&io(Ot?.sections);if(Ae&&v&&bn!==v){yn(v);const t=H[0],s=He[0];if(t&&s){P(0),Fe(0),L([]);const a=bt(t,s,l);a&&(N(a.data),T(a.resolveType),We(null),De(null))}}!Ae&&bn!==null&&yn(null),Ze.current={rawSections:H,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:Ve,selectedSectionIndex:m};const Hs=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!V)return;if(!E||!jn||t.length<=1){V(null);return}const a=qn(E,{multivariate:!0,index:s,variants:t},l,i);V(a.length>0?a:null)},xt=(t,s,a)=>{if(!V)return;if(!E){V(null);return}const r=Hs(),f=qn(E,r,l,i);if(!t||s<0){V(f.length>0?f:null);return}const S=Vo({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...S];V(h.length>0?h:null)},dt=(t,s,a,r=m??-1,f=!1)=>{const S=nt(t,s);if(!S){N(null),T(null),We(null),De(null),f&&xt(null,r,a);return}const A=In(S,ht)[a];if(!A){N(null),T(null),We(null),De(null),f&&xt(null,r,a);return}const W=ho(A.value,l);N(W?.data??null),T(W?.resolveType??null);const{resolveType:C,formValue:O}=Ct(A.rule,l,i??void 0);We(C),De(O),f&&xt(S,r,a)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==Ce&&(ee(y?.seq??null),typeof Nt=="number")){const t=H[Nt],s=He[Nt];if(t&&s)if(P(Nt),Fe(0),L([]),F(a=>a+1),s.isMultivariate)dt(t,s,0,Nt);else{const a=bt(t,s,l);a?(N(a.data),T(a.resolveType)):(N(null),T(null)),We(null),De(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p??void 0,siteSlug:Le},rn=Z&&i?qt(Z,i):null,Ye=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Mt(l,E,t,$e,Ge);Ne.mutate({blockKey:E,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{P(null),N(null),T(null),Fe(0),De(null),We(null),L([]),F(t=>t+1)},Us=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Ze.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current,C=r[s];if(!C)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const z=No(C,O);if(!z)return;Ne.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...S[h]},Re=[...r];if(O.isMultivariate){const z=nt(C,O);if(!z||!h)return;const G=Ao(z,a,t);Re[s]=yt(C,O,G)}else if(O.isHidden){const z=rs(C.__resolveType),G=z?{...C.section}:{...C},Be=Array.isArray(G.variants)?[...G.variants]:[];Be[0]&&(Be[0]={...Be[0],value:t}),G.variants=Be,z?Re[s]={...C,section:G}:Re[s]=G}else O.isLazy?Re[s]={...C,section:t}:Re[s]=t;if(A.length>1){const z=$.sections,G=[...z?.variants??[]];G[W]&&(G[W]={...G[W],value:Re}),$.sections={...z,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},gn)},Gs=t=>{P(t),Fe(0),L([]),F(f=>f+1);const s=H[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=bt(s,a,l);if(!r){N(null),T(null),We(null),De(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),De(null),xt(null,t,0)},Rn=t=>{const s=t;N(s),m!==null&&Us(s,m)},ln=t=>{if(!E||!l||!i||!Qe)return;const s={kind:"page",pageKey:E,pageName:String(Qe.name??""),path:String(Qe.path??"")},a=Bn(l,s,i);a&&Zt.save(E,()=>{const r=Vs.getQueryData(Ca.decofile(Ds))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?oi(s,a,f,t.inner):f})},qs=(t,s)=>{E&&(tn.current[t]=s,ln())},Ws=(t,s)=>{if(!E)return;const a=Lt([...H],t,s);m!==null&&(m===t?P(s):t<m&&s>=m?P(m-1):t>m&&s<=m&&P(m+1)),Ye(a)},Qs=t=>{if(!E)return;const s=H.filter((a,r)=>r!==t);m===t?_t():m!==null&&m>t&&P(m-1),Ye(s)},Ys=t=>{if(!E)return;const s=H[t];if(!s)return;const a=[...H];a.splice(t+1,0,To(s)),m!==null&&m>t&&P(m+1),Ye(a)},Js=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a)return;const r=a.isHidden?wo(s):ko(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Ye(f)},Xs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=Ro(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Ye(f)},Zs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=bt(s,a,l);if(!r?.data)return;const{name:f,...S}=r.data,h=[...H];a.isLazy?h[t]={...s,section:S}:h[t]=S,m===t&&_t(),Ye(h)},ea=t=>{if(!E)return;const s=[...H,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{se(!1),P(a),Fe(0),L([]),F(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const S=bt(r,f,l);if(!S){N(null),T(null),We(null),De(null);return}N(S.data),T(S.resolveType),We(null),De(null)}})},wn=t=>{le.current=t.append,se(!0)},ta=t=>{const s=le.current;if(!s){ea(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},na=t=>{if(m===null)return;const s=H[m],a=He[m];!s||!a?.isMultivariate||(Fe(t),L([]),F(r=>r+1),dt(s,a,t,m,!0))},sa=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=_o(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...H];S[m]=yt(s,a,f);const h=f.variants;let A=Ve;t===Ve?A=Math.min(t,h.length-1):t<Ve&&(A=Ve-1),Fe(A),L([]),F(W=>W+1),dt(S[m],a,A),Ye(S)},aa=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=jo(r,t),S=[...H];S[m]=yt(s,a,f);const h=t+1;Fe(h),L([]),F(A=>A+1),dt(S[m],a,h),Ye(S)},oa=(t,s)=>{if(m===null||!E||t===s)return;const a=H[m],r=He[m];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const S=yo(f,t,s),h=[...H];h[m]=yt(a,r,S);let A=Ve;Ve===t?A=s:t<Ve&&s>=Ve?A=Ve-1:t>Ve&&s<=Ve&&(A=Ve+1),Fe(A),dt(h[m],r,A),Ye(h)},cn=t=>{const s=t??m;if(s===null||!E)return;const a=H[s],r=He[s];if(!a||!r)return;const f=vo(a,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...H];S[s]=f.section;const h=Wt(S,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}P(s),Fe(f.newVariantIndex),L([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Ye(S)},ia=()=>{if(m===null||!E)return;const t=H[m],s=He[m];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=xo(t,s,a);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...H];f[m]=r;const S=Wt(f,l)[m];if(!S)return;Fe(0),We(null),De(null),L([]),F(A=>A+1);const h=bt(r,S,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Ye(f)},ra=async t=>{if(te===null||!E)return;const s=pn(t,l);if(s){q.error(s);return}const a=H[te],r=He[te];if(!a||!r)return;const f=bt(a,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:S});const h=[...H];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Mt(l,E,h,$e,Ge)}),m===te&&_t(),Oe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&m===null&&ie===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);ye(t),J(s)}const zt=i?ro(i):[],Tn=i&&l?lo(i,l):[],la=!Ae&&!!(Y&&i&&l),ca=ie&&i?qt(ie,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},At=async(t,s)=>{if(!(Do(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Vn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f={...a[s]},S={...f.sections},h=[...S.variants??[]],A=h[r],W=A?.rule;if(Et(W,a,i)){const C=W?.__resolveType??"",O=a[C],$=typeof O?.name=="string"?O.name:C,{__resolveType:Re,...z}=t;Ne.mutate({blockKey:C,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...S,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},gn)},ua=t=>{ye(t);const s=t?zn(t,i):{__resolveType:Hn};J(t?s:{}),Vn(s)},da=t=>{const s=t;J(s);const a=ie?{__resolveType:ie,...s}:{...s};Vn(a)},ma=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f=a[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[r];if(!W)return;const C=Pt(W.rule,a,i),O=Yt(t);A[r]={...W,rule:O};const $={...a,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:z}=Ct(O,$,i??void 0);ye(Re),J(z);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),C&&C!==t&&await At(C,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,S,i)){const be=z?.__resolveType??"",Je=S[be],rt=typeof Je?.name=="string"?Je.name:be,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:be,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=$n($,a,t),Be=[...r];Be[s]=yt(C,O,G);const et=Mt(S,h,Be,W,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:be=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:be.message}))})},gn))},fa=t=>{We(t);const s=t?zn(t,i):{__resolveType:Hn};De(t?s:{}),Dn(s)},pa=t=>{const s=t;De(s);const a=Xe?{__resolveType:Xe,...s}:{...s};Dn(a)},ga=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(s===null||!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],z=Pt(Re[a]?.rule,S,i),G=Yt(t),Be=$n($,a,G),et=[...r];et[s]=yt(C,O,Be);const be=Mt(S,h,et,W,A),Je={...S,[h]:be},{resolveType:rt,formValue:pt}=Ct(G,Je,i??void 0);We(rt),De(pt);try{await Ne.mutateAsync({blockKey:h,data:be}),z&&z!==t&&await At(z,Je),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,Nn=m!==null?H[m]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,St=An?In(An,ht):[],un=Math.min(Ve,Math.max(St.length-1,0)),Ht=St[un]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&we)),ha=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||ha,va=Ae?xn:mt?.label??"",Sa=Xe&&i?qt(Xe,i):null,dn=Ut&&(!Ae||re.length>0)?Ae?[xn,...re]:[Qe.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],ba=I&&Qe?[Qe.name,"SEO",...Te]:[],Gt=I?ba:it?dn.length>0?dn:[va]:dn,ya=!I&&!Ae&&ft&&re.length===0,Pn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=So(t.sections,H);if(!s)return;const a=bo(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(a),P(null),N(null),T(null),L([]),J(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,a)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const A=Co(S,h),W={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:W[E]},{onSuccess:()=>{s?.(),a&&At(a,W)},onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},xa=t=>{xe(null),B(t),P(null),N(null),T(null),L([]);const s=Ge[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);ye(a),J(r),En(Ge.map(f=>({rule:f.rule})),t)},_a=(t,s)=>{if(t===s)return;let a=$e;$e===t?a=s:t<$e&&s>=$e?a=$e-1:t>$e&&s<=$e&&(a=$e+1),B(a);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);En(r,a),mn(f=>Lt(f,t,s))},ja=t=>{const s=Ge[t]?.rule,a=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<$e?B($e-1):t===$e&&B(Math.max(0,t-1)),P(null),N(null),T(null),L([]),J(null),ye(null)},a)},Ea=t=>{mn(s=>Po(s,t),()=>{B(t+1),P(null),N(null),T(null),L([]),J(null),ye(null)})},Ra=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Ze.current.activePageKey,r=Ze.current.decofile;if(!a)return;const f=r[a],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[t];if(!W?.rule||typeof W.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=W.rule,O=s.trim();It(!0);try{if(!O){if(!Et(C,r,i)){xe(null);return}const et=C.__resolveType??"";A[t]={...W,rule:Un(C,r,i)};const be={...r,[a]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:a,data:be[a]}),await At(et,be),xe(null),g?.();return}const $=Gn(C,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=fn(O),z=pn(Re,r);if(z){q.error(z);return}const G=Rt($.resolveType,$.data,O);let Be=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Be=Re,A[t]={...W,rule:Yt(Re)},await Ne.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:A}}}),Be=null}catch(et){throw Be&&await en.mutateAsync({blockKey:Be}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},wa=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(a===null||!h)return;const C=r[a],O=f[a];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=z.rule,Be=s.trim();It(!0);const et=async be=>{const Je={...$,variants:be},rt=[...r];rt[a]=yt(C,O,Je);const pt=Mt(S,h,rt,W,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Be){if(!Et(G,S,i)){me(null);return}const gt=G.__resolveType??"",Kn=[...Re];Kn[t]={...z,rule:Un(G,S,i)};const Na=await et(Kn);await At(gt,Na),me(null),g?.();return}const be=Gn(G,S,i);if(!be){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(be.blockKey){await Ne.mutateAsync({blockKey:be.blockKey,data:Rt(be.resolveType,be.data,Be)}),me(null),g?.();return}const Je=fn(Be),rt=pn(Je,S);if(rt){q.error(rt);return}const pt=Rt(be.resolveType,be.data,Be);let lt=null;try{await Ne.mutateAsync({blockKey:Je,data:pt}),lt=Je;const gt=[...Re];gt[t]={...z,rule:Yt(Je)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Be})),g?.()}catch(be){q.error(be instanceof Error?be.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},ka=t=>{X(t),ln({inner:t})},Ta=t=>{ve(t),ln({raw:t})},Va=()=>{X(null),_([])},Da=()=>ae(t=>t+1),Ln=t=>{if(I){if(t===0){Zt.flush(),Ee(!1),X(null),ve(void 0),_([]),ae(a=>a+1),K?.();return}if(t===1){_([]),ae(a=>a+1);return}_(Te.slice(0,t-1)),ae(a=>a+1);return}if(Ae){L(re.slice(0,t)),F(a=>a+1);return}if(t===0){Mn();return}if(t===1){L([]),F(a=>a+1);return}if(ft&&t===2){L([]),F(a=>a+1);return}const s=ft?2:1;L(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"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:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Mo(Gt.length,{isMultivariateSectionTop:ya})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Io,{className:"size-4"})}),!Ae&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("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",co),children:[n.jsx(ks,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=uo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx($o,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ho,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(On,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("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(mo,{pageKey:E,initialName:Qe.name,initialPath:Qe.path,onFieldChange:qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Oo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M():je(!0),children:n.jsx(Fo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(On,{onClick:Pn})]})}),I?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&E?n.jsx(ai,{rawSeo:an,innerSeo:_n,defaultResolveType:Fs,seoSchema:$s,activeResolveType:on,seoTypeOptions:Os,formResetKey:Se,siteDefaultSeo:zs,onBreadcrumbChange:_,onPersistRaw:Ta,onInnerChange:ka,onClearForm:Va,onBumpFormKey:Da}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Jt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(fo,{listKey:`${E??""}:${m??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:na,onRename:me,onDuplicate:aa,onDelete:sa,onRemoveAll:ia,onReorder:oa,onAdd:()=>cn()}),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:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:Xe??"",currentLabel:Qt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:fa,onSelectGlobal:ga,schema:Sa,formValue:ct,onChange:pa,formKey:`${m??"none"}:${un}:${Xe??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})]},"editor-section-form"):Ae?n.jsx(Jt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&E&&n.jsx(Li,{listKey:E,variants:Ge,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:xa,onReorder:_a,onRename:xe,onDuplicate:Ea,onDelete:ja,onAdd:Pn}),Ft&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(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":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(zo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Lo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Dt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:ie,currentLabel:Qt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ua,onSelectGlobal:ma,schema:ca,formValue:de,onChange:da,formKey:`${$e}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(ki,{listKey:`${E??""}-${$e}`,rawSections:H,sections:He,meta:i,selectedIndex:m,onSelect:Gs,onReorder:Ws,onDelete:Qs,onDuplicate:Ys,onMakeReusable:Oe,onToggleHidden:Js,onToggleLazy:Xs,onAddVariant:cn,onDetach:Zs,onAddSection:()=>se(!0),canAddSection:la})})]},"editor-section-list"),n.jsx(po,{open:te!==null,onOpenChange:t=>{t||Oe(null)},defaultBlockId:te!==null?fn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ra}),Y&&n.jsx(li,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:Y,onSelect:ta}),Me&&E&&l&&n.jsx(go,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Pe!==null&&n.jsx(Qn,{open:!0,initialName:Et(Ge[Pe]?.rule,l??{},i??void 0)?Qt(Ge[Pe]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(Ge[Pe]?.rule,l??{},i??void 0)),isPending:Dt,onSubmit:async t=>{await Ra(Pe,t)},onOpenChange:t=>{!t&&!Dt&&xe(null)}}),ne!==null&&n.jsx(Qn,{open:!0,initialName:Et(St[ne]?.rule,l??{},i??void 0)?Qt(St[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(St[ne]?.rule,l??{},i??void 0)),isPending:Dt,onSubmit:async t=>{await wa(ne,t)},onOpenChange:t=>{!t&&!Dt&&me(null)}})]})}export{Ic as SectionsEditor};
|
|
1
|
+
import{c as st,b as Dt,r as w,n as Ue,j as n,aH as Zn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Aa,t as q,K as Ca}from"./index-Dg_D1q-d.js";import{b as Pa}from"./chat-context-CAsN7haM.js";import{a8 as ts,a9 as Ma,aa as La,ab as Ka,ac as Ba,O as ns,P as Xt,ad as ss,ae as as,Q as os,U as is,af as rs,ag as Ia,$ as ls,a0 as cs,ah as Oa,ai as Fa,aj as us,G as $a,V as ds,W as Lt,Z as ms,_ as fs,X as ps,a5 as gs,ak as za,al as Kt,am as hs,an as Ha,ao as Ua,ap as Ga,aq as qa,ar as Wa,e as Qa,g as Ya,as as Ja,at as Xa,au as Za,av as eo,aw as Bn,ax as to,ay as no,az as so,a3 as qt,aA as ao,aB as oo,aC as Wt,aD as io,aE as bt,aF as Ct,aG as ro,aH as lo,aI as nt,aJ as In,aK as co,h as uo,aL as On,aM as mo,aN as fo,aO as Pt,aP as Qt,aQ as Fn,aR as po,aS as fn,aT as go,aU as ht,aV as Et,aW as ho,aX as vo,aY as So,aZ as bo,a_ as yo,a$ as yt,b0 as xo,b1 as _o,b2 as jo,j as Eo,b3 as $n,b4 as Mt,b5 as zn,b6 as Hn,b7 as Ro,b8 as wo,b9 as ko,ba as To,bb as pn,bc as Un,bd as Gn,be as Rt,bf as Yt,bg as qn,bh as Do,bi as gn,bj as Vo,bk as No,bl as Ao,bm as Co,bn as Po,bo as Mo}from"./index-DQi5Cm5z.js";import{t as Lo}from"./ChevronDown-CnPHyH5A.js";import{ad as vn,u as Ko,Q as vs,z as Bo,r as Io,ak as Oo,o as Fo}from"./agent-icon-ChVISiUs.js";import{i as $o}from"./ChevronRight-DdS63gkb.js";import{n as zo}from"./ChevronUp-ylRdQRex.js";import{i as Ho}from"./Globe01-Dha0bbDh.js";import{S as Jt}from"./scroll-area-BvnHZd_6.js";import{d as Uo,h as Go,c as qo,e as Wo,b as Qo,D as Yo}from"./dialog-BBUJZcpD.js";import{I as Jo}from"./input-DpPa_42i.js";import{a as Ss}from"./Copy01-DDc5DYlU.js";import{i as Xo}from"./Settings02-BBs-XBr4.js";import{s as Zo}from"./Eye-DXxdN1gq.js";import{s as ei}from"./TrendUp01-gVityjDF.js";import{s as Sn}from"./Plus-CChyZYWb.js";import{s as bs}from"./Trash01-CRm0bRR3.js";import{i as ti}from"./Zap-Brll3GtA.js";import{D as ys,a as vt,c as xs,b as _s,i as ni}from"./dropdown-menu-Fmf4NmkL.js";import{a as si,P as ai,b as oi}from"./page-seo-form-CBDVI6Sy.js";import{a as ii}from"./Tool01-CWUzFy5X.js";import{u as ri,A as li}from"./use-section-preview-base-DhS-dmV_.js";import"./use-panel-navigate-CeNfN5zO.js";import"./use-destination-route-TwScqij0.js";import"./thread-route-B4oWVYoI.js";import"./Check-CKt7kGsd.js";import"./Download01-CKf-gKDD.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-Do0onfCH.js";import"./use-mcp-client-EO5iWiVs.js";import"./auth-BGkoJ1cG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C93pdOD1.js";import"./task-board-wCy7jspP.js";import"./schema-yAsjbXXp.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CxvwShU4.js";import"./use-ai-providers-CM54Q0OX.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DF_rDZmO.js";import"./use-organization-settings-DRNltYjf.js";import"./ArrowUp-D629Mb3w.js";import"./automation-runs-CCyhCizU.js";import"./useInfiniteQuery-DFMRU76h.js";import"./use-infinite-scroll-C3BgauEG.js";import"./use-connection-G7c7s6Q6.js";import"./table-BNqY6P4c.js";import"./empty-state-CeJslyet.js";import"./use-members-BYGwa9Z7.js";import"./use-org-auth-client-ZxQTDAGn.js";import"./AlertCircle-CvNkLcsO.js";import"./CheckCircle-mv7-ypug.js";import"./DotsVertical-Bi8zkQ90.js";import"./XCircle-fgqsbzhf.js";import"./use-automations-CPxuY6-O.js";import"./useSuspenseInfiniteQuery-DcraGyx6.js";import"./avatar-Dz9Cdkfa.js";import"./User01-rxqPQIKe.js";import"./Tool02-qjcc9miB.js";import"./Stars01-BrYl4UPC.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DB-byMLt.js";import"./markdown-DiIariuP.js";import"./ZoomOut-Dez1Ra4B.js";import"./monaco-editor-71ToWHer.js";import"./spinner-D9tRFss2.js";import"./editor-BfKSMUcF.js";import"./types-M9rjJ4so.js";import"./XClose-DE1anhKv.js";import"./Share07-C2wZgYsU.js";import"./SearchMd-C15U6rGb.js";import"./shell-layout-ChmjyFL-.js";import"./Users03-Cg3iPl3n.js";import"./SearchLg-B7BqY8rM.js";import"./Stars02-Bjd10p5h.js";import"./FilterLines-dSEFajEE.js";import"./Monitor01-L0tZYSKQ.js";import"./required-auth-layout-DXyOZrhi.js";import"./use-org-sso-EQbKGGm_.js";import"./Image01-slXRU7Zv.js";import"./LinkExternal01-Cu8q8TyX.js";import"./integration-icon-CWNKMETE.js";import"./Palette-DY0XYqhu.js";import"./use-navigate-to-agent-UrsMPHtA.js";import"./chart-DLwNihK6.js";import"./index-Diw377tl.js";import"./AreaChart-CSSrVbcX.js";import"./form-Pq5VEUJX.js";import"./label-BL_7ZfUT.js";import"./file-type-icon-gS1uLZ7y.js";import"./drawer-ROsGZL8h.js";import"./collection-search-BYssgoWM.js";import"./Upload01-dRwHInn7.js";import"./select-DNzQTE9-.js";import"./UserSquare-6jbHCY0r.js";import"./ArrowLeft-Ln0LNrXp.js";import"./tabs-DPRnGGBh.js";import"./toggle-group-BNyMaUAI.js";import"./super-agent-icon-VLWg2gcg.js";import"./self-tool-result-Biy61Uc5.js";import"./alert-dialog-DAcPFaME.js";import"./extract-connection-data-BV9lY0YE.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DopC2TwH.js";import"./authenticate-and-persist-oauth-BkZkHJZD.js";import"./mcp-oauth-ifEh5lsV.js";import"./track-lHZWKOcc.js";import"./popover-CWhQzDoV.js";import"./toolbar-DDVFxk0t.js";import"./github-repo-picker-BJ1F-akh.js";import"./LockUnlocked01-R9XHKzKD.js";import"./use-mcp-tools-K3GZYNAp.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-DTi-12VQ.js";import"./use-registry-connections-h293jGTM.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-R3gwzWuz.js";import"./connection-form-helpers-d8MRf_ol.js";import"./collection-tabs-DE_Himgg.js";import"./badge-CLPA3ucP.js";import"./select-model-uxVcrYeA.js";import"./checkbox-U8zBPmpm.js";import"./ChevronSelectorVertical-D8umbTYG.js";import"./Key01-BaUPD50J.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-CKBCnr8T.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DRtkfkey.js";import"./ZapSquare-DTXwxwOz.js";import"./skill-preview-COx4IWY-.js";import"./GitBranch01-C1Lu83ty.js";import"./Package-DviXgiuM.js";import"./use-file-configs-BZkqroRL.js";import"./pt-BR-CLy76QW2.js";import"./Play-BjOu0Brf.js";import"./use-debounced-autosave-DvymupLc.js";import"./search-input-bYvwKxnA.js";import"./use-mcp-auth-status-hGYxLW55.js";import"./switch-Vpgt8Dtr.js";import"./Users01-B8VhqH7r.js";import"./use-secrets-DLBve_-_.js";import"./config-DzpAHZgc.js";import"./Shield01-DB8jblJb.js";import"./command-vRQZOs-8.js";import"./index-BC5LO8yG.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-2GV4TpKd.js";import"./SwitchHorizontal01-DKHrNHvQ.js";import"./use-tags-D04LvBWo.js";import"./automation-list-row-B6fgeAly.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-C3wPoLn0.js";import"./cards-CZP2Hek5.js";import"./CreditCard01-jp5QVACe.js";import"./Globe04-CFA4wFJC.js";import"./HardDrive-D0FT4JHF.js";import"./LogOut01-G5_xLIhM.js";import"./Sun-DURbhC_d.js";function ci(d){return d.schema?.definitions??d.schema?.$defs??{}}function js(d,e){const o=ci(e),u=o[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=o[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function ui(d,e){for(const o of js(d,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function di(d,e){if(!e)return;const o=ts(d);if(!o)return;const u=ui(o.resolveType,e);if(!u)return;const p=Ma(u,o.data);if(p)return La(p)}const mi={escape:Ba};function fi(d,e){for(const o of js(d,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function pi(d,e){if(!e)return;const o=ts(d);if(o)try{const u=fi(o.resolveType,e);return u&&Ka.render(u,o.data,{},mi).trim()||void 0}catch{return}}const gi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",hi="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 Wn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Es(d){return d.map((e,o)=>({...e,index:o}))}function vi(d,e){if(e===d.length)return d;if(e<d.length)return Es(d.slice(0,e));const o=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...o]}function Rs(d){const e=st.c(25),{section:o,raw:u,meta:p}=d,x=o.isSavedBlock===!0,j=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?di(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?pi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Ko,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let D;e[11]!==j||e[12]!==x?(D=x?{color:$a}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=D):D=e[13];let c;e[14]!==D?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:D}),e[14]=D,e[15]=c):c=e[15];const b=o.isHidden&&"line-through opacity-50";let R;e[16]!==b?(R=Ue("min-w-0 flex-1 truncate text-sm font-medium",b),e[16]=b,e[17]=R):R=e[17];const l=k??o.label;let V;e[18]!==R||e[19]!==l?(V=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=V):V=e[20];let i;return e[21]!==V||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,V]}),e[21]=V,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const Si="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",bi="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",yi="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?Si:d?yi:bi)}function ws(d,e){const o=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?gi:u?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function xi(d){const e=st.c(82),{section:o,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:K,onToggleLazy:M,onAddVariant:D,onDetach:c}=d,b=Dt(),R=u?rs(u.__resolveType??""):!1,l=o.isHidden===!0,V=R||l;let i;e[0]!==o?(i=Ia(o),e[0]=o,e[1]=i):i=e[1];const Q=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:wi},e[2]=x,e[3]=U):U=e[3];const{attributes:Le,listeners:Y,setNodeRef:m,transform:P,isDragging:we}=ls(U);let N;e[4]!==P?(N=cs.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=N):N=e[5];const Z=we?0:void 0;let T;e[6]!==N||e[7]!==Z?(T={transform:N,opacity:Z},e[6]=N,e[7]=Z,e[8]=T):T=e[8];const oe=T;let B;e[9]!==o?(B=Oa(o),e[9]=o,e[10]=B):B=e[10];const Ce=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let J;e[13]!==o||e[14]!==j||e[15]!==de?(J=Ue("touch-none transition-colors",de,ws(o,j)),e[13]=o,e[14]=j,e[15]=de,e[16]=J):J=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==o?(ie=n.jsx(Rs,{section:o,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=o,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==b?(ye=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=b,e[23]=ye):ye=e[23];let re;e[24]!==K?(re=_=>{_.stopPropagation(),K()},e[24]=K,e[25]=re):re=e[25];let L;e[26]!==l?(L=l?n.jsx(Xo,{className:"h-3.5 w-3.5"}):n.jsx(Zo,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=L):L=e[27];let qe;e[28]!==l||e[29]!==b?(qe=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=b,e[30]=qe):qe=e[30];let Ke;e[31]!==qe?(Ke=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Ke):Ke=e[32];const Ie=xs,ke=ys,F=!0,te=tt,Oe="button",Pe="ghost",xe="icon";let ne;e[33]!==b?(ne=b("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=b,e[34]=ne):ne=e[34];const me=Ue(hn(V,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Oe,variant:Pe,size:xe,"aria-label":ne,className:me,onClick:ji,onPointerDown:_i,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(Ss,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==b?(je=b("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=b,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==Q||e[52]!==D||e[53]!==b?(I=Q&&n.jsxs(vt,{className:Fa,onClick:_=>{_.stopPropagation(),D()},children:[n.jsx(ei,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=Q,e[52]=D,e[53]=b,e[54]=I):I=e[54];let Ee;e[55]!==Ce||e[56]!==k||e[57]!==b?(Ee=Ce&&n.jsxs(vt,{className:hi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Ce,e[56]=k,e[57]=b,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==o.isMultivariate||e[61]!==o.isSavedBlock||e[62]!==b?(ge=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=o.isMultivariate,e[61]=o.isSavedBlock,e[62]=b,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(bs,{className:"h-4 w-4"}),e[66]=he):he=e[66];let X;e[67]!==b?(X=b("sectionsEditor.sectionList.deleteMenuItem"),e[67]=b,e[68]=X):X=e[68];let ue;e[69]!==ce||e[70]!==X?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,X]}),e[69]=ce,e[70]=X,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(_s,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Ie||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Ie,{children:[pe,ve]}),e[78]=Ie,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:oe,...Le,...Y,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:J,children:[ie,!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":b(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(V,R)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ri,children:n.jsx(ti,{className:Ue("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:b(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(hn(V,l)),onClick:re,onPointerDown:Ei,children:L})}),Ke]}),Te]})}function _i(d){return d.stopPropagation()}function ji(d){return d.stopPropagation()}function Ei(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function wi(){return!1}function ki(d){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:K,onToggleHidden:M,onToggleLazy:D,onAddVariant:c,onDetach:b,onAddSection:R,canAddSection:l}=d,V=l===void 0?!0:l,i=Dt();let Q;e[0]!==p.length?(Q=()=>Wn(p.length),e[0]=p.length,e[1]=Q):Q=e[1];const[U,Le]=w.useState(Q),[Y,m]=w.useState(null),[P,we]=w.useState(o),[N,Z]=w.useState(p.length),T=w.useRef(!1);P!==o?(we(o),Z(p.length),Le(Wn(p.length))):N!==p.length&&(Z(p.length),Le(Te=>vi(Te,p.length)));let oe;e[2]===Symbol.for("react.memo_cache_sentinel")?(oe={activationConstraint:{distance:8}},e[2]=oe):oe=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ds},e[3]=B):B=e[3];const Ce=ns(Xt(is,oe),Xt(os,B));let ee;e[4]!==U?(ee=U.map(Ti),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let J;e[6]===Symbol.for("react.memo_cache_sentinel")?(J=Te=>{m(String(Te.active.id))},e[6]=J):J=e[6];const ie=J;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:Se}=Te;if(!Se||_.id===Se.id)return;const ae=de.indexOf(String(_.id)),De=de.indexOf(String(Se.id));ae===-1||De===-1||(Le(Fe=>Es(Lt([...Fe],ae,De))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(ae,De))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{m(null)},e[10]=L):L=e[10];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==Y||e[12]!==V||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==b||e[21]!==k||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==D||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Ce||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==Y||e[47]!==V||e[48]!==U||e[49]!==R||e[50]!==u||e[51]!==p||e[52]!==i){const _=Y?U.find(Se=>Se.id===Y):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let Se;e[56]!==i?(Se=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=Se):Se=e[57];let ae;e[58]!==Se?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Se}),e[58]=Se,e[59]=ae):ae=e[59];const De=!V;let Fe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsx(Sn,{size:14}),e[60]=Fe):Fe=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let Ve;e[63]!==R||e[64]!==De||e[65]!==ct?(Ve=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:De,onClick:R,children:[Fe,ct]}),e[63]=R,e[64]=De,e[65]=ct,e[66]=Ve):Ve=e[66];let Xe;e[67]!==ae||e[68]!==Ve?(Xe=n.jsxs("div",{className:"space-y-2",children:[ae,Ve]}),e[67]=ae,e[68]=Ve,e[69]=Xe):Xe=e[69],se=Xe;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=Y,e[47]=V,e[48]=U,e[49]=R,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Ie=ms,xe=Ce,ne=fs,me=ie,_e=re,fe=qe,Ke=ps,Oe=de,Pe=gs,Me="space-y-1",te=U.map(_=>{const Se=p[_.index];return Se?n.jsx(xi,{sortableId:_.id,section:Se,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>K(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>D(_.index),onAddVariant:()=>c(_.index),onDetach:()=>b(_.index)},_.id):null})}e[11]=Y,e[12]=V,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=R,e[18]=c,e[19]=g,e[20]=b,e[21]=k,e[22]=K,e[23]=v,e[24]=M,e[25]=D,e[26]=u,e[27]=p,e[28]=j,e[29]=Ce,e[30]=i,e[31]=Ke,e[32]=Ie,e[33]=ke,e[34]=F,e[35]=te,e[36]=Oe,e[37]=Pe,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Ke=e[31],Ie=e[32],ke=e[33],F=e[34],te=e[35],Oe=e[36],Pe=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Ke||e[74]!==Oe||e[75]!==Pe||e[76]!==je?(le=n.jsx(Ke,{items:Oe,strategy:Pe,children:je}),e[73]=Ke,e[74]=Oe,e[75]=Pe,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ws(F,!1)),children:n.jsx(Rs,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Ie||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Ie,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Ie,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!V;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(Sn,{size:14}),e[93]=he):he=e[93];let X;e[94]!==i?(X=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=X):X=e[95];let ue;e[96]!==R||e[97]!==ce||e[98]!==X?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:R,children:[he,X]}),e[96]=R,e[97]=ce,e[98]=X,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function Ti(d){return d.id}function Qn(d){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Dt(),[k,K]=w.useState(u),[M,D]=w.useState(o);o!==M&&(D(o),o&&K(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const b=c;let R;e[3]!==y||e[4]!==k||e[5]!==j?(R=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=R):R=e[6];const l=R;let V;e[7]!==g?(V=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=V):V=e[8];let i;e[9]!==V?(i=n.jsx(Uo,{children:V}),e[9]=V,e[10]=i):i=e[10];let Q;e[11]!==p||e[12]!==g?(Q=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=Q):Q=e[13];let U;e[14]!==Q?(U=n.jsx(Go,{children:Q}),e[14]=Q,e[15]=U):U=e[15];let Le;e[16]!==i||e[17]!==U?(Le=n.jsxs(qo,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Le):Le=e[18];let Y;e[19]!==g?(Y=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=Y):Y=e[20];let m;e[21]!==Y?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:Y}),e[21]=Y,e[22]=m):m=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=ie=>K(ie.target.value),e[23]=P):P=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Jo,{id:"variant-rename-name",value:k,onChange:P,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let oe;e[35]!==y||e[36]!==Z||e[37]!==T?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:Z,disabled:y,children:T}),e[35]=y,e[36]=Z,e[37]=T,e[38]=oe):oe=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Ce;e[42]!==y||e[43]!==B?(Ce=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Ce):Ce=e[44];let ee;e[45]!==oe||e[46]!==Ce?(ee=n.jsxs(Wo,{children:[oe,Ce]}),e[45]=oe,e[46]=Ce,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Le?(de=n.jsx(Qo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Le,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Le,e[52]=de):de=e[52];let J;return e[53]!==b||e[54]!==o||e[55]!==de?(J=n.jsx(Yo,{open:o,onOpenChange:b,children:de}),e[53]=b,e[54]=o,e[55]=de,e[56]=J):J=e[56],J}function ks(d){const e=st.c(5),{rule:o,matchers:u}=d,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??za(p);x=Bo(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Yn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function Jn(d){return d.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Di(d,e){const o=new Map;for(const u of d){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Vi(d){return d.map((e,o)=>({...e,index:o}))}function Ts(d){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Dt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(ks,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let D;e[5]!==x||e[6]!==j||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(D=!j&&n.jsxs(xs,{children:[n.jsx(ys,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ai,onPointerDown:Ni,children:n.jsx(vs,{size:14})})}),n.jsxs(_s,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:b=>{b.stopPropagation(),v?.()},children:[n.jsx(ii,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:b=>{b.stopPropagation(),y?.()},children:[n.jsx(Ss,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ni,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:b=>{b.stopPropagation(),g?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=D):D=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==D?(c=n.jsxs(n.Fragment,{children:[K,M,D]}),e[13]=K,e[14]=M,e[15]=D,e[16]=c):c=e[16],c}function Ni(d){return d.stopPropagation()}function Ai(d){return d.stopPropagation()}function Ci(d){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:K}=d;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Pi},e[0]=o.id,e[1]=M):M=e[1];const{attributes:D,listeners:c,setNodeRef:b,transform:R,isDragging:l}=ls(M);let V;e[2]!==R?(V=cs.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=V):V=e[3];const i=l?0:void 0;let Q;e[4]!==V||e[5]!==i?(Q={transform:V,opacity:i},e[4]=V,e[5]=i,e[6]=Q):Q=e[6];const U=Q,Le=j??void 0;let Y;e[7]!==x||e[8]!==o.variant.rule||e[9]!==Le?(Y=Kt(o.variant.rule,x,Le),e[7]=x,e[8]=o.variant.rule,e[9]=Le,e[10]=Y):Y=e[10];const m=Y;let P;e[11]!==y?(P=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=P):P=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?hs:us;let Z;e[13]!==we||e[14]!==N?(Z=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=Z):Z=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==o.variant.label||e[19]!==v||e[20]!==K||e[21]!==k||e[22]!==g?(T=n.jsx(Ts,{label:o.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:K}),e[16]=p,e[17]=m,e[18]=o.variant.label,e[19]=v,e[20]=K,e[21]=k,e[22]=g,e[23]=T):T=e[23];let oe;return e[24]!==D||e[25]!==c||e[26]!==y||e[27]!==b||e[28]!==U||e[29]!==Z||e[30]!==T||e[31]!==P?(oe=n.jsx("div",{ref:b,style:U,...D,...c,onClick:y,onKeyDown:P,className:Z,children:T}),e[24]=D,e[25]=c,e[26]=y,e[27]=b,e[28]=U,e[29]=Z,e[30]=T,e[31]=P,e[32]=oe):oe=e[32],oe}function Pi(){return!1}function Mi(d){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==o.rule?(v=Kt(o.rule,u,j),e[0]=u,e[1]=j,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==o.label?(k=n.jsx("div",{className:g,children:n.jsx(Ts,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=k):k=e[8],k}function Li(d){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:K,onDelete:M,onAdd:D}=d,c=Dt();let b;e[0]!==u?(b=()=>Jn(u),e[0]=u,e[1]=b):b=e[1];const[R,l]=w.useState(b),[V,i]=w.useState(null),[Q,U]=w.useState(o),[Le,Y]=w.useState(u.length);let m;e[2]!==u?(m=()=>Yn(u),e[2]=u,e[3]=m):m=e[3];const[P,we]=w.useState(m),N=w.useRef(!1),Z=Yn(u);Q!==o?(U(o),Y(u.length),we(Z),l(Jn(u))):(Le!==u.length||P!==Z)&&(Y(u.length),we(Z),l(ge=>Di(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ds},e[5]=oe):oe=e[5];const B=ns(Xt(is,T),Xt(os,oe));let Ce;e[6]!==R?(Ce=R.map(Ki),e[6]=R,e[7]=Ce):Ce=e[7];const ee=Ce,de=u.length>1;let J;e[8]!==R?(J=ge=>{const ce=String(ge.active.id);i(R.find(he=>he.id===ce)??null)},e[8]=R,e[9]=J):J=e[9];const ie=J;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const X=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));X===-1||ue===-1||(l(ve=>Vi(Lt([...ve],X,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(X,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{i(null)},e[13]=L):L=e[13];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==R||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==D||e[24]!==M||e[25]!==K||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=ae=>{N.current||y(ae)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let X;e[47]!==c?(X=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=X):X=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Sn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==D||e[51]!==X?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":X,className:"size-6",onClick:D,children:ue})}),e[50]=D,e[51]=X,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let Se;e[57]!==ve||e[58]!==_?(Se=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=Se):Se=e[59],e[60]!==he||e[61]!==Se?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,Se]}),e[60]=he,e[61]=Se,e[62]=fe):fe=e[62],Ie=ms,Oe=B,Pe=fs,xe=ie,ne=re,me=qe,Ke=ps,F=ee,te=gs,pe="space-y-0.5",ke=R.map(ae=>n.jsx(Ci,{entry:ae,isActive:ae.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(ae.index),onRename:()=>k(ae.index),onDuplicate:()=>K(ae.index),onDelete:()=>M(ae.index)},ae.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=R,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=D,e[24]=M,e[25]=K,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Ke,e[31]=Ie,e[32]=ke,e[33]=F,e[34]=te,e[35]=Oe,e[36]=Pe,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Ke=e[30],Ie=e[31],ke=e[32],F=e[33],te=e[34],Oe=e[35],Pe=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Ke||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Ke,{items:F,strategy:te,children:se}),e[66]=Ke,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==V||e[72]!==x||e[73]!==v||e[74]!==j?(je=V?n.jsx(Mi,{variant:V.variant,decofile:x,meta:j,matchers:v}):null,e[71]=V,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Ie||e[79]!==Oe||e[80]!==Pe||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Ie,{sensors:Oe,collisionDetection:Pe,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Ie,e[79]=Oe,e[80]=Pe,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Ki(d){return d.id}function Xn(d){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:K,formKey:M,formWrapperClassName:D,meta:c,decofile:b,onSaveReferencedBlock:R,sandbox:l}=d;let V;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(V=n.jsx(Ha,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=V):V=e[7];let i;e[8]!==b||e[9]!==M||e[10]!==k||e[11]!==D||e[12]!==c||e[13]!==K||e[14]!==R||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:D,children:n.jsx(Ua,{schema:g,value:k,onChange:K,meta:c,decofile:b,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=b,e[9]=M,e[10]=k,e[11]=D,e[12]=c,e[13]=K,e[14]=R,e[15]=l,e[16]=g,e[17]=i):i=e[17];let Q;return e[18]!==V||e[19]!==i?(Q=n.jsxs(n.Fragment,{children:[V,i]}),e[18]=V,e[19]=i,e[20]=Q):Q=e[20],Q}function Oc({orgSlug:d,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:D}){const c=Dt(),b=Pa()?.taskId??null,R=u?{orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p}:null,{data:l,isLoading:V}=Ga(R),{data:i,isLoading:Q}=qa(R),U=Wa(),Le=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,Y=ri({virtualMcpId:e,sandboxUrl:p}),[m,P]=w.useState(null),[we,N]=w.useState(null),[Z,T]=w.useState(null),[oe,B]=w.useState(0),[Ce,ee]=w.useState(void 0),[de,J]=w.useState(null),[ie,ye]=w.useState(null),[re,L]=w.useState([]),qe=w.useRef(null),[Ke,Ie]=w.useState(re.length);Ke!==re.length&&(Ie(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=w.useState(0),[te,Oe]=w.useState(null),[Pe,xe]=w.useState(null),[ne,me]=w.useState(null),[_e,fe]=w.useState(!0),[pe,se]=w.useState(!1),[Me,je]=w.useState(!1),le=w.useRef(null),[I,Ee]=w.useState(k),[ge,ce]=w.useState(k);k&&!ge&&(ce(!0),Ee(!0),P(null),N(null),T(null),L([])),!k&&ge&&ce(!1);const[he,X]=w.useState(null),[ue,ve]=w.useState(void 0),[Te,_]=w.useState([]),[Se,ae]=w.useState(0),[De,Fe]=w.useState(0),[ct,Ve]=w.useState(null),[Xe,We]=w.useState(null),[bn,yn]=w.useState(null),Ds=Aa(),Vs=`${d}/${e}/${o}`,Zt=Qa({orgSlug:d,virtualMcpId:e,branch:o}),[Ns,As]=w.useState(x),[Cs,Ps]=w.useState(j),[Ms,Ls]=w.useState(v);(Ns!==x||Cs!==j||Ms!==v)&&(queueMicrotask(()=>Zt.flush()),As(x),Ps(j),Ls(v),P(null),N(null),T(null),B(0),J(null),ye(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1),Ee(!1),X(null),ve(void 0),_([]),ae(t=>t+1));const Ne=Ya({orgSlug:d,virtualMcpId:e,branch:o}),Bt=Eo((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Ja({orgSlug:d,virtualMcpId:e,branch:o}),[Vt,It]=w.useState(!1),ze=w.useRef(null),at=w.useRef(null),ot=w.useRef(null),tn=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||V||Q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ks=Xa(l),Ae=!!v,Qe=Ae?null:Za(Ks,x,j),E=Ae?v:Qe?.key??null,nn=Ae&&v?l[v]:void 0,xn=Ae&&v&&nn?eo(v,nn):Ae&&v?v:"",Ot=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Qe?Bn(l,{kind:"page",pageKey:E,pageName:String(Qe.name??""),path:String(Qe.path??"")},i):null,Bs=I?Ot?.seo:void 0,an=ue!==void 0?ue:Bs,Is=I?to(an):void 0,Os=sn?.seoTypeOptions??[],Fs=I&&i?no(i):"",_n=he??Is??{},on=I&&sn?si(_n,sn):null,$s=I&&on&&so(an)?qt(on,i):null,zs=I?ao(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:oo(Ot?.sections,l??{}),Ft=Ge.length>1,$e=Math.min(oe,Ge.length-1),ut=Ge[$e],H=ut?.sections??[],He=Wt(H,l),jn=!Ae&&io(Ot?.sections);if(Ae&&v&&bn!==v){yn(v);const t=H[0],s=He[0];if(t&&s){P(0),Fe(0),L([]);const a=bt(t,s,l);a&&(N(a.data),T(a.resolveType),We(null),Ve(null))}}!Ae&&bn!==null&&yn(null),Ze.current={rawSections:H,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:De,selectedSectionIndex:m};const Hs=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!D)return;if(!E||!jn||t.length<=1){D(null);return}const a=qn(E,{multivariate:!0,index:s,variants:t},l,i);D(a.length>0?a:null)},xt=(t,s,a)=>{if(!D)return;if(!E){D(null);return}const r=Hs(),f=qn(E,r,l,i);if(!t||s<0){D(f.length>0?f:null);return}const S=Do({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...S];D(h.length>0?h:null)},dt=(t,s,a,r=m??-1,f=!1)=>{const S=nt(t,s);if(!S){N(null),T(null),We(null),Ve(null),f&&xt(null,r,a);return}const A=In(S,ht)[a];if(!A){N(null),T(null),We(null),Ve(null),f&&xt(null,r,a);return}const W=ho(A.value,l);N(W?.data??null),T(W?.resolveType??null);const{resolveType:C,formValue:O}=Ct(A.rule,l,i??void 0);We(C),Ve(O),f&&xt(S,r,a)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==Ce&&(ee(y?.seq??null),typeof Nt=="number")){const t=H[Nt],s=He[Nt];if(t&&s)if(P(Nt),Fe(0),L([]),F(a=>a+1),s.isMultivariate)dt(t,s,0,Nt);else{const a=bt(t,s,l);a?(N(a.data),T(a.resolveType)):(N(null),T(null)),We(null),Ve(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p??void 0,siteSlug:Le},rn=Z&&i?qt(Z,i):null,Ye=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Mt(l,E,t,$e,Ge);Ne.mutate({blockKey:E,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{P(null),N(null),T(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1)},Us=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Ze.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current,C=r[s];if(!C)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const z=No(C,O);if(!z)return;Ne.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...S[h]},Re=[...r];if(O.isMultivariate){const z=nt(C,O);if(!z||!h)return;const G=Ao(z,a,t);Re[s]=yt(C,O,G)}else if(O.isHidden){const z=rs(C.__resolveType),G=z?{...C.section}:{...C},Be=Array.isArray(G.variants)?[...G.variants]:[];Be[0]&&(Be[0]={...Be[0],value:t}),G.variants=Be,z?Re[s]={...C,section:G}:Re[s]=G}else O.isLazy?Re[s]={...C,section:t}:Re[s]=t;if(A.length>1){const z=$.sections,G=[...z?.variants??[]];G[W]&&(G[W]={...G[W],value:Re}),$.sections={...z,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},gn)},Gs=t=>{P(t),Fe(0),L([]),F(f=>f+1);const s=H[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=bt(s,a,l);if(!r){N(null),T(null),We(null),Ve(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),Ve(null),xt(null,t,0)},Rn=t=>{const s=t;N(s),m!==null&&Us(s,m)},ln=t=>{if(!E||!l||!i||!Qe)return;const s={kind:"page",pageKey:E,pageName:String(Qe.name??""),path:String(Qe.path??"")},a=Bn(l,s,i);a&&Zt.save(E,()=>{const r=Ds.getQueryData(Ca.decofile(Vs))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?oi(s,a,f,t.inner):f})},qs=(t,s)=>{E&&(tn.current[t]=s,ln())},Ws=(t,s)=>{if(!E)return;const a=Lt([...H],t,s);m!==null&&(m===t?P(s):t<m&&s>=m?P(m-1):t>m&&s<=m&&P(m+1)),Ye(a)},Qs=t=>{if(!E)return;const s=H.filter((a,r)=>r!==t);m===t?_t():m!==null&&m>t&&P(m-1),Ye(s)},Ys=t=>{if(!E)return;const s=H[t];if(!s)return;const a=[...H];a.splice(t+1,0,To(s)),m!==null&&m>t&&P(m+1),Ye(a)},Js=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a)return;const r=a.isHidden?wo(s):ko(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Ye(f)},Xs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=Ro(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Ye(f)},Zs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=bt(s,a,l);if(!r?.data)return;const{name:f,...S}=r.data,h=[...H];a.isLazy?h[t]={...s,section:S}:h[t]=S,m===t&&_t(),Ye(h)},ea=t=>{if(!E)return;const s=[...H,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{se(!1),P(a),Fe(0),L([]),F(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const S=bt(r,f,l);if(!S){N(null),T(null),We(null),Ve(null);return}N(S.data),T(S.resolveType),We(null),Ve(null)}})},wn=t=>{le.current=t.append,se(!0)},ta=t=>{const s=le.current;if(!s){ea(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},na=t=>{if(m===null)return;const s=H[m],a=He[m];!s||!a?.isMultivariate||(Fe(t),L([]),F(r=>r+1),dt(s,a,t,m,!0))},sa=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=_o(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...H];S[m]=yt(s,a,f);const h=f.variants;let A=De;t===De?A=Math.min(t,h.length-1):t<De&&(A=De-1),Fe(A),L([]),F(W=>W+1),dt(S[m],a,A),Ye(S)},aa=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=jo(r,t),S=[...H];S[m]=yt(s,a,f);const h=t+1;Fe(h),L([]),F(A=>A+1),dt(S[m],a,h),Ye(S)},oa=(t,s)=>{if(m===null||!E||t===s)return;const a=H[m],r=He[m];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const S=yo(f,t,s),h=[...H];h[m]=yt(a,r,S);let A=De;De===t?A=s:t<De&&s>=De?A=De-1:t>De&&s<=De&&(A=De+1),Fe(A),dt(h[m],r,A),Ye(h)},cn=t=>{const s=t??m;if(s===null||!E)return;const a=H[s],r=He[s];if(!a||!r)return;const f=vo(a,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...H];S[s]=f.section;const h=Wt(S,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}P(s),Fe(f.newVariantIndex),L([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Ye(S)},ia=()=>{if(m===null||!E)return;const t=H[m],s=He[m];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=xo(t,s,a);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...H];f[m]=r;const S=Wt(f,l)[m];if(!S)return;Fe(0),We(null),Ve(null),L([]),F(A=>A+1);const h=bt(r,S,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Ye(f)},ra=async t=>{if(te===null||!E)return;const s=pn(t,l);if(s){q.error(s);return}const a=H[te],r=He[te];if(!a||!r)return;const f=bt(a,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:S});const h=[...H];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Mt(l,E,h,$e,Ge)}),m===te&&_t(),Oe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&m===null&&ie===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);ye(t),J(s)}const zt=i?ro(i):[],Tn=i&&l?lo(i,l):[],la=!Ae&&!!(Y&&i&&l),ca=ie&&i?qt(ie,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},At=async(t,s)=>{if(!(Vo(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f={...a[s]},S={...f.sections},h=[...S.variants??[]],A=h[r],W=A?.rule;if(Et(W,a,i)){const C=W?.__resolveType??"",O=a[C],$=typeof O?.name=="string"?O.name:C,{__resolveType:Re,...z}=t;Ne.mutate({blockKey:C,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...S,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},gn)},ua=t=>{ye(t);const s=t?zn(t,i):{__resolveType:Hn};J(t?s:{}),Dn(s)},da=t=>{const s=t;J(s);const a=ie?{__resolveType:ie,...s}:{...s};Dn(a)},ma=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f=a[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[r];if(!W)return;const C=Pt(W.rule,a,i),O=Yt(t);A[r]={...W,rule:O};const $={...a,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:z}=Ct(O,$,i??void 0);ye(Re),J(z);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),C&&C!==t&&await At(C,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,S,i)){const be=z?.__resolveType??"",Je=S[be],rt=typeof Je?.name=="string"?Je.name:be,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:be,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=$n($,a,t),Be=[...r];Be[s]=yt(C,O,G);const et=Mt(S,h,Be,W,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:be=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:be.message}))})},gn))},fa=t=>{We(t);const s=t?zn(t,i):{__resolveType:Hn};Ve(t?s:{}),Vn(s)},pa=t=>{const s=t;Ve(s);const a=Xe?{__resolveType:Xe,...s}:{...s};Vn(a)},ga=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(s===null||!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],z=Pt(Re[a]?.rule,S,i),G=Yt(t),Be=$n($,a,G),et=[...r];et[s]=yt(C,O,Be);const be=Mt(S,h,et,W,A),Je={...S,[h]:be},{resolveType:rt,formValue:pt}=Ct(G,Je,i??void 0);We(rt),Ve(pt);try{await Ne.mutateAsync({blockKey:h,data:be}),z&&z!==t&&await At(z,Je),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,Nn=m!==null?H[m]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,St=An?In(An,ht):[],un=Math.min(De,Math.max(St.length-1,0)),Ht=St[un]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&we)),ha=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||ha,va=Ae?xn:mt?.label??"",Sa=Xe&&i?qt(Xe,i):null,dn=Ut&&(!Ae||re.length>0)?Ae?[xn,...re]:[Qe.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],ba=I&&Qe?[Qe.name,"SEO",...Te]:[],Gt=I?ba:it?dn.length>0?dn:[va]:dn,ya=!I&&!Ae&&ft&&re.length===0,Pn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=So(t.sections,H);if(!s)return;const a=bo(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(a),P(null),N(null),T(null),L([]),J(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,a)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const A=Co(S,h),W={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:W[E]},{onSuccess:()=>{s?.(),a&&At(a,W)},onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},xa=t=>{xe(null),B(t),P(null),N(null),T(null),L([]);const s=Ge[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);ye(a),J(r),En(Ge.map(f=>({rule:f.rule})),t)},_a=(t,s)=>{if(t===s)return;let a=$e;$e===t?a=s:t<$e&&s>=$e?a=$e-1:t>$e&&s<=$e&&(a=$e+1),B(a);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);En(r,a),mn(f=>Lt(f,t,s))},ja=t=>{const s=Ge[t]?.rule,a=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<$e?B($e-1):t===$e&&B(Math.max(0,t-1)),P(null),N(null),T(null),L([]),J(null),ye(null)},a)},Ea=t=>{mn(s=>Po(s,t),()=>{B(t+1),P(null),N(null),T(null),L([]),J(null),ye(null)})},Ra=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Ze.current.activePageKey,r=Ze.current.decofile;if(!a)return;const f=r[a],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[t];if(!W?.rule||typeof W.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=W.rule,O=s.trim();It(!0);try{if(!O){if(!Et(C,r,i)){xe(null);return}const et=C.__resolveType??"";A[t]={...W,rule:Un(C,r,i)};const be={...r,[a]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:a,data:be[a]}),await At(et,be),xe(null),g?.();return}const $=Gn(C,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=fn(O),z=pn(Re,r);if(z){q.error(z);return}const G=Rt($.resolveType,$.data,O);let Be=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Be=Re,A[t]={...W,rule:Yt(Re)},await Ne.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:A}}}),Be=null}catch(et){throw Be&&await en.mutateAsync({blockKey:Be}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},wa=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(a===null||!h)return;const C=r[a],O=f[a];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=z.rule,Be=s.trim();It(!0);const et=async be=>{const Je={...$,variants:be},rt=[...r];rt[a]=yt(C,O,Je);const pt=Mt(S,h,rt,W,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Be){if(!Et(G,S,i)){me(null);return}const gt=G.__resolveType??"",Kn=[...Re];Kn[t]={...z,rule:Un(G,S,i)};const Na=await et(Kn);await At(gt,Na),me(null),g?.();return}const be=Gn(G,S,i);if(!be){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(be.blockKey){await Ne.mutateAsync({blockKey:be.blockKey,data:Rt(be.resolveType,be.data,Be)}),me(null),g?.();return}const Je=fn(Be),rt=pn(Je,S);if(rt){q.error(rt);return}const pt=Rt(be.resolveType,be.data,Be);let lt=null;try{await Ne.mutateAsync({blockKey:Je,data:pt}),lt=Je;const gt=[...Re];gt[t]={...z,rule:Yt(Je)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Be})),g?.()}catch(be){q.error(be instanceof Error?be.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},ka=t=>{X(t),ln({inner:t})},Ta=t=>{ve(t),ln({raw:t})},Da=()=>{X(null),_([])},Va=()=>ae(t=>t+1),Ln=t=>{if(I){if(t===0){Zt.flush(),Ee(!1),X(null),ve(void 0),_([]),ae(a=>a+1),K?.();return}if(t===1){_([]),ae(a=>a+1);return}_(Te.slice(0,t-1)),ae(a=>a+1);return}if(Ae){L(re.slice(0,t)),F(a=>a+1);return}if(t===0){Mn();return}if(t===1){L([]),F(a=>a+1);return}if(ft&&t===2){L([]),F(a=>a+1);return}const s=ft?2:1;L(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"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:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Mo(Gt.length,{isMultivariateSectionTop:ya})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Io,{className:"size-4"})}),!Ae&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("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",co),children:[n.jsx(ks,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=uo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx($o,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ho,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(On,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("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(mo,{pageKey:E,initialName:Qe.name,initialPath:Qe.path,onFieldChange:qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Oo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M():je(!0),children:n.jsx(Fo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(On,{onClick:Pn})]})}),I?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&E?n.jsx(ai,{rawSeo:an,innerSeo:_n,defaultResolveType:Fs,seoSchema:$s,activeResolveType:on,seoTypeOptions:Os,formResetKey:Se,siteDefaultSeo:zs,onBreadcrumbChange:_,onPersistRaw:Ta,onInnerChange:ka,onClearForm:Da,onBumpFormKey:Va}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Jt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(fo,{listKey:`${E??""}:${m??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:na,onRename:me,onDuplicate:aa,onDelete:sa,onRemoveAll:ia,onReorder:oa,onAdd:()=>cn()}),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:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:Xe??"",currentLabel:Qt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:fa,onSelectGlobal:ga,schema:Sa,formValue:ct,onChange:pa,formKey:`${m??"none"}:${un}:${Xe??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})]},"editor-section-form"):Ae?n.jsx(Jt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&E&&n.jsx(Li,{listKey:E,variants:Ge,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:xa,onReorder:_a,onRename:xe,onDuplicate:Ea,onDelete:ja,onAdd:Pn}),Ft&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(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":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(zo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Lo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:ie,currentLabel:Qt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ua,onSelectGlobal:ma,schema:ca,formValue:de,onChange:da,formKey:`${$e}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(ki,{listKey:`${E??""}-${$e}`,rawSections:H,sections:He,meta:i,selectedIndex:m,onSelect:Gs,onReorder:Ws,onDelete:Qs,onDuplicate:Ys,onMakeReusable:Oe,onToggleHidden:Js,onToggleLazy:Xs,onAddVariant:cn,onDetach:Zs,onAddSection:()=>se(!0),canAddSection:la})})]},"editor-section-list"),n.jsx(po,{open:te!==null,onOpenChange:t=>{t||Oe(null)},defaultBlockId:te!==null?fn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ra}),Y&&n.jsx(li,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:Y,onSelect:ta}),Me&&E&&l&&n.jsx(go,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Pe!==null&&n.jsx(Qn,{open:!0,initialName:Et(Ge[Pe]?.rule,l??{},i??void 0)?Qt(Ge[Pe]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(Ge[Pe]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await Ra(Pe,t)},onOpenChange:t=>{!t&&!Vt&&xe(null)}}),ne!==null&&n.jsx(Qn,{open:!0,initialName:Et(St[ne]?.rule,l??{},i??void 0)?Qt(St[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(St[ne]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await wa(ne,t)},onOpenChange:t=>{!t&&!Vt&&me(null)}})]})}export{Oc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bx as st,bv as Ne,j as i,e7 as rt,bz as Ie,bw as k,e8 as lt,bs as j,by as P,cL as $,e9 as at,aH as Ee,ea as Re,bt as ct,cG as it,eb as dt,cP as ut,ec as pt,ed as ft,ee as mt,ef as ht,eg as gt,bu as vt,eh as xt,ei as St,ej as wt,c as ee,n as oe}from"./index-VPFEEz3Y.js";import{i as yt}from"./Check-Eb20R0uP.js";import{t as je}from"./ChevronDown-Bv15tE3e.js";import{n as Ct}from"./ChevronUp-CJSi4ok2.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.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]),d.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]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(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 b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),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(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.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=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,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 m;e[6]!==o||e[7]!==u?(m=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]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=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",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,po as a,uo as b,fo as c,mo as d,Pe as e};
|
|
1
|
+
import{r as d,bx as st,bv as Ne,j as i,e7 as rt,bz as Ie,bw as k,e8 as lt,bs as j,by as P,cL as $,e9 as at,aH as Ee,ea as Re,bt as ct,cG as it,eb as dt,cP as ut,ec as pt,ed as ft,ee as mt,ef as ht,eg as gt,bu as vt,eh as xt,ei as St,ej as wt,c as ee,n as oe}from"./index-Dg_D1q-d.js";import{i as yt}from"./Check-CKt7kGsd.js";import{t as je}from"./ChevronDown-CnPHyH5A.js";import{n as Ct}from"./ChevronUp-ylRdQRex.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:c,dir:u,name:m,autoComplete:v,disabled:w,required:y,form:S}=s,p=pe(e),[g,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:c,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return i.jsx(rt,{...p,children:i.jsxs(Nt,{required:y,scope:e,trigger:g,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?i.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?i.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,c=k(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[v,w,y]=ot(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===r.value),h=nt(g,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(lt,{asChild:!0,...a,children:i.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:c,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,v=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.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]),d.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]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:v,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return i.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(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 b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,c]=d.useState(null),[u,m]=d.useState(null),v=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&g&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),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(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,re=g.offsetHeight/2,f=g.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,g,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return i.jsx(St,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.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=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=r;if(w?.current&&v){const y=Math.abs(c.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;v.style.height=x+"px",v.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,v]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.itemRefCallback?.(h,o,n)),p=Ie(),g=d.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{v(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{g.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{g.current=h.pointerType,n?c.onItemLeave?.():g.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),c=$e(le,t),u=_t(le,t),[m,v]=d.useState(null),w=k(e,C=>v(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?i.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?i.jsx(wt,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const v=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(v)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function io(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,c=r===void 0?!1:r,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 m;e[6]!==o||e[7]!==u?(m=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]=m):m=e[8];let v;e[9]!==c?(v=!c&&i.jsx(no,{}),e[9]=c,e[10]=v):v=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==v||e[22]!==S||e[23]!==p?(g=i.jsx(Xt,{children:i.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(u=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",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let v;e[11]!==t||e[12]!==n?(v=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=v):v=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==v?(w=i.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,v]}),e[14]=a,e[15]=u,e[16]=m,e[17]=v,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{io as S,po as a,uo as b,fo as c,mo as d,Pe as e};
|